com.sap.conn.jco.ext
Interface ServerDataProvider


public interface ServerDataProvider

Applications using the JCoServer functionality, i.e. applications that provide a function module in Java that is invoked by an ABAP program, need to manage the server configuration parameters. ServerDataProvider is the interface to be implemented by an infrastructure components within such applications. It is not the responsibility of business application logic to provide and register such an implementation. A business application is only providing the implementation of the function module.

ServerDataProvider provides server configurations to the JCo runtime. The JCo runtime uses the registered instance to get all server configuration information.

Note:

The following properties are supported:

mandatory parameters
jco.server.gwhost Gateway host on which the server should be registered
jco.server.gwserv Gateway service, i.e. the port on which a registration can be done
jco.server.progid The program ID with which the registration is done
jco.server.connection_count The number of connections that should be registered at the gateway
optional parameters
jco.server.saprouter SAP router string to use for a system protected by a firewall
jco.server.max_startup_delay The maximum time (in seconds) between two startup attempts in case of failures
jco.server.repository_destination Client destination from which to obtain the repository
jco.server.repository_map repository map, if more than one repository should be used by JCoServer
jco.server.trace Enable/disable RFC trace (1 or 0)
jco.server.worker_thread_count set the number of threads that can be used by the JCoServer instance
jco.server.worker_thread_min_count set the number of threads always kept running by JCoServer
SNC parameters (only required if snc_mode is on)
jco.server.snc_mode Secure network connection (SNC) mode, 0 (off) or 1 (on)
jco.server.snc_qop SNC level of security, 1 to 9
jco.server.snc_myname SNC name of your server. Overrides the default SNC name. Typically something like p:CN=JCoServer, O=ACompany, C=EN
jco.server.snc_lib Path to library which provides SNC service.


Field Summary
static java.lang.String JCO_CONNECTION_COUNT
          The number of connections that should be registered at the gateway.
static java.lang.String JCO_GWHOST
          Gateway host on which the server should be registered
static java.lang.String JCO_GWSERV
          Gateway service, i.e.
static java.lang.String JCO_MAX_STARTUP_DELAY
          The maximum time (in seconds) between two startup attempts in case of failures.
static java.lang.String JCO_PROGID
          The program ID with which the registration is done.
static java.lang.String JCO_REP_DEST
          Client destination to obtain the repository.
static java.lang.String JCO_REP_MAP
          Mapping rule between repositories and ABAP Systems.
static java.lang.String JCO_SAPROUTER
          SAP router string to use for a system protected by a firewall, and which hence can only be reached via a SAProuter, when registering the server at the gateway of that ABAP System.
static java.lang.String JCO_SNC_LIBRARY
          Path to library which provides SNC service.
static java.lang.String JCO_SNC_MODE
          Secure network connection (SNC) mode, 0 (off) or 1 (on)
static java.lang.String JCO_SNC_MYNAME
          SNC name of your server.
static java.lang.String JCO_SNC_QOP
          SNC level of security, 1 to 9
static java.lang.String JCO_TRACE
          Enable/disable RFC trace (0 or 1)
static java.lang.String JCO_WORKER_THREAD_COUNT
          The maximal number of threads used by a single JCoServer.
static java.lang.String JCO_WORKER_THREAD_MIN_COUNT
          The minimal number of threads used by JCo server.
 
Method Summary
 java.util.Properties getServerProperties(java.lang.String serverName)
          getServerProperties should return a properties object that contains a subset of the supported properties mentioned above representing the configuration of the given server .
 void setServerDataEventListener(ServerDataEventListener eventListener)
          This method sets a ServerDataEventListener implemented by JCo that processes the fired events within the JCo runtime.
 boolean supportsEvents()
          Returns true if the implementation can support ServerDataEvents that allow a better integration into the JCo runtime resource management.
 

Field Detail

JCO_GWHOST

static final java.lang.String JCO_GWHOST
Gateway host on which the server should be registered

See Also:
Constant Field Values

JCO_GWSERV

static final java.lang.String JCO_GWSERV
Gateway service, i.e. the port on which a registration can be done. In order to resolve the service names sapgwXXX a lookup in etc/services is performed by the network layer of the operating system. If using port numbers instead of symbolic service names, no lookups are performed and no additional entries are needed.

See Also:
Constant Field Values

JCO_PROGID

static final java.lang.String JCO_PROGID
The program ID with which the registration is done. Serves as identifier on the gateway and in the destination in the ABAP system.

See Also:
Constant Field Values

JCO_TRACE

static final java.lang.String JCO_TRACE
Enable/disable RFC trace (0 or 1)

See Also:
Constant Field Values

JCO_SNC_MODE

static final java.lang.String JCO_SNC_MODE
Secure network connection (SNC) mode, 0 (off) or 1 (on)

See Also:
Constant Field Values

JCO_SNC_MYNAME

static final java.lang.String JCO_SNC_MYNAME
SNC name of your server. Overrides the default SNC name. Typically something like p:CN=JCoServer, O=ACompany, C=EN

See Also:
Constant Field Values

JCO_SNC_QOP

static final java.lang.String JCO_SNC_QOP
SNC level of security, 1 to 9

See Also:
Constant Field Values

JCO_SNC_LIBRARY

static final java.lang.String JCO_SNC_LIBRARY
Path to library which provides SNC service. If this property is not provided, the value of the JCo property jco.middleware.snc_lib is used instead

See Also:
Constant Field Values

JCO_MAX_STARTUP_DELAY

static final java.lang.String JCO_MAX_STARTUP_DELAY
The maximum time (in seconds) between two startup attempts in case of failures. The waiting time is doubled from initially 1 second after each startup failure until either the maximum value is reached or the server could be started successfully.

