Interface AgentAgencyAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to re-assign Agents to
Agencies . An Agent may map to multiple Agencies and
removing the last reference to an Agent 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 ).
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignAgentToAgency(Id agentId, Id agencyId) Adds an existingAgentto anAgency.booleanTests if this user can alter agent/agency mappings.booleancanAssignAgentsToAgency(Id agencyId) Tests if this user can alter agent/agency mappings.getAssignableAgencyIds(Id agencyId) Gets a list of agencies including and under the given agency node in which any agent can be assigned.getAssignableAgencyIdsForAgent(Id agencyId, Id agentId) Gets a list of agencies including and under the given agency node in which a specific agent can be assigned.voidreassignAgentToAgency(Id agentId, Id fromAgencyId, Id toAgencyId) Moves anAgentfrom oneAgencyto another.voidunassignAgentFromAgency(Id agentId, Id agencyId) Removes anAgentfrom anAgency.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
-
canAssignAgents
boolean canAssignAgents()Tests if this user can alter agent/agency mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer lookup operations to unauthorized users.- Returns:
falseif mapping is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canAssignAgentsToAgency
Tests if this user can alter agent/agency mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer lookup operations to unauthorized users.- Parameters:
agencyId- theIdof theAgency- Returns:
falseif mapping is not authorized,trueotherwise- Throws:
NullArgumentException-agencyIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignableAgencyIds
Gets a list of agencies including and under the given agency node in which any agent can be assigned.- Parameters:
agencyId- theIdof theAgency- Returns:
- list of assignable agency
Ids - Throws:
NullArgumentException-agencyIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getAssignableAgencyIdsForAgent
Gets a list of agencies including and under the given agency node in which a specific agent can be assigned.- Parameters:
agencyId- theIdof theAgencyagentId- theIdof theAgent- Returns:
- list of assignable bin
Ids - Throws:
NullArgumentException-agencyIdoragentIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignAgentToAgency
void assignAgentToAgency(Id agentId, Id agencyId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingAgentto anAgency.- Parameters:
agentId- theIdof theAgentagencyId- theIdof theAgency- Throws:
AlreadyExistsException-agentIdis already assigned toagencyIdNotFoundException-agentIdoragencyIdnot foundNullArgumentException-agentIdoragencyIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignAgentFromAgency
void unassignAgentFromAgency(Id agentId, Id agencyId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes anAgentfrom anAgency.- Parameters:
agentId- theIdof theAgentagencyId- theIdof theAgency- Throws:
NotFoundException-agentIdoragencyIdnot found oragentIdnot assigned toagencyIdNullArgumentException-agentIdoragencyIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignAgentToAgency
void reassignAgentToAgency(Id agentId, Id fromAgencyId, Id toAgencyId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves anAgentfrom oneAgencyto another. Mappings to otherAgenciesare unaffected.- Parameters:
agentId- theIdof theAgentfromAgencyId- theIdof the currentAgencytoAgencyId- theIdof the destinationAgency- Throws:
AlreadyExistsException-agentIdalready assigned totoAgencyIdNotFoundException-agentId, fromAgencyId, ortoAgencyIdnot found oragentIdnot mapped tofromAgencyIdNullArgumentException-agentId, fromAgencyId, ortoAgencyIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-