SAP CC 1.0
API 4.2 (Core)

com.highdeal.pnr.tif
Class Transaction

java.lang.Object
  extended by com.highdeal.pnr.tif.Transaction
All Implemented Interfaces:
XMLMarshallable

public class Transaction
extends java.lang.Object
implements XMLMarshallable

This class represents a transaction computed by the rating engine.


XML Schema Fragment
<xs:element name="transac" type="TransactionType"/>
  
   <xs:complexType name="TransactionType">
    <xs:sequence>
      <xs:element name="detail" minOccurs="0" maxOccurs="unbounded">
        <xs:complexType>
          <xs:attribute name="name" type="xs:string"/>
          <xs:attribute name="type" type="xs:string"/>
          <xs:attribute name="value" type="xs:anySimpleType"/>
        </xs:complexType>
      </xs:element>
      <xs:element ref="notification" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="amount" type="xs:string"/>
    <xs:attribute name="offerCode" type="xs:string"/>
    <xs:attribute name="subscriptionCode" type="xs:string"/>
    <xs:attribute name="chargeCode" type="xs:string"/>
    <xs:attribute name="dispatchCode1" type="xs:string"/>
    <xs:attribute name="dispatchCode2" type="xs:string"/>
    <xs:attribute name="dispatchCode3" type="xs:string"/>
    <xs:attribute name="origin" type="TransactionOrigin"/>
    <xs:attribute name="date" type="xs:dateTime"/>
    <xs:attribute name="label" type="xs:string"/>
    <xs:attribute name="relationshipType" type="TransacRelationShipTypeType" default="client"/>
    <xs:attribute name="operationType" type="TransacOperationTypeType" default="debit"/>
    <xs:attribute name="reservationUID" type="xs:long"/>
    <xs:attribute name="sessionID" type="xs:string"/>
   </xs:complexType>

 <xs:simpleType name="TransactionOrigin">
   <xs:restriction base="xs:string">
      <xs:enumeration value="usage"/>
      <xs:enumeration value="recurring"/>
      <xs:enumeration value="oneshot"/>
   </xs:restriction>
 </xs:simpleType>
<xs:simpleType name="TransacRelationShipTypeType">
   <xs:restriction base="xs:string">
     <xs:enumeration value="client"/>
     <xs:enumeration value="partner"/>
   </xs:restriction>
 </xs:simpleType>
<xs:simpleType name="TransacOperationTypeType">
   <xs:restriction base="xs:string">
     <xs:enumeration value="debit"/>
     <xs:enumeration value="credit"/>
   </xs:restriction>
 </xs:simpleType>

Field Summary
static int CLIENT_RELATIONSHIP
          Constant value for a client type business relationship .
static int CREDIT_OPERATION
          Constant value for a credit operation.
static int DEBIT_OPERATION
          Constant value for a debit operation.
static int ONESHOT
          Value of the origin field indicating a oneshot transaction.
static int PARTNER_RELATIONSHIP
          Constant value for a partner type business relationship .
static int RECURRING
          Value of the origin field indicating a recurring transaction.
static int USAGE
          Value of the origin field indicating a usage transaction.
 
Constructor Summary
Transaction()
          Builds an empty transaction.
Transaction(Money amount, java.lang.String offerCode, java.lang.String subscriptionCode, java.lang.String chargeCode, java.lang.String dispatchCode1, java.lang.String dispatchCode2, java.lang.String dispatchCode3, int origin, DetailRecord detailRecord, java.util.Date date, java.lang.String label)
          Builds a full transaction with neither reservationUID nor sessionID
Transaction(Money amount, java.lang.String offerCode, java.lang.String subscriptionCode, java.lang.String chargeCode, java.lang.String dispatchCode1, java.lang.String dispatchCode2, java.lang.String dispatchCode3, int origin, DetailRecord detailRecord, java.util.Date date, java.lang.String label, java.lang.Long reservationUID, java.lang.String sessionID)
          Builds a full transaction.
Transaction(Money amount, java.lang.String offerCode, java.lang.String subscriptionCode, java.lang.String chargeCode, java.lang.String dispatchCode1, java.lang.String dispatchCode2, java.lang.String dispatchCode3, int origin, DetailRecord detailRecord, java.util.Date date, java.lang.String label, java.lang.Long reservationUID, java.lang.String sessionID, java.util.Vector<Notification> notifications)
           
