|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sourceforge.jwap.wtp.CWTPInitiator
This class implements a WTP state machine of one transaction according to the WTP specification by the WAP Forum. It uses CWTPManagement to send the PDUs. CWTPManagement receives PDUs from the remote, decodes them and calls #process(CWTPPDU pdu) of the corresponding tranaction (this class).
To be informed of thrown service primitives by this layer, you should implement the interface IWTPUpperLayer and give it with the constructor.
To construct a service primitive to be processed by this WTP-socket, use objects of the class CWTPEvent, that implement service primitives.
To Use a whole WAP Stack besides you need the WSP layer, implemented in package mmsjua.wap.wsp.
Notice, that development is actually in progress. Most features are implemented but only for Initiator, not for a responder! (for a definition of these terms refer to the spec, section 3.2.)
Section descriptions used in this class refer to WTP Specification WAP-224-WTP-20010710-a by the WAP Forum
Field Summary | |
static int |
AEC_MAX
|
static int |
RCR_MAX
|
Fields inherited from interface net.sourceforge.jwap.wtp.IWTPTransaction |
CLASS_TYPE_0, CLASS_TYPE_1, CLASS_TYPE_2 |
Constructor Summary | |
CWTPInitiator(CWTPSocket wtp_Socket,
IWTPUpperLayer upper_Layer,
CWTPEvent initPacket,
boolean ackType,
byte classType)
Constructs a CWTPSocket using a DatagramSocket (UDP). |
Method Summary | |
void |
abort()
use this method to invoke a TR-ABORT.REQ by the upper Layer |
void |
abort(short abortReason)
use this method to invoke a TR-ABORT.REQ by the upper Layer |
void |
close(short reasonCode)
|
short |
getAbortCode()
|
byte |
getClassType()
|
int |
getTID()
|
boolean |
isAborted()
|
void |
process(CWTPEvent p)
Invoked by higher layers to process given service primitives according to state machine described in section 9.5. Notice: Only WTP Initiator is implemented! |
void |
process(CWTPPDU pdu)
Invoked by the run()-Method of the Management-Entity CWTPManagement. |
void |
process(EWTPCorruptPDUException e)
|
void |
setClassType(byte classType)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int RCR_MAX
public static final int AEC_MAX
Constructor Detail |
public CWTPInitiator(CWTPSocket wtp_Socket, IWTPUpperLayer upper_Layer, CWTPEvent initPacket, boolean ackType, byte classType)
close()
to
- destination address (section 5.3.1.3)port
- destination port (section 5.3.1.4)ackType
- Ack Type (section 5.3.1.5)classType
- Class Type (0, 1 or 2) (section 5.3.1.8)java.lang.IllegalArgumentException
- SocketException
- close(short)
Method Detail |
public void process(CWTPPDU pdu) throws EWTPAbortedException
process
in interface IWTPTransaction
pdu
- the pdu to be processed in the state machinepublic void process(CWTPEvent p) throws EWTPAbortedException
process
in interface IWTPTransaction
p
- the Service Primitive to be processedpublic void process(EWTPCorruptPDUException e)
process
in interface IWTPTransaction
public void abort()
abort
in interface IWTPTransaction
public void abort(short abortReason)
abort
in interface IWTPTransaction
public void close(short reasonCode)
close
in interface IWTPTransaction
public int getTID()
getTID
in interface IWTPTransaction
public void setClassType(byte classType) throws java.lang.IllegalArgumentException
setClassType
in interface IWTPTransaction
public byte getClassType()
getClassType
in interface IWTPTransaction
public boolean isAborted()
isAborted
in interface IWTPTransaction
public short getAbortCode()
getAbortCode
in interface IWTPTransaction
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |