Interface RelevancyOntologyAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface RelevancyOntologyAssignmentSession extends OsidSession

This session provides methods to re-assign Relevancies to Ontologies . A Relevancy may map to multiple Ontologies and removing the last reference to a Relevancy 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 Relevancy to another Ontology is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignRelevancies

      boolean canAssignRelevancies()
      Tests if this user can alter relevancy/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.
    • canAssignRelevanciesToOntology

      boolean canAssignRelevanciesToOntology(Id ontologyId)
      Tests if this user can alter relevancy/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 relevancy 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.
    • getAssignableOntologyIdsForRelevancy

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

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

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

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