Interface CustomerLookupSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods for retrieving customers. A
Customer is a Resource related to the billing system.
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 business view: All customer methods in this session
operate, retrieve and pertain to customers defined explicitly in the
current business. Using an isolated view is useful for managing
Customerswith theCustomerAdminSession. - federated business view: All customer lookup methods in this session operate, retrieve and pertain to all customers defined in this business and any other customers implicitly available in this business through business inheritence.
- effective customer view: All customer lookup methods return customers where the current date falls in between the effective dates inclusive.
- any effective customer view: Customers of any effective date are returned from methods.
The methods useFederatedBusinessView() and
useIsolatedBusinessView() behave as a radio group and one should be
selected before invoking any lookup methods.
Customers may have an additional records indicated by their respective
record types. The record may not be accessed through a cast of the
Customer .
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can performCustomerlookups.Gets theBusinessassociated with this session.Gets theBusinessIdassociated with this session.getCustomer(Id customerId) Gets theCustomerspecified by itsId.Gets allCustomers.getCustomersByActivity(Id activityId) Gets aCustomerListhaving the given activity.getCustomersByGenusType(Type customerGenusType) Gets aCustomerListcorresponding to the given customer genusTypewhich does not include customers of types derived from the specifiedType.getCustomersByIds(IdList customerIds) Gets aCustomerListcorresponding to the givenIdList.getCustomersByNumber(String number) Gets aCustomerListrelated to the given customer number.getCustomersByParentGenusType(Type customerGenusType) Gets aCustomerListcorresponding to the given customer genusTypeand include any additional customers with genus types derived from the specifiedType.getCustomersByRecordType(Type customerRecordType) Gets aCustomerListcontaining the given customer recordType.getCustomersByResource(Id resourceId) Gets aCustomerListrelated to the given resource.getCustomersByResourceOnDate(Id resourceId, DateTime from, DateTime to) Gets aCustomerListof the given resource and effective during the entire given date range inclusive but not confined to the date range.getCustomersOnDate(DateTime from, DateTime to) Gets aCustomerListeffective during the entire given date range inclusive but not confined to the date range.voidAll customers 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 customers 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 theCustomerreturns 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
-
getBusinessId
Id getBusinessId()Gets theBusinessIdassociated with this session.- Returns:
- the
Business Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getBusiness
Gets theBusinessassociated with this session.- Returns:
- the business
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canLookupCustomers
boolean canLookupCustomers()Tests if this user can performCustomerlookups. 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 not offer lookup operations to unauthorized users.- Returns:
falseif lookup methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
useComparativeCustomerView
void useComparativeCustomerView()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.
-
usePlenaryCustomerView
void usePlenaryCustomerView()A complete view of theCustomerreturns 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.
-
useFederatedBusinessView
void useFederatedBusinessView()Federates the view for methods in this session. A federated view will include customers in catalogs which are children of this catalog in the business hierarchy.- Compliance:
mandatory- This method is must be implemented.
-
useIsolatedBusinessView
void useIsolatedBusinessView()Isolates the view for methods in this session. An isolated view restricts retrievals to this business only.- Compliance:
mandatory- This method is must be implemented.
-
useEffectiveCustomerView
void useEffectiveCustomerView()Only customers whose effective dates are current are returned by methods in this session.- Compliance:
mandatory- This method is must be implemented.
-
useAnyEffectiveCustomerView
void useAnyEffectiveCustomerView()All customers of any effective dates are returned by methods in this session.- Compliance:
mandatory- This method is must be implemented.
-
getCustomer
Customer getCustomer(Id customerId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets theCustomerspecified by itsId. In plenary mode, the exactIdis found or aNOT_FOUNDresults. Otherwise, the returnedCustomermay have a differentIdthan requested, such as the case where a duplicateIdwas assigned to aCustomerand retained for compatibility. In effective mode, customers are returned that are currently effective. In any effective mode, effective customers and those currently expired are returned.- Parameters:
customerId- theIdof theCustomerto retrieve- Returns:
- the returned
Customer - Throws:
NotFoundException- noCustomerfound with the givenIdNullArgumentException-customerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCustomersByIds
CustomerList getCustomersByIds(IdList customerIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets aCustomerListcorresponding to the givenIdList. In plenary mode, the returned list contains all of the customers 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, inaccessibleCustomersmay be omitted from the list and may present the elements in any order including returning a unique set. In effective mode, customers are returned that are currently effective. In any effective mode, effective customers and those currently expired are returned.- Parameters:
customerIds- the list ofIdsto retrieve- Returns:
- the returned
CustomerListlist - Throws:
NotFoundException- anId wasnot foundNullArgumentException-customerIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCustomersByGenusType
CustomerList getCustomersByGenusType(Type customerGenusType) throws OperationFailedException, PermissionDeniedException Gets aCustomerListcorresponding to the given customer genusTypewhich does not include customers of types derived from the specifiedType. In plenary mode, the returned list contains all known customers or an error results. Otherwise, the returned list may contain only those customers that are accessible through this session. In effective mode, customers are returned that are currently effective. In any effective mode, effective customers and those currently expired are returned.- Parameters:
customerGenusType- a customer genus type- Returns:
- the returned
CustomerListlist - Throws:
NullArgumentException-customerGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCustomersByParentGenusType
CustomerList getCustomersByParentGenusType(Type customerGenusType) throws OperationFailedException, PermissionDeniedException Gets aCustomerListcorresponding to the given customer genusTypeand include any additional customers with genus types derived from the specifiedType. In plenary mode, the returned list contains all known customers or an error results. Otherwise, the returned list may contain only those customers that are accessible through this session. In effective mode, customers are returned that are currently effective. In any effective mode, effective customers and those currently expired are returned.- Parameters:
customerGenusType- a customer genus type- Returns:
- the returned
CustomerListlist - Throws:
NullArgumentException-customerGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCustomersByRecordType
CustomerList getCustomersByRecordType(Type customerRecordType) throws OperationFailedException, PermissionDeniedException Gets aCustomerListcontaining the given customer recordType. In plenary mode, the returned list contains all known customers or an error results. Otherwise, the returned list may contain only those customers that are accessible through this session. In effective mode, customers are returned that are currently effective. In any effective mode, effective customers and those currently expired are returned.- Parameters:
customerRecordType- a customer record type- Returns:
- the returned
CustomerListlist - Throws:
NullArgumentException-customerRecordTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCustomersOnDate
CustomerList getCustomersOnDate(DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets aCustomerListeffective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known customers or an error results. Otherwise, the returned list may contain only those customers that are accessible through this session. In effective mode, customers are returned that are currently effective in addition to being effective during the given date range. In any effective mode, effective customers and those currently expired are returned.- Parameters:
from- starting dateto- ending date- Returns:
- the returned
CustomerListlist - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCustomersByNumber
CustomerList getCustomersByNumber(String number) throws OperationFailedException, PermissionDeniedException Gets aCustomerListrelated to the given customer number. In plenary mode, the returned list contains all known customers or an error results. Otherwise, the returned list may contain only those customers that are accessible through this session. In effective mode, customers are returned that are currently effective. In any effective mode, effective customers and those currently expired are returned.- Parameters:
number- a customer number- Returns:
- the returned
CustomerListlist - Throws:
NullArgumentException-numberisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCustomersByResource
CustomerList getCustomersByResource(Id resourceId) throws OperationFailedException, PermissionDeniedException Gets aCustomerListrelated to the given resource. In plenary mode, the returned list contains all known customers or an error results. Otherwise, the returned list may contain only those customers that are accessible through this session. In effective mode, customers are returned that are currently effective. In any effective mode, effective customers and those currently expired are returned.- Parameters:
resourceId- a resourceId- Returns:
- the returned
CustomerListlist - Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCustomersByResourceOnDate
CustomerList getCustomersByResourceOnDate(Id resourceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets aCustomerListof the given 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 customers or an error results. Otherwise, the returned list may contain only those customers that are accessible through this session. In effective mode, customers are returned that are currently effective in addition to being effective during the given date range. In any effective mode, effective customers and those currently expired are returned.- Parameters:
resourceId- a resourceIdfrom- starting dateto- ending date- Returns:
- the returned
CustomerListlist - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-resourceId, from, ortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCustomersByActivity
CustomerList getCustomersByActivity(Id activityId) throws OperationFailedException, PermissionDeniedException Gets aCustomerListhaving the given activity. In plenary mode, the returned list contains all known customers or an error results. Otherwise, the returned list may contain only those customers that are accessible through this session. In effective mode, customers are returned that are currently effective. In any effective mode, effective customers and those currently expired are returned.- Parameters:
activityId- an activityId- Returns:
- the returned
CustomerListlist - Throws:
NullArgumentException-activityIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCustomers
Gets allCustomers. In plenary mode, the returned list contains all known customers or an error results. Otherwise, the returned list may contain only those customers that are accessible through this session.- Returns:
- a list of
Customers - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-