com.sap.mw.jco

Class JCO.Client

java.lang.Object
  extended bycom.sap.mw.jco.JCO.Connection
      extended bycom.sap.mw.jco.JCO.Client
All Implemented Interfaces:
Cloneable
Enclosing class:
JCO

public static class JCO.Client
extends JCO.Connection

This object holds all information necessary to establish a connection to a remote JCO server, i.e. either a SAP system or an external JCO compliant server, respectively.


Field Summary
protected static JCO.MetaData auth_trace_set
           
protected static JCO.MetaData auth_trace_set_unicode
           
protected static JCO.MetaData auth_trace_status
           
protected static JCO.MetaData auth_trace_status_rc
           
protected static JCO.MetaData auth_trace_status_rc_unicode
           
protected static JCO.MetaData auth_trace_status_unicode
           
protected  com.sap.mw.jco.IMiddleware.IClient middleware
           
protected  String stack_trace
           
 
Fields inherited from class com.sap.mw.jco.JCO.Connection
attributes, codepage_converter, conn_object, conn_params, connection_cpc_mode, dsr_monitor, jarm_monitor, last_active_timestamp, num_received_bytes, num_sent_bytes, passport_bytes, pool, properties, rfc_handle, rfm_name, start_time, state, throughput, time_handle_request, time_middleware, time_total
 
Constructor Summary
protected JCO.Client(Properties properties)
          Creates an instance of a client connection to a remote SAP system
protected JCO.Client(String[][] params)
          Creates an instance of a client to a remote SAP system using an array to specify the connection parameters.
protected JCO.Client(String gwhost, String gwserv, String tpname)
          Creates an instance of a client connection to a remote JCO compliant server program
protected JCO.Client(String gwhost, String gwserv, String tpname, String tphost)
          Creates an instance of a client connection to a remote JCO compliant server program
protected JCO.Client(String client, String user, String passwd, String lang, String url)
          Creates an instance of a client connection to a remote SAP system
protected JCO.Client(String client, String user, String passwd, String lang, String ashost, String sysnr)
          Creates an instance of a client connection to a remote SAP system (no load balancing)
protected JCO.Client(String client, String user, String passwd, String lang, String mshost, String r3name, String group)
          Creates an instance of a client connection to a remote SAP system (with load balancing)
protected JCO.Client(String client, String user, String passwd, String lang, String ashost, String sysnr, String gwhost, String gwserv)
          Creates an instance of a client connection to a remote SAP system (no load balancing)
 
Method Summary
 void abort(String message)
          Aborts the connection to the remote system, i.e.
protected  void beginCall()
          Notify about begin of call processing
 Object clone()
          Returns a clone of this connection The cloned connection however will not be opened
 void confirmTID(String tid)
          Confirms that a transaction has been successfull
 void connect()
          Opens a client connection to the remote system using the current connection parameters
 String createTID()
          Creates a new transaction ID
 void disconnect()
          Closes the connection to the remote system.
protected  void disconnect(boolean is_pooled)
          Closes the connection to the remote system.
 void endAuthorizationTracing()
          Resets authorization tracing in the SAP system for this client.
protected  void endCall()
          Notify about end of call processing
 void execute(JCO.Function function)
          Executes the function on the remote server synchronously
 void execute(JCO.Function function, String tid)
          Executes the function on the remote server in transactional mode (asynchronously)
 void execute(JCO.Function function, String tid, String queue_name)
          Executes the function on the remote server in queued transactional mode (asynchronously)
 void execute(JCO.Function function, String tid, String queue_name, int queue_pos)
          Executes the function on the remote server in transactional mode (asynchronously)
 JCO.Response execute(JCO.Request request)
          Executes the request on the remote server synchronously
 void execute(JCO.Request request, String tid)
          Executes the request on the remote server asynchronously
 void execute(JCO.Request request, String tid, String queue_name)
          Executes the request on the remote server asynchronously
 void execute(JCO.Request request, String tid, String queue_name, int queue_pos)
          Executes the request on the remote server asynchronously
