com.softwareag.xbd.extension
Class JCOStreamService

java.lang.Object
  extended bycom.softwareag.xbd.extension.JCOStreamService
All Implemented Interfaces:
CacheController.Interface
Direct Known Subclasses:
JCOAdapter

public class JCOStreamService
extends java.lang.Object
implements CacheController.Interface

Provides a stream interface for the SAP Java Connector (JCO). As client, a XML stream can call a RFC enabled function and the result is serialised into an XML stream. As server, a XML stream is received, the stream is forwarded to HTTP POST service and the result will send back.

Version:
$Revision: 1.5 $

Field Summary
protected  CacheController handles
          Caches and controlls connection handles
protected  boolean isTracing
          Flag for next tracing
protected  Logger logger
          Writes log information to this logger;
 
Constructor Summary
JCOStreamService()
           
 
Method Summary
 java.io.InputStream call(java.lang.String connectionContext, org.w3c.dom.Document request)
           
 java.io.InputStream call(java.lang.String connectionContext, java.io.InputStream request)
           
 void call(java.lang.String connectionContext, java.io.InputStream request, java.io.OutputStream result)
           
 void closeClient(java.lang.String connectionContext)
          Close and release all connection handles from this client connectionContext.
 java.lang.String connectClient(java.lang.String client, java.lang.String userID, java.lang.String password, java.lang.String language, java.lang.String host, java.lang.String systemNumber)
           
 java.lang.String connectClientWithLoadBalancing(java.lang.String client, java.lang.String userID, java.lang.String password, java.lang.String language, java.lang.String mshost, java.lang.String r3name, java.lang.String group)
           
 java.lang.String connectServer(java.lang.String gwhost, java.lang.String gwserv, java.lang.String programID, ServerDispatcher dispatcher, java.io.InputStream repositoryInput, java.util.Properties properties)
           
protected static void doWrite(org.w3c.dom.Element node, java.io.OutputStream output)
           
protected static void doWrite(org.w3c.dom.Element node, java.io.Writer output)
           
 boolean existServer(java.lang.String connectionContext)
           
 java.io.InputStream getFunctionTemplate(java.lang.String connectionContext, java.lang.String function)
           
 void getFunctionTemplate(java.lang.String connectionContext, java.lang.String function, java.io.OutputStream result)
           
protected  void getRequestFieldsFor(com.sap.mw.jco.JCO.Function jcoFunction, org.w3c.dom.Document request, boolean importParm, boolean exportParm, boolean tableParm)
          Parses the document request, reads the parameter and fills the values into jcoFunction.
protected  void getRequestFieldsFor(com.sap.mw.jco.JCO.Function jcoFunction, java.io.InputStream request, boolean importParm, boolean exportParm, boolean tableParm)
           
protected  void getResultFor(com.sap.mw.jco.IFunctionTemplate jcoFunction, java.io.Writer writer, boolean importParm, boolean exportParm, boolean tableParm)
           
protected  void getResultFor(com.sap.mw.jco.JCO.Function jcoFunction, java.io.OutputStream output, boolean importParm, boolean exportParm, boolean tableParm)
           
protected  void getResultFor(com.sap.mw.jco.JCO.Function jcoFunction, java.io.Writer writer, boolean importParm, boolean exportParm, boolean tableParm)
           
static java.lang.String getRevision()
          Returns CVS revision.
 java.lang.String getServerConnectionContext(java.lang.String gwhost, java.lang.String gwserv, java.lang.String programID)
           
protected  boolean isElement(org.w3c.dom.Node node)
           
static void main(java.lang.String[] args)
           
 void notifyNonActivityTimeout(java.lang.Object key, java.lang.Object value)
          Notify timeouts for handles
protected  void registerFunction(com.sap.mw.jco.IRepository repository, org.w3c.dom.Element functionTemplate, boolean unicode)
           
 void registerFunction(java.lang.String connectionContext, java.io.InputStream request, boolean unicode)
           
protected  void registerParameter(com.sap.mw.jco.IRepository repository, org.w3c.dom.Element param, com.sap.mw.jco.JCO.MetaData fmeta, boolean unicode)
           
 void resetClientRepository(java.lang.String connectionContext)
           
