|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.cbse.jeasy.JEHttpClient
public class JEHttpClient
The JEHttpClient is the client component of the communication with the servlet JEHttpConnector.
This communication always calls a given method at the server with one parameter.
This parameter is an XML structure holding all data used for the method.
To transfer binary data you may define an attachment.
Crypting and compressing data is configurable at the server.
| Field Summary | |
|---|---|
(package private) boolean |
attachFlag
|
(package private) boolean |
compress
|
(package private) boolean |
compressFlag
|
(package private) boolean |
continuedFlag
|
(package private) boolean |
crypt
|
(package private) boolean |
cryptFlag
|
(package private) javax.crypto.Cipher |
dc
|
(package private) javax.crypto.Cipher |
ec
|
(package private) java.lang.Object |
httpConnector
|
(package private) java.lang.StringBuffer |
httpSb
|
(package private) java.io.InputStream |
in
|
(package private) JECallBack |
jeClient
|
(package private) java.security.Key |
k
|
(package private) java.lang.String |
methodName
|
(package private) java.io.OutputStream |
os
|
(package private) java.lang.String |
request
|
(package private) java.lang.String |
service
|
(package private) java.lang.String |
session
|
(package private) boolean |
simulate
|
(package private) java.lang.String |
surl
|
(package private) java.lang.String |
sXml
|
(package private) java.net.URL |
url
|
| Constructor Summary | |
|---|---|
JEHttpClient()
|
|
| Method Summary | |
|---|---|
java.lang.String |
callAndWait()
Use this method to call the server and wait for a return. |
java.lang.String |
getSessionId()
Gets the sessionId created by calling setSession();. |
java.net.URL |
getURL()
Gets the URL of the server. |
boolean |
isAlive()
Test if the session to to server is just alive. |
void |
run()
When running as a thread this method is called when the client starts the thread. |
java.lang.String |
sendAttachment(java.lang.String name,
java.io.ByteArrayOutputStream baos)
Transfers bytes out of an ByteArrayOutputStream to the server and calls the service. |
java.lang.String |
sendAttachment(java.lang.String fileName,
java.io.InputStream attachment)
Transfers byte out of an InputStream to the server and calls the service Use this method to call the server and wait for a return. |
void |
setParameters(JECallBack o,
java.lang.String service,
java.lang.String sXml)
Because the JEHttpClient may be run as a thread, the parameters are to be set here. |
void |
setParameters(JECallBack o,
java.lang.String service,
java.lang.String sXml,
java.io.OutputStream os)
Because the JEHttpClient is running as a thread, the parameters are to be set here. |
boolean |
setSession(boolean b)
If b is true the method requests a session id from the JEHttpConnector, who will instantiate a JEDispatcher object at the server. |
void |
setSimulate(boolean simulate)
Simulates the connection to JEHttpConnector by instantiating a local JEHttpConnector. |
void |
setSimulateParams(java.lang.String JEHttpConnectorClass,
java.lang.String JEDispatcherClass,
java.lang.String property)
Sets the parameters for the server classes for simulation. |
void |
setURL(java.lang.String URL)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
java.lang.String methodName
java.lang.String service
java.lang.String sXml
java.lang.String surl
java.lang.String request
java.io.OutputStream os
java.io.InputStream in
java.net.URL url
JECallBack jeClient
java.lang.String session
boolean simulate
java.lang.Object httpConnector
java.lang.StringBuffer httpSb
boolean compress
boolean crypt
boolean compressFlag
boolean cryptFlag
boolean attachFlag
boolean continuedFlag
javax.crypto.Cipher ec
javax.crypto.Cipher dc
java.security.Key k
| Constructor Detail |
|---|
public JEHttpClient()
| Method Detail |
|---|
public void setURL(java.lang.String URL)
URL - public void setSimulate(boolean simulate)
simulate -
public void setSimulateParams(java.lang.String JEHttpConnectorClass,
java.lang.String JEDispatcherClass,
java.lang.String property)
JEHttpConnectorClass - JEDispatcherClass - property - public java.net.URL getURL()
public void setParameters(JECallBack o,
java.lang.String service,
java.lang.String sXml)
o - the JECallBack object (your JEasy client class) who's
callBackInvoke method is called with the return string of the
JEDispatcherservice - the service id the JEDispatcher performs. In general it is a
method of JEDispatcher.sXml - an XML string holding all parameters you need for this
service. The JEDispatcher has to read XML and has to know
about the tagnames
public void setParameters(JECallBack o,
java.lang.String service,
java.lang.String sXml,
java.io.OutputStream os)
o - the JECallBack object (your JEasy client class) who's
callBackInvoke method is called with the return string of the
JEDispatcherservice - the service id the JEDispatcher performs. In general it is a
method of JEDispatcher.sXml - an XML string holding all parameters you need for this
service. The JEDispatcher has to read XML and has to know
about the tagnamesos - OutputStream to receive the attachmentpublic boolean isAlive()
public boolean setSession(boolean b)
b -
public void run()
run in interface java.lang.Runnable
public java.lang.String callAndWait()
throws java.lang.Exception
java.lang.Exception
public java.lang.String sendAttachment(java.lang.String fileName,
java.io.InputStream attachment)
throws java.lang.Exception
fileName - attachment -
java.lang.Exception
public java.lang.String sendAttachment(java.lang.String name,
java.io.ByteArrayOutputStream baos)
throws java.lang.Exception
name - name to store at the serverbaos -
java.lang.Exceptionpublic java.lang.String getSessionId()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||