Interface CreditLookupSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods for retrieving credits.
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 billing view: All credit methods in this session
operate, retrieve and pertain to credits defined explicitly in the
current billing. Using an isolated view is useful for managing credits
with the
CreditAdminSession. - federated billing view: All credit lookup methods in this session operate, retrieve and pertain to all credits defined in this billing and any other billings implicitly available in this billing through billing inheritence.
- effective credit view: All credit lookup methods return credits where the current date falls in between the effective dates inclusive.
- any effective credit view: Credits of any effective date are returned from methods.
The methods useFederatedBillingView() and
useIsolatedBillingView() behave as a radio group and one should be
selected before invoking any lookup methods.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can examine this billing.Gets theBillingassociated with this session.Gets theBillingIdassociated with this session.Gets theCreditspecified by itsId.Gets all credits.getCreditsByGenusType(Type creditGenusType) Gets aCreditListcorresponding to the given credit genusTypewhich does not include credits of types derived from the specifiedType.getCreditsByGenusTypeForReference(Id referenceId, Type creditGenusType) Gets a list of credits by a genus type for a reference.getCreditsByGenusTypeForReferenceOnDate(Id referenceId, Type creditGenusType, DateTime from, DateTime to) Gets a list of credits of the given genus type for a reference and effective entire given date range inclusive but not confined to the date range.getCreditsByGenusTypeForResource(Id resourceId, Type creditGenusType) Gets a list of credits by a genus type for a resource.getCreditsByGenusTypeForResourceAndReference(Id resourceId, Id referenceId, Type creditGenusType) Gets aCreditListof the given genus type for the given resource and reference.getCreditsByGenusTypeForResourceAndReferenceOnDate(Id resourceId, Id referenceId, Type creditGenusType, DateTime from, DateTime to) Gets aCreditListof the given genus type corresponding to the given resource and reference and effective entire given date range inclusive but not confined to the date range.getCreditsByGenusTypeForResourceOnDate(Id resourceId, Type creditGenusType, DateTime from, DateTime to) Gets a list of credits by genus type for a resource and effective during the entire given date range inclusive but not confined to the date range.getCreditsByGenusTypeOnDate(Type creditGenusType, DateTime from, DateTime to) Gets a list of credits of the given genus type and effective entire given date range inclusive but not confined to the date range.getCreditsByIds(IdList creditIds) Gets aCreditListcorresponding to the givenIdList.getCreditsByParentGenusType(Type creditGenusType) Gets aCreditListcorresponding to the given credit genusTypeand include any additional credits with genus types derived from the specifiedType.getCreditsByRecordType(Type creditRecordType) Gets aCreditListcontaining the given credit recordType.getCreditsForReference(Id referenceId) Gets aCreditListfor the given referenceId.getCreditsForReferenceOnDate(Id referenceId, DateTime from, DateTime to) Gets a list of credits for a reference and effective entire given date range inclusive but not confined to the date range.getCreditsForResource(Id resourceId) Gets aCreditListfor the given resourceId.getCreditsForResourceAndReference(Id resourceId, Id referenceId) Gets aCreditListfor the given resource and reference.getCreditsForResourceAndReferenceOnDate(Id resourceId, Id referenceId, DateTime from, DateTime to) Gets aCreditListcorresponding to the given resource and reference and effective entire given date range inclusive but not confined to the date range.getCreditsForResourceOnDate(Id resourceId, DateTime from, DateTime to) Gets a list of credits for a resource and effective during the entire given date range inclusive but not confined to the date range.getCreditsOnDate(DateTime from, DateTime to) Gets aCreditListeffective during the entire given date range inclusive but not confined to the date range.voidAll credits of any effective dates are returned by methods in this session.voidThe returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error.voidOnly credits whose effective dates are current are returned by methods in this session.voidFederates the view for methods in this session.voidIsolates the view for methods in this session.voidA complete view of theCreditreturns 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
-
getBillingId
Id getBillingId()Gets theBillingIdassociated with this session.- Returns:
- the
Billing Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getBilling
Gets theBillingassociated with this session.- Returns:
- the billing
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canLookupCredits
boolean canLookupCredits()Tests if this user can examine this billing. 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 these operations.- Returns:
falseif billing reading methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
useComparativeCreditView
void useComparativeCreditView()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.
-
usePlenaryCreditView
void usePlenaryCreditView()A complete view of theCreditreturns 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.
-
useFederatedBillingView
void useFederatedBillingView()Federates the view for methods in this session. A federated view will include credits in billings which are children of this billing in the billing hierarchy.- Compliance:
mandatory- This method is must be implemented.
-
useIsolatedBillingView
void useIsolatedBillingView()Isolates the view for methods in this session. An isolated view restricts retrievals to this billing only.- Compliance:
mandatory- This method is must be implemented.
-
useEffectiveCreditView
void useEffectiveCreditView()Only credits whose effective dates are current are returned by methods in this session.- Compliance:
mandatory- This method is must be implemented.
-
useAnyEffectiveCreditView
void useAnyEffectiveCreditView()All credits of any effective dates are returned by methods in this session.- Compliance:
mandatory- This method is must be implemented.
-
getCredit
Credit getCredit(Id creditId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets theCreditspecified by itsId. In plenary mode, the exact Id is found or aNOT_FOUNDresults. Otherwise, the returnedCreditmay have a differentIdthan requested, such as the case where a duplicateIdwas assigned to aCreditand retained for compatibility. In effective mode, credits are returned that are currently effective. In any effective mode, effective credits and those currently expired are returned.- Parameters:
creditId- theIdof theCreditto retrieve- Returns:
- the returned
Credit - Throws:
NotFoundException- noCreditfound with the givenIdNullArgumentException-creditIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCreditsByIds
CreditList getCreditsByIds(IdList creditIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets aCreditListcorresponding to the givenIdList. In plenary mode, the returned list contains all of the credits 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, inaccessible credits may be omitted from the list and may present the elements in any order including returning a unique set. In effective mode, credits are returned that are currently effective. In any effective mode, effective credits and those currently expired are returned.- Parameters:
creditIds- the list ofIdsto retrieve- Returns:
- the returned
Credit list - Throws:
NotFoundException- anId wasnot foundNullArgumentException-creditIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCreditsByGenusType
CreditList getCreditsByGenusType(Type creditGenusType) throws OperationFailedException, PermissionDeniedException Gets aCreditListcorresponding to the given credit genusTypewhich does not include credits of types derived from the specifiedType. In plenary mode, the returned list contains all known credits or an error results. Otherwise, the returned list may contain only those credits that are accessible through this session. In effective mode, credits are returned that are currently effective. In any effective mode, effective credits and those currently expired are returned.- Parameters:
creditGenusType- a credits genus type- Returns:
- the returned
Credit list - Throws:
NullArgumentException-creditGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCreditsByParentGenusType
CreditList getCreditsByParentGenusType(Type creditGenusType) throws OperationFailedException, PermissionDeniedException Gets aCreditListcorresponding to the given credit genusTypeand include any additional credits with genus types derived from the specifiedType. In plenary mode, the returned list contains all known credits or an error results. Otherwise, the returned list may contain only those credits that are accessible through this session. In effective mode, credits are returned that are currently effective. In any effective mode, effective credits and those currently expired are returned.- Parameters:
creditGenusType- a credit genus type- Returns:
- the returned
Credit list - Throws:
NullArgumentException-creditGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCreditsByRecordType
CreditList getCreditsByRecordType(Type creditRecordType) throws OperationFailedException, PermissionDeniedException Gets aCreditListcontaining the given credit recordType. In plenary mode, the returned list contains all known credits or an error results. Otherwise, the returned list may contain only those credits that are accessible through this session. In effective mode, credits are returned that are currently effective. In any effective mode, effective credits and those currently expired are returned.- Parameters:
creditRecordType- a credit record type- Returns:
- the returned
CreditList - Throws:
NullArgumentException-creditRecordTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCreditsOnDate
CreditList getCreditsOnDate(DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets aCreditListeffective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known credits or an error results. Otherwise, the returned list may contain only those credits that are accessible through this session. In effective mode, credits are returned that are currently effective in addition to being effective in the given date range. In any effective mode, effective credits and those currently expired are returned.- Parameters:
from- start of date rangeto- end of date range- Returns:
- the returned
CreditList - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-from or toisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCreditsByGenusTypeOnDate
CreditList getCreditsByGenusTypeOnDate(Type creditGenusType, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of credits of the given genus type and effective entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known credits or an error results. Otherwise, the returned list may contain only those credits that are accessible through this session. In effective mode, credits are returned that are currently effective in addition to being effective in the given date range. In any effective mode, effective credits and those currently expired are returned.- Parameters:
creditGenusType- a credit genusTypefrom- start of date rangeto- end of date range- Returns:
- the returned
CreditList - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-creditGenusType, from, ortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCreditsForResource
CreditList getCreditsForResource(Id resourceId) throws OperationFailedException, PermissionDeniedException Gets aCreditListfor the given resourceId. In plenary mode, the returned list contains all of the credits corresponding to the given peer, including duplicates, or an error results if a credit is inaccessible. Otherwise, inaccessibleCreditsmay be omitted from the list. In effective mode, credits are returned that are currently effective. In any effective mode, effective credits and those currently expired are returned.- Parameters:
resourceId- theIdof the resource- Returns:
- the returned
CreditList - Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCreditsForResourceOnDate
CreditList getCreditsForResourceOnDate(Id resourceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of credits for a resource and effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known credits or an error results. Otherwise, the returned list may contain only those credits that are accessible through this session. In effective mode, credits are returned that are currently effective in addition to being effective in the given date range. In any effective mode, effective credits and those currently expired are returned.- Parameters:
resourceId- a resourceIdfrom- start of date rangeto- end of date range- Returns:
- the returned
CreditList - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-resourceId, from, ortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCreditsByGenusTypeForResource
CreditList getCreditsByGenusTypeForResource(Id resourceId, Type creditGenusType) throws OperationFailedException, PermissionDeniedException Gets a list of credits by a genus type for a resource. In plenary mode, the returned list contains all known credits or an error results. Otherwise, the returned list may contain only those credits that are accessible through this session. In effective mode, credits are returned that are currently effective. In any effective mode, effective credits and those currently expired are returned.- Parameters:
resourceId- a resourceIdcreditGenusType- a credit genusType- Returns:
- the returned
CreditList - Throws:
NullArgumentException-creditGenusTypeorresourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCreditsByGenusTypeForResourceOnDate
CreditList getCreditsByGenusTypeForResourceOnDate(Id resourceId, Type creditGenusType, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of credits by genus type for a resource and effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known credits or an error results. Otherwise, the returned list may contain only those credits that are accessible through this session. In effective mode, credits are returned that are currently effective in addition to being effective in the given date range. In any effective mode, effective credits and those currently expired are returned.- Parameters:
resourceId- a resourceIdcreditGenusType- a credit genusTypefrom- start of date rangeto- end of date range- Returns:
- the returned
CreditList - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-resourceId, creditGenusType, from, ortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCreditsForReference
CreditList getCreditsForReference(Id referenceId) throws OperationFailedException, PermissionDeniedException Gets aCreditListfor the given referenceId. In plenary mode, the returned list contains all of the credits corresponding to the given peer, including duplicates, or an error results if a credit is inaccessible. Otherwise, inaccessibleCreditsmay be omitted from the list. In effective mode, credits are returned that are currently effective. In any effective mode, effective credits and those currently expired are returned.- Parameters:
referenceId- a referenceId- Returns:
- the returned
CreditList - Throws:
NullArgumentException-referenceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCreditsForReferenceOnDate
CreditList getCreditsForReferenceOnDate(Id referenceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of credits for a reference and effective entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known credits or an error results. Otherwise, the returned list may contain only those credits that are accessible through this session. In effective mode, credits are returned that are currently effective in addition to being effective in the given date range. In any effective mode, effective credits and those currently expired are returned.- Parameters:
referenceId- a referenceIdfrom- start of date rangeto- end of date range- Returns:
- the returned
CreditList - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-referenceId, from, ortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCreditsByGenusTypeForReference
CreditList getCreditsByGenusTypeForReference(Id referenceId, Type creditGenusType) throws OperationFailedException, PermissionDeniedException Gets a list of credits by a genus type for a reference. In plenary mode, the returned list contains all known credits or an error results. Otherwise, the returned list may contain only those credits that are accessible through this session. In effective mode, credits are returned that are currently effective. In any effective mode, effective credits and those currently expired are returned.- Parameters:
referenceId- a referenceIdcreditGenusType- a credit genusType- Returns:
- the returned
CreditList - Throws:
NullArgumentException-referenceIdorcreditGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCreditsByGenusTypeForReferenceOnDate
CreditList getCreditsByGenusTypeForReferenceOnDate(Id referenceId, Type creditGenusType, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of credits of the given genus type for a reference and effective entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known credits or an error results. Otherwise, the returned list may contain only those credits that are accessible through this session. In effective mode, credits are returned that are currently effective in addition to being effective in the given date range. In any effective mode, effective credits and those currently expired are returned.- Parameters:
referenceId- a referenceIdcreditGenusType- a credit genusTypefrom- start of date rangeto- end of date range- Returns:
- the returned
CreditList - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-referenceId, creditGenusType, from, ortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCreditsForResourceAndReference
CreditList getCreditsForResourceAndReference(Id resourceId, Id referenceId) throws OperationFailedException, PermissionDeniedException Gets aCreditListfor the given resource and reference. In plenary mode, the returned list contains all of the credits corresponding to the given resource and reference, including duplicates, or an error results if a credit is inaccessible. Otherwise, inaccessibleCreditsmay be omitted from the list. In effective mode, credits are returned that are currently effective. In any effective mode, effective credits and those currently expired are returned.- Parameters:
resourceId- a resourceIdreferenceId- a referenceId- Returns:
- the returned
CreditList - Throws:
NullArgumentException-resourceIdorreferenceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCreditsForResourceAndReferenceOnDate
CreditList getCreditsForResourceAndReferenceOnDate(Id resourceId, Id referenceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets aCreditListcorresponding to the given resource and reference and effective entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all of the credits corresponding to the given peer, including duplicates, or an error results if a credit is inaccessible. Otherwise, inaccessibleCreditsmay be omitted from the list. In effective mode, credits are returned that are currently effective. In any effective mode, effective credits and those currently expired are returned.- Parameters:
resourceId- a resourceIdreferenceId- a referenceIdfrom- start of date rangeto- end of date range- Returns:
- the returned
CreditList - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-resourceIdorreferenceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCreditsByGenusTypeForResourceAndReference
CreditList getCreditsByGenusTypeForResourceAndReference(Id resourceId, Id referenceId, Type creditGenusType) throws OperationFailedException, PermissionDeniedException Gets aCreditListof the given genus type for the given resource and reference. In plenary mode, the returned list contains all of the credits corresponding to the given resource and reference, including duplicates, or an error results if a credit is inaccessible. Otherwise, inaccessibleCreditsmay be omitted from the list. In effective mode, credits are returned that are currently effective. In any effective mode, effective credits and those currently expired are returned.- Parameters:
resourceId- a resourceIdreferenceId- a referenceIdcreditGenusType- a credit genusType- Returns:
- the returned
CreditList - Throws:
NullArgumentException-resourceId,referenceId, orcreditGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCreditsByGenusTypeForResourceAndReferenceOnDate
CreditList getCreditsByGenusTypeForResourceAndReferenceOnDate(Id resourceId, Id referenceId, Type creditGenusType, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets aCreditListof the given genus type corresponding to the given resource and reference and effective entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all of the credits corresponding to the given peer, including duplicates, or an error results if a credit is inaccessible. Otherwise, inaccessibleCreditsmay be omitted from the list. In effective mode, credits are returned that are currently effective in addition to being effective in the given date range. In any effective mode, effective credits and those currently expired are returned.- Parameters:
resourceId- a resourceIdreferenceId- a referenceIdcreditGenusType- a credit genusTypefrom- start of date rangeto- end of date range- Returns:
- the returned
CreditList - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-resourceId, referenceId,creditGenusType,from, ortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCredits
Gets all credits. In plenary mode, the returned list contains all known credits or an error results. Otherwise, the returned list may contain only those credits that are accessible through this session. In effective mode, credits are returned that are currently effective. In any effective mode, effective credits and those currently expired are returned.- Returns:
- a list of credits
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-