Interface AssetContentAdminSession

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

public interface AssetContentAdminSession extends OsidSession

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

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

The delete operations delete AssetContents . To unmap an AssetContent from the current Repository , the AssetContentRepositoryAssignmentSession should be used. These delete operations attempt to remove the AssetContent itself thus removing it from all known Repository catalogs.

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

  • Method Details

    • getRepositoryId

      Id getRepositoryId()
      Gets the Repository Id associated with this session.
      Returns:
      the Repository Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getRepository

      Gets the Repository associated with this session.
      Returns:
      the repository
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canCreateAssetContents

      boolean canCreateAssetContents()
      Tests if this user can create AssetContents . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an AssetContent will result in a PERMISSION_DENIED. Th is is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.
      Returns:
      false if AssetContent creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateAssetContentWithRecordTypes

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

      AssetContentForm getAssetContentFormForCreate(Id assetId, Type[] assetContentRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the asset content form for creating new asset contents. A new form should be requested for each create transaction.
      Parameters:
      assetId - an asset Id
      assetContentRecordTypes - array of asset content record types
      Returns:
      the asset content form
      Throws:
      NotFoundException - asetId is not found
      NullArgumentException - assetId or assetContentRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createAssetContent

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

      boolean canUpdateAssetContents()
      Tests if this user can update AssetContents . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an AssetContent will result in a PERMISSION_DENIED. Th is is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.
      Returns:
      false if AssetContent modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getAssetContentFormForUpdate

      AssetContentForm getAssetContentFormForUpdate(Id assetContentId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the asset content form for updating an existing asset content. A new asset content form should be requested for each update transaction.
      Parameters:
      assetContentId - the Id of the AssetContent
      Returns:
      the asset content form
      Throws:
      NotFoundException - assetContentId is not found
      NullArgumentException - assetContentId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateAssetContent

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

      boolean canDeleteAssetContents()
      Tests if this user can delete AssetContents . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an AssetContent will result in a PERMISSION_DENIED. Th is is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.
      Returns:
      false if AssetContent deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteAssetContent

      void deleteAssetContent(Id assetContentId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes an AssetContent .
      Parameters:
      assetContentId - the Id of the AssetContent to remove
      Throws:
      NotFoundException - assetContentId not found
      NullArgumentException - assetContentId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageAssetContentAliases

      boolean canManageAssetContentAliases()
      Tests if this user can manage Id aliases for AssetContents 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 AssetContent aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasAssetContent

      void aliasAssetContent(Id assetContentId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an Id to an AssetContent for the purpose of creating compatibility. The primary Id of the AssetContent is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another asset content, it is reassigned to the given asset content Id .
      Parameters:
      assetContentId - the Id of an AssetContent
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - assetContentId not found
      NullArgumentException - assetContentId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.