Interface PackageLookupSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface PackageLookupSession extends OsidSession

This session provides methods for retrieving Packages from remote Depots .

This session defines views that offer differing behaviors when retrieving multiple objects.

  • comparative view: elements may be silently omitted or re-ordered
  • plenary view: provides a complete set or is an error condition
  • isolated depot view: All package methods in this session operate, retrieve and pertain to packages defined explicitly in the current depot. Using an isolated view is useful for managing packages with the PackageAdminSession .
  • federated depot view: All package methods in this session operate, retrieve and pertain to all packages defined in this depot and any other depots implicitly available in this depot through depot inheritence.
  • normalized version view: multiple versions of the same package are suppressed
  • denormalized version vew: all versions of an installation are returned

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

  • Method Details

    • getDepotId

      Id getDepotId()
      Gets the Depot Id associated with this session.
      Returns:
      the Depot Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getDepot

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

      boolean canLookupPackages()
      Tests if this user can perform Package 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 to unauthorized users.
      Returns:
      false if lookup methods are not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • useComparativePackageView

      void useComparativePackageView()
      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.
    • usePlenaryPackageView

      void usePlenaryPackageView()
      A complete view of the Package 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.
    • useFederatedDepotView

      void useFederatedDepotView()
      Federates the view for methods in this session. A federated view will include packages in depots which are children of this depot in the depot hierarchy.
      Compliance:
      mandatory - This method is must be implemented.
    • useIsolatedDepotView

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

      void useNormalizedVersionView()
      The returns from the lookup methods may omit multiple versions of the same package.
      Compliance:
      mandatory - This method is must be implemented.
    • useDenormalizedVersionView

      void useDenormalizedVersionView()
      All versions of the same package are returned.
      Compliance:
      mandatory - This method is must be implemented.
    • getPackage

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

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

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

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

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

      PackageList getPackagesByProvider(Id resourceId) throws OperationFailedException, PermissionDeniedException
      Gets a PackageList for the given provider. In plenary mode, the returned list contains all known packages or an error results. Otherwise, the returned list may contain only those packages that are accessible through this session.
      Parameters:
      resourceId - a resource Id
      Returns:
      the returned Package list
      Throws:
      NullArgumentException - resourceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getDependentPackages

      Gets a list of packages depending on the given package.
      Parameters:
      packageId - an Id of a Package
      Returns:
      list of package dependents
      Throws:
      NotFoundException - packageId is not found
      NullArgumentException - packageId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getPackageVersions

      Gets a list of packages in the specified package version chain.
      Parameters:
      packageId - an Id of a Package
      Returns:
      list of dependencies
      Throws:
      NotFoundException - packageId is not found
      NullArgumentException - packageId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getPackages

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