Transaction(TransactionTemplateModel template)
          Builds an empty transaction with a template which will determine how to filter the transaction.
 
Method Summary
 void addCharacterData(java.lang.String cData)
          Adds character data to the content element.
 void addChild(java.lang.String tagName, XMLMarshallable child)
          Adds a child to the objects, the child represents the marshallable object to be added into the content tree.
 Transaction duplicate()
          Duplicate the transaction.
 Money getAmount()
          Gets the amount.
 java.lang.String getChargeCode()
          Returns the code of the charge.
 java.util.Date getDate()
          Gets the date.
 DetailRecord getDetailRecord()
          Gets the detail record.
 java.lang.String getDispatchCode1()
          Gets the dispatch code number 1.
 java.lang.String getDispatchCode2()
          Gets the dispatch code number 2.
 java.lang.String getDispatchCode3()
          Gets the dispatch code number 3.
 java.lang.String getLabel()
          Returns the label.
 java.util.Vector<Notification> getNotifications()
          Gets the list of triggered notifications.
 java.lang.String getOfferCode()
          Gets the code of the offer.
 int getOperationType()
          Gets the operation type of the transaction.
 int getOrigin()
          Gets the origin.
 int getRelationshipType()
          Gets the relationship type of the transaction.
 java.lang.Long getReservationUID()
          Gets the reservation id related to this transaction when it has been computed by a PreRateOp or PostRateOp.
 java.lang.String getSessionID()
          Gets the session id related to this transaction when it has been computed by session-based rating operations.
 java.lang.String getSubscriptionCode()
          Gets the code of the subscription.
 Transaction getTransaction(boolean isFilterTransaction)
          Gets the transaction according to the isFilterTransaction value.
 TransactionTemplateModel getTransactionTemplate()
          Gets the transaction template which determines the filtering
 boolean isFree()
          Checks if transaction is free, i.e.
 void marshal(XMLOutputter output)
          Gives an XML representation of this object, and of its children.
 void marshal(XMLOutputter output, java.lang.String tagName)
           
 void setAmount(Money amount)
          Sets the amount.
 void setAttributes(XMLAttributes atts)
          Sets the attributes of the XML representation of the tag beeing processed.
 void setChargeCode(java.lang.String code)
          Sets the charge code.
 void setDate(java.util.Date date)
          Sets the date.
 void setDetailRecord(DetailRecord record)
          Sets the detail record.
 void setDispatchCode1(java.lang.String code)
          Sets the dispatch code number 1.
 void setDispatchCode2(java.lang.String code)
          Sets the dispatch code number 2.
 void setDispatchCode3(java.lang.String code)
          Sets the dispatch code number 3.
 void setLabel(java.lang.String label)
          Sets the label.
 void setNotifications(java.util.Vector<Notification> notifications)
          Sets the list of triggered notifications.
 void setOfferCode(java.lang.String code)
          Sets the offer code.
 void setOperationType(int type)
          Sets the operation type for the transaction.
 void setOrigin(int origin)
          Sets the origin.
 void setRelationshipType(int relationshipType)
          Sets the relationship type of the transaction.
 void setReservationUID(java.lang.Long reservationUID)
          Sets the reservation id related to this transaction when it has been computed by a PreRateOp or PostRateOp.
 void setSessionID(java.lang.String sessionID)
          Sets the session id related to this transaction when it has been computed by session-based rating operations.
 void setSubscriptionCode(java.lang.String code)
          Sets the subscription code.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

USAGE

public static final int USAGE
Value of the origin field indicating a usage transaction.

See Also:
Constant Field Values

RECURRING

public static final int RECURRING
Value of the origin field indicating a recurring transaction.

See Also:
Constant Field Values

ONESHOT

public static final int ONESHOT
Value of the origin field indicating a oneshot transaction.

See Also:
Constant Field Values

CLIENT_RELATIONSHIP

public static final int CLIENT_RELATIONSHIP
Constant value for a client type business relationship .

See Also:
Constant Field Values

PARTNER_RELATIONSHIP

public static final int PARTNER_RELATIONSHIP
Constant value for a partner type business relationship .

See Also:
Constant Field Values

DEBIT_OPERATION

public static final int DEBIT_OPERATION
Constant value for a debit operation.

See Also:
Constant Field Values

CREDIT_OPERATION

public static final int CREDIT_OPERATION
Constant value for a credit operation.

See Also:
Constant Field Values
Constructor Detail

Transaction

