Interface RelationshipFamilyAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, 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 Summary
Modifier and TypeMethodDescriptionvoidassignRelationshipToFamily(Id relationshipId, Id familyId) Adds an existingRelationshipto aFamily.booleanTests if this user can alter relationship/family mappings.booleancanAssignRelationshipsToFamily(Id familyId) Tests if this user can alter relationship/family mappings.getAssignableFamilyIds(Id familyId) Gets a list of families including and under the given family node in which any relationship can be assigned.getAssignableFamilyIdsForRelationship(Id familyId, Id relationshipId) Gets a list of families including and under the given family node in which a specific relationship can be assigned.voidreassignRelationshipToFamily(Id relationshipId, Id fromFamilyId, Id toFamilyId) Moves aRelationshipfrom oneFamilyto another.voidunassignRelationshipFromFamily(Id relationshipId, Id familyId) Removes aRelationshipfrom aFamily.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Returns:
falseif mapping is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canAssignRelationshipsToFamily
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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Parameters:
familyId- theIdof theFamily- Returns:
falseif mapping is not authorized,trueotherwise- Throws:
NullArgumentException-familyIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignableFamilyIds
Gets a list of families including and under the given family node in which any relationship can be assigned.- Parameters:
familyId- theIdof theFamily- Returns:
- list of assignable family
Ids - Throws:
NullArgumentException-familyIdisnullOperationFailedException- 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- theIdof theFamilyrelationshipId- theIdof theRelationship- Returns:
- list of assignable family
Ids - Throws:
NullArgumentException-familyIdorrelationshipIdisnullOperationFailedException- 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 existingRelationshipto aFamily.- Parameters:
relationshipId- theIdof theRelationshipfamilyId- theIdof theFamily- Throws:
AlreadyExistsException-relationshipIdis already assigned tofamilyIdNotFoundException-relationshipIdorfamilyIdnot foundNullArgumentException-relationshipIdorfamilyIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignRelationshipFromFamily
void unassignRelationshipFromFamily(Id relationshipId, Id familyId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes aRelationshipfrom aFamily.- Parameters:
relationshipId- theIdof theRelationshipfamilyId- theIdof theFamily- Throws:
NotFoundException-relationshipIdorfamilyIdnot found orrelationshipIdnot assigned tofamilyIdNullArgumentException-relationshipIdorfamilyIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignRelationshipToFamily
void reassignRelationshipToFamily(Id relationshipId, Id fromFamilyId, Id toFamilyId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves aRelationshipfrom oneFamilyto another. Mappings to otherFamiliesare unaffected.- Parameters:
relationshipId- theIdof theRelationshipfromFamilyId- theIdof the currentFamilytoFamilyId- theIdof the destinationFamily- Throws:
AlreadyExistsException-relationshipIdalready assigned totoFamilyIdNotFoundException-relationshipId, fromFamilyId, ortoFamilyIdnot found orrelationshipIdnot mapped tofromFamilyIdNullArgumentException-relationshipId, fromFamilyId, ortoFamilyIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-