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:
- req (upper -> WTP) - Anounce a request
- ind (WTP -> upper) - Indicate a request by a remote stack
- res (upper -> WTP) - Answer a indication
- cnf (wtp -> upper) - Answer a request
The wireless transaction protocol provides the following services
according tp section 5.3 of the specification.
- TR-INVOKE - Used to initiate a new transaction (req, ind, res, cnf)
- TR-RESULT - Used to send back a result of a previously initiated transaction
- TR-ABORT - Used to abort an existing transaction.
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.
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. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
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 layerexitInfo
- 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 layertransaction
- the transaction the service primitive belongs to.type
- the type of this service primitive
(use constants defined in the class)
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)