public interface AgentAgencyAssignmentSession extends OsidSession
This session provides methods to re-assign Agents
to
Agencies
An Agent
may map to multiple
Agency
objects 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
).
Modifier and Type | Method and Description |
---|---|
void |
assignAgentToAgency(Id agentId,
Id agencyId)
Adds an existing
Agent to an Agency. |
boolean |
canAssignAgents()
Tests if this user can alter agent/agency mappings.
|
boolean |
canAssignAgentsToAgency(Id agencyId)
Tests if this user can alter agent/agency mappings.
|
IdList |
getAssignableAgencyIds(Id agencyId)
Gets a list of agencies including and under the given agency node in
which any agent can be assigned.
|
IdList |
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.
|
void |
reassignAgentToAgency(Id agentId,
Id fromAgencyId,
Id toAgencyId)
Moves an
Agent from one Agency to
another. |
void |
unassignAgentFromAgency(Id agentId,
Id agencyId)
Removes an
Agent from an Agency. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
boolean canAssignAgents()
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 canAssignAgentsToAgency(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 getAssignableAgencyIdsForAgent(Id agencyId, Id agentId) throws OperationFailedException
agencyId
- the Id
of the Agency
agentId
- the Id
of the Agent
Ids
NullArgumentException
- agencyId
or
agentId
is null
OperationFailedException
- unable to complete requestmandatory
- This method must be implemented. void assignAgentToAgency(Id agentId, Id agencyId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Agent
to an Agency.
agentId
- the Id
of the Agent
agencyId
- the Id
of the Agency
AlreadyExistsException
- agentId
is
already assigned to agencyId
NotFoundException
- agentId
or
agencyId
not foundNullArgumentException
- agentId
or
agencyId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void unassignAgentFromAgency(Id agentId, Id agencyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Agent
from an Agency.
agentId
- the Id
of the Agent
agencyId
- the Id
of the Agency
NotFoundException
- agentId
or
agencyId
not found or agentId
not
assigned to agencyId
NullArgumentException
- agentId
or
agencyId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void reassignAgentToAgency(Id agentId, Id fromAgencyId, Id toAgencyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Agent
from one Agency
to
another. Mappings to other Agencies
are unaffected.agentId
- the Id
of the Agent
fromAgencyId
- the Id
of the current
Agency
toAgencyId
- the Id
of the destination
Agency
NotFoundException
- agentId, fromAgencyId,
or toAgencyId
not found or
agentId
not mapped to fromAgencyId
NullArgumentException
- agentId, fromAgencyId,
or toAgencyId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.