Interface OrganizationRealmAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to re-assign Organizations to
Bilings . An Organization may map to multiple
Realms and removing the last reference to an Organization 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 an Organization to another Realm
is not a copy operation (eg: does not change its Id ).
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignOrganizationToRealm(Id organizationId, Id realmId) Adds an existingOrganizationto aRealm.booleanTests if this user can alter organization/realm mappings.booleancanAssignOrganizationsToRealm(Id realmId) Tests if this user can alter organization/realm mappings.getAssignableRealmIds(Id realmId) Gets a list of realms including and under the given realm node in which any organization can be assigned.getAssignableRealmIdsForOrganization(Id realmId, Id organizationId) Gets a list of realms including and under the given realm node in which a specific organization can be assigned.voidreassignOrganizationToRealm(Id organizationId, Id fromRealmId, Id toRealmId) Moves anOrganizationfrom oneRealmto another.voidunassignOrganizationFromRealm(Id organizationId, Id realmId) Removes anOrganizationfrom 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
-
canAssignOrganizations
boolean canAssignOrganizations()Tests if this user can alter organization/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.
-
canAssignOrganizationsToRealm
Tests if this user can alter organization/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 organization 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.
-
getAssignableRealmIdsForOrganization
IdList getAssignableRealmIdsForOrganization(Id realmId, Id organizationId) throws OperationFailedException Gets a list of realms including and under the given realm node in which a specific organization can be assigned.- Parameters:
realmId- theIdof theRealmorganizationId- theIdof theOrganization- Returns:
- list of assignable realm
Ids - Throws:
NullArgumentException-realmIdororganizationIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignOrganizationToRealm
void assignOrganizationToRealm(Id organizationId, Id realmId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingOrganizationto aRealm.- Parameters:
organizationId- theIdof theOrganizationrealmId- theIdof theRealm- Throws:
AlreadyExistsException-organizationIdalready assigned torealmIdNotFoundException-organizationIdorrealmIdnot foundNullArgumentException-organizationIdorrealmIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignOrganizationFromRealm
void unassignOrganizationFromRealm(Id organizationId, Id realmId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes anOrganizationfrom aRealm.- Parameters:
organizationId- theIdof theOrganizationrealmId- theIdof theRealm- Throws:
NotFoundException-organizationIdorrealmIdnot found ororganizationIdnot mapped torealmIdNullArgumentException-organizationIdorrealmIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignOrganizationToRealm
void reassignOrganizationToRealm(Id organizationId, Id fromRealmId, Id toRealmId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves anOrganizationfrom oneRealmto another. Mappings to otherRealmsare unaffected.- Parameters:
organizationId- theIdof theOrganizationfromRealmId- theIdof the currentRealmtoRealmId- theIdof the destinationRealm- Throws:
AlreadyExistsException-organizationIdalready assigned totoRealmIdNotFoundException-organizationId, fromRealmId, ortoRealmIdnot found ororganizationIdnot mapped tofromRealmIdNullArgumentException-organizationId, fromRealmId, ortoRealmIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-