ibilling.client
Class TransformationContext

java.lang.Object
  extended by ibilling.client.TransformationContext

public class TransformationContext
extends java.lang.Object

Helper class used to resolve references (convert object to ids and ids back to objects) during object to xml and xml to object conversion processing

Since:
1.0

Field Summary
private  java.util.Map<java.lang.Integer,AssetTransaction> assetTransactions
          The asset transactions.
private  java.util.Map<java.lang.Integer,CustomerAccount> customerAccounts
          The customer accounts.
private  java.util.Map<java.lang.Integer,PaymentOption> paymentOptions
          The payment options.
private  java.util.Map<java.lang.Integer,PaymentPlan> paymentPlans
          The payment plans.
private  java.util.Map<java.lang.Integer,RevenueTransaction> revenueTransactions
          The revenue transactions.
 
Constructor Summary
TransformationContext()
          Instantiates a new transformation context.
TransformationContext(SessionContext sessionContext)
          /** Instantiates a new transformation context.
 
Method Summary
private  void addAssetTransactionElement(ElementFacade root, AssetTransaction transaction)
          Adds the asset transaction element.
private  void addPaymentOptionElement(ElementFacade root, PaymentOption paymentOption)
          Adds the payment option element.
private  void addPaymentPlanElement(ElementFacade root, PaymentPlan paymentPlan)
          Adds the payment plan element.
private  void addRevenueTransactionElement(ElementFacade root, RevenueTransaction transaction)
          Adds the revenue transaction element.
private  void checkAndReplaceAssetTransaction(AssetTransaction clientObject)
           
private  void checkAndReplaceCustomerAccount(CustomerAccount clientObject)
           
private  void checkAndReplacePaymentOption(PaymentOption clientObject)
           
private  void checkAndReplacePaymentPlan(PaymentPlan clientObject)
           
private  void checkAndReplaceRevenueTransaction(RevenueTransaction clientObject)
           
 java.util.Map<java.lang.String,java.lang.Object> deserealizeQueryParameters(ElementFacade facade)
          Deserealize query parameters.
 java.util.List<ClientObject> deserializeList(ElementFacade facade, boolean isQueryResponse)
          Deserialize list.
 void deserializeMapConfig(ElementFacade facade, java.util.Map<java.lang.String,java.lang.Object> config)
          Deserialize config parameters
 AssetTransaction getAssetTransaction(ElementFacade facade, java.lang.String attributeName)
          Gets the asset transaction.
 CustomerAccount getCustomerAccount(ElementFacade facade, java.lang.String attributeName)
          Gets the customer account.
 java.lang.Integer getMerchantAccountCode(ElementFacade facade)
          Gets the merchant account code.
 java.lang.String getPassword(ElementFacade facade)
          Gets the password.
 PaymentOption getPaymentOption(ElementFacade facade, java.lang.String attributeName)
          Gets the payment option.
 PaymentPlan getPaymentPlan(ElementFacade facade, java.lang.String attributeName)
          Gets the payment plan.
 java.lang.String getQueryName(ElementFacade facade)
          Gets the query name.
 RevenueTransaction getRevenueTransaction(ElementFacade facade, java.lang.String attributeName)
          Gets the revenue transaction.
 boolean isQueryRequest(ElementFacade facade)
          Checks if is query request.
 ElementFacade serealizeQuery(java.lang.Integer merchantAccountCode, java.lang.String password, java.lang.String queryName, java.util.Map<java.lang.String,java.lang.Object> parameters, java.util.Map<java.lang.String,java.lang.Object> config)
          Serealize query.
 ElementFacade serializeList(java.lang.Integer merchantAccountCode, java.lang.String password, java.util.List<ClientObject> list, java.util.Map<java.lang.String,java.lang.Object> config)
          Serialize list.
private  java.util.List<CustomerAccount> takeCustomerAccounts()
          Gets the customer accounts.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

customerAccounts

private java.util.Map<java.lang.Integer,CustomerAccount> customerAccounts
The customer accounts.


paymentOptions

private java.util.Map<java.lang.Integer,PaymentOption> paymentOptions
The payment options.


revenueTransactions

private java.util.Map<java.lang.Integer,RevenueTransaction> revenueTransactions
The revenue transactions.


assetTransactions

private java.util.Map<java.lang.Integer,AssetTransaction> assetTransactions
The asset transactions.


paymentPlans

private java.util.Map<java.lang.Integer,PaymentPlan> paymentPlans
The payment plans.

Constructor Detail

TransformationContext

public TransformationContext()
Instantiates a new transformation context.


TransformationContext

public TransformationContext(SessionContext sessionContext)
/** Instantiates a new transformation context.

Parameters:
sessionContext -
Method Detail

serializeList

public ElementFacade serializeList(java.lang.Integer merchantAccountCode,
                                   java.lang.String password,
                                   java.util.List<ClientObject> list,
                                   java.util.Map<java.lang.String,java.lang.Object> config)
Serialize list.

Parameters:
merchantAccountCode - the merchant account code
password - the password
list - the list
config - the config
Returns:
the element facade

deserializeList

public java.util.List<ClientObject> deserializeList(ElementFacade facade,
                                                    boolean isQueryResponse)
Deserialize list.

Parameters:
facade - the facade
isQueryResponse - the is query response
Returns:
the list

deserializeMapConfig

public void deserializeMapConfig(ElementFacade facade,
                                 java.util.Map<java.lang.String,java.lang.Object> config)
Deserialize config parameters

Parameters:
facade - ElementFacade
config - Map

serealizeQuery

public ElementFacade serealizeQuery(java.lang.Integer merchantAccountCode,
                                    java.lang.String password,
                                    java.lang.String queryName,
                                    java.util.Map<java.lang.String,java.lang.Object> parameters,
                                    java.util.Map<java.lang.String,java.lang.Object> config)
Serealize query.

Parameters:
merchantAccountCode - the merchant account code
password - the password
queryName - the query name
parameters - the parameters
Returns:
the element facade

deserealizeQueryParameters

public java.util.Map<java.lang.String,java.lang.Object> deserealizeQueryParameters(ElementFacade facade)
Deserealize query parameters.

Parameters:
facade - the facade
Returns:
the map< string, object>

getMerchantAccountCode

public java.lang.Integer getMerchantAccountCode(ElementFacade facade)
Gets the merchant account code.

Parameters:
facade - the facade
Returns:
the merchant account code

getPassword

public java.lang.String getPassword(ElementFacade facade)
Gets the password.

Parameters:
facade - the facade
Returns:
the password

getQueryName

public java.lang.String getQueryName(ElementFacade facade)
Gets the query name.

Parameters:
facade - the facade
Returns:
the query name

isQueryRequest

public boolean isQueryRequest(ElementFacade facade)
Checks if is query request.

Parameters:
facade - the facade
Returns:
true, if is query request

getCustomerAccount

public CustomerAccount getCustomerAccount(ElementFacade facade,
                                          java.lang.String attributeName)
Gets the customer account.

Parameters:
facade - the facade
attributeName - the attribute name
Returns:
the customer account

getPaymentOption

public PaymentOption getPaymentOption(ElementFacade facade,
                                      java.lang.String attributeName)
Gets the payment option.

Parameters:
facade - the facade
attributeName - the attribute name
Returns:
the payment option

getRevenueTransaction

public RevenueTransaction getRevenueTransaction(ElementFacade facade,
                                                java.lang.String attributeName)
Gets the revenue transaction.

Parameters:
facade - the facade
attributeName - the attribute name
Returns:
the revenue transaction

getAssetTransaction

public AssetTransaction getAssetTransaction(ElementFacade facade,
                                            java.lang.String attributeName)
Gets the asset transaction.

Parameters:
facade - the facade
attributeName - the attribute name
Returns:
the asset transaction

getPaymentPlan

public PaymentPlan getPaymentPlan(ElementFacade facade,
                                  java.lang.String attributeName)
Gets the payment plan.

Parameters:
facade - the facade
attributeName - the attribute name
Returns:
the payment plan

takeCustomerAccounts

private java.util.List<CustomerAccount> takeCustomerAccounts()
Gets the customer accounts.

Returns:
the customer accounts

addPaymentOptionElement

private void addPaymentOptionElement(ElementFacade root,
                                     PaymentOption paymentOption)
Adds the payment option element.

Parameters:
root - the root
paymentOption - the payment option

addPaymentPlanElement

private void addPaymentPlanElement(ElementFacade root,
                                   PaymentPlan paymentPlan)
Adds the payment plan element.

Parameters:
root - the root
paymentPlan - the payment plan

addRevenueTransactionElement

private void addRevenueTransactionElement(ElementFacade root,
                                          RevenueTransaction transaction)
Adds the revenue transaction element.

Parameters:
root - the root
transaction - the transaction

addAssetTransactionElement

private void addAssetTransactionElement(ElementFacade root,
                                        AssetTransaction transaction)
Adds the asset transaction element.

Parameters:
root - the root
transaction - the transaction

checkAndReplaceCustomerAccount

private void checkAndReplaceCustomerAccount(CustomerAccount clientObject)
Parameters:
clientObject -

checkAndReplacePaymentOption

private void checkAndReplacePaymentOption(PaymentOption clientObject)
Parameters:
clientObject -

checkAndReplacePaymentPlan

private void checkAndReplacePaymentPlan(PaymentPlan clientObject)
Parameters:
clientObject -

checkAndReplaceRevenueTransaction

private void checkAndReplaceRevenueTransaction(RevenueTransaction clientObject)
Parameters:
clientObject -

checkAndReplaceAssetTransaction

private void checkAndReplaceAssetTransaction(AssetTransaction clientObject)
Parameters:
clientObject -