Interface CompositionRepositoryAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface CompositionRepositoryAssignmentSession extends OsidSession

This session provides methods to re-assign Compositions to Repository objects. A Composition may be associated with multiple Repository objects. Removing the last reference to a Composition is the equivalent of deleting it. Each Repository may have its own authorizations governing who is allowed to operate on it.

Moving or adding a reference of a Composition to another Repository is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignCompositions

      boolean canAssignCompositions()
      Tests if this user can alter composition/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 . This 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.
    • canAssignCompositionsToRepository

      boolean canAssignCompositionsToRepository(Id repositoryId)
      Tests if this user can alter composition/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 . This 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 composition 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.
    • getAssignableRepositoryIdsForComposition

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

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

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

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