Interface SpeedZoneAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
SpeedZoneBatchAdminSession
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 Summary
Modifier and TypeMethodDescriptionvoidaliasSpeedZone(Id speedZoneId, Id aliasId) Adds anIdto aSpeedZonefor the purpose of creating compatibility.booleanTests if this user can createSpeedZones.booleancanCreateSpeedZoneWithRecordTypes(Type[] speedZoneRecordTypes) Tests if this user can create a singleSpeedZoneusing the desired record types.booleancanDeleteSpeedZone(Id speedZoneId) Tests if this user can delete a specifiedSpeedZone.booleanTests if this user can manageIdaliases forSpeedZones.booleanTests if this user can updateSpeedZones.createSpeedZone(SpeedZoneForm speedZoneForm) Creates a newSpeedZone.voiddeleteSpeedZone(Id speedZoneId) Deletes aSpeedZone.getMap()Gets theMapassociated with this session.getMapId()Gets theMapIdassociated with this session.getSpeedZoneFormForCreate(Type[] speedZoneRecordTypes) Gets the speed zone form for creating new speed zones.getSpeedZoneFormForUpdate(Id speedZoneId) Gets the speed zone form for updating an existing speed zone.voidupdateSpeedZone(SpeedZoneForm speedZoneForm) Updates an existing speed zone.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getMapId
Id getMapId()Gets theMapIdassociated with this session.- Returns:
- the
Map Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getMap
Gets theMapassociated with this session.- Returns:
- the map
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateSpeedZones
boolean canCreateSpeedZones()Tests if this user can createSpeedZones. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aSpeedZonewill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifSpeedZonecreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateSpeedZoneWithRecordTypes
Tests if this user can create a singleSpeedZoneusing the desired record types. WhileMappingPathManager.getSpeedZoneRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificSpeedZone. Providing an empty array tests if aSpeedZonecan be created with no records.- Parameters:
speedZoneRecordTypes- array of speed zone record types- Returns:
trueifSpeedZonecreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-speedZoneRecordTypesisnull- 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-speedZoneRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form with given record types- Compliance:
mandatory- This method must be implemented.
-
createSpeedZone
SpeedZone createSpeedZone(SpeedZoneForm speedZoneForm) throws OperationFailedException, PermissionDeniedException Creates a newSpeedZone.- Parameters:
speedZoneForm- the form for thisSpeedZone- Returns:
- the new
SpeedZone - Throws:
IllegalStateException-speedZoneFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-speedZoneFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-speedZoneFormdid not originate fromgetSpeedZoneFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateSpeedZones
boolean canUpdateSpeedZones()Tests if this user can updateSpeedZones. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aSpeedZonewill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseifSpeedZonemodification is not authorized,trueotherwise- 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- theIdof theSpeedZone- Returns:
- the speed zone form
- Throws:
NotFoundException-speedZoneIdis not foundNullArgumentException-speedZoneIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- 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-speedZoneFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-speedZoneIdorspeed zoneFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-speedZoneFormdid not originate fromgetSpeedZoneFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteSpeedZone
Tests if this user can delete a specifiedSpeedZone. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting theSpeedZonewill result in aPERMISSION_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- theIdof theSpeedZone- Returns:
falseif deletion of thisSpeedZoneis not authorized,trueotherwise- Throws:
NullArgumentException-speedZoneIdisnull- 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 aSpeedZone.- Parameters:
speedZoneId- theIdof theSpeedZoneto remove- Throws:
NotFoundException-speedZoneIdnot foundNullArgumentException-speedZoneIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageSpeedZoneAliases
boolean canManageSpeedZoneAliases()Tests if this user can manageIdaliases forSpeedZones. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifSpeedZonealiasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasSpeedZone
void aliasSpeedZone(Id speedZoneId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aSpeedZonefor the purpose of creating compatibility. The primaryIdof theSpeedZoneis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another speed zone, it is reassigned to the given speed zoneId.- Parameters:
speedZoneId- theIdof aSpeedZonealiasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-speedZoneIdnot foundNullArgumentException-speedZoneIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-