Interface LocationAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
All Known Subinterfaces:
LocationBatchAdminSession

public interface LocationAdminSession extends OsidSession

This session creates, updates, and deletes Locations . The data for create and update is provided by the consumer via the form. OsidForms are requested for each create or update and may not be reused.

Create and update operations differ in their usage. To create a Location , a LocationForm is requested using getLocationFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned LocationForm will indicate that it is to be used with a create operation and can be used to examine metdata or validate data prior to creation. Once the LocationForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each LocationForm corresponds to an attempted transaction.

For updates, LocationForms are requested to the Location Id that is to be updated using getLocationFormForUpdate() . Similarly, the LocationForm has metadata about the data that can be updated and it can perform validation before submitting the update. The LocationForm can only be used once for a successful update and cannot be reused.

The delete operations delete Locations . To unmap a Location from the current Map , the LocationMapAssignmentSession should be used. These delete operations attempt to remove the Location itself thus removing it from all known Map catalogs.

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

  • Method Details

    • getMapId

      Id getMapId()
      Gets the Map Id associated with this session.
      Returns:
      the Map Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getMap

      Gets the Map associated with this session.
      Returns:
      the map
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canCreateLocations

      boolean canCreateLocations()
      Tests if this user can create Locations . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Location will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.
      Returns:
      false if Location creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateLocationWithRecordTypes

      boolean canCreateLocationWithRecordTypes(Type[] locationRecordTypes)
      Tests if this user can create a single Location using the desired record types. While MappingManager.getLocationRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Location . Providing an empty array tests if a Location can be created with no records.
      Parameters:
      locationRecordTypes - array of location record types
      Returns:
      true if Location creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - locationRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getLocationFormForCreate

      LocationForm getLocationFormForCreate(Type[] locationRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the location form for creating new locations. A new form should be requested for each create transaction.
      Parameters:
      locationRecordTypes - array of location record types
      Returns:
      the location form
      Throws:
      NullArgumentException - locationRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get a form with given record types
      Compliance:
      mandatory - This method must be implemented.
    • createLocation

      Creates a new Location .
      Parameters:
      locationForm - the form for this Location
      Returns:
      the new Location
      Throws:
      IllegalStateException - locationForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - locationForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - locationForm did not originate from getLocationFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateLocations

      boolean canUpdateLocations()
      Tests if this user can update Locations . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Location will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.
      Returns:
      false if Location modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getLocationFormForUpdate

      Gets the location form for updating an existing location. A new location form should be requested for each update transaction.
      Parameters:
      locationId - the Id of the Location
      Returns:
      the location form
      Throws:
      NotFoundException - locationId is not found
      NullArgumentException - locationId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateLocation

      void updateLocation(LocationForm locationForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing location.
      Parameters:
      locationForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - locationForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - locationId or locationForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - locationForm did not originate from getLocationFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteLocations

      boolean canDeleteLocations()
      Tests if this user can delete Locations . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Location will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.
      Returns:
      false if Location deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteLocation

      void deleteLocation(Id locationId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes a Location .
      Parameters:
      locationId - the Id of the Location to remove
      Throws:
      NotFoundException - locationId not found
      NullArgumentException - locationId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageLocationAliases

      boolean canManageLocationAliases()
      Tests if this user can manage Id aliases for Locations . A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.
      Returns:
      false if Location aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasLocation

      Adds an Id to a Location for the purpose of creating compatibility. The primary Id of the Location is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another location, it is reassigned to the given location Id .
      Parameters:
      locationId - the Id of a Location
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - locationId not found
      NullArgumentException - locationId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.