Interface RelationshipLookupSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods for retrieving relationships. A
Relationship is mapped to two OSID Ids .
This lookup session defines several views:
- comparative view: elements may be silently omitted or re-ordered
- plenary view: provides a complete result set or is an error condition
- federated family view: includes relationships in families which are children of this family in the family hierarchy
- isolated family view: restricts lookups to this family only
- effective relationship view: Relationship methods return only relationships currently in effect.
- any effective relationship view: Relationship methods return both effective and ineffective relationships.
Relationships may have an additional records indicated by their
respective record types. The record may not be accessed through a cast of
the Relationship .
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can performRelationshiplookups.Gets theFamilyassociated with this session.Gets theFamilyIdassociated with this session.getRelationship(Id relationshipId) Gets theRelationshipspecified by itsId.Gets allRelationships.getRelationshipsByGenusType(Type relationshipGenusType) Gets aRelationshipListcorresponding to the given relationship genusTypewhich does not include relationships of types derived from the specifiedType.getRelationshipsByGenusTypeForDestination(Id destinationId, Type relationshipGenusType) Gets aRelationshipListcorresponding to the given peerIdand relationship genusType. Relationshipsof any genus derived from the given genus are returned.getRelationshipsByGenusTypeForDestinationOnDate(Id destinationId, Type relationshipGenusType, DateTime from, DateTime to) Gets aRelationshipListcorresponding to the given peerIdand relationship genusTypeand effective during the entire given date range inclusive but not confined to the date range.getRelationshipsByGenusTypeForPeers(Id sourceId, Id destinationId, Type relationshipGenusType) Gets aRelationshipListcorresponding between the given peerIdsand relationship genusType. Relationshipsof any genus derived from the given genus are returned.getRelationshipsByGenusTypeForPeersOnDate(Id sourceId, Id destinationId, Type relationshipGenusType, DateTime from, DateTime to) Gets aRelationshipListeffective during the entire given date range inclusive but not confined to the date range.getRelationshipsByGenusTypeForSource(Id sourceId, Type relationshipGenusType) Gets aRelationshipListcorresponding to the given peerIdand relationship genusType. Relationshipsof any genus derived from the given genus are returned.getRelationshipsByGenusTypeForSourceOnDate(Id sourceId, Type relationshipGenusType, DateTime from, DateTime to) Gets aRelationshipListcorresponding to the given peerIdand relationship genusTypeand effective during the entire given date range inclusive but not confined to the date range.getRelationshipsByIds(IdList relationshipIds) Gets aRelationshipListcorresponding to the givenIdList.getRelationshipsByParentGenusType(Type relationshipGenusType) Gets aRelationshipListcorresponding to the given relationship genusTypeand include any additional relationships with genus types derived from the specifiedType.getRelationshipsByRecordType(Type relationshipRecordType) Gets aRelationshipListcontaining the given relationship recordType.getRelationshipsForDestination(Id destinationId) Gets aRelationshipListcorresponding to the given peerId.getRelationshipsForDestinationOnDate(Id destinationId, DateTime from, DateTime to) Gets aRelationshipListcorresponding to the given peerIdwith a starting effective date in the given range inclusive.getRelationshipsForPeers(Id sourceId, Id destinationId) Gets aRelationshipListcorresponding to the given peerIds.getRelationshipsForPeersOnDate(Id sourceId, Id destinationId, DateTime from, DateTime to) Gets aRelationshipListcorresponding to the given peerIdsand effective during the entire given date range inclusive but not confined to the date range.getRelationshipsForSource(Id sourceId) Gets aRelationshipListcorresponding to the given peerId.getRelationshipsForSourceOnDate(Id sourceId, DateTime from, DateTime to) Gets aRelationshipListcorresponding to the given peerIdand effective during the entire given date range inclusive but not confined to the date range.getRelationshipsOnDate(DateTime from, DateTime to) Gets aRelationshipListeffective during the entire given date range inclusive but not confined to the date range.voidAll relationships of any effective dates are returned by all methods in this session.voidThe returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error.voidOnly relationships whose effective dates are current are returned by methods in this session.voidFederates the view for methods in this session.voidIsolates the view for methods in this session.voidA complete view of theRelationshipreturns is desired.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
-
getFamilyId
Id getFamilyId()Gets theFamilyIdassociated with this session.- Returns:
- the
Family Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getFamily
Gets theFamilyassociated with this session.- Returns:
- the family
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canLookupRelationships
boolean canLookupRelationships()Tests if this user can performRelationshiplookups. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may not offer lookup operations to unauthorized users.- Returns:
falseif lookup methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
useComparativeRelationshipView
void useComparativeRelationshipView()The returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error. This view is used when greater interoperability is desired at the expense of precision.- Compliance:
mandatory- This method is must be implemented.
-
usePlenaryRelationshipView
void usePlenaryRelationshipView()A complete view of theRelationshipreturns is desired. Methods will return what is requested or result in an error. This view is used when greater precision is desired at the expense of interoperability.- Compliance:
mandatory- This method is must be implemented.
-
useFederatedFamilyView
void useFederatedFamilyView()Federates the view for methods in this session. A federated view will include relationships in families which are children of this family in the family hierarchy.- Compliance:
mandatory- This method is must be implemented.
-
useIsolatedFamilyView
void useIsolatedFamilyView()Isolates the view for methods in this session. An isolated view restricts retrievals to this family only.- Compliance:
mandatory- This method is must be implemented.
-
useEffectiveRelationshipView
void useEffectiveRelationshipView()Only relationships whose effective dates are current are returned by methods in this session.- Compliance:
mandatory- This method is must be implemented.
-
useAnyEffectiveRelationshipView
void useAnyEffectiveRelationshipView()All relationships of any effective dates are returned by all methods in this session.- Compliance:
mandatory- This method is must be implemented.
-
getRelationship
Relationship getRelationship(Id relationshipId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets theRelationshipspecified by itsId. In plenary mode, the exactIdis found or aNOT_FOUNDresults. Otherwise, the returnedRelationshipmay have a differentIdthan requested, such as the case where a duplicateIdwas assigned to aRelationshipand retained for compatibility. In effective mode, relationships are returned that are currently effective. In any effective mode, effective relationships and those currently expired are returned.- Parameters:
relationshipId- theIdof theRelationshipto retrieve- Returns:
- the returned
Relationship - Throws:
NotFoundException- noRelationshipfound with the givenIdNullArgumentException-relationshipIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRelationshipsByIds
RelationshipList getRelationshipsByIds(IdList relationshipIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets aRelationshipListcorresponding to the givenIdList. In plenary mode, the returned list contains all of the relationships specified in theIdlist, in the order of the list, including duplicates, or an error results if anIdin the supplied list is not found or inaccessible. Otherwise, inaccessibleRelationshipsmay be omitted from the list and may present the elements in any order including returning a unique set. In effective mode, relationships are returned that are currently effective. In any effective mode, effective relationships and those currently expired are returned.- Parameters:
relationshipIds- the list ofIdsto retrieve- Returns:
- the returned
Relationship list - Throws:
NotFoundException- anIdwas not foundNullArgumentException-relationshipIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRelationshipsByGenusType
RelationshipList getRelationshipsByGenusType(Type relationshipGenusType) throws OperationFailedException, PermissionDeniedException Gets aRelationshipListcorresponding to the given relationship genusTypewhich does not include relationships of types derived from the specifiedType. In plenary mode, the returned list contains all known relationships or an error results. Otherwise, the returned list may contain only those relationships that are accessible through this session. In effective mode, relationships are returned that are currently effective. In any effective mode, effective relationships and those currently expired are returned.- Parameters:
relationshipGenusType- a relationship genus type- Returns:
- the returned
Relationship list - Throws:
NullArgumentException-relationshipGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRelationshipsByParentGenusType
RelationshipList getRelationshipsByParentGenusType(Type relationshipGenusType) throws OperationFailedException, PermissionDeniedException Gets aRelationshipListcorresponding to the given relationship genusTypeand include any additional relationships with genus types derived from the specifiedType. In plenary mode, the returned list contains all known relationships or an error results. Otherwise, the returned list may contain only those relationships that are accessible through this session. In effective mode, relationships are returned that are currently effective. In any effective mode, effective relationships and those currently expired are returned.- Parameters:
relationshipGenusType- a relationship genus type- Returns:
- the returned
Relationship list - Throws:
NullArgumentException-relationshipGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRelationshipsByRecordType
RelationshipList getRelationshipsByRecordType(Type relationshipRecordType) throws OperationFailedException, PermissionDeniedException Gets aRelationshipListcontaining the given relationship recordType. In plenary mode, the returned list contains all known relationships or an error results. Otherwise, the returned list may contain only those relationships that are accessible through this session. In effective mode, relationships are returned that are currently effective. In any effective mode, effective relationships and those currently expired are returned.- Parameters:
relationshipRecordType- a relationship record type- Returns:
- the returned
RelationshipList - Throws:
NullArgumentException-relationshipRecordTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRelationshipsOnDate
RelationshipList getRelationshipsOnDate(DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets aRelationshipListeffective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all of the relationships corresponding to date or an error results if a relationship is inaccessible. Otherwise, inaccessibleRelationshipsmay be omitted from the list. In effective mode, relationships are returned that are currently effective in addition to being effective during the given dates. In any effective mode, effective relationships and those currently expired are returned.- Parameters:
from- starting dateto- ending date- Returns:
- the relationships
- Throws:
InvalidArgumentException-from is greater than toNullArgumentException-fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRelationshipsForSource
RelationshipList getRelationshipsForSource(Id sourceId) throws OperationFailedException, PermissionDeniedException Gets aRelationshipListcorresponding to the given peerId. In plenary mode, the returned list contains all of the relationships corresponding to the given peer or an error results if a relationship is inaccessible. Otherwise, inaccessibleRelationshipsmay be omitted from the list and may present the elements in any order including returning a unique set. In effective mode, relationships are returned that are currently effective. In any effective mode, effective relationships and those currently expired are returned.- Parameters:
sourceId- a peerId- Returns:
- the relationships
- Throws:
NullArgumentException-sourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRelationshipsForSourceOnDate
RelationshipList getRelationshipsForSourceOnDate(Id sourceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets aRelationshipListcorresponding to the given peerIdand effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all of the relationships corresponding to the given peer or an error results if a relationship is inaccessible. Otherwise, inaccessibleRelationshipsmay be omitted from the list. In effective mode, relationships are returned that are currently effective in addition to being effective during the given dates. In any effective mode, effective relationships and those currently expired are returned.- Parameters:
sourceId- a peerIdfrom- starting dateto- ending date- Returns:
- the relationships
- Throws:
InvalidArgumentException-from is greater than toNullArgumentException-sourceId, from,ortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRelationshipsByGenusTypeForSource
RelationshipList getRelationshipsByGenusTypeForSource(Id sourceId, Type relationshipGenusType) throws OperationFailedException, PermissionDeniedException Gets aRelationshipListcorresponding to the given peerIdand relationship genusType. Relationshipsof any genus derived from the given genus are returned. In plenary mode, the returned list contains all of the relationships corresponding to the given peer, including duplicates, or an error results if a relationship is inaccessible. Otherwise, inaccessibleRelationshipsmay be omitted from the list and may present the elements in any order including returning a unique set. In effective mode, relationships are returned that are currently effective. In any effective mode, effective relationships and those currently expired are returned.- Parameters:
sourceId- a peerIdrelationshipGenusType- a relationship genus type- Returns:
- the relationships
- Throws:
NullArgumentException-sourceIdorrelationshipGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRelationshipsByGenusTypeForSourceOnDate
RelationshipList getRelationshipsByGenusTypeForSourceOnDate(Id sourceId, Type relationshipGenusType, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets aRelationshipListcorresponding to the given peerIdand relationship genusTypeand effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all of the relationships corresponding to the given peer or an error results if a relationship is inaccessible. Otherwise, inaccessibleRelationshipsmay be omitted from the list. In effective mode, relationships are returned that are currently effective in addition to being effective during the given dates. In any effective mode, effective relationships and those currently expired are returned.- Parameters:
sourceId- a peerIdrelationshipGenusType- a relationship genus typefrom- starting dateto- ending date- Returns:
- the relationships
- Throws:
InvalidArgumentException-from is greater than toNullArgumentException-sourceId, relationshipGenusType, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRelationshipsForDestination
RelationshipList getRelationshipsForDestination(Id destinationId) throws OperationFailedException, PermissionDeniedException Gets aRelationshipListcorresponding to the given peerId. In plenary mode, the returned list contains all of the relationships corresponding to the given peer or an error results if a relationship is inaccessible. Otherwise, inaccessibleRelationshipsmay be omitted from the list and may present the elements in any order including returning a unique set. In effective mode, relationships are returned that are currently effective. In any effective mode, effective relationships and those currently expired are returned.- Parameters:
destinationId- a peerId- Returns:
- the relationships
- Throws:
NullArgumentException-destinationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRelationshipsForDestinationOnDate
RelationshipList getRelationshipsForDestinationOnDate(Id destinationId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets aRelationshipListcorresponding to the given peerIdwith a starting effective date in the given range inclusive. In plenary mode, the returned list contains all of the relationships corresponding to the given peer or an error results if a relationship is inaccessible. Otherwise, inaccessibleRelationshipsmay be omitted from the list. In effective mode, relationships are returned that are currently effective. In any effective mode, effective relationships and those currently expired are returned.- Parameters:
destinationId- a peerIdfrom- starting dateto- ending date- Returns:
- the relationships
- Throws:
InvalidArgumentException-from is greater than toNullArgumentException-destinationId, from,ortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRelationshipsByGenusTypeForDestination
RelationshipList getRelationshipsByGenusTypeForDestination(Id destinationId, Type relationshipGenusType) throws OperationFailedException, PermissionDeniedException Gets aRelationshipListcorresponding to the given peerIdand relationship genusType. Relationshipsof any genus derived from the given genus are returned. In plenary mode, the returned list contains all of the relationships corresponding to the given peer, including duplicates, or an error results if a relationship is inaccessible. Otherwise, inaccessibleRelationshipsmay be omitted from the list and may present the elements in any order including returning a unique set. In effective mode, relationships are returned that are currently effective. In any effective mode, effective relationships and those currently expired are returned.- Parameters:
destinationId- a peerIdrelationshipGenusType- a relationship genus type- Returns:
- the relationships
- Throws:
NullArgumentException-destinationIdorrelationshipGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRelationshipsByGenusTypeForDestinationOnDate
RelationshipList getRelationshipsByGenusTypeForDestinationOnDate(Id destinationId, Type relationshipGenusType, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets aRelationshipListcorresponding to the given peerIdand relationship genusTypeand effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all of the relationships corresponding to the given peer or an error results if a relationship is inaccessible. Otherwise, inaccessibleRelationshipsmay be omitted from the list. In effective mode, relationships are returned that are currently effective in addition to being effective during the given dates. In any effective mode, effective relationships and those currently expired are returned.- Parameters:
destinationId- a peerIdrelationshipGenusType- a relationship genus typefrom- starting dateto- ending date- Returns:
- the relationships
- Throws:
InvalidArgumentException-from is greater than toNullArgumentException-destinationId, relationshipGenusType, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRelationshipsForPeers
RelationshipList getRelationshipsForPeers(Id sourceId, Id destinationId) throws OperationFailedException, PermissionDeniedException Gets aRelationshipListcorresponding to the given peerIds. In plenary mode, the returned list contains all of the relationships corresponding to the given peer or an error results if a relationship is inaccessible. Otherwise, inaccessibleRelationshipsmay be omitted from the list. In effective mode, relationships are returned that are currently effective. In any effective mode, effective relationships and those currently expired are returned.- Parameters:
sourceId- a peerIddestinationId- a related peerId- Returns:
- the relationships
- Throws:
NullArgumentException-sourceIdordestinationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRelationshipsForPeersOnDate
RelationshipList getRelationshipsForPeersOnDate(Id sourceId, Id destinationId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets aRelationshipListcorresponding to the given peerIdsand effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all of the relationships corresponding to the given peer set or an error results if a relationship is inaccessible. Otherwise, inaccessibleRelationshipsmay be omitted from the list. In effective mode, relationships are returned that are currently effective in addition to being effective during the given dates. In any effective mode, effective relationships and those currently expired are returned.- Parameters:
sourceId- a peerIddestinationId- a related peerIdfrom- starting dateto- ending date- Returns:
- the relationships
- Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-sourceId, destinationId, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRelationshipsByGenusTypeForPeers
RelationshipList getRelationshipsByGenusTypeForPeers(Id sourceId, Id destinationId, Type relationshipGenusType) throws OperationFailedException, PermissionDeniedException Gets aRelationshipListcorresponding between the given peerIdsand relationship genusType. Relationshipsof any genus derived from the given genus are returned. In plenary mode, the returned list contains all of the relationships corresponding to the given peer or an error results if a relationship is inaccessible. Otherwise, inaccessibleRelationshipsmay be omitted from the list. In effective mode, relationships are returned that are currently effective. In any effective mode, effective relationships and those currently expired are returned.- Parameters:
sourceId- a peerIddestinationId- a related peerIdrelationshipGenusType- a relationship genus type- Returns:
- the relationships
- Throws:
NullArgumentException-sourceId, destinationId, orrelationshipGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRelationshipsByGenusTypeForPeersOnDate
RelationshipList getRelationshipsByGenusTypeForPeersOnDate(Id sourceId, Id destinationId, Type relationshipGenusType, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets aRelationshipListeffective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all of the relationships corresponding to the given peer set or an error results if a relationship is inaccessible. Otherwise, inaccessibleRelationshipsmay be omitted from the list. In effective mode, relationships are returned that are currently effective in addition to being effective during the given dates. In any effective mode, effective relationships and those currently expired are returned.- Parameters:
sourceId- a peerIddestinationId- a related peerIdrelationshipGenusType- a relationship genus typefrom- starting dateto- ending date- Returns:
- the relationships
- Throws:
InvalidArgumentException-from is greater than toNullArgumentException-sourceId, destinationId, relationshipGenusType, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRelationships
Gets allRelationships. In plenary mode, the returned list contains all known relationships or an error results. Otherwise, the returned list may contain only those relationships that are accessible through this session. In effective mode, relationships are returned that are currently effective. In any effective mode, effective relationships and those currently expired are returned.- Returns:
- a list of
Relationships - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-