Interface AcademyAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
AcademyBatchAdminSession
This session creates, updates, and deletes Academies 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
Academy , an AcademyForm is requested using
getAcademyFormForCreate() specifying the desired record Types or
none if no record Types are needed. The returned
AcademyForm 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 AcademyForm is submiited to a create operation, it cannot
be reused with another create operation unless the first operation was
unsuccessful. Each AcademyForm corresponds to an attempted
transaction.
For updates, AcademyForms are requested to the Academy
Id that is to be updated using getAcademyFormForUpdate() .
Similarly, the AcademyForm has metadata about the data that can be
updated and it can perform validation before submitting the update. The
AcademyForm can only be used once for a successful update and
cannot be reused.
The delete operations delete Academies .
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasAcademy(Id academyId, Id aliasId) Adds anIdto anAcademyfor the purpose of creating compatibility.booleanTests if this user can createAcademies.booleancanCreateAcademyWithRecordTypes(Type[] academyRecordTypes) Tests if this user can create a singleAcademyusing the desired record types.booleanTests if this user can deleteAcademiesA return of true does not guarantee successful authorization.booleanTests if this user can manageIdaliases forAcademies.booleanTests if this user can updateAcademies.createAcademy(AcademyForm academyForm) Creates a newAcademy.voiddeleteAcademy(Id academyId) Deletes anAcademy.getAcademyFormForCreate(Type[] academyRecordTypes) Gets the academy form for creating new academies.getAcademyFormForUpdate(Id academyId) Gets the academy form for updating an existing academy.voidupdateAcademy(AcademyForm academyForm) Updates an existing academy.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
-
canCreateAcademies
boolean canCreateAcademies()Tests if this user can createAcademies. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating anAcademywill 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:
falseifAcademycreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateAcademyWithRecordTypes
Tests if this user can create a singleAcademyusing the desired record types. WhileRecognitionManager.getAcademyRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificAcademy. Providing an empty array tests if anAcademycan be created with no records.- Parameters:
academyRecordTypes- array of academy types- Returns:
trueifAcademycreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-academyRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getAcademyFormForCreate
AcademyForm getAcademyFormForCreate(Type[] academyRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the academy form for creating new academies. A new form should be requested for each create transaction.- Parameters:
academyRecordTypes- array of academy types- Returns:
- the academy form
- Throws:
NullArgumentException-academyRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createAcademy
Academy createAcademy(AcademyForm academyForm) throws OperationFailedException, PermissionDeniedException Creates a newAcademy.- Parameters:
academyForm- the form for thisAcademy- Returns:
- the new
Academy - Throws:
IllegalStateException-academyFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-academyFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-academyFormdid not originate fromgetAcademyFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateAcademies
boolean canUpdateAcademies()Tests if this user can updateAcademies. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anAcademywill 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:
falseifAcademymodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getAcademyFormForUpdate
AcademyForm getAcademyFormForUpdate(Id academyId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the academy form for updating an existing academy. A new academy form should be requested for each update transaction.- Parameters:
academyId- theIdof theAcademy- Returns:
- the academy form
- Throws:
NotFoundException-academyIdis not foundNullArgumentException-academyIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateAcademy
void updateAcademy(AcademyForm academyForm) throws OperationFailedException, PermissionDeniedException Updates an existing academy.- Parameters:
academyForm- the form containing the elements to be updated- Throws:
IllegalStateException-academyFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-academyFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-academyFormdid not originate fromgetAcademyFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteAcademies
boolean canDeleteAcademies()Tests if this user can deleteAcademiesA return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anAcademywill 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:
falseifAcademydeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteAcademy
void deleteAcademy(Id academyId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes anAcademy.- Parameters:
academyId- theIdof theAcademyto remove- Throws:
NotFoundException-academyIdnot foundNullArgumentException-academyIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageAcademyAliases
boolean canManageAcademyAliases()Tests if this user can manageIdaliases forAcademies. 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:
falseifAcademyaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasAcademy
void aliasAcademy(Id academyId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anAcademyfor the purpose of creating compatibility. The primaryIdof theAcademyis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another academy, it is reassigned to the given academyId.- Parameters:
academyId- theIdof anAcademyaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-academyIdnot foundNullArgumentException-academyIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-