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.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasSpeedZone(Id speedZoneId,
Id aliasId)
Adds an
Id to a SpeedZone for the
purpose of creating compatibility. |
boolean |
canCreateSpeedZones()
Tests if this user can create
SpeedZones. |
boolean |
canCreateSpeedZoneWithRecordTypes(Type[] speedZoneRecordTypes)
Tests if this user can create a single
SpeedZone using
the desired record types. |
boolean |
canDeleteSpeedZone(Id speedZoneId)
Tests if this user can delete a specified
SpeedZone. |
boolean |
canManageSpeedZoneAliases()
Tests if this user can manage
Id aliases for
SpeedZones. |
boolean |
canUpdateSpeedZones()
Tests if this user can update
SpeedZones. |
SpeedZone |
createSpeedZone(SpeedZoneForm speedZoneForm)
Creates a new
SpeedZone. |
void |
deleteSpeedZone(Id speedZoneId)
Deletes a
SpeedZone. |
Map |
getMap()
Gets the
Map associated with this session. |
Id |
getMapId()
Gets the
Map Id associated with this
session. |
SpeedZoneForm |
getSpeedZoneFormForCreate(Type[] speedZoneRecordTypes)
Gets the speed zone form for creating new speed zones.
|
SpeedZoneForm |
getSpeedZoneFormForUpdate(Id speedZoneId)
Gets the speed zone form for updating an existing speed zone.
|
void |
updateSpeedZone(SpeedZoneForm speedZoneForm)
Updates an existing speed zone.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getMapId()
Map Id associated with this
session. Map Id associated with this sessionmandatory - This method must be implemented. Map getMap() throws OperationFailedException, PermissionDeniedException
Map associated with this session.OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canCreateSpeedZones()
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. false if SpeedZone creation is
not authorized, true otherwisemandatory - This method must be implemented. boolean canCreateSpeedZoneWithRecordTypes(Type[] speedZoneRecordTypes)
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.speedZoneRecordTypes - array of speed zone record types true if SpeedZone creation using
the specified record Types is supported,
false otherwiseNullArgumentException - speedZoneRecordTypes
is null mandatory - This method must be implemented. SpeedZoneForm getSpeedZoneFormForCreate(Type[] speedZoneRecordTypes) throws OperationFailedException, PermissionDeniedException
speedZoneRecordTypes - array of speed zone record typesNullArgumentException - speedZoneRecordTypes
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form with given
record typesmandatory - This method must be implemented. SpeedZone createSpeedZone(SpeedZoneForm speedZoneForm) throws OperationFailedException, PermissionDeniedException
SpeedZone. speedZoneForm - the form for this SpeedZone SpeedZone IllegalStateException - speedZoneForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - speedZoneForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - speedZoneForm did
not originate from getSpeedZoneFormForCreate() mandatory - This method must be implemented. boolean canUpdateSpeedZones()
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. false if SpeedZone modification
is not authorized, true otherwisemandatory - This method must be implemented. SpeedZoneForm getSpeedZoneFormForUpdate(Id speedZoneId) throws NotFoundException, OperationFailedException, PermissionDeniedException
speedZoneId - the Id of the SpeedZone
NotFoundException - speedZoneId is not
foundNullArgumentException - speedZoneId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateSpeedZone(SpeedZoneForm speedZoneForm) throws OperationFailedException, PermissionDeniedException
speedZoneForm - the form containing the elements to be updatedIllegalStateException - speedZoneForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - speedZoneId or
speed zoneForm is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - speedZoneForm did
not originate from getSpeedZoneFormForUpdate() mandatory - This method must be implemented. boolean canDeleteSpeedZone(Id speedZoneId)
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.speedZoneId - the Id of the SpeedZone
false if deletion of this SpeedZone
is not authorized, true otherwiseNullArgumentException - speedZoneId is
null mandatory - This method must be implemented. If - the speedZoneId is not found, then it is
acceptable to return false to indicate the lack of an delete
available. void deleteSpeedZone(Id speedZoneId) throws NotFoundException, OperationFailedException, PermissionDeniedException
SpeedZone. speedZoneId - the Id of the SpeedZone
to removeNotFoundException - speedZoneId not
foundNullArgumentException - speedZoneId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageSpeedZoneAliases()
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. false if SpeedZone aliasing is
not authorized, true otherwisemandatory - This method must be implemented. void aliasSpeedZone(Id speedZoneId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
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. speedZoneId - the Id of a SpeedZone
aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - speedZoneId not
foundNullArgumentException - speedZoneId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.