Interface AssetContentRepositoryAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface AssetContentRepositoryAssignmentSession extends OsidSession

This session provides methods to re-assign AssetContents to Repository mappings. An AssetContent may appear in multiple Repository catalogs and removing the last reference to an AssetContent is the equivalent of deleting it. Each Repository may have its own authorizations governing who is allowed to operate on it.

Adding a reference of an AssetContent to another Repository is n ot a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignAssetContents

      boolean canAssignAssetContents()
      Tests if this user can alter asset content/repository mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PERMISSION_DENIED. T his is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
      Returns:
      false if mapping is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canAssignAssetContentToRepository

      boolean canAssignAssetContentToRepository(Id repositoryId)
      Tests if this user can alter asset content/repository mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PERMISSION_DENIED. T his is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
      Parameters:
      repositoryId - the Id of the Repository
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - repositoryId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableRepositoryIds

      IdList getAssignableRepositoryIds(Id repositoryId) throws OperationFailedException
      Gets a list of repositories including and under the given repository node in which any asset content can be assigned.
      Parameters:
      repositoryId - the Id of the Repository
      Returns:
      list of assignable repository Ids
      Throws:
      NullArgumentException - repositoryId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableRepositoryIdsForAssetContent

      IdList getAssignableRepositoryIdsForAssetContent(Id repositoryId, Id assetContentId) throws OperationFailedException
      Gets a list of repositories including and under the given repository node in which a specific asset content can be assigned.
      Parameters:
      repositoryId - the Id of the Repository
      assetContentId - the Id of the AssetContent
      Returns:
      list of assignable repository Ids
      Throws:
      NullArgumentException - repositoryId or assetContentId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignAssetContentToRepository

      void assignAssetContentToRepository(Id assetContentId, Id repositoryId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing AssetContent to a Repository .
      Parameters:
      assetContentId - the Id of the AssetContent
      repositoryId - the Id of the Repository
      Throws:
      AlreadyExistsException - assetContentId is already assigned to repositoryId
      NotFoundException - assetContentId or repositoryId not found
      NullArgumentException - assetContentId or repositoryId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignAssetContentFromRepository

      void unassignAssetContentFromRepository(Id assetContentId, Id repositoryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes an AssetContent from a Repository .
      Parameters:
      assetContentId - the Id of the AssetContent
      repositoryId - the Id of the Repository
      Throws:
      NotFoundException - assetContentId or repositoryId not found or assetContentId not assigned to repositoryId
      NullArgumentException - assetContentId or repositoryId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignAssetContentToRepository

      void reassignAssetContentToRepository(Id assetContentId, Id fromRepositoryId, Id toRepositoryId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves an AssetContent from one Repository to another. Mappings to other Repositories are unaffected.
      Parameters:
      assetContentId - the Id of the AssetContent
      fromRepositoryId - the Id of the current Repository
      toRepositoryId - the Id of the destination Repository
      Throws:
      AlreadyExistsException - assetContentId already assigned to torepositoryId
      NotFoundException - assetContentId, fromRepositoryId , or toRepositoryeId not found or assetContentId not mapped to fromRepositoryId
      NullArgumentException - assetContentId, fromRepositoryId , or toRepositoryId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.