anon.pay.xml
Class XMLBalance

java.lang.Object
  extended by anon.pay.xml.XMLBalance
All Implemented Interfaces:
IXMLEncodable

public class XMLBalance
extends java.lang.Object
implements IXMLEncodable

This class holds a balance certificate. Can be converted to and from XML


Field Summary
private static java.lang.String DEFAULT_RATE_ENDDATE
           
private  org.w3c.dom.Document m_docTheBalance
           
private  java.sql.Timestamp m_flatEnddate
           
private  long m_lAccountNumber
          the number of the account that this balance object belongs to
private  long m_lDeposit
          the amount of money which the user has paid for the corresponding volume plan
private  long m_lSpent
          the amount of byte which are already consumed for the corresponding account
private  java.lang.String m_message
           
private  java.net.URL m_messageLink
           
private  java.lang.String m_messageText
           
private  java.sql.Timestamp m_Timestamp
           
private  java.sql.Timestamp m_ValidTime
          bytes that are not consumed if there are any will expire after that date
private  long m_volumeKBytesleft
          the kbytes that are still left to spend for the corresponding account
 
Fields inherited from interface anon.util.IXMLEncodable
FIELD_XML_ELEMENT_CONTAINER_NAME, FIELD_XML_ELEMENT_NAME, XML_ATTR_ID, XML_ATTR_LANGUAGE, XML_ATTR_VERSION
 
Constructor Summary
XMLBalance(org.w3c.dom.Document doc)
           
XMLBalance(org.w3c.dom.Element elemBalance)
           
XMLBalance(long accountNumber, long deposit, long spent, java.sql.Timestamp timestamp, java.sql.Timestamp validTime, long volumeBytesleft, java.sql.Timestamp flatEnddate, IMyPrivateKey signKey)
           
XMLBalance(java.lang.String xmlDoc)
           
 
Method Summary
 long getAccountNumber()
          Returns the number the number of the account to which this balance belongs to
 long getDeposit()
          Returns the total amount of money spent by the user to buy the corresponding volume plan.
 java.sql.Timestamp getFlatEnddate()
           
 PayMessage getMessage()
           
 long getSpent()
          Returns the overall spent bytes for the corresponding account
 java.sql.Timestamp getTimestamp()
           
 java.sql.Timestamp getValidTime()
          Returns the Date after that unspent byte volume will expire
 long getVolumeKBytesLeft()
          getVolumeKBytesLeft: returns the current credit of the user Implementation depends on the payment system used formerly returned the difference between cumulative spent and deposit bytes now returns volume_bytesleft return value will be compared to jap.pay.PaymentMainPanel WARNING_AMOUNT
private  org.w3c.dom.Element internal_toXmlElement(org.w3c.dom.Document a_doc)
           
 void setMessage(PayMessage a_message)
           
private  void setValues(org.w3c.dom.Element elemRoot)
           
 void sign(IMyPrivateKey signKey)
           
 org.w3c.dom.Element toXmlElement(org.w3c.dom.Document a_doc)
          Return an element that can be appended to the document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_RATE_ENDDATE

private static final java.lang.String DEFAULT_RATE_ENDDATE
See Also:
Constant Field Values

m_lAccountNumber

private long m_lAccountNumber
the number of the account that this balance object belongs to


m_Timestamp

private java.sql.Timestamp m_Timestamp

m_ValidTime

private java.sql.Timestamp m_ValidTime
bytes that are not consumed if there are any will expire after that date


m_lDeposit

private long m_lDeposit
the amount of money which the user has paid for the corresponding volume plan


m_lSpent

private long m_lSpent
the amount of byte which are already consumed for the corresponding account


m_flatEnddate

private java.sql.Timestamp m_flatEnddate

m_volumeKBytesleft

private long m_volumeKBytesleft
the kbytes that are still left to spend for the corresponding account


m_message

private java.lang.String m_message

m_messageText

private java.lang.String m_messageText

m_messageLink

private java.net.URL m_messageLink

m_docTheBalance

private org.w3c.dom.Document m_docTheBalance
Constructor Detail

XMLBalance

public XMLBalance(long accountNumber,
                  long deposit,
                  long spent,
                  java.sql.Timestamp timestamp,
                  java.sql.Timestamp validTime,
                  long volumeBytesleft,
                  java.sql.Timestamp flatEnddate,
                  IMyPrivateKey signKey)

XMLBalance

public XMLBalance(org.w3c.dom.Document doc)
           throws java.lang.Exception
Throws:
java.lang.Exception

XMLBalance

public XMLBalance(java.lang.String xmlDoc)
           throws java.lang.Exception
Throws:
java.lang.Exception

XMLBalance

public XMLBalance(org.w3c.dom.Element elemBalance)
           throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

sign

public void sign(IMyPrivateKey signKey)

setMessage

public void setMessage(PayMessage a_message)

setValues

private void setValues(org.w3c.dom.Element elemRoot)
                throws java.lang.Exception
Throws:
java.lang.Exception

internal_toXmlElement

private org.w3c.dom.Element internal_toXmlElement(org.w3c.dom.Document a_doc)

getAccountNumber

public long getAccountNumber()
Returns the number the number of the account to which this balance belongs to

Returns:
number of the account that this balance belongs to

getDeposit

public long getDeposit()
Returns the total amount of money spent by the user to buy the corresponding volume plan.

Returns:
costs for the volume plan of the corresponding account

getSpent

public long getSpent()
Returns the overall spent bytes for the corresponding account

Returns:
bytes spent overall

getVolumeKBytesLeft

public long getVolumeKBytesLeft()
getVolumeKBytesLeft: returns the current credit of the user Implementation depends on the payment system used formerly returned the difference between cumulative spent and deposit bytes now returns volume_bytesleft return value will be compared to jap.pay.PaymentMainPanel WARNING_AMOUNT

Returns:
long: currently volume_kbytesleft

getFlatEnddate

public java.sql.Timestamp getFlatEnddate()

getTimestamp

public java.sql.Timestamp getTimestamp()

getValidTime

public java.sql.Timestamp getValidTime()
Returns the Date after that unspent byte volume will expire

Returns:
the expire date

getMessage

public PayMessage getMessage()
Returns:
PayMessage: a PayMessage object if this Balance has a message associated with it If the short message text is null or an empty String, getMessage() will return null (even if a link or long text exists)

toXmlElement

public org.w3c.dom.Element toXmlElement(org.w3c.dom.Document a_doc)
Description copied from interface: IXMLEncodable
Return an element that can be appended to the document. This Method must not change the document in any way!

Specified by:
toXmlElement in interface IXMLEncodable
Parameters:
a_doc - a document
Returns:
the interface as xml element