net.sourceforge.jwap.wtp
Class CWTPResponder

java.lang.Object
  |
  +--net.sourceforge.jwap.wtp.CWTPResponder
All Implemented Interfaces:
IWTPTransaction

public class CWTPResponder
extends java.lang.Object
implements IWTPTransaction


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
CWTPResponder(CWTPSocket wtp_Socket, IWTPUpperLayer upper_Layer, CWTPInvoke initPDU, 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)
          RcvErrorPDU
 void setClassType(byte classType)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RCR_MAX

public static final int RCR_MAX

AEC_MAX

public static final int AEC_MAX
Constructor Detail

CWTPResponder

public CWTPResponder(CWTPSocket wtp_Socket,
                     IWTPUpperLayer upper_Layer,
                     CWTPInvoke initPDU,
                     boolean ackType,
                     byte classtype)
Constructs a CWTPSocket using a DatagramSocket (UDP). Even implementing all parameters belonging to according to TR-Invoke service primitive (section 5.3.1), which are not temporary for one transaction. This socket can be used several times by service primitives. After all it has to be closed by calling close()
Parameters:
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)
Throws:
java.lang.IllegalArgumentException -  
SocketException -  
See Also:
close(short)
Method Detail

process

public void process(CWTPPDU pdu)
             throws EWTPAbortedException
Invoked by the run()-Method of the Management-Entity CWTPManagement. Processes given protocol data units according to state machine described in section 9.5 Notice: Only WTP Initiator is implemented!
Specified by:
process in interface IWTPTransaction
Parameters:
pdu - the pdu to be processed in the state machine

process

public void process(CWTPEvent p)
             throws EWTPAbortedException
Invoked by higher layers to process given service primitives according to state machine described in section 9.5.
Notice: Only WTP Initiator is implemented!
Specified by:
process in interface IWTPTransaction
Parameters:
p - the Service Primitive to be processed

process

public void process(EWTPCorruptPDUException e)
RcvErrorPDU
Specified by:
process in interface IWTPTransaction
Parameters:
e - exception thrown by CWTPFactory

abort

public void abort()
use this method to invoke a TR-ABORT.REQ by the upper Layer
Specified by:
abort in interface IWTPTransaction

abort

public void abort(short abortReason)
use this method to invoke a TR-ABORT.REQ by the upper Layer
Specified by:
abort in interface IWTPTransaction

close

public void close(short reasonCode)
Specified by:
close in interface IWTPTransaction

getTID

public int getTID()
Specified by:
getTID in interface IWTPTransaction

setClassType

public void setClassType(byte classType)
                  throws java.lang.IllegalArgumentException
Specified by:
setClassType in interface IWTPTransaction

getClassType

public byte getClassType()
Specified by:
getClassType in interface IWTPTransaction

isAborted

public boolean isAborted()
Specified by:
isAborted in interface IWTPTransaction

getAbortCode

public short getAbortCode()
Specified by:
getAbortCode in interface IWTPTransaction