protected  void resetRepository(com.sap.mw.jco.IRepository repository)
           
 void setTrace(boolean value)
          Set trace or stop trace for next connect request.
 void setTraceDirectory(java.lang.String directory)
          Set the target directory for trace files.
 void startServer(java.lang.String connectionContext, int workers)
           
 void stopServer(java.lang.String connectionContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

handles

protected CacheController handles
Caches and controlls connection handles


isTracing

protected boolean isTracing
Flag for next tracing


logger

protected Logger logger
Writes log information to this logger;

Constructor Detail

JCOStreamService

public JCOStreamService()
Method Detail

getRevision

public static java.lang.String getRevision()
Returns CVS revision.

Returns:
CVS revision as string

connectClient

public java.lang.String connectClient(java.lang.String client,
                                      java.lang.String userID,
                                      java.lang.String password,
                                      java.lang.String language,
                                      java.lang.String host,
                                      java.lang.String systemNumber)
                               throws java.lang.Throwable
Throws:
java.lang.Throwable

connectClientWithLoadBalancing

public java.lang.String connectClientWithLoadBalancing(java.lang.String client,
                                                       java.lang.String userID,
                                                       java.lang.String password,
                                                       java.lang.String language,
                                                       java.lang.String mshost,
                                                       java.lang.String r3name,
                                                       java.lang.String group)
                                                throws java.lang.Throwable
Throws:
java.lang.Throwable

call

public void call(java.lang.String connectionContext,
                 java.io.InputStream request,
                 java.io.OutputStream result)
          throws java.lang.Throwable
Throws:
java.lang.Throwable

call

public java.io.InputStream call(java.lang.String connectionContext,
                                java.io.InputStream request)
                         throws java.lang.Throwable
Throws:
java.lang.Throwable

call

public java.io.InputStream call(java.lang.String connectionContext,
                                org.w3c.dom.Document request)
                         throws java.lang.Throwable
Throws:
java.lang.Throwable

closeClient

public void closeClient(java.lang.String connectionContext)
Close and release all connection handles from this client connectionContext.

Parameters:
connectionContext -

getFunctionTemplate

public java.io.InputStream getFunctionTemplate(java.lang.String connectionContext,
                                               java.lang.String function)
                                        throws java.lang.Throwable
Throws:
java.lang.Throwable

getFunctionTemplate

public void getFunctionTemplate(java.lang.String connectionContext,
                                java.lang.String function,
                                java.io.OutputStream result)
                         throws java.lang.Throwable
Throws:
java.lang.Throwable

getResultFor

protected void getResultFor(com.sap.mw.jco.JCO.Function jcoFunction,
                            java.io.OutputStream output,
                            boolean importParm,
                            boolean exportParm,
                            boolean tableParm)
                     throws java.lang.Throwable
Throws:
java.lang.Throwable

getResultFor

protected void getResultFor(com.sap.mw.jco.JCO.Function jcoFunction,
                            java.io.Writer writer,
                            boolean importParm,
                            boolean exportParm,
                            boolean tableParm)
                     throws java.lang.Throwable
Throws:
java.lang.Throwable

getResultFor

protected void getResultFor(com.sap.mw.jco.IFunctionTemplate jcoFunction,
                            java.io.Writer writer,
                            boolean importParm,
                            boolean exportParm,
                            boolean tableParm)
                     throws java.lang.Throwable
Throws:
java.lang.Throwable

getRequestFieldsFor

protected void getRequestFieldsFor(com.sap.mw.jco.JCO.Function jcoFunction,
                                   java.io.InputStream request,
                                   boolean importParm,
                                   boolean exportParm,
                                   boolean tableParm)
                            throws java.lang.Throwable
Throws:
java.lang.Throwable

getRequestFieldsFor

protected void getRequestFieldsFor(com.sap.mw.jco.JCO.Function jcoFunction,
                                   org.w3c.dom.Document request,
                                   boolean importParm,
                                   boolean exportParm,
                                   boolean tableParm)
                            throws java.lang.Throwable
Parses the document request, reads the parameter and fills the values into jcoFunction.

Parameters:
jcoFunction - Fill with parameter values
request - Source document
Throws:
java.lang.Throwable

doWrite

protected static void doWrite(org.w3c.dom.Element node,
                              java.io.OutputStream output)
                       throws java.io.IOException
Throws:
java.io.IOException

doWrite

protected static void doWrite(org.w3c.dom.Element node,
                              java.io.Writer output)
                       throws java.io.IOException
Throws:
java.io.IOException

registerFunction

public void registerFunction(java.lang.String connectionContext,
                             java.io.InputStream request,
                             boolean unicode)
                      throws java.lang.Throwable
Throws:
java.lang.Throwable

registerFunction

protected void registerFunction(com.sap.mw.jco.IRepository repository,
                                org.w3c.dom.Element functionTemplate,
                                boolean unicode)
                         throws java.lang.Throwable
Throws:
java.lang.Throwable

isElement

protected boolean isElement(org.w3c.dom.Node node)

registerParameter

protected void registerParameter(com.sap.mw.jco.IRepository repository,
                                 org.w3c.dom.Element param,
                                 com.sap.mw.jco.JCO.MetaData fmeta,
                                 boolean unicode)
                          throws java.lang.Throwable
Throws:
java.lang.Throwable

connectServer

public java.lang.String connectServer(java.lang.String gwhost,
                                      java.lang.String gwserv,
                                      java.lang.String programID,
                                      ServerDispatcher dispatcher,
                                      java.io.InputStream repositoryInput,
                                      java.util.Properties properties)
                               throws java.lang.Throwable
Throws:
java.lang.Throwable

startServer

public void startServer(java.lang.String connectionContext,
                        int workers)
                 throws java.lang.Throwable
Throws:
java.lang.Throwable

stopServer

public void stopServer(java.lang.String connectionContext)
                throws java.lang.Throwable
Throws:
java.lang.Throwable

getServerConnectionContext

public java.lang.String getServerConnectionContext(java.lang.String gwhost,
                                                   java.lang.String gwserv,
                                                   java.lang.String programID)

existServer

public boolean existServer(java.lang.String connectionContext)

setTrace

public void setTrace(boolean value)
Set trace or stop trace for next connect request.

Parameters:
value - Set trace option

setTraceDirectory

public void setTraceDirectory(java.lang.String directory)
Set the target directory for trace files.

Parameters:
directory - Name

notifyNonActivityTimeout

public void notifyNonActivityTimeout(java.lang.Object key,
                                     java.lang.Object value)
Notify timeouts for handles

Specified by:
notifyNonActivityTimeout in interface CacheController.Interface
Parameters:
key -
value -

resetClientRepository

public void resetClientRepository(java.lang.String connectionContext)
                           throws java.lang.Throwable
Throws:
java.lang.Throwable

resetRepository

protected void resetRepository(com.sap.mw.jco.IRepository repository)

main

public static void main(java.lang.String[] args)
                 throws java.lang.Throwable
Throws:
java.lang.Throwable


Copyright © 2004-2007 Software AG. All Rights Reserved.