Interface AwardAcademyAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to re-assign Awards to
Academies . An Award may map to multiple Academies and
removing the last reference to an Award is the equivalent of
deleting it. Each Academy may have its own authorizations
governing who is allowed to operate on it.
Adding a reference of an Award to another Academy is
not a copy operation (eg: does not change its Id ).
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignAwardToAcademy(Id awardId, Id academyId) Adds an existingAwardto anAcademy.booleanTests if this user can alter award/academy mappings.booleancanAssignAwardsToAcademy(Id academyId) Tests if this user can alter award/academy mappings.getAssignableAcademyIds(Id academyId) Gets a list of academies including and under the given academy node in which any award can be assigned.getAssignableAcademyIdsForAward(Id academyId, Id awardId) Gets a list of academies including and under the given academy node in which a specific award can be assigned.voidreassignAwardToAcademy(Id awardId, Id fromAcademyId, Id toAcademyId) Moves anAwardfrom oneAcademyto another.voidunassignAwardFromAcademy(Id awardId, Id academyId) Removes anAwardfrom anAcademy.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
-
canAssignAwards
boolean canAssignAwards()Tests if this user can alter award/academy 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.- Returns:
falseif mapping is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canAssignAwardsToAcademy
Tests if this user can alter award/academy 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:
academyId- theIdof theAcademy- Returns:
falseif mapping is not authorized,trueotherwise- Throws:
NullArgumentException-academyIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignableAcademyIds
Gets a list of academies including and under the given academy node in which any award can be assigned.- Parameters:
academyId- theIdof theAcademy- Returns:
- list of assignable academy
Ids - Throws:
NullArgumentException-academyIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getAssignableAcademyIdsForAward
Gets a list of academies including and under the given academy node in which a specific award can be assigned.- Parameters:
academyId- theIdof theAcademyawardId- theIdof theAward- Returns:
- list of assignable academy
Ids - Throws:
NullArgumentException-academyIdorawardIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignAwardToAcademy
void assignAwardToAcademy(Id awardId, Id academyId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingAwardto anAcademy.- Parameters:
awardId- theIdof theAwardacademyId- theIdof theAcademy- Throws:
AlreadyExistsException-awardIdis already assigned toacademyIdNotFoundException-awardIdoracademyIdnot foundNullArgumentException-awardIdoracademyIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignAwardFromAcademy
void unassignAwardFromAcademy(Id awardId, Id academyId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes anAwardfrom anAcademy.- Parameters:
awardId- theIdof theAwardacademyId- theIdof theAcademy- Throws:
NotFoundException-awardIdoracademyIdnot found orawardIdnot asigned toacademyIdNullArgumentException-awardIdoracademyIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignAwardToAcademy
void reassignAwardToAcademy(Id awardId, Id fromAcademyId, Id toAcademyId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves anAwardfrom oneAcademyto another. Mappings to otherAcademiesare unaffected.- Parameters:
awardId- theIdof theAwardfromAcademyId- theIdof the currentAcademytoAcademyId- theIdof the destinationAcademy- Throws:
AlreadyExistsException-awardIdalready assigned totoAcademyIdNotFoundException-awardId, fromAcademyId, ortoAcademyIdnot found orawardIdnot mapped tofromAcademyIdNullArgumentException-awardId, fromAcademyId, ortoAcademyIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-