Interface AwardAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
AwardBatchAdminSession
This session creates, updates, and deletes Awards . The data
for create and update is provided by the consumer via the form object.
OsidForms are requested for each create or update and may not be
reused.
Create and update operations differ in their usage. To create an
Award , an AwardForm is requested using
getAwardFormForCreate() specifying the desired record Types or
none if no record Types are needed. The returned AwardForm
will indicate that it is to be used with a create operation and can be
used to examine metdata or validate data prior to creation. Once the
AwardForm is submiited to a create operation, it cannot be reused
with another create operation unless the first operation was unsuccessful.
Each AwardForm corresponds to an attempted transaction.
For updates, AwardForms are requested to the Award
Id that is to be updated using getAwardFormForUpdate() .
Similarly, the AwardForm has metadata about the data that can be
updated and it can perform validation before submitting the update. The
AwardForm can only be used once for a successful update and cannot
be reused.
The delete operations delete Awards . To unmap an
Award from the current Academy , the
AwardAcademyAssignmentSession should be used. These delete operations
attempt to remove the Award itself thus removing it from all known
Academy catalogs.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasAward(Id awardId, Id aliasId) Adds anIdto anAwardfor the purpose of creating compatibility.booleanTests if this user can createAwards.booleancanCreateAwardWithRecordTypes(Type[] awardRecordTypes) Tests if this user can create a singleAwardusing the desired record types.booleanTests if this user can deleteAwardsA return of true does not guarantee successful authorization.booleanTests if this user can manageIdaliases forAwards.booleanTests if this user can updateAwards.createAward(AwardForm awardForm) Creates a newAward.voiddeleteAward(Id awardId) Deletes anAward.Gets theAcademyassociated with this session.Gets theAcademyIdassociated with this session.getAwardFormForCreate(Type[] awardRecordTypes) Gets the award form for creating new awards.getAwardFormForUpdate(Id awardId) Gets the award form for updating an existing award.voidupdateAward(AwardForm awardForm) Updates an existing award.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
-
getAcademyId
Id getAcademyId()Gets theAcademyIdassociated with this session.- Returns:
- the
Academy Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getAcademy
Gets theAcademyassociated with this session.- Returns:
- the academy
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateAwards
boolean canCreateAwards()Tests if this user can createAwards. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating anAwardwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Returns:
falseifAwardcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateAwardWithRecordTypes
Tests if this user can create a singleAwardusing the desired record types. WhileRecognitionManager.getAwardRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificAward. Providing an empty array tests if anAwardcan be created with no records.- Parameters:
awardRecordTypes- array of award record types- Returns:
trueifAwardcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-awardRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getAwardFormForCreate
AwardForm getAwardFormForCreate(Type[] awardRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the award form for creating new awards. A new form should be requested for each create transaction.- Parameters:
awardRecordTypes- array of award record types- Returns:
- the award form
- Throws:
NullArgumentException-awardRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createAward
Creates a newAward.- Parameters:
awardForm- the form for thisAward- Returns:
- the new
Award - Throws:
IllegalStateException-awardFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-awardFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-awardFormdid not originate fromgetAwardFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateAwards
boolean canUpdateAwards()Tests if this user can updateAwards. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anAwardwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Returns:
falseifAwardmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getAwardFormForUpdate
AwardForm getAwardFormForUpdate(Id awardId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the award form for updating an existing award. A new award form should be requested for each update transaction.- Parameters:
awardId- theIdof theAward- Returns:
- the award form
- Throws:
NotFoundException-awardIdis not foundNullArgumentException-awardIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateAward
Updates an existing award.- Parameters:
awardForm- the form containing the elements to be updated- Throws:
IllegalStateException-awardFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-awardFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-awardFormdid not originate fromgetAwardFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteAwards
boolean canDeleteAwards()Tests if this user can deleteAwardsA return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anAwardwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Returns:
falseifAwarddeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteAward
void deleteAward(Id awardId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes anAward.- Parameters:
awardId- theIdof theAwardto remove- Throws:
NotFoundException-awardIdnot foundNullArgumentException-awardIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageAwardAliases
boolean canManageAwardAliases()Tests if this user can manageIdaliases forAwards. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifAwardaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasAward
void aliasAward(Id awardId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anAwardfor the purpose of creating compatibility. The primaryIdof theAwardis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another award, it is reassigned to the given awardId.- Parameters:
awardId- theIdof anAwardaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-awardIdnot foundNullArgumentException-awardIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-