See Also:
Constant Field Values

JCO_SAPROUTER

static final java.lang.String JCO_SAPROUTER
SAP router string to use for a system protected by a firewall, and which hence can only be reached via a SAProuter, when registering the server at the gateway of that ABAP System. A router string typically looks like /H/firewall.hostname/H/

See Also:
Constant Field Values

JCO_REP_DEST

static final java.lang.String JCO_REP_DEST
Client destination to obtain the repository. The server will use the repository obtained by getRepository() API from the given destination

See Also:
Constant Field Values

JCO_REP_MAP

static final java.lang.String JCO_REP_MAP
Mapping rule between repositories and ABAP Systems.

Since JCo 3.0.5 a JCoServer can support more than one repository. Additionally to the default JCO_REP_DEST repository, applications can define particular repository destinations for a particular ABAP system SID and client combination. For example, it is possible to use the DDIC from system ABC client 000 for calls from system ABC client 000 and the DDIC from system ABC client 100 for calls from client 100, and the DDIC in system XYZ for calls originating from system XYZ. For calls from other systems the system specified by JCO_REP_DEST will be used, which is serving as default repository. With specifying a client the scope for the DDIC to be used can be limited to specific clients within an ABAP system. All other clients from that system will then use the specified destination for the same system without client limitation or if this is not defined, the default repository destination JCO_REP_DEST will be used. The repository map definition

        <single_map> := <SID>['('<CLIENT>')'](,<SID>['('<CLIENT>')'])*=<DESTINATION>
        jco.server.repository_map=<single_map>(';'<single_map>)
        where ...
           <single_map> is a single repository mapping expression
           <SID> is the system ID of the SAP ABAP backend (or 'EXTERN' in case of external RFC client programs)
           <CLIENT> is the client of the SAP ABAP backend
           <DESTINATION> is the destination that should be used for DDIC queries if a call is coming
                         from SAP ABAP backend <SID> and - if specified - from client <CLIENT>
 
The following example demonstrates how you can use the destination DEFAULT for all DDIC queries except for calls from PRD. If a call is sent from PRD client 100 or client 200 the destination PRD_DDIC_100 should be used, for all other clients in PRD system the destination PRD_DDIC_000.
 jco.server.repository_destination=DEFAULT
 jco.server.repository_map=PRD(100),PRD(200)=PRD_DDIC_100;PRD=PRD_DDIC_000
 
Of course you should not forget to define all referenced destinations - DEFAULT, PRD_DDIC_100 and PRD_DDIC_000

Since:
JCo 3.0.5
See Also:
Constant Field Values

JCO_CONNECTION_COUNT

static final java.lang.String JCO_CONNECTION_COUNT
The number of connections that should be registered at the gateway. If your ServerDataProvider supports events, you can adjust the count of registered connections at runtime by firing the update event. Please note that stateful connections are established in addition to the stateless ones and are not configured, i.e. if a server connection is set to stateful by an application, JCo will ensure that the configured number of connections is still available for stateless requests. This means, with connection count you actually configure how many concurrent stateless connections you want to offer.

See Also:
Constant Field Values

JCO_WORKER_THREAD_COUNT

static final java.lang.String JCO_WORKER_THREAD_COUNT
The maximal number of threads used by a single JCoServer. If not set, the value for connection count is used as the maximal thread count. Initially, the JCo runtime starts JCO_WORKER_THREAD_MIN_COUNT worker threads. Further threads are then started on demand up to the maximum. Note: the maximal number of threads has to be no more than 99. If your ServerDataProvider supports events, you can adjust the maximal number of worker threads at runtime by firing the update event.

See Also:
Constant Field Values

JCO_WORKER_THREAD_MIN_COUNT

static final java.lang.String JCO_WORKER_THREAD_MIN_COUNT
The minimal number of threads used by JCo server. If not set, the value for connection count is used as the minimal thread count. If your ServerDataProvider supports events, you can adjust the maximal number of worker threads at runtime by firing the update event.

See Also:
Constant Field Values
Method Detail

getServerProperties

java.util.Properties getServerProperties(java.lang.String serverName)
getServerProperties should return a properties object that contains a subset of the supported properties mentioned above representing the configuration of the given server . null means that the server configuration is not available. In that case JCoException with key JCO_ERROR_RESOURCE will be thrown. The implementation may throw DataProviderException in order to signal severe issues in an existing configuration or some other internal error, like a wrong setup. As consequence JCoServerFactory.getServer() method throws JCoRuntimerException with the appropriate key. By other exceptions JCo runtime assume that the destination was not found and generates JCoException with key JCO_ERROR_RESOURCE.

Parameters:
serverName - the name of the server configuration for which the properties should be returned
Returns:
Properties for the server configuration or null if the server was not found

supportsEvents

boolean supportsEvents()
Returns true if the implementation can support ServerDataEvents that allow a better integration into the JCo runtime resource management. If the implementation cannot support events it should return false. If you're not sure about the ability that your ServerDataProvider can guarantee to fire all events you can return false to be on the safe side. Check out ServerDataEventListener for details about the events that your ServerDataProvider needs to fire when returning true for this method

Returns:
whether the implementation supports ServerDataEvents completely
See Also:
ServerDataEventListener

setServerDataEventListener

void setServerDataEventListener(ServerDataEventListener eventListener)
This method sets a ServerDataEventListener implemented by JCo that processes the fired events within the JCo runtime.
The JCo runtime will register only a single ServerDataEventListener instance.

Parameters:
eventListener - the ServerDataEventListener to which configuration events need to be fired


Copyright © 2008-2014 SAP AG. All Rights Reserved.