protected  JCO.Response execute(JCO.Request request, String tid, String queue_name, int queue_pos, int dummy)
          Executes the request on the remote server synchronously
 void execute(String name, JCO.ParameterList input, JCO.ParameterList output)
          Executes the function on the remote server synchronously
 void execute(String name, JCO.ParameterList input, JCO.ParameterList output, JCO.ParameterList tables)
          Executes the function on the remote server synchronously
protected  void execute(String name, JCO.ParameterList input, JCO.ParameterList input_tables, JCO.ParameterList output, JCO.ParameterList output_tables, String tid, String queue_name, int queue_pos)
          Executes the function on the remote server synchronously
 void execute(String name, JCO.ParameterList input, JCO.ParameterList tables, String tid)
          Executes the function on the remote server in transactional mode (asynchronously)
 void execute(String name, JCO.ParameterList input, JCO.ParameterList tables, String tid, String queue_name)
          Executes the function on the remote server in queued transactional mode (asynchronously)
 void execute(String name, JCO.ParameterList input, JCO.ParameterList tables, String tid, String queue_name, int queue_pos)
          Executes the function on the remote server in transactional mode (asynchronously)
protected  void finalize()
          Overrides the finalize method in Connection Called upon garbage collection
 boolean getAbapDebug()
          Returns whether debugging is enabled or not.
 String getASHost()
          Returns the application server
 JCO.Attributes getAttributes()
          Returns the attributes object for this connection.
 String getAuthorizationTraceID()
          Returns the currently used authorization trace ID for this client.
 String getClient()
          Returns the client
protected static com.sap.mw.jco.IMiddleware.IClient getClientInterface()
          Creates a new middleware object
 String getGroup()
          Returns the group of application servers
 String getGWHost()
          Returns the gateway server
 String getGWServ()
          Returns the gateway service
 String getHashKey(boolean personalized)
          Returns a hash key for this client connection
 String getLanguage()
          Returns the logon language
 String getMSHost()
          Returns the message server
protected  String getPassword()
          Returns the encrypted password
 String[][] getPropertyInfo()
          Returns the property info for the connection
 int getSapGui()
          Returns if a SAP GUI is being used during a call
 byte getState()
          Returns the state of the client as a bit vector
 String getSystemID()
          Returns the SAP system ID
 String getSystemNumber()
          Returns the system number
 String getTPName()
          Returns the program ID of an registered JCO compliant server program
 boolean getTrace()
          Returns whether trace is enabled or not.
 URL getURL()
          Returns the url to the remote system
 String getUser()
          Returns the user
protected  JCO.Client hide()
          Hide the client from application to avoid further usage
 boolean isAlive()
          Checks whether the connection is still alive
 boolean isAuthorizationTracingEnabled()
          Checks whether authorization tracing is enabled in the SAP system.
 boolean isPooled()
          Returns true if the client was allocated from an JCO.Pool.
 void ping()
          Sends a ping to the server
 void reset()
          Resets the client, i.e. frees all resources allocated by this connection on the client and server side.
 void send(Object idoc, String tid)
          Asynchronously sends an intermediate document (IDoc) to the remote server
 void send(Object idoc, String tid, char idoc_version)
          Asynchronously sends an intermediate document (IDoc) to the remote server
 void send(Object idoc, String tid, String queue_name)
          Asynchronously sends an intermediate document (IDoc) to an inbound queue of a remote server
 void send(Object idoc, String tid, String queue_name, char idoc_version)
          Asynchronously sends an intermediate document (IDoc) to an inbound queue of a remote server
 void send(Object idoc, String tid, String queue_name, int queue_pos)
          Asynchronously sends an intermediate document (IDoc) to an inbound queue of a remote server
 void send(Object idoc, String tid, String queue_name, int queue_pos, char idoc_version)
          Asynchronously sends an intermediate document (IDoc) to an inbound queue of a remote server
 void setAbapDebug(boolean debug)
          Enables/disables abap debug.
 void setDsrPassport(com.sap.jdsr.writer.DsrIPassport passport)
          Sets jdsr passport for next remote function call.
 void setProperty(String key, String value)
          Sets the property for the given key.
 void setSapGui(int use_sapgui)
          Sets the use_sapgui parameter
 void setTrace(boolean trace)
          Enables/disables trace.
 void startAuthorizationTracing(String traceID, String serviceType)
          Turns on authorization tracing, if authorization tracing is enabled in the SAP system.
 
