OSID Logo
OSID Specifications
resource package
Version 3.0.0
Release Candidate Preview
Interfaceosid.resource.ResourceLookupSession
Implementsosid.OsidSession
Description

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.

MethodgetBinId
Description

Gets the Bin Id associated with this session.

Returnosid.id.Idthe Bin Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetBin
Description

Gets the Bin associated with this session.

Returnosid.resource.Binthe Bin associated with this session
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanLookupResources
Description

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.

Returnboolean false if lookup methods are not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoduseComparativeResourceView
Description

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.

CompliancemandatoryThis method is must be implemented.
MethodusePlenaryResourceView
Description

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.

CompliancemandatoryThis method is must be implemented.
MethoduseFederatedBinView
Description

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.

CompliancemandatoryThis method is must be implemented.
MethoduseIsolatedBinView
Description

Isolates the view for methods in this session. An isolated view restricts lookups to this bin only.

CompliancemandatoryThis method is must be implemented.
MethodgetResource
Description

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.

Parametersosid.id.IdresourceIdthe Id of the Resource to retrieve
Returnosid.resource.Resourcethe returned Resource
ErrorsNOT_FOUNDno Resource found with the given Id
NULL_ARGUMENT resourceId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetResourcesByIds
Description

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.

Parametersosid.id.IdListresourceIdsthe list of Ids to retrieve
Returnosid.resource.ResourceListthe returned Resource list
ErrorsNOT_FOUNDan Id was not found
NULL_ARGUMENT resourceIds is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetResourcesByGenusType
Description

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.

Parametersosid.type.TyperesourceGenusTypea resource genus type
Returnosid.resource.ResourceListthe returned Resource list
ErrorsNULL_ARGUMENT resourceGenusType is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetResourcesByParentGenusType
Description

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.

Parametersosid.type.TyperesourceGenusTypea resource genus type
Returnosid.resource.ResourceListthe returned Resource list
ErrorsNULL_ARGUMENT resourceGenusType is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetResourcesByRecordType
Description

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.

Parametersosid.type.TyperesourceRecordTypea resource record type
Returnosid.resource.ResourceListthe returned Resource list
ErrorsNULL_ARGUMENT resourceRecordType is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetResources
Description

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.

Returnosid.resource.ResourceLista list of Resources
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.