public interface PeriodLookupSession extends OsidSession
This session provides methods for retrieving Period
objects. The Period
represents a billing.
This session defines views that offer differing behaviors when retrieving multiple objects.
Periods
with the PeriodAdminSession.
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 useFederatedBusinessView()
and
useIsolatedBusinessView()
behave as a radio group and one should
be selected before invoking any lookup methods.
Modifier and Type | Method and Description |
---|---|
boolean |
canLookupPeriods()
Tests if this user can perform
Period lookups. |
Business |
getBusiness()
Gets the
Business associated with this session. |
Id |
getBusinessId()
Gets the
Business Id associated with
this session. |
Period |
getPeriod(Id periodId)
Gets the
Period specified by its Id. |
PeriodList |
getPeriods()
Gets all
Periods. |
PeriodList |
getPeriodsByGenusType(Type periodGenusType)
Gets a
PeriodList corresponding to the given period
genus Type which does not include periods of genus
types derived from the specified Type. |
PeriodList |
getPeriodsByIds(IdList periodIds)
Gets a
PeriodList corresponding to the given
IdList. |
PeriodList |
getPeriodsByParentGenusType(Type periodGenusType)
Gets a
PeriodList corresponding to the given period
genus Type and include any additional periods with
genus types derived from the specified Type. |
PeriodList |
getPeriodsByRecordType(Type periodRecordType)
Gets a
PeriodList containing the given period record
Type. |
PeriodList |
getPeriodsOnDate(DateTime from,
DateTime to)
Gets a
PeriodList where to the given DateTime
range falls within the period inclusive. |
void |
useComparativePeriodView()
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 |
useFederatedBusinessView()
Federates the view for methods in this session.
|
void |
useIsolatedBusinessView()
Isolates the view for methods in this session.
|
void |
usePlenaryPeriodView()
A complete view of the
Period returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getBusinessId()
Business
Id
associated with
this session. Business Id
associated with this sessionmandatory
- This method must be implemented. Business getBusiness() throws OperationFailedException, PermissionDeniedException
Business
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canLookupPeriods()
Period
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 useComparativePeriodView()
mandatory
- This method is must be implemented. void usePlenaryPeriodView()
Period
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 useFederatedBusinessView()
mandatory
- This method is must be implemented. void useIsolatedBusinessView()
mandatory
- This method is must be implemented. Period getPeriod(Id periodId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Period
specified by its Id.
In
plenary mode, the exact Id
is found or a
NOT_FOUND
results. Otherwise, the returned Period
may have a different Id
than requested, such as
the case where a duplicate Id
was assigned to a
Period
and retained for compatibility.periodId
- Id
of the Period
NotFoundException
- periodId
not foundNullArgumentException
- periodId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method is must be implemented. PeriodList getPeriodsByIds(IdList periodIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
PeriodList
corresponding to the given
IdList.
In plenary mode, the returned list contains all of the
periods 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 Periods
may be omitted from the list and
may present the elements in any order including returning a unique
set.periodIds
- the list of Ids
to retrieve Period
listNotFoundException
- an Id was
not foundNullArgumentException
- periodIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. PeriodList getPeriodsByGenusType(Type periodGenusType) throws OperationFailedException, PermissionDeniedException
PeriodList
corresponding to the given period
genus Type
which does not include periods of genus
types derived from the specified Type.
In plenary mode,
the returned list contains all known periods or an error results.
Otherwise, the returned list may contain only those periods that are
accessible through this session.periodGenusType
- a period genus type Period
listNullArgumentException
- periodGenusType
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. PeriodList getPeriodsByParentGenusType(Type periodGenusType) throws OperationFailedException, PermissionDeniedException
PeriodList
corresponding to the given period
genus Type
and include any additional periods with
genus types derived from the specified Type.
In plenary
mode, the returned list contains all known periods or an error
results. Otherwise, the returned list may contain only those periods
that are accessible through this session.periodGenusType
- a period genus type Period
listNullArgumentException
- periodGenusType
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. PeriodList getPeriodsByRecordType(Type periodRecordType) throws OperationFailedException, PermissionDeniedException
PeriodList
containing the given period record
Type.
In plenary mode, the returned list contains all
known periods or an error results. Otherwise, the returned list may
contain only those periods that are accessible through this session.periodRecordType
- a period record type Period
listNullArgumentException
- periodRecordType
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. PeriodList getPeriodsOnDate(DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
PeriodList
where to the given DateTime
range falls within the period inclusive. Periods containing
the given date are matched. In plenary mode, the returned list
contains all of the periods 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 Periods
may be
omitted from the list including returning a unique set.from
- start of date rangeto
- end of date range Period
listInvalidArgumentException
- from
is
greater than to
NullArgumentException
- from
or
to
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. PeriodList getPeriods() throws OperationFailedException, PermissionDeniedException
Periods.
In plenary mode, the returned list
contains all known periods or an error results. Otherwise, the
returned list may contain only those periods that are accessible
through this session. Periods
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.