Methods inherited from class com.sap.mw.jco.JCO.Connection
checkProperties, getConnectionHandle, getProperties, getProperty, getThroughput, hideConnection, isValid, setState, setThroughput
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

middleware

protected com.sap.mw.jco.IMiddleware.IClient middleware

stack_trace

protected String stack_trace

auth_trace_set

protected static final JCO.MetaData auth_trace_set

auth_trace_set_unicode

protected static final JCO.MetaData auth_trace_set_unicode

auth_trace_status_rc

protected static final JCO.MetaData auth_trace_status_rc

auth_trace_status_rc_unicode

protected static final JCO.MetaData auth_trace_status_rc_unicode

auth_trace_status

protected static final JCO.MetaData auth_trace_status

auth_trace_status_unicode

protected static final JCO.MetaData auth_trace_status_unicode
Constructor Detail

JCO.Client

protected JCO.Client(Properties properties)
Creates an instance of a client connection to a remote SAP system

Parameters:
properties - the connection parameters as a property list

JCO.Client

protected JCO.Client(String[][] params)
Creates an instance of a client to a remote SAP system using an array to specify the connection parameters. Each item in the array is a name/value pair where the first element is the name and the second is the value associated with the name, e.g.
     static String[][] login_params  = {
        { "client" ,   "000"      },
        { "user"   ,   "johndoe"  },
        { "passwd" ,   "whoknows" },
        { "language" , "EN"       },
        ...
     };

        ...

     JCO.Client = JCO.createClient(login_params);

 

Parameters:
params - the connection parameters as an two-dimemsional array

JCO.Client

protected JCO.Client(String client,
                     String user,
                     String passwd,
                     String lang,
                     String ashost,
                     String sysnr)
Creates an instance of a client connection to a remote SAP system (no load balancing)

Parameters:
client - SAP logon client
user - SAP logon user
passwd - SAP logon password
lang - SAP logon language. If null or "" is being passed the default logon language will be used.
ashost - Host name of the application server
sysnr - SAP system number

JCO.Client

protected JCO.Client(String client,
                     String user,
                     String passwd,
                     String lang,
                     String ashost,
                     String sysnr,
                     String gwhost,
                     String gwserv)
Creates an instance of a client connection to a remote SAP system (no load balancing)

Parameters:
client - SAP logon client
user - SAP logon user
passwd - SAP logon password
lang - SAP logon language. If null or "" is being passed the default logon language will be used.
ashost - Host name of the application server
sysnr - SAP system number
gwhost - Host name of the SAP gateway
gwserv - Service number of the SAP gateway

JCO.Client

protected JCO.Client(String client,
                     String user,
                     String passwd,
                     String lang,
                     String mshost,
                     String r3name,
                     String group)
Creates an instance of a client connection to a remote SAP system (with load balancing)

Parameters:
client - SAP logon client
user - SAP logon user
passwd - SAP logon password
lang - SAP logon language. If null or "" is being passed the default logon language will be used.
mshost - Host name of the message server
r3name - Name of the SAP system
group - Name of the group of application servers

JCO.Client

protected JCO.Client(String gwhost,
                     String gwserv,
                     String tpname)
Creates an instance of a client connection to a remote JCO compliant server program

Parameters:
gwhost - Host name of the SAP gateway
gwserv - Service number of the SAP gateway
tpname - Program ID of an registered JCO compliant server program

JCO.Client

protected JCO.Client(String gwhost,
                     String gwserv,
                     String tpname,
                     String tphost)
Creates an instance of a client connection to a remote JCO compliant server program

Parameters:
gwhost - Host name of the SAP gateway
gwserv - Service number of the SAP gateway
tpname - Program ID of an registered server program
tphost - Host name where the external server runs

JCO.Client

protected JCO.Client(String client,
                     String user,
                     String passwd,
                     String lang,
                     String url)
