Interface PackageLookupSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, 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 Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can performPackagelookups.getDependentPackages(Id packageId) Gets a list of packages depending on the given package.getDepot()Gets theDepotassociated with this session.Gets theDepotIdassociated with this session.getPackage(Id packageId) Gets thePackagespecified by itsId.Gets allPackages.getPackagesByGenusType(Type packageGenusType) Gets aPackageListcorresponding to the given package genusTypewhich does not include packages of genus types derived from the specifiedType.getPackagesByIds(IdList packageIds) Gets aPackageListcorresponding to the givenIdList.getPackagesByParentGenusType(Type packageGenusType) Gets aPackageListcorresponding to the given package genusTypeand include any additional package with genus types derived from the specifiedType.getPackagesByProvider(Id resourceId) Gets aPackageListfor the given provider.getPackagesByRecordType(Type packageRecordType) Gets aPackageListcontaining the given package recordType.getPackageVersions(Id packageId) Gets a list of packages in the specified package version chain.voidThe returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error.voidAll versions of the same package are returned.voidFederates the view for methods in this session.voidIsolates the view for methods in this session.voidThe returns from the lookup methods may omit multiple versions of the same package.voidA complete view of thePackagereturns 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
-
getDepotId
Id getDepotId()Gets theDepotIdassociated with this session.- Returns:
- the
Depot Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getDepot
Gets theDepotassociated with this session.- Returns:
- the
Depotassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canLookupPackages
boolean canLookupPackages()Tests if this user can performPackagelookups. 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 to unauthorized users.- Returns:
falseif lookup methods are not authorized,trueotherwise- 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 thePackagereturns 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
Package getPackage(Id packageId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets thePackagespecified by itsId. In plenary mode, the exactIdis found or aNOT_FOUNDresults. Otherwise, the returnedPackagemay have a differentIdthan requested, such as the case where a duplicateIdwas assigned to aPackageand retained for compatibility.- Parameters:
packageId-Idof thePackage- Returns:
- the package
- Throws:
NotFoundException-packageIdnot foundNullArgumentException-packageIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method is must be implemented.
-
getPackagesByIds
PackageList getPackagesByIds(IdList packageIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets aPackageListcorresponding to the givenIdList. In plenary mode, the returned list contains all of the packages 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, inaccessiblePackagesmay be omitted from the list and may present the elements in any order including returning a unique set.- Parameters:
packageIds- the list ofIdsto retrieve- Returns:
- the returned
Packagelist - Throws:
NotFoundException- anIdwas not foundNullArgumentException-packageIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getPackagesByGenusType
PackageList getPackagesByGenusType(Type packageGenusType) throws OperationFailedException, PermissionDeniedException Gets aPackageListcorresponding to the given package genusTypewhich does not include packages of genus types derived from the specifiedType. 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
Packagelist - Throws:
NullArgumentException-packageGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getPackagesByParentGenusType
PackageList getPackagesByParentGenusType(Type packageGenusType) throws OperationFailedException, PermissionDeniedException Gets aPackageListcorresponding to the given package genusTypeand include any additional package with genus types derived from the specifiedType. 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
Packagelist - Throws:
NullArgumentException-packageGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getPackagesByRecordType
PackageList getPackagesByRecordType(Type packageRecordType) throws OperationFailedException, PermissionDeniedException Gets aPackageListcontaining the given package recordType. 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
Packagelist - Throws:
NullArgumentException-packageRecordTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getPackagesByProvider
PackageList getPackagesByProvider(Id resourceId) throws OperationFailedException, PermissionDeniedException Gets aPackageListfor 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 resourceId- Returns:
- the returned
Packagelist - Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getDependentPackages
PackageList getDependentPackages(Id packageId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets a list of packages depending on the given package.- Parameters:
packageId- anIdof aPackage- Returns:
- list of package dependents
- Throws:
NotFoundException-packageIdis not foundNullArgumentException-packageIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getPackageVersions
PackageList getPackageVersions(Id packageId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets a list of packages in the specified package version chain.- Parameters:
packageId- anIdof aPackage- Returns:
- list of dependencies
- Throws:
NotFoundException-packageIdis not foundNullArgumentException-packageIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getPackages
Gets allPackages. 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 requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-