public interface DepotAdminSession extends OsidSession
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.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasDepot(Id depotId,
Id aliasId)
Adds an
Id to a Depot for the purpose of
creating compatibility. |
boolean |
canCreateDepots()
Tests if this user can create
Depots. |
boolean |
canCreateDepotWithRecordTypes(Type[] depotRecordTypes)
Tests if this user can create a single
Depot using the
desired record types. |
boolean |
canDeleteDepot(Id depotId)
Tests if this user can delete a specified
Depot. |
boolean |
canDeleteDepots()
Tests if this user can delete depots.
|
boolean |
canManageDepotAliases()
Tests if this user can manage
Id aliases for
Depots. |
boolean |
canUpdateDepot(Id depotId)
Tests if this user can update a specified
Depot. |
boolean |
canUpdateDepots()
Tests if this user can update
Depots. |
Depot |
createDepot(DepotForm depotForm)
Creates a new
Depot. |
void |
deleteDepot(Id depotId)
Deletes a
Depot. |
DepotForm |
getDepotFormForCreate(Type[] depotRecordTypes)
Gets the depot form for creating new depots.
|
DepotForm |
getDepotFormForUpdate(Id depotId)
Gets the depot form for updating an existing depot.
|
void |
updateDepot(DepotForm depotForm)
Updates an existing depot.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseboolean canCreateDepots()
Depots. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating a Depot 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 Depot creation is not
authorized, true otherwisemandatory - This method must be implemented. boolean canCreateDepotWithRecordTypes(Type[] depotRecordTypes)
Depot using the
desired record types. While
InstallationManager.getDepotRecordTypes() can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Depot. Providing
an empty array tests if a Depot can be created with no
records.depotRecordTypes - array of depot record types true if Depot creation using the
specified Types is supported, false
otherwiseNullArgumentException - depotRecordTypes
is null mandatory - This method must be implemented. DepotForm getDepotFormForCreate(Type[] depotRecordTypes) throws OperationFailedException, PermissionDeniedException
depotRecordTypes - array of depot record typesNullArgumentException - depotRecordTypes
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. Depot createDepot(DepotForm depotForm) throws OperationFailedException, PermissionDeniedException
Depot. depotForm - the form for this Depot Depot IllegalStateException - depotForm
already used for a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - depotForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - depotForm did not
originate from getDepotFormForCreate() mandatory - This method must be implemented. boolean canUpdateDepots()
Depots. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating a Depot 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 Depot modification is
not authorized, true otherwisemandatory - This method must be implemented. boolean canUpdateDepot(Id depotId)
Depot. A
return of true does not guarantee successful authorization. A return
of false indicates that it is known updating the Depot
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.depotId - the Id of the Depot false if depot modification is not authorized,
true otherwiseNullArgumentException - depotId is
null mandatory - This method must be implemented. If - the depotId is not found, then it is
acceptable to return false to indicate the lack of an update
available. DepotForm getDepotFormForUpdate(Id depotId) throws NotFoundException, OperationFailedException, PermissionDeniedException
depotId - the Id of the Depot NotFoundException - depotId is not foundNullArgumentException - depotId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateDepot(DepotForm depotForm) throws OperationFailedException, PermissionDeniedException
depotForm - the form containing the elements to be updatedInvalidArgumentException - the form contains an invalid
valueNullArgumentException - depotForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - depotForm did not
originate from getDepotFormForUpdate() mandatory - This method must be implemented. boolean canDeleteDepots()
Depot 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 Depot deletion is not
authorized, true otherwisemandatory - This method must be implemented. boolean canDeleteDepot(Id depotId)
Depot. A
return of true does not guarantee successful authorization. A return
of false indicates that it is known deleting the Depot
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.depotId - the Id of the Depot false if deletion of this Depot
is not authorized, true otherwiseNullArgumentException - depotId is
null mandatory - This method must be implemented. If - the depotId is not found, then it is
acceptable to return false to indicate the lack of a delete
available. void deleteDepot(Id depotId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Depot. depotId - the Id of the Depot to
removeNotFoundException - depotId not foundNullArgumentException - depotId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageDepotAliases()
Id aliases for
Depots. 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 Depot aliasing is not
authorized, true otherwisemandatory - This method must be implemented. void aliasDepot(Id depotId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to a Depot for the purpose of
creating compatibility. The primary Id of the
Depot is determined by the provider. The new Id
performs as an alias to the primary Id. If the alias is
a pointer to another depot it is reassigned to the given depot
Id. depotId - the Id of a Depot aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - depotId not foundNullArgumentException - depotId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.