Creates an instance of a client connection to a remote SAP system

Parameters:
client - SAP logon client
user - SAP logon user
passwd - SAP logon password
lang - SAP logon language. If null or "" is being passed the default logon language will be used.
url - the url to the remote system
Method Detail

getClientInterface

protected static com.sap.mw.jco.IMiddleware.IClient getClientInterface()
Creates a new middleware object


clone

public Object clone()
Returns a clone of this connection The cloned connection however will not be opened

Overrides:
clone in class JCO.Connection
Returns:
a copy of the client

hide

protected final JCO.Client hide()
Hide the client from application to avoid further usage


reset

public void reset()
Resets the client, i.e. frees all resources allocated by this connection on the client and server side.

Throws:
JCO.Exception - thrown if the client could not be resetted
Since:
JCo 2.0

getPropertyInfo

public final String[][] getPropertyInfo()
Returns the property info for the connection

Overrides:
getPropertyInfo in class JCO.Connection
Returns:
the property info

setProperty

public void setProperty(String key,
                        String value)
Sets the property for the given key. If value is null the property will be removed from the property list.

Overrides:
setProperty in class JCO.Connection

getUser

public final String getUser()
Returns the user

Returns:
the user

getPassword

protected final String getPassword()
Returns the encrypted password

Returns:
the encrypted password Note: Password encryption not implemented yet !!!

getClient

public final String getClient()
Returns the client

Returns:
the client

getLanguage

public final String getLanguage()
Returns the logon language

Returns:
the client logon

getSystemNumber

public final String getSystemNumber()
Returns the system number

Returns:
the system number

getASHost

public final String getASHost()
Returns the application server

Returns:
the application server

getMSHost

public final String getMSHost()
Returns the message server

Returns:
the message server

getGWHost

public final String getGWHost()
Returns the gateway server

Returns:
the gateway server

getGWServ

public final String getGWServ()
Returns the gateway service

Returns:
the gateway service

getSystemID

public final String getSystemID()
Returns the SAP system ID

Returns:
the SAP system ID

getGroup

public final String getGroup()
Returns the group of application servers

Returns:
the group of application servers

getTPName

public final String getTPName()
Returns the program ID of an registered JCO compliant server program

Returns:
Program ID of an registered JCO compliant server program

getURL

public final URL getURL()
Returns the url to the remote system

Returns:
the url to the remote system or null if not set or malformed

getTrace

public final boolean getTrace()
Returns whether trace is enabled or not.

Overrides:
getTrace in class JCO.Connection
Returns:
true if trace is enabled, false otherwise

setTrace

public final void setTrace(boolean trace)
Enables/disables trace.
Note:If the connection is already established the method will close and reopen the connection. Any states associated with the connection might get lost.

Overrides:
setTrace in class JCO.Connection
Parameters:
trace - if true enables the trace and disables it otherwise.

getAbapDebug

public boolean getAbapDebug()
Returns whether debugging is enabled or not.

Returns:
true if debugging is enabled, false otherwise

setAbapDebug

public void setAbapDebug(boolean debug)
Enables/disables abap debug.
Note:If the connection is already established the method will close and reopen the connection. Any states associated with the connection might get lost.

Parameters:
debug - if true enables ABAP debugging, disables it otherwise

getSapGui

public int getSapGui()
Returns if a SAP GUI is being used during a call

Returns:
0 if no GUI, 1 if visible GUI, and 2 if invisible GUI is being used

setSapGui

public void setSapGui(int use_sapgui)
Sets the use_sapgui parameter

Parameters:
use_sapgui - 0/1/2: without/with/invisible SAPGUI

getState

public byte getState()
Returns the state of the client as a bit vector

Overrides:
getState in class JCO.Connection
Returns:
the state of the client as a bit vector
Flag Description
JCO.STATE_DISCONNECTEDThe client is disconnected
JCO.STATE_CONNECTED The client is connected to the remote server
JCO.STATE_BUSY The client is currently executing a remote function call
JCO.STATE_USED A pooled connection has been allocated by a program

getAttributes

