Interface CatalogueAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
All Known Subinterfaces:
CatalogueBatchAdminSession

public interface CatalogueAdminSession extends OsidSession

This session creates, updates, and deletes Catalogues . 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 Catalogue , a CatalogueForm is requested using getCatalogueFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned CatalogueForm 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 CatalogueForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each CatalogueForm corresponds to an attempted transaction.

For updates, CatalogueForms are requested to the Catalogue Id that is to be updated using getCatalogueFormForUpdate() . Similarly, the CatalogueForm has metadata about the data that can be updated and it can perform validation before submitting the update. The CatalogueForm can only be used once for a successful update and cannot be reused.

The delete operations delete Catalogues . It is safer to remove all mappings to the Catalogue catalogs before deletion.

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

  • Method Details

    • canCreateCatalogues

      boolean canCreateCatalogues()
      Tests if this user can create Catalogues . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Catalogue 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.
      Returns:
      false if Catalogue creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateCatalogueWithRecordTypes

      boolean canCreateCatalogueWithRecordTypes(Type[] catalogueRecordTypes)
      Tests if this user can create a single Catalogue using the desired record types. While OfferingManager.getCatalogueRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Catalogue . Providing an empty array tests if a Catalogue can be created with no records.
      Parameters:
      catalogueRecordTypes - array of types
      Returns:
      true if Catalogue creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - catalogueRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getCatalogueFormForCreate

      CatalogueForm getCatalogueFormForCreate(Type[] catalogueRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the catalogue form for creating new catalogues. A new form should be requested for each create transaction.
      Parameters:
      catalogueRecordTypes - array of types
      Returns:
      the catalogue form
      Throws:
      NullArgumentException - catalogueRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - cannot get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createCatalogue

      Creates a new Catalogue .
      Parameters:
      catalogueForm - the form for this Catalogue
      Returns:
      the new Catalogue
      Throws:
      IllegalStateException - catalogueForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - catalogueForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - catalogueForm did not originate from getCatalogueFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateCatalogues

      boolean canUpdateCatalogues()
      Tests if this user can update Catalogues . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Catalogue 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.
      Returns:
      false if Catalogue modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getCatalogueFormForUpdate

      CatalogueForm getCatalogueFormForUpdate(Id catalogueId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the catalogue form for updating an existing catalogue. A new catalogue form should be requested for each update transaction.
      Parameters:
      catalogueId - the Id of the Catalogue
      Returns:
      the catalogue form
      Throws:
      NotFoundException - catalogueId is not found
      NullArgumentException - catalogueId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateCatalogue

      void updateCatalogue(CatalogueForm catalogueForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing catalogue.
      Parameters:
      catalogueForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - catalogueForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - catalogueForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - catalogueForm did not originate from getCataloguetFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteCatalogues

      boolean canDeleteCatalogues()
      Tests if this user can delete Catalogues A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Catalogue 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.
      Returns:
      false if Catalogue deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteCatalogue

      void deleteCatalogue(Id catalogueId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes a Catalogue .
      Parameters:
      catalogueId - the Id of the Catalogue to remove
      Throws:
      NotFoundException - catalogueId not found
      NullArgumentException - catalogueId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageCatalogueAliases

      boolean canManageCatalogueAliases()
      Tests if this user can manage Id aliases for Catalogues . 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.
      Returns:
      false if Catalogue aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasCatalogue

      Adds an Id to a Catalogue for the purpose of creating compatibility. The primary Id of the Item is determined by the provider. The new Id is an alias to the primary Id . If the alias is a pointer to another catalogue, it is reassigned to the given catalogue Id .
      Parameters:
      catalogueId - the Id of a Catalogue
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is in use as a primary Id
      NotFoundException - catalogueId not found
      NullArgumentException - catalogueId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.