Interface SubjectOntologyAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface SubjectOntologyAssignmentSession extends OsidSession

This session provides methods to re-assign Subjects to Ontologies . A Subject may map to multiple Ontologies and removing the last reference to a Subject is the equivalent of deleting it. Each Ontology may have its own authorizations governing who is allowed to operate on it.

Adding a reference of a Subject to another Ontology is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignSubjects

      boolean canAssignSubjects()
      Tests if this user can alter subject/ontology 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.
    • canAssignSubjectsToOntology

      boolean canAssignSubjectsToOntology(Id ontologyId)
      Tests if this user can alter subject/ontology 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:
      ontologyId - the Id of the Ontology
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - ontologyId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableOntologyIds

      IdList getAssignableOntologyIds(Id ontologyId) throws OperationFailedException
      Gets a list of ontologies including and under the given ontology node in which any subject can be assigned.
      Parameters:
      ontologyId - the Id of the Ontology
      Returns:
      list of assignable ontology Ids
      Throws:
      NullArgumentException - ontologyId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableOntologyIdsForSubject

      IdList getAssignableOntologyIdsForSubject(Id ontologyId, Id subjectId) throws OperationFailedException
      Gets a list of ontologies including and under the given ontology node in which a specific subject can be assigned.
      Parameters:
      ontologyId - the Id of the Ontology
      subjectId - the Id of the Subject
      Returns:
      list of assignable ontology Ids
      Throws:
      NullArgumentException - ontologyId or subjectId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignSubjectToOntology

      void assignSubjectToOntology(Id subjectId, Id ontologyId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing Subject to an Ontology .
      Parameters:
      subjectId - the Id of the Subject
      ontologyId - the Id of the Ontology
      Throws:
      AlreadyExistsException - subjectId is already assigned to ontologyId
      NotFoundException - subjectId or ontologyId not found
      NullArgumentException - subjectId or ontologyId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignSubjectFromOntology

      void unassignSubjectFromOntology(Id subjectId, Id ontologyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a Subject from an Ontology .
      Parameters:
      subjectId - the Id of the Subject
      ontologyId - the Id of the Ontology
      Throws:
      NotFoundException - subjectId or ontologyId not found or subjectId not assigned to ontologyId
      NullArgumentException - subjectId or ontologyId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignSubjectToOntology

      void reassignSubjectToOntology(Id subjectId, Id fromOntologyId, Id toOntologyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a Subject from one Ontology to another. Mappings to other Ontologies are unaffected.
      Parameters:
      subjectId - the Id of the Subject
      fromOntologyId - the Id of the current Ontology
      toOntologyId - the Id of the destination Ontology
      Throws:
      NotFoundException - subjectId, fromOntologyId , or toOntologyId not found or subjectId not mapped to fromOntologyId
      NullArgumentException - subjectId, fromOntologyId , or toOntologyId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.