public final JCO.Attributes getAttributes()
Returns the attributes object for this connection.

Specified by:
getAttributes in class JCO.Connection
Returns:
the attributes object for this connection.
Throws:
JCO.Exception - thrown if the attributes could not be retrieved.
See Also:
JCO.Attributes

getHashKey

public String getHashKey(boolean personalized)
Returns a hash key for this client connection

Parameters:
personalized - if true include the user into the key generation
Returns:
a hash key for this client connection
Since:
JCo 2.0

isAlive

public boolean isAlive()
Checks whether the connection is still alive

Specified by:
isAlive in class JCO.Connection
Returns:
true if the connection is alive, false otherwise

connect

public void connect()
Opens a client connection to the remote system using the current connection parameters

Throws:
JCO.Exception - if the connection could not be established

isPooled

public boolean isPooled()
Returns true if the client was allocated from an JCO.Pool. Otherwise returns false

Returns:
true if the client was allocated from an JCO.Pool

disconnect

public void disconnect()
Closes the connection to the remote system.

Specified by:
disconnect in class JCO.Connection
Throws:
JCO.Exception - with the error group set to JCO.Exception.JCO_ERROR_RESOURCE, must be released back to its pool by using JCO.releaseClient().
See Also:
JCO.releaseClient(com.sap.mw.jco.JCO.Client)

disconnect

protected void disconnect(boolean is_pooled)
Closes the connection to the remote system.

Throws:
JCO.Exception - with the error group set to JCO.Exception.JCO_ERROR_RESOURCE, if a client was allocated from a pool via getClient().

finalize

protected void finalize()
                 throws Throwable
Overrides the finalize method in Connection Called upon garbage collection

Overrides:
finalize in class JCO.Connection
Throws:
Throwable

abort

public void abort(String message)
Aborts the connection to the remote system, i.e. tries to send a final message to the host before it disconnects.

Specified by:
abort in class JCO.Connection
Parameters:
message - the final message which will be sent to the remote system.

execute

public void execute(JCO.Function function)
Executes the function on the remote server synchronously

Parameters:
function - the function to execute on the remote server
Throws:
JCO.AbapException - thrown if something went awry in the called function.
JCO.Exception - thrown if something went wrong during communication, marshalling, etc.

execute

public void execute(JCO.Function function,
                    String tid)
Executes the function on the remote server in transactional mode (asynchronously)

Parameters:
function - the function to execute on the remote server
tid - the transaction id to use for this call
Throws:
JCO.AbapException - thrown if something went awry in the called function.
JCO.Exception - thrown if something went wrong during communication, marshalling, etc. Note: Don't forget to call confirmTID() if this call was successful

execute

public void execute(JCO.Function function,
                    String tid,
                    String queue_name)
Executes the function on the remote server in queued transactional mode (asynchronously)

Parameters:
function - the function to execute on the remote server
tid - the transaction id to use for this call
queue_name - the queue name where to insert the transaction. If queue_name is null the call will be executed in normal transaction mode.
Throws:
JCO.AbapException - thrown if something went awry in the called function.
JCO.Exception - thrown if something went wrong during communication, marshalling, etc. Note: Don't forget to call confirmTID() if this call was successful
Since:
JCo 1.1

execute

public void execute(JCO.Function function,
                    String tid,
                    String queue_name,
                    int queue_pos)
Executes the function on the remote server in transactional mode (asynchronously)

Parameters:
function - the function to execute on the remote server
tid - the transaction id to use for this call
queue_name - the queue name where to insert the transaction. If queue_name is null the call will be executed in normal transaction mode.
queue_pos - the position in the queue where to insert the transaction
Throws:
JCO.AbapException - thrown if something went awry in the called function.
JCO.Exception - thrown if something went wrong during communication, marshalling, etc. Note: Don't forget to call confirmTID() if this call was successful
Since:
JCo 1.1

execute

public void execute(String name,
                    JCO.ParameterList input,
                    JCO.ParameterList output)
Executes the function on the remote server synchronously

