Interface BranchLookupSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface BranchLookupSession extends 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 Branches with the BranchAdminSession .
  • 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 Details

    • getJournalId

      Id getJournalId()
      Gets the Journal Id associated with this session.
      Returns:
      the Journal Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getJournal

      Gets the Journal associated with this session.
      Returns:
      the Journal associated with this session
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canLookupBranches

      boolean canLookupBranches()
      Tests if this user can perform Branch lookups. 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 a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer lookup operations.
      Returns:
      false if lookup methods are not authorized, true otherwise
      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 the Branch returns 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

      Gets the Branch specified by its Id . In plenary mode, the exact Id is found or a NOT_FOUND results. Otherwise, the returned Branch may have a different Id than requested, such as the case where a duplicate Id was assigned to a Branch and retained for compatibility.
      Parameters:
      branchId - the Id of the Branch to retrieve
      Returns:
      the returned Branch
      Throws:
      NotFoundException - no Branch found with the given Id
      NullArgumentException - branchId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getBranchesByIds

      Gets a BranchList corresponding to the given IdList . In plenary mode, the returned list contains all of the branches specified in the Id list, in the order of the list, including duplicates, or an error results if an Id in the supplied list is not found or inaccessible. Otherwise, inaccessible Branches may be omitted from the list and may present the elements in any order including returning a unique set.
      Parameters:
      branchIds - the list of Ids to retrieve
      Returns:
      the returned Branch list
      Throws:
      NotFoundException - an Id was not found
      NullArgumentException - branchIds is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getBranchesByGenusType

      BranchList getBranchesByGenusType(Type branchGenusType) throws OperationFailedException, PermissionDeniedException
      Gets a BranchList corresponding to the given branch genus Type which does not include branches of types derived from the specified Type . 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 Branch list
      Throws:
      NullArgumentException - branchGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getBranchesByParentGenusType

      BranchList getBranchesByParentGenusType(Type branchGenusType) throws OperationFailedException, PermissionDeniedException
      Gets a BranchList corresponding to the given branch genus Type and include any additional branches with genus types derived from the specified Type . 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 Branch list
      Throws:
      NullArgumentException - branchGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getBranchesByRecordType

      BranchList getBranchesByRecordType(Type branchRecordType) throws OperationFailedException, PermissionDeniedException
      Gets a BranchList containing the given branch record Type . 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 Branch list
      Throws:
      NullArgumentException - branchRecordType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getBranches

      Gets all Branches . 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 request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.