public Transaction()
Builds an empty transaction.


Transaction

public Transaction(TransactionTemplateModel template)
Builds an empty transaction with a template which will determine how to filter the transaction.

Parameters:
template - the manner to filter transaction.

Transaction

public Transaction(Money amount,
                   java.lang.String offerCode,
                   java.lang.String subscriptionCode,
                   java.lang.String chargeCode,
                   java.lang.String dispatchCode1,
                   java.lang.String dispatchCode2,
                   java.lang.String dispatchCode3,
                   int origin,
                   DetailRecord detailRecord,
                   java.util.Date date,
                   java.lang.String label)
Builds a full transaction with neither reservationUID nor sessionID

Parameters:
amount -
offerCode -
subscriptionCode -
chargeCode -
dispatchCode1 -
dispatchCode2 -
dispatchCode3 -
origin -
detailRecord -
date -
label -

Transaction

public Transaction(Money amount,
                   java.lang.String offerCode,
                   java.lang.String subscriptionCode,
                   java.lang.String chargeCode,
                   java.lang.String dispatchCode1,
                   java.lang.String dispatchCode2,
                   java.lang.String dispatchCode3,
                   int origin,
                   DetailRecord detailRecord,
                   java.util.Date date,
                   java.lang.String label,
                   java.lang.Long reservationUID,
                   java.lang.String sessionID)
Builds a full transaction.

Parameters:
amount -
offerCode -
subscriptionCode -
chargeCode -
dispatchCode1 -
dispatchCode2 -
dispatchCode3 -
origin -
detailRecord -
date -
label -
reservationUID -
sessionID -

Transaction

public Transaction(Money amount,
                   java.lang.String offerCode,
                   java.lang.String subscriptionCode,
                   java.lang.String chargeCode,
                   java.lang.String dispatchCode1,
                   java.lang.String dispatchCode2,
                   java.lang.String dispatchCode3,
                   int origin,
                   DetailRecord detailRecord,
                   java.util.Date date,
                   java.lang.String label,
                   java.lang.Long reservationUID,
                   java.lang.String sessionID,
                   java.util.Vector<Notification> notifications)
Method Detail

getTransaction

public Transaction getTransaction(boolean isFilterTransaction)
Gets the transaction according to the isFilterTransaction value.

Parameters:
isFilterTransaction - true if the returned transaction must be filtered, false otherwise.
Returns:
the transaction filtered or not.

duplicate

public final Transaction duplicate()
Duplicate the transaction.

Returns:
the duplicated transaction

getAmount

public Money getAmount()
Gets the amount.

Returns:
the amount.

setAmount

public void setAmount(Money amount)
Sets the amount.

Parameters:
amount - the amount to set.

isFree

public boolean isFree()
Checks if transaction is free, i.e. if amount is null.

Returns:
true if transaction is free, false otherwise

getOfferCode

public java.lang.String getOfferCode()
Gets the code of the offer.

Returns:
the offer code.

setOfferCode

public void setOfferCode(java.lang.String code)
Sets the offer code.

Parameters:
code - the transaction offer code.

getSubscriptionCode

public java.lang.String getSubscriptionCode()
Gets the code of the subscription.

Returns:
the subscription code.

setSubscriptionCode

public void setSubscriptionCode(java.lang.String code)
Sets the subscription code.

Parameters:
code - the transaction subscription code.

getChargeCode

public java.lang.String getChargeCode()
Returns the code of the charge.

Returns:
the charge code.

setChargeCode

public void setChargeCode(java.lang.String code)
Sets the charge code.

Parameters:
code - the transaction charge code.

getDispatchCode1

public java.lang.String getDispatchCode1()
Gets the dispatch code number 1.

Returns:
the dispatch code.

setDispatchCode1

public void setDispatchCode1(java.lang.String code)
Sets the dispatch code number 1.

Parameters:
code - the dispatch code 1.

getDispatchCode2

public java.lang.String getDispatchCode2()
Gets the dispatch code number 2.

Returns:
the dispatch code.

setDispatchCode2

public void setDispatchCode2(java.lang.String code)
Sets the dispatch code number 2.

Parameters:
code - the dispatch code 2.

getDispatchCode3

public java.lang.String getDispatchCode3()
Gets the dispatch code number 3.

Returns:
the dispatch code.

setDispatchCode3

public void setDispatchCode3(java.lang.String code)
Sets the dispatch code number 3.