Parameters:
name - the name of the remote function to execute
input - the list of parameters to send to the remote function module
output - the list of parameters to receive from the remote function module
Throws:
JCO.AbapException - thrown if something went awry in the called function.
JCO.Exception - thrown if something went wrong during communication, marshalling, etc.

execute

public void execute(String name,
                    JCO.ParameterList input,
                    JCO.ParameterList output,
                    JCO.ParameterList tables)
Executes the function on the remote server synchronously

Parameters:
name - the name of the remote function to execute
input - the list of parameters to send to the remote function module
output - the list of parameters to receive from the remote function module
tables - the list of tables to pass on to the remote function module
Throws:
JCO.AbapException - thrown if something went awry in the called function.
JCO.Exception - thrown if something went wrong during communication, marshalling, etc.

execute

public void execute(String name,
                    JCO.ParameterList input,
                    JCO.ParameterList tables,
                    String tid)
Executes the function on the remote server in transactional mode (asynchronously)

Parameters:
name - the name of the remote function to execute
input - the list of parameters to send to the remote function module
tables - the list of tables to pass on to the remote function module
tid - the transaction id to use for this call
Throws:
JCO.AbapException - thrown if something went awry in the called function.
JCO.Exception - thrown if something went wrong during communication, marshalling, etc. Note: Don't forget to call confirmTID() if this call was successful

execute

public void execute(String name,
                    JCO.ParameterList input,
                    JCO.ParameterList tables,
                    String tid,
                    String queue_name)
Executes the function on the remote server in queued transactional mode (asynchronously)

Parameters:
name - the name of the remote function to execute
input - the list of parameters to send to the remote function module
tables - the list of tables to pass on to the remote function module
tid - the transaction id to use for this call
queue_name - the queue name where to insert the transaction. If queue_name is null the call will be executed in normal transaction mode.
Throws:
JCO.AbapException - thrown if something went awry in the called function.
JCO.Exception - thrown if something went wrong during communication, marshalling, etc. Note: Don't forget to call confirmTID() if this call was successful
Since:
JCo 1.1

execute

public void execute(String name,
                    JCO.ParameterList input,
                    JCO.ParameterList tables,
                    String tid,
                    String queue_name,
                    int queue_pos)
Executes the function on the remote server in transactional mode (asynchronously)

Parameters:
name - the name of the remote function to execute
input - the list of parameters to send to the remote function module
tables - the list of tables to pass on to the remote function module
tid - the transaction id to use for this call
queue_name - the queue name where to insert the transaction. If queue_name is null the call will be executed in normal transaction mode.
queue_pos - the position in the queue where to insert the transaction
Throws:
JCO.AbapException - thrown if something went awry in the called function.
JCO.Exception - thrown if something went wrong during communication, marshalling, etc. Note: Don't forget to call confirmTID() if this call was successful
Since:
JCo 1.1

execute

public JCO.Response execute(JCO.Request request)
Executes the request on the remote server synchronously

Parameters:
request - the request to execute on the remote server
Returns:
JCO.Response the response for null if the called function does not export any data
Throws:
JCO.AbapException - thrown if something went awry in the called function.
JCO.Exception - thrown if something went wrong during communication, marshalling, etc.
Since:
JCo 2.0

execute

public void execute(JCO.Request request,
                    String tid)
Executes the request on the remote server asynchronously

Parameters:
request - the request to execute on the remote server
tid - the transaction id to use for this call
Throws:
JCO.AbapException - thrown if something went awry in the called function.
JCO.Exception - thrown if something went wrong during communication, marshalling, etc.
Since:
JCo 2.0

execute

public void execute(JCO.Request request,
                    String tid,
                    String queue_name)
Executes the request on the remote server asynchronously

Parameters:
request - the request to execute on the remote server
tid - the transaction id to use for this call
queue_name - the queue name where to insert the transaction. if queue_name is null the call will be executed in normal transaction mode.
Throws:
JCO.AbapException - thrown if something went awry in the called function.
JCO.Exception - thrown if something went wrong during communication, marshalling, etc.
Since:
JCo 2.0

execute

public void execute(JCO.Request request,
                    String tid,
                    String queue_name,
                    int queue_pos)
