public interface StoreAdminSession extends OsidSession
This session creates, updates, and deletes Stores. 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
Store, a StoreForm is requested using
getStoreFormForCreate() specifying the desired record Types
or none if no record Types are needed. The returned
StoreForm 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 StoreForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each StoreForm
corresponds to an attempted transaction.
For updates, StoreForms are requested to the
Store Id that is to be updated using
getStoreFormForUpdate(). Similarly, the StoreForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The StoreForm can
only be used once for a successful update and cannot be reused.
The delete operations delete Stores.
This session includes an Id aliasing mechanism to
assign an external Id to an internally assigned Id.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasStore(Id storeId,
Id aliasId)
Adds an
Id to a Store for the purpose of
creating compatibility. |
boolean |
canCreateStores()
Tests if this user can create
Stores. |
boolean |
canCreateStoreWithRecordTypes(Type[] storeRecordTypes)
Tests if this user can create a single
Store using the
desired record types. |
boolean |
canDeleteStores()
Tests if this user can delete
Stores A return of true
does not guarantee successful authorization. |
boolean |
canManageStoreAliases()
Tests if this user can manage
Id aliases for
Stores. |
boolean |
canUpdateStores()
Tests if this user can update
Stores. |
Store |
createStore(StoreForm storeForm)
Creates a new
Store. |
void |
deleteStore(Id storeId)
Deletes a
Store. |
StoreForm |
getStoreFormForCreate(Type[] storeRecordTypes)
Gets the store form for creating new stores.
|
StoreForm |
getStoreFormForUpdate(Id storeId)
Gets the store form for updating an existing store.
|
void |
updateStore(StoreForm storeForm)
Updates an existing store.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseboolean canCreateStores()
Stores. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating a Store 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 Store creation is not
authorized, true otherwisemandatory - This method must be implemented. boolean canCreateStoreWithRecordTypes(Type[] storeRecordTypes)
Store using the
desired record types. While
OrderingManager.getStoreRecordTypes() can be used to examine
which records are supported, this method tests which record(s) are
required for creating a specific Store. Providing an
empty array tests if a Store can be created with no
records.storeRecordTypes - array of store record types true if Store creation using the
specified record Types is supported,
false otherwiseNullArgumentException - storeRecordTypes
is null mandatory - This method must be implemented. StoreForm getStoreFormForCreate(Type[] storeRecordTypes) throws OperationFailedException, PermissionDeniedException
storeRecordTypes - array of store record typesNullArgumentException - storeRecordTypes
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. Store createStore(StoreForm storeForm) throws OperationFailedException, PermissionDeniedException
Store. storeForm - the form for this Store Store IllegalStateException - storeForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - storeForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - storeForm did not
originate from getStoreFormForCreate() mandatory - This method must be implemented. boolean canUpdateStores()
Stores. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating a Store 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 Store modification is
not authorized, true otherwisemandatory - This method must be implemented. StoreForm getStoreFormForUpdate(Id storeId)
storeId - the Id of the Store NullArgumentException - storeId is
null mandatory - This method must be implemented. void updateStore(StoreForm storeForm) throws OperationFailedException, PermissionDeniedException
storeForm - the form containing the elements to be updatedIllegalStateException - storeForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - storeForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - storeForm did not
originate from getStoreFormForUpdate() mandatory - This method must be implemented. boolean canDeleteStores()
Stores A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting a Store 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 Store deletion is not
authorized, true otherwisemandatory - This method must be implemented. void deleteStore(Id storeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Store. storeId - the Id of the Store to
removeNotFoundException - storeId not foundNullArgumentException - storeId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageStoreAliases()
Id aliases for
Stores. 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 Store aliasing is not
authorized, true otherwisemandatory - This method must be implemented. void aliasStore(Id storeId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to a Store for the purpose of
creating compatibility. The primary Id of the
Store is determined by the provider. The new Id
performs as an alias to the primary Id. If the alias is
a pointer to another store, it is reassigned to the given store
Id. storeId - the Id of a Store aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - storeId not foundNullArgumentException - storeId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.