Interface CreditBillingAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to re-assign Credits to
Bilings . A Credit may map to multiple Billings and
removing the last reference to a Credit is the equivalent of
deleting it. Each Billing may have its own authorizations
governing who is allowed to operate on it.
Adding a reference of a Credit to another Billing is
not a copy operation (eg: does not change its Id ).
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignCreditToBilling(Id creditId, Id billingId) Adds an existingCreditto aBilling.booleanTests if this user can alter credit/billing mappings.booleancanAssignCreditsToBilling(Id billingId) Tests if this user can alter credit/billing mappings.getAssignableBillingIds(Id billingId) Gets a list of billings including and under the given billing node in which any credit can be assigned.getAssignableBillingIdsForCredit(Id billingId, Id creditId) Gets a list of billings including and under the given billing node in which a specific credit can be assigned.voidreassignCreditToBilling(Id creditId, Id fromBillingId, Id toBiillingId) Moves aCreditfrom oneBillingto another.voidunassignCreditFromBilling(Id creditId, Id billingId) Removes aCreditfrom aBilling.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
-
canAssignCredits
boolean canAssignCredits()Tests if this user can alter credit/billing mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer lookup operations to unauthorized users.- Returns:
falseif mapping is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canAssignCreditsToBilling
Tests if this user can alter credit/billing mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Parameters:
billingId- theIdof theBilling- Returns:
falseif mapping is not authorized,trueotherwise- Throws:
NullArgumentException-billingIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignableBillingIds
Gets a list of billings including and under the given billing node in which any credit can be assigned.- Parameters:
billingId- theIdof theBilling- Returns:
- list of assignable billing
Ids - Throws:
NullArgumentException-billingIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getAssignableBillingIdsForCredit
Gets a list of billings including and under the given billing node in which a specific credit can be assigned.- Parameters:
billingId- theIdof theBillingcreditId- theIdof theCredit- Returns:
- list of assignable billing
Ids - Throws:
NullArgumentException-billingIdorcreditIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignCreditToBilling
void assignCreditToBilling(Id creditId, Id billingId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingCreditto aBilling.- Parameters:
creditId- theIdof theCreditbillingId- theIdof theBilling- Throws:
AlreadyExistsException-creditIdalready assigned tobillingIdNotFoundException-creditIdorbillingIdnot foundNullArgumentException-creditIdorbillingIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignCreditFromBilling
void unassignCreditFromBilling(Id creditId, Id billingId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes aCreditfrom aBilling.- Parameters:
creditId- theIdof theCreditbillingId- theIdof theBilling- Throws:
NotFoundException-creditIdorbillingIdnot found orcreditIdnot mapped tobillingIdNullArgumentException-creditIdorbillingIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignCreditToBilling
void reassignCreditToBilling(Id creditId, Id fromBillingId, Id toBiillingId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves aCreditfrom oneBillingto another. Mappings to otherBillingsare unaffected.- Parameters:
creditId- theIdof theCreditfromBillingId- theIdof the currentBillingtoBiillingId- theIdof the destinationBilling- Throws:
AlreadyExistsException-creditIdalready assigned totoBillingIdNotFoundException-creditId, fromBillingId, ortoBillingIdnot found orcreditIdnot mapped tofromBillingIdNullArgumentException-creditId, fromBillingId, ortoBillingIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-