Interface ResourceLookupSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface ResourceLookupSession extends OsidSession

This session defines methods for retrieving resources. A Resource is an arbitrary entity that may represent a person, place or thing used to identify an object used in various services.

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 bin view: All resource methods in this session operate, retrieve and pertain to resources defined explicitly in the current bin. Using an isolated view is useful for managing Resources with the ResourceAdminSession .
  • federated bin view: All resource methods in this session operate, retrieve and pertain to all resources defined in this bin and any other resources implicitly available in this bin through bin inheritence.

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

Resources may have an additional records indicated by their respective record types. The record may not be accessed through a cast of the Resource .

  • Method Details

    • getBinId

      Id getBinId()
      Gets the Bin Id associated with this session.
      Returns:
      the Bin Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getBin

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

      boolean canLookupResources()
      Tests if this user can perform Resource 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.
    • useComparativeResourceView

      void useComparativeResourceView()
      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.
    • usePlenaryResourceView

      void usePlenaryResourceView()
      A complete view of the Resource 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.
    • useFederatedBinView

      void useFederatedBinView()
      Federates the view for methods in this session. A federated view will include resources in bins which are children of this bin in the bin hierarchy.
      Compliance:
      mandatory - This method is must be implemented.
    • useIsolatedBinView

      void useIsolatedBinView()
      Isolates the view for methods in this session. An isolated view restricts lookups to this bin only.
      Compliance:
      mandatory - This method is must be implemented.
    • getResource

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

      Gets a ResourceList corresponding to the given IdList . In plenary mode, the returned list contains all of the resources 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 Resources may be omitted from the list and may present the elements in any order including returning a unique set.
      Parameters:
      resourceIds - the list of Ids to retrieve
      Returns:
      the returned Resource list
      Throws:
      NotFoundException - an Id was not found
      NullArgumentException - resourceIds is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getResourcesByGenusType

      ResourceList getResourcesByGenusType(Type resourceGenusType) throws OperationFailedException, PermissionDeniedException
      Gets a ResourceList corresponding to the given resource genus Type which does not include resources of types derived from the specified Type .In plenary mode, the returned list contains all known resources or an error results. Otherwise, the returned list may contain only those resources that are accessible through this session.
      Parameters:
      resourceGenusType - a resource genus type
      Returns:
      the returned Resource list
      Throws:
      NullArgumentException - resourceGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getResourcesByParentGenusType

      ResourceList getResourcesByParentGenusType(Type resourceGenusType) throws OperationFailedException, PermissionDeniedException
      Gets a ResourceList corresponding to the given resource genus Type and include any additional resources with genus types derived from the specified Type .In plenary mode, the returned list contains all known resources or an error results. Otherwise, the returned list may contain only those resources that are accessible through this session.
      Parameters:
      resourceGenusType - a resource genus type
      Returns:
      the returned Resource list
      Throws:
      NullArgumentException - resourceGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getResourcesByRecordType

      ResourceList getResourcesByRecordType(Type resourceRecordType) throws OperationFailedException, PermissionDeniedException
      Gets a ResourceList containing the given resource record Type . In plenary mode, the returned list contains all known resources or an error results. Otherwise, the returned list may contain only those resources that are accessible through this session.
      Parameters:
      resourceRecordType - a resource record type
      Returns:
      the returned Resource list
      Throws:
      NullArgumentException - resourceRecordType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getResources

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