public interface KeyAgencyAssignmentSession extends OsidSession
This session provides methods to re-assign Keys to
Agencies An Key may map to multiple
Agency objects and removing the last reference to an Key
is the equivalent of deleting it. Each Agency may
have its own authorizations governing who is allowed to operate on it.
Moving or adding a reference of an Ageny to another
Agency is not a copy operation (eg: does not change its
Id ).
| Modifier and Type | Method and Description |
|---|---|
void |
assignKeyToAgency(Id keyId,
Id agencyId)
Adds an existing
Key to an Agency. |
boolean |
canAssignKeys()
Tests if this user can alter key/agency mappings.
|
boolean |
canAssignKeysToAgency(Id agencyId)
Tests if this user can alter key/agency mappings.
|
IdList |
getAssignableAgencyIds(Id agencyId)
Gets a list of agencies including and under the given agency node in
which any key can be assigned.
|
IdList |
getAssignableAgencyIdsForKey(Id agencyId,
Id keyId)
Gets a list of agencies including and under the given agency node in
which a specific key can be assigned.
|
void |
reassignKeyToAgency(Id keyId,
Id fromAgencyId,
Id toAgencyId)
Moves a
Key from one Agency to another. |
void |
unassignKeyFromAgency(Id keyId,
Id agencyId)
Removes an
Key from an Agency. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseboolean canAssignKeys()
PERMISSION_DENIED. This is intended as a hint to
an application that may opt not to offer lookup operations to
unauthorized users. false if mapping is not authorized, true
otherwisemandatory - This method must be implemented. boolean canAssignKeysToAgency(Id agencyId)
PERMISSION_DENIED. This is intended as a hint to
an application that may opt not to offer lookup operations to
unauthorized users.agencyId - the Id of the Agency false if mapping is not authorized, true
otherwiseNullArgumentException - agencyId is
null mandatory - This method must be implemented. IdList getAssignableAgencyIds(Id agencyId) throws OperationFailedException
agencyId - the Id of the Agency Ids NullArgumentException - agencyId is
null OperationFailedException - unable to complete requestmandatory - This method must be implemented. IdList getAssignableAgencyIdsForKey(Id agencyId, Id keyId) throws OperationFailedException
agencyId - the Id of the Agency keyId - the Id of the Key Ids NullArgumentException - agencyId or
keyId is null OperationFailedException - unable to complete requestmandatory - This method must be implemented. void assignKeyToAgency(Id keyId, Id agencyId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Key to an Agency. keyId - the Id of the Key agencyId - the Id of the Agency AlreadyExistsException - keyId is
already assigned to agencyId NotFoundException - keyId or
agencyId not foundNullArgumentException - keyId or
agencyId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void unassignKeyFromAgency(Id keyId, Id agencyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Key from an Agency. keyId - the Id of the Key agencyId - the Id of the Agency NotFoundException - keyId or
agencyId not found or keyId not
assigned to agencyId NullArgumentException - keyId or
agencyId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void reassignKeyToAgency(Id keyId, Id fromAgencyId, Id toAgencyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Key from one Agency to another.
Mappings to other Agencies are unaffected.keyId - the Id of the Key fromAgencyId - the Id of the current
Agency toAgencyId - the Id of the destination
Agency NotFoundException - keyId, fromAgencyId,
or toAgencyId not found or keyId
not mapped to fromAgencyId NullArgumentException - keyId, fromAgencyId,
or toAgencyId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.