Interface BranchLookupSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods for retrieving branches. A branch is a sequence of journal entries.
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
- isolated journal view: All branch methods in this session
operate, retrieve and pertain to branches defined explicitly in the
current journal. Using an isolated view is useful for managing
Brancheswith theBranchAdminSession. - federated journal view: All branch methods in this session operate, retrieve and pertain to all branches defined in this journal and any other branches implicitly available in this journal through journal inheritence.
- active branch view: Active brcnhes are returned in this session.
- any status branch view: Active and inactive branches are returned in this session.
The methods useFederatedJournalView() and
useIsolatedJournalView() behave as a radio group and one should be
selected before invoking any lookup methods.
Branches may have an additional records indicated by their respective
record types. The record may not be accessed through a cast of the
Branch .
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can performBranchlookups.Gets theBranchspecified by itsId.Gets allBranches.getBranchesByGenusType(Type branchGenusType) Gets aBranchListcorresponding to the given branch genusTypewhich does not include branches of types derived from the specifiedType.getBranchesByIds(IdList branchIds) Gets aBranchListcorresponding to the givenIdList.getBranchesByParentGenusType(Type branchGenusType) Gets aBranchListcorresponding to the given branch genusTypeand include any additional branches with genus types derived from the specifiedType.getBranchesByRecordType(Type branchRecordType) Gets aBranchListcontaining the given branch recordType.Gets theJournalassociated with this session.Gets theJournalIdassociated with this session.voidMethods return only branches that are active.voidActuve and inactive branches are returned from lookup 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.voidFederates the view for methods in this session.voidIsolates the view for methods in this session.voidA complete view of theBranchreturns 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
-
getJournalId
Id getJournalId()Gets theJournalIdassociated with this session.- Returns:
- the
Journal Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getJournal
Gets theJournalassociated with this session.- Returns:
- the
Journalassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canLookupBranches
boolean canLookupBranches()Tests if this user can performBranchlookups. 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 opt not to offer lookup operations.- Returns:
falseif lookup methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
useComparativeBranchView
void useComparativeBranchView()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.
-
usePlenaryBranchView
void usePlenaryBranchView()A complete view of theBranchreturns 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.
-
useFederatedJournalView
void useFederatedJournalView()Federates the view for methods in this session. A federated view will include branches in journals which are children of this journal in the journal hierarchy.- Compliance:
mandatory- This method is must be implemented.
-
useIsolatedJournalView
void useIsolatedJournalView()Isolates the view for methods in this session. An isolated view restricts lookups to this journal only.- Compliance:
mandatory- This method is must be implemented.
-
useActiveBranchView
void useActiveBranchView()Methods return only branches that are active.- Compliance:
mandatory- This method is must be implemented.
-
useAnyStatusBranchView
void useAnyStatusBranchView()Actuve and inactive branches are returned from lookup methods in this session.- Compliance:
mandatory- This method is must be implemented.
-
getBranch
Branch getBranch(Id branchId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets theBranchspecified by itsId. In plenary mode, the exactIdis found or aNOT_FOUNDresults. Otherwise, the returnedBranchmay have a differentIdthan requested, such as the case where a duplicateIdwas assigned to aBranchand retained for compatibility.- Parameters:
branchId- theIdof theBranchto retrieve- Returns:
- the returned
Branch - Throws:
NotFoundException- noBranchfound with the givenIdNullArgumentException-branchIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getBranchesByIds
BranchList getBranchesByIds(IdList branchIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets aBranchListcorresponding to the givenIdList. In plenary mode, the returned list contains all of the branches 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, inaccessibleBranchesmay be omitted from the list and may present the elements in any order including returning a unique set.- Parameters:
branchIds- the list ofIdsto retrieve- Returns:
- the returned
Branchlist - Throws:
NotFoundException- anId wasnot foundNullArgumentException-branchIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getBranchesByGenusType
BranchList getBranchesByGenusType(Type branchGenusType) throws OperationFailedException, PermissionDeniedException Gets aBranchListcorresponding to the given branch genusTypewhich does not include branches of types derived from the specifiedType. In plenary mode, the returned list contains all known branches or an error results. Otherwise, the returned list may contain only those branches that are accessible through this session.- Parameters:
branchGenusType- a branch genus type- Returns:
- the returned
Branchlist - Throws:
NullArgumentException-branchGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getBranchesByParentGenusType
BranchList getBranchesByParentGenusType(Type branchGenusType) throws OperationFailedException, PermissionDeniedException Gets aBranchListcorresponding to the given branch genusTypeand include any additional branches with genus types derived from the specifiedType. In plenary mode, the returned list contains all known branches or an error results. Otherwise, the returned list may contain only those branches that are accessible through this session.- Parameters:
branchGenusType- a branch genus type- Returns:
- the returned
Branchlist - Throws:
NullArgumentException-branchGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getBranchesByRecordType
BranchList getBranchesByRecordType(Type branchRecordType) throws OperationFailedException, PermissionDeniedException Gets aBranchListcontaining the given branch recordType. In plenary mode, the returned list contains all known branches or an error results. Otherwise, the returned list may contain only those branches that are accessible through this session.- Parameters:
branchRecordType- a branch record type- Returns:
- the returned
Branchlist - Throws:
NullArgumentException-branchRecordTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getBranches
Gets allBranches. In plenary mode, the returned list contains all known branches or an error results. Otherwise, the returned list may contain only those branches that are accessible through this session.- Returns:
- a list of
Branches - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-