com.ibm.etill.kitcashcassette.test.card
Class KitCashMessage

java.lang.Object
  |
  +--com.ibm.etill.kitcashcassette.test.card.KitCashMessage

public class KitCashMessage
extends java.lang.Object


Field Summary
static byte AMOUNT_REQ
          Token for the amount request message: How much do you want.
static byte AMOUNT_RESP
          Token for the amount response message: I want zzz.
static byte AUTH_REQ
          Token for the authorisation request message: Hello I'm xxx.
static byte AUTH_RESP
          Token for the authorisation response message: I'm yyy.
 byte command
           
static byte CONTINUE
          Response token from the KitCash card indicating that it expects to receive another message
static byte NO_MSG
          Token indicating no message type has been set
static byte PAYMENT
          Token for the payment message: Here you are.
static byte PAYMENT_ACCEPTED
          Token indicating successful receipt of payment
static byte PAYMENT_REJECTED
          Token indicating unsuccessful receipt of payment
static byte PAYMENT_RESP
          Token for the payment response message: Thanks.
static byte STOP
          Response token from the KitCash card indicating that it expects to receive no more messages
 
Constructor Summary
KitCashMessage(byte[] msg)
          Constructs a new KitCashMessage from a byte array.
 
Method Summary
 int getAmount()
          Returns the amount embedded inside the message (only for AMOUNT_RESP messages)
 java.lang.String getID()
          returns the ID of the sender of the message (only for AUTH_REQ and AUTH_RESP messages)
 byte[] getMessage()
          Returns the message as a byte array
 boolean isComplete()
          Returns true if the message should be not sent to the receiver of the cash
 boolean toBeForwarded()
          Returns true if the message should be sent to the receiver of the cash
 java.lang.String toString()
          Returns string representation of the KitCash protocol message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

AUTH_REQ

public static final byte AUTH_REQ
Token for the authorisation request message: Hello I'm xxx. Who are you?

AUTH_RESP

public static final byte AUTH_RESP
Token for the authorisation response message: I'm yyy.

AMOUNT_REQ

public static final byte AMOUNT_REQ
Token for the amount request message: How much do you want.

AMOUNT_RESP

public static final byte AMOUNT_RESP
Token for the amount response message: I want zzz.

PAYMENT

public static final byte PAYMENT
Token for the payment message: Here you are.

PAYMENT_RESP

public static final byte PAYMENT_RESP
Token for the payment response message: Thanks.

NO_MSG

public static final byte NO_MSG
Token indicating no message type has been set

CONTINUE

public static final byte CONTINUE
Response token from the KitCash card indicating that it expects to receive another message

STOP

public static final byte STOP
Response token from the KitCash card indicating that it expects to receive no more messages

PAYMENT_ACCEPTED

public static final byte PAYMENT_ACCEPTED
Token indicating successful receipt of payment

PAYMENT_REJECTED

public static final byte PAYMENT_REJECTED
Token indicating unsuccessful receipt of payment

command

public byte command
Constructor Detail

KitCashMessage

public KitCashMessage(byte[] msg)
               throws KitCashException
Constructs a new KitCashMessage from a byte array.
Throws:
KitCashException - if the byte array is not valid
Method Detail

getAmount

public int getAmount()
Returns the amount embedded inside the message (only for AMOUNT_RESP messages)
Returns:
the amount embedded inside the message

getID

public java.lang.String getID()
returns the ID of the sender of the message (only for AUTH_REQ and AUTH_RESP messages)
Returns:
the ID of the sender of the message

getMessage

public byte[] getMessage()
Returns the message as a byte array
Returns:
the message as a byte array

isComplete

public boolean isComplete()
Returns true if the message should be not sent to the receiver of the cash
Returns:
true if the message should be not sent to the receiver of the cash; false otherwise

toBeForwarded

public boolean toBeForwarded()
Returns true if the message should be sent to the receiver of the cash
Returns:
true if the message should be sent to the receiver of the cash; false otherwise

toString

public java.lang.String toString()
Returns string representation of the KitCash protocol message
Overrides:
toString in class java.lang.Object
Returns:
string representation of the KitCash protocol message