Interface PositionRealmAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to re-assign Positions to
Bilings . A Position may map to multiple Realms and
removing the last reference to a Position is the equivalent of
deleting it. Each Realm may have its own authorizations governing
who is allowed to operate on it.
Adding a reference of a Position to another Realm is
not a copy operation (eg: does not change its Id ).
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignPositionToRealm(Id positionId, Id realmId) Adds an existingPositionto aRealm.booleanTests if this user can alter position/realm mappings.booleancanAssignPositionsToRealm(Id realmId) Tests if this user can alter position/realm mappings.getAssignableRealmIds(Id realmId) Gets a list of realms including and under the given realm node in which any position can be assigned.getAssignableRealmIdsForPosition(Id realmId, Id positionId) Gets a list of realms including and under the given realm node in which a specific position can be assigned.voidreassignPositionToRealm(Id positionId, Id fromRealmId, Id toRealmId) Moves aPositionfrom oneRealmto another.voidunassignPositionFromRealm(Id positionId, Id realmId) Removes aPositionfrom aRealm.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
-
canAssignPositions
boolean canAssignPositions()Tests if this user can alter position/realm 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.
-
canAssignPositionsToRealm
Tests if this user can alter position/realm 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 assignment operations to unauthorized users.- Parameters:
realmId- theIdof theRealm- Returns:
falseif mapping is not authorized,trueotherwise- Throws:
NullArgumentException-realmIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignableRealmIds
Gets a list of realms including and under the given realm node in which any position can be assigned.- Parameters:
realmId- theIdof theRealm- Returns:
- list of assignable realm
Ids - Throws:
NullArgumentException-realmIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getAssignableRealmIdsForPosition
Gets a list of realms including and under the given realm node in which a specific position can be assigned.- Parameters:
realmId- theIdof theRealmpositionId- theIdof thePosition- Returns:
- list of assignable realm
Ids - Throws:
NullArgumentException-realmIdorpositionIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignPositionToRealm
void assignPositionToRealm(Id positionId, Id realmId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingPositionto aRealm.- Parameters:
positionId- theIdof thePositionrealmId- theIdof theRealm- Throws:
AlreadyExistsException-positionIdalready assigned torealmIdNotFoundException-positionIdorrealmIdnot foundNullArgumentException-positionIdorrealmIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignPositionFromRealm
void unassignPositionFromRealm(Id positionId, Id realmId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes aPositionfrom aRealm.- Parameters:
positionId- theIdof thePositionrealmId- theIdof theRealm- Throws:
NotFoundException-positionIdorrealmIdnot found orpositionIdnot mapped torealmIdNullArgumentException-positionIdorrealmIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignPositionToRealm
void reassignPositionToRealm(Id positionId, Id fromRealmId, Id toRealmId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves aPositionfrom oneRealmto another. Mappings to otherRealmsare unaffected.- Parameters:
positionId- theIdof thePositionfromRealmId- theIdof the currentRealmtoRealmId- theIdof the destinationRealm- Throws:
AlreadyExistsException-positionIdalready assigned totoRealmIdNotFoundException-positionId, fromRealmId, ortoRealmIdnot found orpositionIdnot mapped tofromRealmIdNullArgumentException-positionId, fromRealmId, ortoRealmIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-