Interface RelationshipFamilyAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface RelationshipFamilyAssignmentSession extends OsidSession

This session provides methods to re-assign Relationships to Family objects A Relationship may appear in multiple Family objects and removing the last reference to a Relationship is the equivalent of deleting it. Each Family may have its own authorizations governing who is allowed to operate on it.

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

  • Method Details

    • canAssignRelationships

      boolean canAssignRelationships()
      Tests if this user can alter relationship/family 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.
    • canAssignRelationshipsToFamily

      boolean canAssignRelationshipsToFamily(Id familyId)
      Tests if this user can alter relationship/family 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:
      familyId - the Id of the Family
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - familyId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableFamilyIds

      IdList getAssignableFamilyIds(Id familyId) throws OperationFailedException
      Gets a list of families including and under the given family node in which any relationship can be assigned.
      Parameters:
      familyId - the Id of the Family
      Returns:
      list of assignable family Ids
      Throws:
      NullArgumentException - familyId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableFamilyIdsForRelationship

      IdList getAssignableFamilyIdsForRelationship(Id familyId, Id relationshipId) throws OperationFailedException
      Gets a list of families including and under the given family node in which a specific relationship can be assigned.
      Parameters:
      familyId - the Id of the Family
      relationshipId - the Id of the Relationship
      Returns:
      list of assignable family Ids
      Throws:
      NullArgumentException - familyId or relationshipId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignRelationshipToFamily

      void assignRelationshipToFamily(Id relationshipId, Id familyId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing Relationship to a Family .
      Parameters:
      relationshipId - the Id of the Relationship
      familyId - the Id of the Family
      Throws:
      AlreadyExistsException - relationshipId is already assigned to familyId
      NotFoundException - relationshipId or familyId not found
      NullArgumentException - relationshipId or familyId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignRelationshipFromFamily

      void unassignRelationshipFromFamily(Id relationshipId, Id familyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a Relationship from a Family .
      Parameters:
      relationshipId - the Id of the Relationship
      familyId - the Id of the Family
      Throws:
      NotFoundException - relationshipId or familyId not found or relationshipId not assigned to familyId
      NullArgumentException - relationshipId or familyId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignRelationshipToFamily

      void reassignRelationshipToFamily(Id relationshipId, Id fromFamilyId, Id toFamilyId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a Relationship from one Family to another. Mappings to other Families are unaffected.
      Parameters:
      relationshipId - the Id of the Relationship
      fromFamilyId - the Id of the current Family
      toFamilyId - the Id of the destination Family
      Throws:
      AlreadyExistsException - relationshipId already assigned to toFamilyId
      NotFoundException - relationshipId, fromFamilyId , or toFamilyId not found or relationshipId not mapped to fromFamilyId
      NullArgumentException - relationshipId, fromFamilyId , or toFamilyId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.