|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sourceforge.jwap.wsp.CWSPSession
This class implements the WSP state machine named "management entity"
in the Wireless Session Protocol Specification by the WAP-forum.
Using this class the programmer can use all methods of the WSP layer.
To use the WAP-Stack with a class corresponding to HttpURLConnection
please use WapURLConnection by calling
URL example = new URL("wap://wap.nokia.com");
URLConnection con = example.getConnection();
Field Summary | |
static short |
ABORT_CONGESTION
|
static short |
ABORT_CONNECTERR
|
static short |
ABORT_DISCONNECT
|
static short |
ABORT_MOREXCEEDED
|
static short |
ABORT_MRUEXCEEDED
|
static short |
ABORT_NETERR
|
static short |
ABORT_PEERREQ
|
static short |
ABORT_PROTOERR
|
static short |
ABORT_RESUME
|
static short |
ABORT_SUSPEND
|
static short |
ABORT_USERDCR
|
static short |
ABORT_USERDCU
|
static short |
ABORT_USERPND
|
static short |
ABORT_USERREQ
|
static short |
ABORT_USERRFS
|
static short |
STATE_CONNECTED
|
static short |
STATE_CONNECTING
|
static short |
STATE_NULL
|
static short |
STATE_RESUMING
|
static short |
STATE_SUSPENDED
|
java.lang.String[] |
states
|
Constructor Summary | |
CWSPSession(CWSPSocketAddress address,
CWSPSocketAddress localAddress,
IWSPUpperLayer upperLayer,
boolean verbose)
Construct a new WSP session. |
|
CWSPSession(CWSPSocketAddress address,
IWSPUpperLayer upperLayer,
boolean verbose)
Construct a new WSP session. |
|
CWSPSession(java.net.InetAddress toAddress,
int toPort,
java.net.InetAddress localAddress,
int localPort,
IWSPUpperLayer upperLayer,
boolean verbose)
Construct a new WSP Session. |
|
CWSPSession(java.net.InetAddress toAddress,
int toPort,
IWSPUpperLayer upperLayer)
Construct a new WSP session. |
|
CWSPSession(java.net.InetAddress toAddress,
int toPort,
IWSPUpperLayer upperLayer,
boolean verbose)
Construct a new WSP Session. |
Method Summary | |
void |
disconnect()
|
short |
getDisconnectCode()
|
int |
getMRU()
|
long |
getSessionID()
|
short |
getState()
|
short |
getSuspendedCode()
|
CWTPSocket |
getWTPSocket()
|
boolean |
isDisonnected()
|
boolean |
isSuspended()
|
void |
removeMethod(CWSPMethodManager m)
|
void |
s_connect()
Establish a WSP connection. |
void |
s_connect(CWSPHeaders headers)
Establish a WSP connection using WSP headers |
void |
s_disconnect()
S-Disconnect.req |
CWSPMethodManager |
s_get(CWSPHeaders headers,
java.lang.String uri)
Use this method to construct a GET-MethodInvoke.req. |
CWSPMethodManager |
s_get(java.lang.String uri)
Use this method to construct a GET-MethodInvoke.req. |
CWSPMethodManager |
s_methodInvoke(CWSPPDU pdu)
S-MethodInvoke.req To construct a POST- or GET-Request please use get(String uri) or
post(byte[] data, String contentType)
instead of this method. |
CWSPMethodManager |
s_post(byte[] data,
java.lang.String contentType,
java.lang.String uri)
Use this method to construct a POST-MethodInvoke.req. |
CWSPMethodManager |
s_post(CWSPHeaders headers,
byte[] data,
java.lang.String contentType,
java.lang.String uri)
Use this method to construct a POST-MethodInvoke.req. |
void |
s_resume()
S-Resume.req |
boolean |
s_suspend()
S-Suspend.req |
void |
suspend()
|
void |
tr_abort(short abortReason)
TR-Abort.ind |
void |
tr_process(CWTPEvent p)
process all TR-*.ind and TR-*.cnf service primitives except TR-Abort (call tr-abort(short abortReason) to indicate a Abort by TR). |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final short STATE_NULL
public static final short STATE_CONNECTING
public static final short STATE_CONNECTED
public static final short STATE_SUSPENDED
public static final short STATE_RESUMING
public static final short ABORT_PROTOERR
public static final short ABORT_DISCONNECT
public static final short ABORT_SUSPEND
public static final short ABORT_RESUME
public static final short ABORT_CONGESTION
public static final short ABORT_CONNECTERR
public static final short ABORT_MRUEXCEEDED
public static final short ABORT_MOREXCEEDED
public static final short ABORT_PEERREQ
public static final short ABORT_NETERR
public static final short ABORT_USERREQ
public static final short ABORT_USERRFS
public static final short ABORT_USERPND
public static final short ABORT_USERDCR
public static final short ABORT_USERDCU
public java.lang.String[] states
Constructor Detail |
public CWSPSession(java.net.InetAddress toAddress, int toPort, IWSPUpperLayer upperLayer, boolean verbose) throws java.net.SocketException
toAddress
- address of the WAP gatewaytoPort
- WAP gateway portupperLayer
- WSP Upper Layerverbose
- verbose loggingjava.net.SocketException
- if the underlying WTP socket cannot be createdpublic CWSPSession(java.net.InetAddress toAddress, int toPort, java.net.InetAddress localAddress, int localPort, IWSPUpperLayer upperLayer, boolean verbose) throws java.net.SocketException
toAddress
- address of the WAP gatewaytoPort
- WAP gateway portlocalAddress
- local address to bind to (null to let the OS decide)localPort
- local port to bind to (use 0 to let the OS pick a free port)upperLayer
- WSP Upper Layerverbose
- verbose loggingjava.net.SocketException
- if the underlying WTP socket cannot be createdpublic CWSPSession(java.net.InetAddress toAddress, int toPort, IWSPUpperLayer upperLayer) throws java.net.SocketException
toAddress
- the address of the WAP gatewaytoPort
- WAP gateway portupperLayer
- WSP Upper Layerjava.net.SocketException
- if the underlying WTP socket cannot be createdpublic CWSPSession(CWSPSocketAddress address, IWSPUpperLayer upperLayer, boolean verbose) throws java.net.SocketException
toAddress
- the address and port of the WAP gatewayupperLayer
- WSP Upper Layerverbose
- verbose loggingjava.net.SocketException
- if the underlying WTP socket cannot be createdpublic CWSPSession(CWSPSocketAddress address, CWSPSocketAddress localAddress, IWSPUpperLayer upperLayer, boolean verbose) throws java.net.SocketException
address
- the address and port of the WAP gatewaylocalAddress
- the local address and port or nullupperLayer
- WSP Upper Layerverbose
- verbose loggingjava.net.SocketException
- if the underlying WTP socket cannot be createdMethod Detail |
public void s_connect()
public void s_connect(CWSPHeaders headers)
headers
- the WSP headers to set or nullpublic void s_disconnect()
public boolean s_suspend()
public void s_resume() throws java.net.SocketException
public CWSPMethodManager s_post(byte[] data, java.lang.String contentType, java.lang.String uri)
methodInvoke(CWSPPDU pdu)
to send the constructed WSP-POST-PDU.data
- The data to be POSTedcontentType
- The MIME-ContentType of the data to be POSTedpublic CWSPMethodManager s_post(CWSPHeaders headers, byte[] data, java.lang.String contentType, java.lang.String uri)
methodInvoke(CWSPPDU pdu)
to send the constructed WSP-POST-PDU.headers
- The headers defined for the requestdata
- The data to be POSTedcontentType
- The MIME-ContentType of the data to be POSTeduri
- the target URI to post topublic CWSPMethodManager s_get(java.lang.String uri)
methodInvoke(CWSPPDU pdu)
to send the constructed WSP-GET-PDU.uri
- The Unfied Resource Identifier of the resource to GETpublic CWSPMethodManager s_get(CWSPHeaders headers, java.lang.String uri)
methodInvoke(CWSPPDU pdu)
to send the constructed WSP-GET-PDU.headers
- The headers that are defined for the requesturi
- The Unfied Resource Identifier of the resource to GETpublic CWSPMethodManager s_methodInvoke(CWSPPDU pdu)
get(String uri)
or
post(byte[] data, String contentType)
instead of this method.pdu
- The GET- or POST-PDU to be sent.public void removeMethod(CWSPMethodManager m)
public void tr_process(CWTPEvent p)
tr_process
in interface IWTPUpperLayer
p
- The WTP Service primitivepublic void tr_abort(short abortReason)
tr_abort
in interface IWTPUpperLayer
abortReason
- The abort reasonpublic void disconnect()
public void suspend()
public short getState()
public long getSessionID()
public int getMRU()
public boolean isSuspended()
public short getSuspendedCode()
public boolean isDisonnected()
public short getDisconnectCode()
public CWTPSocket getWTPSocket()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |