public interface AcademyAdminSession extends OsidSession
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.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasAcademy(Id academyId,
Id aliasId)
Adds an
Id to an Academy for the purpose
of creating compatibility. |
boolean |
canCreateAcademies()
Tests if this user can create
Academies. |
boolean |
canCreateAcademyWithRecordTypes(Type[] academyRecordTypes)
Tests if this user can create a single
Academy using
the desired record types. |
boolean |
canDeleteAcademies()
Tests if this user can delete
Academies A return of
true does not guarantee successful authorization. |
boolean |
canManageAcademyAliases()
Tests if this user can manage
Id aliases for
Academies. |
boolean |
canUpdateAcademies()
Tests if this user can update
Academies. |
Academy |
createAcademy(AcademyForm academyForm)
Creates a new
Academy. |
void |
deleteAcademy(Id academyId)
Deletes an
Academy. |
AcademyForm |
getAcademyFormForCreate(Type[] academyRecordTypes)
Gets the academy form for creating new academies.
|
AcademyForm |
getAcademyFormForUpdate(Id academyId)
Gets the academy form for updating an existing academy.
|
void |
updateAcademy(AcademyForm academyForm)
Updates an existing academy.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseboolean canCreateAcademies()
Academies. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating an Academy will
result in a PERMISSION_DENIED. This is intended as a
hint to an application that may not wish to offer create operations to
unauthorized users. false if Academy creation is not
authorized, true otherwisemandatory - This method must be implemented. boolean canCreateAcademyWithRecordTypes(Type[] academyRecordTypes)
Academy using
the desired record types. While
RecognitionManager.getAcademyRecordTypes() can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Academy. Providing
an empty array tests if an Academy can be created with
no records.academyRecordTypes - array of academy types true if Academy creation using
the specified record Types is supported,
false otherwiseNullArgumentException - academyRecordTypes
is null mandatory - This method must be implemented. AcademyForm getAcademyFormForCreate(Type[] academyRecordTypes) throws OperationFailedException, PermissionDeniedException
academyRecordTypes - array of academy typesNullArgumentException - academyRecordTypes
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. Academy createAcademy(AcademyForm academyForm) throws OperationFailedException, PermissionDeniedException
Academy. academyForm - the form for this Academy Academy IllegalStateException - academyForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - academyForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - academyForm did
not originate from getAcademyFormForCreate() mandatory - This method must be implemented. boolean canUpdateAcademies()
Academies. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating an Academy will
result in a PERMISSION_DENIED. This is intended as a
hint to an application that may not wish to offer update operations to
unauthorized users. false if Academy modification is
not authorized, true otherwisemandatory - This method must be implemented. AcademyForm getAcademyFormForUpdate(Id academyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
academyId - the Id of the Academy NotFoundException - academyId is not
foundNullArgumentException - academyId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateAcademy(AcademyForm academyForm) throws OperationFailedException, PermissionDeniedException
academyForm - the form containing the elements to be updatedIllegalStateException - academyForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - academyForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - academyForm did
not originate from getAcademyFormForUpdate() mandatory - This method must be implemented. boolean canDeleteAcademies()
Academies A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting an Academy will
result in a PERMISSION_DENIED. This is intended as a
hint to an application that may not wish to offer delete operations to
unauthorized users. false if Academy deletion is not
authorized, true otherwisemandatory - This method must be implemented. void deleteAcademy(Id academyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Academy. academyId - the Id of the Academy
to removeNotFoundException - academyId not foundNullArgumentException - academyId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageAcademyAliases()
Id aliases for
Academies. A return of true does not guarantee successful
authorization. A return of false indicates that it is known changing
an alias will result in a PERMISSION_DENIED. This is
intended as a hint to an application that may opt not to offer alias
operations to an unauthorized user. false if Academy aliasing is not
authorized, true otherwisemandatory - This method must be implemented. void aliasAcademy(Id academyId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to an Academy for the purpose
of creating compatibility. The primary Id of the
Academy is determined by the provider. The new Id
performs as an alias to the primary Id. If the
alias is a pointer to another academy, it is reassigned to the given
academy Id. academyId - the Id of an Academy aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - academyId not foundNullArgumentException - academyId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.