Executes the request on the remote server asynchronously

Parameters:
request - the request to execute on the remote server
tid - the transaction id to use for this call
queue_name - the queue name where to insert the transaction. If queue_name is null the call will be executed in normal transaction mode.
queue_pos - the position in the queue where to insert the transaction
Throws:
JCO.AbapException - thrown if something went awry in the called function.
JCO.Exception - thrown if something went wrong during communication, marshalling, etc.
Since:
JCo 2.0

execute

protected JCO.Response execute(JCO.Request request,
                               String tid,
                               String queue_name,
                               int queue_pos,
                               int dummy)
Executes the request on the remote server synchronously

Parameters:
request - the request to execute on the remote server
tid - the transaction id to use for this call
queue_name - the queue name were to insert the transaction to. if queue_name is null the call will be executed in normal transaction mode.
queue_pos - the position in the queue were to insert the transaction
Returns:
JCO.Response the response for null if the called function does not export any data
Throws:
JCO.AbapException - thrown if something went awry in the called function.
JCO.Exception - thrown if something went wrong during communication, marshalling, etc.
Since:
JCo 2.0

execute

protected void execute(String name,
                       JCO.ParameterList input,
                       JCO.ParameterList input_tables,
                       JCO.ParameterList output,
                       JCO.ParameterList output_tables,
                       String tid,
                       String queue_name,
                       int queue_pos)
Executes the function on the remote server synchronously

Parameters:
name - the name of the remote function to execute
input - the list of parameters to send to the remote function module
output - the list of parameters to receive from the remote function module
Throws:
JCO.AbapException - thrown if something went awry in the called function.
JCO.Exception - thrown if something went wrong during communication, marshalling, etc.

send

public void send(Object idoc,
                 String tid)
Asynchronously sends an intermediate document (IDoc) to the remote server

Parameters:
idoc - the intermediate document to send. This has to be an implementation of the JCO.IDocument interface.
tid - the transaction ID to use for this call
Throws:
JCO.Exception - thrown if something went wrong during communication.
RuntimeException - thrown if something went wrong when parsing the IDoc.
Since:
JCo 2.0

send

public void send(Object idoc,
                 String tid,
                 String queue_name)
Asynchronously sends an intermediate document (IDoc) to an inbound queue of a remote server

Parameters:
idoc - the intermediate document to send. The passed object must have the JCO.IDocument interface implemented.
tid - the transaction ID to use for this call
queue_name - the queue name where to insert the transaction. If queue_name is null the call will be executed in normal transaction mode.
Throws:
JCO.Exception - thrown if something went wrong during communication.
RuntimeException - thrown if something went wrong when parsing the IDoc.
Since:
JCo 2.0

send

public void send(Object idoc,
                 String tid,
                 String queue_name,
                 int queue_pos)
Asynchronously sends an intermediate document (IDoc) to an inbound queue of a remote server

Parameters:
idoc - the intermediate document to send. The passed object must have the JCO.IDocument interface implemented.
tid - the transaction ID to use for this call
queue_name - the queue name where to insert the transaction. If queue_name is null the call will be executed in normal transaction mode.
queue_pos - the position in the queue where to insert the transaction
Throws:
JCO.Exception - thrown if something went wrong during communication.
RuntimeException - thrown if something went wrong when parsing the IDoc.
Since:
JCo 2.0.4

send

public void send(Object idoc,
                 String tid,
                 char idoc_version)
Asynchronously sends an intermediate document (IDoc) to the remote server

Parameters:
idoc - the intermediate document to send. The passed object must have the JCO.IDocument interface implemented.
tid - the transaction ID to use for this call
idoc_version - the idoc version that will be used. Possible options are
  • JCO.IDOC_VERSION_DEFAULT
  • JCO.IDOC_VERSION_2
  • JCO.IDOC_VERSION_3
Throws:
JCO.Exception - thrown if something went wrong during communication.
RuntimeException - thrown if something went wrong when parsing the IDoc.
Since:
JCo 2.0

send

public void send(Object idoc,
                 String tid,
                 String queue_name,
                 char idoc_version)
