Interface SpeedZoneAdminSession

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

public interface SpeedZoneAdminSession extends OsidSession

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

Create and update operations differ in their usage. To create a SpeedZoneForm , a SpeedZoneForm is requested using getSpeedZoneFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned SpeedZoneForm 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 SpeedZoneForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each SpeedZoneForm corresponds to an attempted transaction.

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

The delete operations delete SpeedZones . To unmap a SpeedZone from the current Map , the SpeedZoneMapAssignmentSession should be used. These delete operations attempt to remove the SpeedZone 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.
    • canCreateSpeedZones

      boolean canCreateSpeedZones()
      Tests if this user can create SpeedZones . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a SpeedZone 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 SpeedZone creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateSpeedZoneWithRecordTypes

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

      SpeedZoneForm getSpeedZoneFormForCreate(Type[] speedZoneRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the speed zone form for creating new speed zones. A new form should be requested for each create transaction.
      Parameters:
      speedZoneRecordTypes - array of speed zone record types
      Returns:
      the speed zone form
      Throws:
      NullArgumentException - speedZoneRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form with given record types
      Compliance:
      mandatory - This method must be implemented.
    • createSpeedZone

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

      boolean canUpdateSpeedZones()
      Tests if this user can update SpeedZones . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a SpeedZone 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 SpeedZone modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getSpeedZoneFormForUpdate

      SpeedZoneForm getSpeedZoneFormForUpdate(Id speedZoneId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the speed zone form for updating an existing speed zone. A new speed zone form should be requested for each update transaction.
      Parameters:
      speedZoneId - the Id of the SpeedZone
      Returns:
      the speed zone form
      Throws:
      NotFoundException - speedZoneId is not found
      NullArgumentException - speedZoneId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateSpeedZone

      void updateSpeedZone(SpeedZoneForm speedZoneForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing speed zone.
      Parameters:
      speedZoneForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - speedZoneForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - speedZoneId or speed zoneForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - speedZoneForm did not originate from getSpeedZoneFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteSpeedZone

      boolean canDeleteSpeedZone(Id speedZoneId)
      Tests if this user can delete a specified SpeedZone . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting the SpeedZone will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer an delete operation to an unauthorized user.
      Parameters:
      speedZoneId - the Id of the SpeedZone
      Returns:
      false if deletion of this SpeedZone is not authorized, true otherwise
      Throws:
      NullArgumentException - speedZoneId is null
      Compliance:
      mandatory - This method must be implemented.
      Notes:
      If - the {@code speedZoneId} is not found, then it is acceptable to return false to indicate the lack of an delete available.
    • deleteSpeedZone

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

      boolean canManageSpeedZoneAliases()
      Tests if this user can manage Id aliases for SpeedZones . 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 SpeedZone aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasSpeedZone

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