Interface DepotAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
DepotBatchAdminSession
This session creates, updates, and deletes Depots . 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 a
Depot , a DepotForm is requested using
getDepotFormForCreate() specifying the desired record Types or
none if no record Types are needed. The returned DepotForm
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
DepotForm is submiited to a create operation, it cannot be reused
with another create operation unless the first operation was unsuccessful.
Each DepotForm corresponds to an attempted transaction.
For updates, DepotForms are requested to the Depot
Id that is to be updated using getDepotFormForUpdate() .
Similarly, the DepotForm has metadata about the data that can be
updated and it can perform validation before submitting the update. The
Depot can only be used once for a successful update and cannot be
reused.
The delete operations delete Depots .This session also
includes an Id aliasing mechanism to assign an external Id
to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasDepot(Id depotId, Id aliasId) Adds anIdto aDepotfor the purpose of creating compatibility.booleanTests if this user can createDepots.booleancanCreateDepotWithRecordTypes(Type[] depotRecordTypes) Tests if this user can create a singleDepotusing the desired record types.booleancanDeleteDepot(Id depotId) Tests if this user can delete a specifiedDepot.booleanTests if this user can delete depots.booleanTests if this user can manageIdaliases forDepots.booleancanUpdateDepot(Id depotId) Tests if this user can update a specifiedDepot.booleanTests if this user can updateDepots.createDepot(DepotForm depotForm) Creates a newDepot.voiddeleteDepot(Id depotId) Deletes aDepot.getDepotFormForCreate(Type[] depotRecordTypes) Gets the depot form for creating new depots.getDepotFormForUpdate(Id depotId) Gets the depot form for updating an existing depot.voidupdateDepot(DepotForm depotForm) Updates an existing depot.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
-
canCreateDepots
boolean canCreateDepots()Tests if this user can createDepots. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aDepotwill 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:
falseifDepotcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateDepotWithRecordTypes
Tests if this user can create a singleDepotusing the desired record types. WhileInstallationManager.getDepotRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificDepot. Providing an empty array tests if aDepotcan be created with no records.- Parameters:
depotRecordTypes- array of depot record types- Returns:
trueifDepotcreation using the specifiedTypesis supported,falseotherwise- Throws:
NullArgumentException-depotRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getDepotFormForCreate
DepotForm getDepotFormForCreate(Type[] depotRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the depot form for creating new depots. A new form should be requested for each create transaction.- Parameters:
depotRecordTypes- array of depot record types- Returns:
- the depot form
- Throws:
NullArgumentException-depotRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createDepot
Creates a newDepot.- Parameters:
depotForm- the form for thisDepot- Returns:
- the new
Depot - Throws:
IllegalStateException-depotFormalready used for a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-depotFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-depotFormdid not originate fromgetDepotFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateDepots
boolean canUpdateDepots()Tests if this user can updateDepots. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aDepotwill 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:
falseifDepotmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canUpdateDepot
Tests if this user can update a specifiedDepot. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating theDepotwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Parameters:
depotId- theIdof theDepot- Returns:
falseif depot modification is not authorized,trueotherwise- Throws:
NullArgumentException-depotIdisnull- Compliance:
mandatory- This method must be implemented.- Notes:
If- the {@code depotId} is not found, then it is acceptable to return false to indicate the lack of an update available.
-
getDepotFormForUpdate
DepotForm getDepotFormForUpdate(Id depotId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the depot form for updating an existing depot. A new depot form should be requested for each update transaction.- Parameters:
depotId- theIdof theDepot- Returns:
- the depot form
- Throws:
NotFoundException-depotIdis not foundNullArgumentException-depotIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateDepot
Updates an existing depot.- Parameters:
depotForm- the form containing the elements to be updated- Throws:
InvalidArgumentException- the form contains an invalid valueNullArgumentException-depotFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-depotFormdid not originate fromgetDepotFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteDepots
boolean canDeleteDepots()Tests if this user can delete depots. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aDepotwill 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:
falseifDepotdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canDeleteDepot
Tests if this user can delete a specifiedDepot. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting theDepotwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Parameters:
depotId- theIdof theDepot- Returns:
falseif deletion of thisDepotis not authorized,trueotherwise- Throws:
NullArgumentException-depotIdisnull- Compliance:
mandatory- This method must be implemented.- Notes:
If- the {@code depotId} is not found, then it is acceptable to return false to indicate the lack of a delete available.
-
deleteDepot
void deleteDepot(Id depotId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aDepot.- Parameters:
depotId- theIdof theDepotto remove- Throws:
NotFoundException-depotIdnot foundNullArgumentException-depotIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageDepotAliases
boolean canManageDepotAliases()Tests if this user can manageIdaliases forDepots. 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:
falseifDepotaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasDepot
void aliasDepot(Id depotId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aDepotfor the purpose of creating compatibility. The primaryIdof theDepotis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another depot it is reassigned to the given depotId.- Parameters:
depotId- theIdof aDepotaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-depotIdnot foundNullArgumentException-depotIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-