Interface CanonicalUnitLookupSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface CanonicalUnitLookupSession extends OsidSession

This session defines methods for retrieving canonical units.

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 catalogue view: All canonical unit methods in this session operate, retrieve and pertain to canonical units defined explicitly in the current catalogue. Using an isolated view is useful for managing canonical units with the CanonicalUnitAdminSession .
  • federated catalogue view: All canonical unit lookup methods in this session operate, retrieve and pertain to all canonical units defined in this catalogue and any other catalogues implicitly available in this catalogue through catalogue inheritence.
  • active canonical view: All rule lookup methods return active canonicals.
  • any status canonical view: Canonicals of any active or inactive status are returned from methods.

The methods useFederatedCatalogueView() and useIsolatedCatalogueView() behave as a radio group and one should be selected before invoking any lookup methods.

  • Method Details

    • getCatalogueId

      Id getCatalogueId()
      Gets the Catalogue Id associated with this session.
      Returns:
      the Catalogue Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getCatalogue

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

      boolean canLookupCanonicalUnits()
      Tests if this user can examine this catalogue. 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 these operations.
      Returns:
      false if catalogue reading methods are not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • useComparativeCanonicalUnitView

      void useComparativeCanonicalUnitView()
      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.
    • usePlenaryCanonicalUnitView

      void usePlenaryCanonicalUnitView()
      A complete view of the CanonicalUnit 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.
    • useFederatedCatalogueView

      void useFederatedCatalogueView()
      Federates the view for methods in this session. A federated view will include canonical units in catalogues which are children of this catalogue in the catalogue hierarchy.
      Compliance:
      mandatory - This method is must be implemented.
    • useIsolatedCatalogueView

      void useIsolatedCatalogueView()
      Isolates the view for methods in this session. An isolated view restricts retrievals to this catalogue only.
      Compliance:
      mandatory - This method is must be implemented.
    • useActiveCanonicalUnitView

      void useActiveCanonicalUnitView()
      Only active canonical units are returned from methods in this session.
      Compliance:
      mandatory - This method is must be implemented.
    • useAnyStatusCanonicalUnitView

      void useAnyStatusCanonicalUnitView()
      Active and inactive canonical units are returned from methods in this session.
      Compliance:
      mandatory - This method is must be implemented.
    • getCanonicalUnit

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

      Gets a CanonicalUnitList corresponding to the given IdList . In plenary mode, the returned list contains all of the canonical units 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 canonical units may be omitted from the list and may present the elements in any order including returning a unique set. In active mode, canonicals are returned that are currently active. In any status mode, active and inactive canonicals are returned.
      Parameters:
      canonicalUnitIds - the list of Ids to retrieve
      Returns:
      the returned CanonicalUnit list
      Throws:
      NotFoundException - an Id was not found
      NullArgumentException - canonicalUnitIds is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCanonicalUnitsByGenusType

      CanonicalUnitList getCanonicalUnitsByGenusType(Type canonicalUnitGenusType) throws OperationFailedException, PermissionDeniedException
      Gets a CanonicalUnitList corresponding to the given canonical unit genus Type which does not include canonical units of types derived from the specified Type . In plenary mode, the returned list contains all known canonical units or an error results. Otherwise, the returned list may contain only those canonical units that are accessible through this session. In active mode, canonicals are returned that are currently active. In any status mode, active and inactive canonicals are returned.
      Parameters:
      canonicalUnitGenusType - a canonical units genus type
      Returns:
      the returned CanonicalUnit list
      Throws:
      NullArgumentException - canonicalUnitGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCanonicalUnitsByParentGenusType

      CanonicalUnitList getCanonicalUnitsByParentGenusType(Type canonicalUnitGenusType) throws OperationFailedException, PermissionDeniedException
      Gets a CanonicalUnitList corresponding to the given canonical unit genus Type and include any additional canonical units with genus types derived from the specified Type . In plenary mode, the returned list contains all known canonical units or an error results. Otherwise, the returned list may contain only those canonical units that are accessible through this session. In active mode, canonicals are returned that are currently active. In any status mode, active and inactive canonicals are returned.
      Parameters:
      canonicalUnitGenusType - a canonical unit genus type
      Returns:
      the returned CanonicalUnit list
      Throws:
      NullArgumentException - canonicalUnitGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCanonicalUnitsByRecordType

      CanonicalUnitList getCanonicalUnitsByRecordType(Type canonicalUnitRecordType) throws OperationFailedException, PermissionDeniedException
      Gets a CanonicalUnitList containing the given canonical unit record Type . In plenary mode, the returned list contains all known canonical units or an error results. Otherwise, the returned list may contain only those canonical units that are accessible through this session. In active mode, canonicals are returned that are currently active. In any status mode, active and inactive canonicals are returned.
      Parameters:
      canonicalUnitRecordType - a canonical unit record type
      Returns:
      the returned CanonicalUnitList
      Throws:
      NullArgumentException - canonicalUnitRecordType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCanonicalUnitsByCode

      Gets canonical units by code. In plenary mode, the returned list contains all known canonical units or an error results. Otherwise, the returned list may contain only those canonical units that are accessible through this session. In active mode, canonicals are returned that are currently active. In any status mode, active and inactive canonicals are returned.
      Parameters:
      code - a code
      Returns:
      a list of canonical units
      Throws:
      NullArgumentException - code is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCanonicalUnits

      Gets all canonical units. In plenary mode, the returned list contains all known canonical units or an error results. Otherwise, the returned list may contain only those canonical units that are accessible through this session. In active mode, canonicals are returned that are currently active. In any status mode, active and inactive canonicals are returned.
      Returns:
      a list of canonical units
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.