XmlCommunication
Class XmlGenerator

java.lang.Object
  extended byXmlCommunication.XmlGenerator

public class XmlGenerator
extends java.lang.Object

Author:
student This class is being used for compiling xml packets using the classes generated by Castor.

Field Summary
private static int counter
           
 
Constructor Summary
XmlGenerator()
          This is the constructor for XmlGenerator.java
 
Method Summary
 java.lang.String adminAddXml(User_Data user, UserAddress_Data address)
          This method is being used for the compilation of an admin add xml packet, which adds a new ncb to the TMS.
 java.lang.String adminUpdateXml(User_Data user, UserAddress_Data address)
          This method is being used for the compilation of admin update xml oacket which is used to update a given ncb.
 java.lang.String enquiryNcbAddressXml(User_Data user, CreditCard_Data card)
          This method is being used for the compilation of enquiry ncb address xml which is used to get the address data of the specified ncb from TMS.
 java.lang.String enquiryNcbXml(User_Data user, CreditCard_Data card)
          This method is being used for the compilation of enquiry ncb xml packet which gets the given ncb's data from TMS.
 java.lang.String transactionAuthXml(User_Data user, CreditCard_Data card)
          This method is being used for compilation of transactionAuth Xml packet which is used to authenticate a customer's credit account and sets up an account with TMS.
 java.lang.String transactionPurchaseXml(Stock_Data stock, User_Data user, UserAddress_Data address)
          This method is being used for the compilation of transaction purchase xml packet which is used to identify a purchase order.
 java.lang.String transactionSettlementXml(User_Data user, CreditCard_Data card, Stock_Data stock)
          This method is being used for the compilation of transaction settlement xml packet which asks for the confirmation of the transaction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

counter

private static int counter
Constructor Detail

XmlGenerator

public XmlGenerator()
This is the constructor for XmlGenerator.java

Method Detail

adminAddXml

public java.lang.String adminAddXml(User_Data user,
                                    UserAddress_Data address)
This method is being used for the compilation of an admin add xml packet, which adds a new ncb to the TMS.

Parameters:
user - User details that are to be added to TMS.
address - Address details that are to be added to TMS.
Returns:
String The xml message representing admin add.

adminUpdateXml

public java.lang.String adminUpdateXml(User_Data user,
                                       UserAddress_Data address)
This method is being used for the compilation of admin update xml oacket which is used to update a given ncb.

Parameters:
user - The user details that are to be updated in TMS.
address - The address details that are being updated in TMS.
Returns:
String The xml string representing the admin update xml message.

enquiryNcbAddressXml

public java.lang.String enquiryNcbAddressXml(User_Data user,
                                             CreditCard_Data card)
This method is being used for the compilation of enquiry ncb address xml which is used to get the address data of the specified ncb from TMS.

Parameters:
user - User details that are being used for enquiry ncb address.
card - The credit card details that are being used for enquiry ncb address.
Returns:
String The xml string that represents enquiry ncb address.

enquiryNcbXml

public java.lang.String enquiryNcbXml(User_Data user,
                                      CreditCard_Data card)
This method is being used for the compilation of enquiry ncb xml packet which gets the given ncb's data from TMS.

Parameters:
user - User details for whom enquiry ncb is being sent.
card - Credit card details that are used for the enquiry ncb.
Returns:
String The xml string that represents theenquiry ncb.

transactionAuthXml

public java.lang.String transactionAuthXml(User_Data user,
                                           CreditCard_Data card)
This method is being used for compilation of transactionAuth Xml packet which is used to authenticate a customer's credit account and sets up an account with TMS.

Parameters:
user - user details that are used for authorising the transaction.
card - Credit card details that are used for authorisation of the transaction.
Returns:
String The xml string representing the transaction auth.

transactionPurchaseXml

public java.lang.String transactionPurchaseXml(Stock_Data stock,
                                               User_Data user,
                                               UserAddress_Data address)
This method is being used for the compilation of transaction purchase xml packet which is used to identify a purchase order.

Parameters:
stock - Stock details that are used for transaction purchase.
user - User details that are used for transaction purchase.
address - Address details that are used for the transaction purchase.
Returns:
String The xml string that represents the transaction purchase.

transactionSettlementXml

public java.lang.String transactionSettlementXml(User_Data user,
                                                 CreditCard_Data card,
                                                 Stock_Data stock)
This method is being used for the compilation of transaction settlement xml packet which asks for the confirmation of the transaction.

Parameters:
user - User details that are being used for the transaction settlement.
card - Credit card details that are being used for the transaction settlement.
stock - Stock details that are being used for the transaction settlement.
Returns:
String The xml string representing the transaction settlement.