Parameters:
code - the dispatch code 3.

getOrigin

public int getOrigin()
Gets the origin. It may contain one of the following types: usage, recurring, oneshot.

Returns:
the origin.

setOrigin

public void setOrigin(int origin)
Sets the origin.

Parameters:
origin - the transaction origin.

getDetailRecord

public DetailRecord getDetailRecord()
Gets the detail record.

Returns:
the detail record.

setDetailRecord

public void setDetailRecord(DetailRecord record)
Sets the detail record.

Parameters:
record - the transaction detail record.

getDate

public java.util.Date getDate()
Gets the date.

Returns:
the date.

setDate

public void setDate(java.util.Date date)
Sets the date.

Parameters:
date - the transaction date.

getLabel

public java.lang.String getLabel()
Returns the label.

Returns:
the label.

setLabel

public void setLabel(java.lang.String label)
Sets the label.

Parameters:
label - the transaction label.

getTransactionTemplate

public TransactionTemplateModel getTransactionTemplate()
Gets the transaction template which determines the filtering

Returns:
template the manner to filter transaction.

getRelationshipType

public int getRelationshipType()
Gets the relationship type of the transaction.

Returns:
value of relationship type.
See Also:
CLIENT_RELATIONSHIP, PARTNER_RELATIONSHIP

setRelationshipType

public void setRelationshipType(int relationshipType)
Sets the relationship type of the transaction.

Parameters:
relationshipType - Value to assign to relationship type.
See Also:
CLIENT_RELATIONSHIP, PARTNER_RELATIONSHIP

getOperationType

public int getOperationType()
Gets the operation type of the transaction.

Returns:
value of operation type.
See Also:
DEBIT_OPERATION, CREDIT_OPERATION

setOperationType

public void setOperationType(int type)
Sets the operation type for the transaction.

Parameters:
type - Value to assign to operation type.
See Also:
DEBIT_OPERATION, CREDIT_OPERATION

getReservationUID

public java.lang.Long getReservationUID()
Gets the reservation id related to this transaction when it has been computed by a PreRateOp or PostRateOp.

Returns:
the reservation id related to this transaction

setReservationUID

public void setReservationUID(java.lang.Long reservationUID)
Sets the reservation id related to this transaction when it has been computed by a PreRateOp or PostRateOp.

Parameters:
reservationUID - the reservation id related to this transaction

getSessionID

public java.lang.String getSessionID()
Gets the session id related to this transaction when it has been computed by session-based rating operations.

Returns:
the session id related to this transaction

setSessionID

public void setSessionID(java.lang.String sessionID)
Sets the session id related to this transaction when it has been computed by session-based rating operations.

Parameters:
sessionID - the session id related to this transaction

getNotifications

public java.util.Vector<Notification> getNotifications()
Gets the list of triggered notifications.

Returns:
the notification list.

setNotifications

public void setNotifications(java.util.Vector<Notification> notifications)
Sets the list of triggered notifications.

Parameters:
notifications - the list of triggered notifications

addCharacterData

public void addCharacterData(java.lang.String cData)
Description copied from interface: XMLMarshallable
Adds character data to the content element.

Specified by:
addCharacterData in interface XMLMarshallable
Parameters:
cData - the character data to be added.

setAttributes

public void setAttributes(XMLAttributes atts)
Description copied from interface: XMLMarshallable
Sets the attributes of the XML representation of the tag beeing processed.

Specified by:
setAttributes in interface XMLMarshallable
Parameters:
atts - the XML attributes of the current tag.

addChild

public void addChild(java.lang.String tagName,
                     XMLMarshallable child)
Description copied from interface: XMLMarshallable
Adds a child to the objects, the child represents the marshallable object to be added into the content tree.

Specified by:
addChild in interface XMLMarshallable
Parameters:
tagName - the name of tag for the child.
child - the child to be added.

marshal

public void marshal(XMLOutputter output)
Description copied from interface: XMLMarshallable
Gives an XML representation of this object, and of its children.

Specified by:
marshal in interface XMLMarshallable
Parameters:
output - the XML output to marshall the object into.

marshal

public void marshal(XMLOutputter output,
                    java.lang.String tagName)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

SAP CC 1.0
API 4.2 (Core)


API Reference - July 2009

SAP Convergent Charging 1.0 (build R4.2.1.35.0.0)
CONVERGENT CHARGING 4.2

(c) Copyright 2009 SAP AG. All rights reserved.