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