net.sourceforge.jwap.wtp
Class CWTPEvent

java.lang.Object
  |
  +--net.sourceforge.jwap.wtp.CWTPEvent

public class CWTPEvent
extends java.lang.Object

This class represents a service primitive used to communicate between WTP layer and the layer above (e.g. WSP). Generally are four types of service primitives:

The wireless transaction protocol provides the following services according tp section 5.3 of the specification. TR-INVOKE and TR-RESULT are modeled by this class. TR-ABORT is a call of abort(abordCode) on the corresponding transaction. Service primitive can be processed by CWTPSocket, that implements the state machine of the WTP layer or they are used to inform IWTPListeners by the WTP layer.


Field Summary
static byte TR_INVOKE_CNF
           
static byte TR_INVOKE_IND
           
static byte TR_INVOKE_REQ
           
static byte TR_INVOKE_RES
           
static byte TR_INVOKEDATA_CNF
           
static byte TR_INVOKEDATA_IND
           
static byte TR_INVOKEDATA_REQ
           
static byte TR_INVOKEDATA_RES
           
static byte TR_RESULT_CNF
           
static byte TR_RESULT_IND
           
static byte TR_RESULT_REQ
           
static byte TR_RESULT_RES
           
static byte TR_RESULTDATA_CNF
           
static byte TR_RESULTDATA_IND
           
static byte TR_RESULTDATA_REQ
           
static byte TR_RESULTDATA_RES
           
static java.lang.String[] types
           
 
Constructor Summary
CWTPEvent(byte[] userData, byte type)
          Constructor to construct tr-invoke and tr-result
defaults: moreData = false, no exitInfo, frameBoundary = false
CWTPEvent(byte[] userData, byte[] exitInfo, boolean moreData, boolean frameBoundary, byte type)
          Constructor to construct tr-invoke and tr-result
(construct Aborts by calling abort(code) on the transaction.
 
Method Summary
 byte[] getExitInfo()
           
 boolean getFrameBoundary()
           
 boolean getMoreData()
           
 IWTPTransaction getTransaction()
           
 byte getType()
           
 byte[] getUserData()
           
 void setExitInfo(byte[] data)
           
 void setFrameBoundary(boolean boundary)
           
 void setMoreData(boolean moreData)
           
 void setTransaction(IWTPTransaction transaction)
           
 void setType(byte type)
           
 void setUserData(byte[] userData)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TR_INVOKE_REQ

public static final byte TR_INVOKE_REQ

TR_INVOKE_IND

public static final byte TR_INVOKE_IND

TR_INVOKE_RES

public static final byte TR_INVOKE_RES

TR_INVOKE_CNF

public static final byte TR_INVOKE_CNF

TR_RESULT_REQ

public static final byte TR_RESULT_REQ

TR_RESULT_IND

public static final byte TR_RESULT_IND

TR_RESULT_RES

public static final byte TR_RESULT_RES

TR_RESULT_CNF

public static final byte TR_RESULT_CNF

TR_INVOKEDATA_REQ

public static final byte TR_INVOKEDATA_REQ

TR_INVOKEDATA_IND

public static final byte TR_INVOKEDATA_IND

TR_INVOKEDATA_RES

public static final byte TR_INVOKEDATA_RES

TR_INVOKEDATA_CNF

public static final byte TR_INVOKEDATA_CNF

TR_RESULTDATA_REQ

public static final byte TR_RESULTDATA_REQ

TR_RESULTDATA_IND

public static final byte TR_RESULTDATA_IND

TR_RESULTDATA_RES

public static final byte TR_RESULTDATA_RES

TR_RESULTDATA_CNF

public static final byte TR_RESULTDATA_CNF

types

public static final java.lang.String[] types
Constructor Detail

CWTPEvent

public CWTPEvent(byte[] userData,
                 byte[] exitInfo,
                 boolean moreData,
                 boolean frameBoundary,
                 byte type)
Constructor to construct tr-invoke and tr-result
(construct Aborts by calling abort(code) on the transaction. After this the transaction throws abortedExceptions on calling anything on it.)
Parameters:
userData - Payload/bytes of the upper layer
exitInfo - Will there be more invocations of this primitive for the same transaction? (available if ext. segmentation and re-assambly used)
moreData - Additional invocations for the same transaction follow (available if ext. segmentation and re-assambly used)
frameBoundary - specifies a new user defined data frame (available if ext. segmentation and re-assambly used)
transaction - the transaction the service primitive belongs to.
type - the type of this service primitive (use constants defined in the class)

CWTPEvent

public CWTPEvent(byte[] userData,
                 byte type)
Constructor to construct tr-invoke and tr-result
defaults: moreData = false, no exitInfo, frameBoundary = false
Parameters:
userData - Payload/bytes of the upper layer
transaction - the transaction the service primitive belongs to.
type - the type of this service primitive (use constants defined in the class)
Method Detail

getType

public byte getType()

setType

public void setType(byte type)

getUserData

public byte[] getUserData()

setUserData

public void setUserData(byte[] userData)

getExitInfo

public byte[] getExitInfo()

setExitInfo

public void setExitInfo(byte[] data)

getMoreData

public boolean getMoreData()

setMoreData

public void setMoreData(boolean moreData)

getFrameBoundary

public boolean getFrameBoundary()

setFrameBoundary

public void setFrameBoundary(boolean boundary)

getTransaction

public IWTPTransaction getTransaction()

setTransaction

public void setTransaction(IWTPTransaction transaction)