Asynchronously sends an intermediate document (IDoc) to an inbound queue of a remote server

Parameters:
idoc - the intermediate document to send. The passed object must have the JCO.IDocument interface implemented.
tid - the transaction ID to use for this call
queue_name - the queue name where to insert the transaction. If queue_name is null the call will be executed in normal transaction mode.
idoc_version - the idoc version that will be used. Possible options are
  • JCO.IDOC_VERSION_DEFAULT
  • JCO.IDOC_VERSION_2
  • JCO.IDOC_VERSION_3
Throws:
JCO.Exception - thrown if something went wrong during communication.
RuntimeException - thrown if something went wrong when parsing the IDoc.
Since:
JCo 2.0

send

public void send(Object idoc,
                 String tid,
                 String queue_name,
                 int queue_pos,
                 char idoc_version)
Asynchronously sends an intermediate document (IDoc) to an inbound queue of a remote server

Parameters:
idoc - the intermediate document to send. The passed object must have the JCO.IDocument interface implemented.
tid - the transaction ID to use for this call
queue_name - the queue name where to insert the transaction. If queue_name is null the call will be executed in normal transaction mode.
queue_pos - the position in the queue where to insert the transaction
idoc_version - the idoc version that will be used. Possible options are
  • JCO.IDOC_VERSION_DEFAULT
  • JCO.IDOC_VERSION_2
  • JCO.IDOC_VERSION_3
Throws:
JCO.Exception - thrown if something went wrong during communication.
RuntimeException - thrown if something went wrong when parsing the IDoc.
Since:
JCo 2.0.4

createTID

public String createTID()
Creates a new transaction ID

Returns:
the newly created transaction ID as a string
Throws:
JCO.Exception - thrown if something went wrong during the creation

confirmTID

public void confirmTID(String tid)
Confirms that a transaction has been successfull

Parameters:
tid - the ID of the transaction to confirm
Throws:
JCO.Exception - thrown if something went wrong during the confirmation

ping

public final void ping()
Sends a ping to the server

Throws:
JCO.Exception - thrown if the ping could not be executed

setDsrPassport

public void setDsrPassport(com.sap.jdsr.writer.DsrIPassport passport)
Sets jdsr passport for next remote function call.
After the call the passport will be discarded.

Throws:
JCO.Exception - if DSR Library isn't loaded or passport isn't valid

beginCall

protected void beginCall()
Notify about begin of call processing

Specified by:
beginCall in class JCO.Connection

endCall

protected void endCall()
Description copied from class: JCO.Connection
Notify about end of call processing

Specified by:
endCall in class JCO.Connection

startAuthorizationTracing

public void startAuthorizationTracing(String traceID,
                                      String serviceType)
Turns on authorization tracing, if authorization tracing is enabled in the SAP system. It sets the authentication trace ID for authorization tracing. If authorization tracing is turned on in the SAP system, all authorization checks will be traced under the given service name. If the client is pooled the tracing will be reset in the SAP system as soon as the client is returned to the pool.

Parameters:
traceID - the unique name for identifying the authentication trace entries in the SAP system
serviceType - type of the service as String, which needs to be one of the following values "BSP", "IVIEW", "PC-UI", "WEBDYNPRO", "WS"
Throws:
JCO.Exception - if Client is not yet connected

isAuthorizationTracingEnabled

public boolean isAuthorizationTracingEnabled()
Checks whether authorization tracing is enabled in the SAP system. If this is not the case authorization will not work, and false will be returned.

Returns:
true, if authorization tracing is enabled in the SAP system, false otherwise.
Throws:
JCO.Exception - if Client is not yet connected

getAuthorizationTraceID

public String getAuthorizationTraceID()
Returns the currently used authorization trace ID for this client. If the authorization trace was not set or was already reset, the return value is null.

Returns:
currently used authorization trace ID

endAuthorizationTracing

public void endAuthorizationTracing()
Resets authorization tracing in the SAP system for this client. If a client is pooled, this will be called automatically when the client is returned to the pool.



Copyright 2006 SAP AG Complete Copyright Notice