public interface WorkLookupSession extends OsidSession
This session provides methods for retrieving Work
objects. The Work
represents a fixed connection between two
Availabilities.
This session defines views that offer differing behaviors when retrieving multiple objects.
Works
with the WorkAdminSession.
Generally, the comparative view should be used for most applications
as it permits operation even if there is data that cannot be accessed. The
methods useFederatedOfficeView()
and
useIsolatedOfficeView()
behave as a radio group and one should be
selected before invoking any lookup methods.
Modifier and Type | Method and Description |
---|---|
boolean |
canLookupWorks()
Tests if this user can perform
Work lookups. |
Office |
getOffice()
Gets the
Office associated with this session. |
Id |
getOfficeId()
Gets the
Office Id associated with this
session. |
Work |
getWork(Id workId)
Gets the
Work specified by its Id. |
WorkList |
getWorks()
Gets all
Works. |
WorkList |
getWorksByGenusType(Type workGenusType)
Gets a
WorkList corresponding to the given work genus
Type which does not include works of genus types
derived from the specified Type. |
WorkList |
getWorksByIds(IdList workIds)
Gets a
WorkList corresponding to the given
IdList. |
WorkList |
getWorksByParentGenusType(Type workGenusType)
Gets a
WorkList corresponding to the given work genus
Type and include any additional works with genus types
derived from the specified Type. |
WorkList |
getWorksByRecordType(Type workRecordType)
Gets a
WorkList containing the given work record
Type. |
void |
useComparativeWorkView()
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 |
useFederatedOfficeView()
Federates the view for methods in this session.
|
void |
useIsolatedOfficeView()
Isolates the view for methods in this session.
|
void |
usePlenaryWorkView()
A complete view of the
Work returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getOfficeId()
Office
Id
associated with this
session. Office Id
associated with this sessionmandatory
- This method must be implemented. Office getOffice() throws OperationFailedException, PermissionDeniedException
Office
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canLookupWorks()
Work
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. false
if lookup methods are not authorized,
true
otherwisemandatory
- This method must be implemented. void useComparativeWorkView()
mandatory
- This method is must be implemented. void usePlenaryWorkView()
Work
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 useFederatedOfficeView()
mandatory
- This method is must be implemented. void useIsolatedOfficeView()
mandatory
- This method is must be implemented. Work getWork(Id workId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Work
specified by its Id.
In
plenary mode, the exact Id
is found or a
NOT_FOUND
results. Otherwise, the returned Work
may have a different Id
than requested, such as the
case where a duplicate Id
was assigned to a Work
and retained for compatibility.workId
- Id
of the Work
NotFoundException
- workId
not foundNullArgumentException
- workId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method is must be implemented. WorkList getWorksByIds(IdList workIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
WorkList
corresponding to the given
IdList.
In plenary mode, the returned list contains all of the
works 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 Works
may be omitted from the list and may
present the elements in any order including returning a unique set.workIds
- the list of Ids
to retrieve Work
listNotFoundException
- an Id was
not foundNullArgumentException
- workIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. WorkList getWorksByGenusType(Type workGenusType) throws OperationFailedException, PermissionDeniedException
WorkList
corresponding to the given work genus
Type
which does not include works of genus types
derived from the specified Type.
In plenary mode, the
returned list contains all known works or an error results. Otherwise,
the returned list may contain only those works that are accessible
through this session.workGenusType
- a work genus type Work
listNullArgumentException
- workGenusType
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. WorkList getWorksByParentGenusType(Type workGenusType) throws OperationFailedException, PermissionDeniedException
WorkList
corresponding to the given work genus
Type
and include any additional works with genus types
derived from the specified Type.
In plenary mode, the
returned list contains all known works or an error results. Otherwise,
the returned list may contain only those works that are accessible
through this sessionworkGenusType
- a work genus type Work
listNullArgumentException
- workGenusType
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. WorkList getWorksByRecordType(Type workRecordType) throws OperationFailedException, PermissionDeniedException
WorkList
containing the given work record
Type.
In plenary mode, the returned list contains all known
works or an error results. Otherwise, the returned list may contain
only those works that are accessible through this session.workRecordType
- a work record type Work
listNullArgumentException
- workRecordType
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. WorkList getWorks() throws OperationFailedException, PermissionDeniedException
Works.
In plenary mode, the returned list
contains all known works or an error results. Otherwise, the returned
list may contain only those works that are accessible through this
session. Works
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.