public interface AssetLookupSession extends OsidSession
This session defines methods for retrieving assets. An Asset
represents an element of content stored in a Repository.
This lookup session defines several views:
Assets
with the AssetAdminSession.
The methods useFederatedRepositoryView()
and
useIsolatedRepositoryView()
behave as a radio group and one should
be selected before invoking any lookup methods.
Assets may have an additional records indicated by their respective
record types. The record may not be accessed through a cast of the
Asset.
Modifier and Type | Method and Description |
---|---|
boolean |
canLookupAssets()
Tests if this user can perform
Asset lookups. |
Asset |
getAsset(Id assetId)
Gets the
Asset specified by its Id. |
AssetList |
getAssets()
Gets all
Assets. |
AssetList |
getAssetsByGenusType(Type assetGenusType)
Gets an
AssetList corresponding to the given asset
genus Type which does not include assets of types
derived from the specified Type. |
AssetList |
getAssetsByIds(IdList assetIds)
Gets an
AssetList corresponding to the given
IdList. |
AssetList |
getAssetsByParentGenusType(Type assetGenusType)
Gets an
AssetList corresponding to the given asset
genus Type and include any additional assets with genus
types derived from the specified Type. |
AssetList |
getAssetsByProvider(Id resourceId)
Gets an
AssetList from the given provider. |
AssetList |
getAssetsByRecordType(Type assetRecordType)
Gets an
AssetList containing the given asset record
Type. |
Repository |
getRepository()
Gets the
Repository associated with this session. |
Id |
getRepositoryId()
Gets the
Repository Id associated with
this session. |
void |
useComparativeAssetView()
The returns from the lookup methods may omit or translate elements
based on this session, such as authorization, and not result in an
error.
|
void |
useFederatedRepositoryView()
Federates the view for methods in this session.
|
void |
useIsolatedRepositoryView()
Isolates the view for methods in this session.
|
void |
usePlenaryAssetView()
A complete view of the
Asset returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getRepositoryId()
Repository
Id
associated with
this session. Repository Id
associated with this sessionmandatory
- This method must be implemented. Repository getRepository() throws OperationFailedException, PermissionDeniedException
Repository
associated with this session. Repository
associated with this sessionOperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canLookupAssets()
Asset
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. false
if lookup methods are not authorized,
true
otherwisemandatory
- This method must be implemented. void useComparativeAssetView()
mandatory
- This method is must be implemented. void usePlenaryAssetView()
Asset
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.mandatory
- This method is must be implemented. void useFederatedRepositoryView()
mandatory
- This method is must be implemented. void useIsolatedRepositoryView()
mandatory
- This method is must be implemented. Asset getAsset(Id assetId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Asset
specified by its Id.
In
plenary mode, the exact Id
is found or a
NOT_FOUND
results. Otherwise, the returned Asset
may have a different Id
than requested, such as
the case where a duplicate Id
was assigned to an
Asset
and retained for compatibility.assetId
- the Id
of the Asset
to
retrieve Asset
NotFoundException
- no Asset
found with
the given Id
NullArgumentException
- assetId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. AssetList getAssetsByIds(IdList assetIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
AssetList
corresponding to the given
IdList.
In plenary mode, the returned list contains all of the
assets 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 Assets
may be omitted from the list and
may present the elements in any order including returning a unique
set.assetIds
- the list of Ids
to retrieve Asset list
NotFoundException
- an Id
was not foundNullArgumentException
- assetIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. AssetList getAssetsByGenusType(Type assetGenusType) throws OperationFailedException, PermissionDeniedException
AssetList
corresponding to the given asset
genus Type
which does not include assets of types
derived from the specified Type.
In plenary mode, the
returned list contains all known assets or an error results.
Otherwise, the returned list may contain only those assets that are
accessible through this session.assetGenusType
- an asset genus type Asset list
NullArgumentException
- assetGenusType
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. AssetList getAssetsByParentGenusType(Type assetGenusType) throws OperationFailedException, PermissionDeniedException
AssetList
corresponding to the given asset
genus Type
and include any additional assets with genus
types derived from the specified Type.
In plenary mode,
the returned list contains all known assets or an error results.
Otherwise, the returned list may contain only those assets that are
accessible through this session.assetGenusType
- an asset genus type Asset list
NullArgumentException
- assetGenusType
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. AssetList getAssetsByRecordType(Type assetRecordType) throws OperationFailedException, PermissionDeniedException
AssetList
containing the given asset record
Type.
In plenary mode, the returned list contains all
known assets or an error results. Otherwise, the returned list may
contain only those assets that are accessible through this session.assetRecordType
- an asset record type Asset list
NullArgumentException
- assetRecordType
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. AssetList getAssetsByProvider(Id resourceId) throws OperationFailedException, PermissionDeniedException
AssetList
from the given provider. In plenary
mode, the returned list contains all known assets or an error results.
Otherwise, the returned list may contain only those assets that are
accessible through this session.resourceId
- a resource Id
Asset list
NullArgumentException
- resourceId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. AssetList getAssets() throws OperationFailedException, PermissionDeniedException
Assets.
In plenary mode, the returned list
contains all known assets or an error results. Otherwise, the returned
list may contain only those assets that are accessible through this
session. Assets
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.