public class Context extends BaseContext
Provides session management (with pinger), applet support, and threadedInvokes.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONTENT_TYPE_HTML |
static int |
CONTXT0003 |
static int |
CONTXT0004 |
static int |
CONTXT0005 |
static int |
CONTXT0006 |
static int |
CONTXT0007 |
static int |
CONTXT0008 |
static int |
CONTXT0009 |
static int |
DISCONNECT_MSG |
static java.lang.String |
HTTP_HEADER_CONTENT_TYPE |
static int |
HTTP_OK_RESPONSE_CODE |
static int |
PING_FAILED_MSG |
static int |
PING_SERVER_MSG |
static int |
TIME_OUT_MSG |
static int |
TRY_PING_MSG |
static int |
UNKNOWN_HOST_MSG |
static int |
UNNOWN_PARTNER_MSG |
Constructor and Description |
---|
Context()
Create a new unconnected Client Context and default to a binary
RPC transport.
|
Context(java.applet.Applet a)
Create a new Client Context and specify that the client is
running as an Applet.
|
Context(int rpcType)
Create a new unconnected Client Context utilizing the specified
RPC type.
|
Context(int rpcType,
Values context) |
Context(Values context) |
Modifier and Type | Method and Description |
---|---|
void |
appletSetup(java.applet.Applet a) |
void |
cleanUpConnection()
Cleanup when a connection has been lost.
|
void |
connect(java.lang.String server)
Connects this Context to an Integration Server and establishes session
state on the server.
|
void |
connect(java.lang.String server,
byte[] certificate)
Connects the Context to a Integration Server and establishes session
state on the server.
|
void |
connect(java.lang.String host,
int port,
java.lang.String user,
java.lang.String pass)
Connects the Context to an Integration Server and establishes session
state on the server.
|
void |
connect(java.lang.String server,
java.lang.String user,
java.lang.String pass)
Connects the Context to an Integration Server and establishes session
state on the server.
|
void |
disconnect()
Disconnects the Context and flushes session state on the Server.
|
void |
disconnect(Values in)
Disconnects the Context and flushes session state on the Server.
|
void |
fakeConnect() |
java.util.Hashtable<java.lang.String,java.lang.String> |
getCookies()
Returns the values of the Set-Cookie headers from the previous response.
|
java.lang.String[] |
getCookiesAsArray()
Returns the values of the Set-Cookie headers from the previous response in an array of Strings.
|
Namespace |
getNamespace() |
Query |
getQuery() |
IData |
invoke(NSName svcName,
IData data) |
Values |
invoke(NSName svcName,
Values data)
Makes a call to the Integration Server to invoke the specified
functionality.
|
IData |
invoke(java.lang.String ifc,
java.lang.String svc,
IData data) |
IData |
invoke(java.lang.String ifc,
java.lang.String svc,
IData data,
boolean isConnect) |
Values |
invoke(java.lang.String ifc,
java.lang.String svc,
Values data)
Makes a call to the Integration Server to invoke the specified
functionality.
|
Values |
invoke(java.lang.String ifc,
java.lang.String svc,
Values data,
boolean isConnect) |
InvokeThread |
invokeThreaded(NSName svcName,
Values data)
Calls invoke asynchronously and returns an InvokeThread.
|
InvokeThread |
invokeThreaded(java.lang.String ifc,
java.lang.String svc,
Values data)
Calls invoke asynchronously and returns an InvokeThread.
|
void |
setCookie(java.lang.String cookie)
Sets the HTTP cookie to be used with the next service invocation.
|
getSSLSupport, isClusteredEnv, isConnected, isSecure, isUseJSSE, setAllowRedir, setAuthentication, setFixedUri, setProxy, setRetryServer, setSecure, setSecureProxy, setSSLCertificates, setSSLCertificates, setSSLCertificates, setUseJSSE
public static final int PING_FAILED_MSG
public static final int PING_SERVER_MSG
public static final int UNKNOWN_HOST_MSG
public static final int UNNOWN_PARTNER_MSG
public static final int DISCONNECT_MSG
public static final int TIME_OUT_MSG
public static final int TRY_PING_MSG
public static final int CONTXT0003
public static final int CONTXT0004
public static final int CONTXT0005
public static final int CONTXT0006
public static final int CONTXT0007
public static final int CONTXT0008
public static final int CONTXT0009
public static final int HTTP_OK_RESPONSE_CODE
public static final java.lang.String HTTP_HEADER_CONTENT_TYPE
public static final java.lang.String CONTENT_TYPE_HTML
public Context(Values context)
public Context(int rpcType, Values context)
public Context()
public Context(int rpcType)
rpcType
- RPC type to use.public Context(java.applet.Applet a) throws ServiceException
Valid <PARAM> attributes are:
SERVER | Server endpoint in the form host:port | |
---|---|---|
SERVERUSER | User to log in as | |
SERVERPASS | User's password | |
SECURE | Boolean to select SSL or not. Values: true or false | |
DEBUG | Set debug level. Values: 0-10 | |
FIXEDURI | For running clients that access Integration servers through web servers with the CGI-gateway |
ServiceException
public final void appletSetup(java.applet.Applet a) throws ServiceException
ServiceException
public Namespace getNamespace()
public Query getQuery()
public void fakeConnect()
public InvokeThread invokeThreaded(NSName svcName, Values data)
svcName
- Service namespace namedata
- input data for the service invocationinvoke
public InvokeThread invokeThreaded(java.lang.String ifc, java.lang.String svc, Values data)
ifc
- Interface name of the service to invokesvc
- service to invokedata
- input data for the service invocationinvoke
public Values invoke(NSName svcName, Values data) throws ServiceException
svcName
- Service Namespace Namedata
- Service input dataServiceException
public IData invoke(NSName svcName, IData data) throws ServiceException
ServiceException
public Values invoke(java.lang.String ifc, java.lang.String svc, Values data) throws ServiceException
ifc
- Target Interfacesvc
- Target Servicedata
- Service input dataServiceException
public IData invoke(java.lang.String ifc, java.lang.String svc, IData data) throws ServiceException
ServiceException
public void connect(java.lang.String host, int port, java.lang.String user, java.lang.String pass) throws ServiceException
host
- hostName of Server endpoint.port
- part of Server endpoint
--=* optional parameters *=--user
- User to connect aspass
- User's passwordServiceException
public final void connect(java.lang.String server, java.lang.String user, java.lang.String pass) throws ServiceException
server
- Server endpoint in the form: host:port
--=* optional parameters *=--user
- User to connect aspass
- User's passwordServiceException
public void connect(java.lang.String server) throws ServiceException
server
- Server endpoint in the form: host:portServiceException
public void connect(java.lang.String server, byte[] certificate) throws ServiceException
server
- Server endpoint in the form: host:portcertificate
- byte image of X.509 certificate to submitServiceException
public void disconnect(Values in)
public void disconnect()
public java.util.Hashtable<java.lang.String,java.lang.String> getCookies()
public java.lang.String[] getCookiesAsArray()
public void setCookie(java.lang.String cookie)
If a response contains a Set-Cookie header field and you want to set the cookie in the next invoke to that entire value, you can use getCookieAsArray and setCookie:
String[] cookies = context.getCookiesAsarray(); StringBuilder cookie = new StringBuilder(); for (String cookieVal : cookies) { cookie.append(cookieVal); cookie.append("; "); } cookie.setLength(cookie.getLength()-2); // remove trailing "; " context.setCookie(cookie.toString());
cookie
- The value of the Cookie header to be used in the next service invocation.public void cleanUpConnection()
public Values invoke(java.lang.String ifc, java.lang.String svc, Values data, boolean isConnect) throws ServiceException
ServiceException
public IData invoke(java.lang.String ifc, java.lang.String svc, IData data, boolean isConnect) throws ServiceException
ServiceException