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 component within such applications. It is not the responsibility of the business application logic to provide and register such an implementation. A business application is only providing the implementation of the function module.

The 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 The gateway host at which the JCoServer should be registered
jco.server.gwserv The gateway service to be used for registering at the gateway, i.e. the symbolic service name or the port number
jco.server.progid The program ID for registering and identifying the JCoServer at the gateway
jco.server.connection_countThe number of server connections to register at the gateway
optional parameters
jco.server.saprouter SAP router string to use for registering at a gateway that is located behind a firewall
jco.server.max_startup_delay The maximum time (in seconds) between two startup attempts in case of failures
jco.server.repository_destination Destination name for obtaining the default JCoRepository
jco.server.repository_map Mapping rule for destination names from ABAP system IDs and clients in order to obtain a matching JCoRepository depending on the incoming RFC requests
jco.server.trace RFC trace flag; 1: enabled, 0: disabled (default)
jco.server.worker_thread_count The maximum number of worker threads used by the JCoServer
jco.server.worker_thread_min_countThe minimum number of worker threads used by the JCoServer
SNC parameters (only required if snc_mode is on)
jco.server.snc_mode Secure Network Communications (SNC) mode; 1: on, 0: off (default)
jco.server.snc_qop SNC quality of protection; valid values: 1, 2, 3, 8 (default), 9
jco.server.snc_mynameSNC name of the JCoServer. Overrides the default SNC name. For example: p:CN=JCoServer, O=ACompany, C=EN
jco.server.snc_lib Full path to the library which provides the SNC service; default: value from JCo middleware property jco.middleware.snc_lib
informational parameters (irrelevant for the JCo library)
jco.server.applicationAssociated or owning application name (may be used for configuration management purposes)


Field Summary
static java.lang.String JCO_APPLICATION
          Associated or owning application name for the configuration.
static java.lang.String JCO_CONNECTION_COUNT
          The number of server connections to register 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 to be used for registering at the gateway.
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
          Program ID for registering and identifying the JCoServer at the gateway.
static java.lang.String JCO_REP_DEST
          Destination name for obtaining the default JCoRepository.
static java.lang.String JCO_REP_MAP
          Mapping rule for destination names from ABAP system IDs and clients in order to obtain a matching JCoRepository depending on the incoming RFC requests.
static java.lang.String JCO_SAPROUTER
          SAP router string to use for registering at a gateway that is located behind a firewall and hence can only be reached via a SAProuter.
static java.lang.String JCO_SNC_LIBRARY
          Full path to the library which provides the SNC service.
static java.lang.String JCO_SNC_MODE
          Secure Network Communications (SNC) mode.
static java.lang.String JCO_SNC_MYNAME
          SNC name of the JCoServer.
static java.lang.String JCO_SNC_QOP
          SNC quality of protection.
Valid values:
    1: Authentication only
    2: Authentication and integrity protection
    3: Authentication, integrity and privacy protection (encryption)
    8: Global default configuration (usually: 3)
    9: Maximum protection
static java.lang.String JCO_TRACE
          RFC trace flag.
static java.lang.String JCO_WORKER_THREAD_COUNT
          The maximum number of worker threads used by the JCoServer.
static java.lang.String JCO_WORKER_THREAD_MIN_COUNT
          The minimum number of worker threads used by the JCo server.
 
Method Summary
 java.util.Properties getServerProperties(java.lang.String serverName)
          This method shall return a properties object that contains a subset of the supported properties mentioned above which represent the configuration of the given JCoServer in your server configuration repository.
 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 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 to be used for registering at the gateway. This can either be a symbolic service name or a port number. If using a symbolic service name like sapgw05 a lookup of the corresponding port number in etc/services is done. In case of port numbers being specified directly no such lookup is performed and no additional entry in etc/services is required.

See Also:
Constant Field Values

JCO_PROGID

static final java.lang.String JCO_PROGID
Program ID for registering and identifying the JCoServer at the gateway.

See Also:
Constant Field Values

JCO_TRACE

static final java.lang.String JCO_TRACE
RFC trace flag. Valid values are 1: enabled, 0: disabled (default)

See Also:
Constant Field Values

JCO_SNC_MODE

static final java.lang.String JCO_SNC_MODE
Secure Network Communications (SNC) mode. Valid values are 1: on, 0: off (default)

See Also:
Constant Field Values

JCO_SNC_MYNAME

static final java.lang.String JCO_SNC_MYNAME
SNC name of the JCoServer. Overrides the default SNC name. For example: p:CN=JCoServer, O=ACompany, C=EN

See Also:
Constant Field Values

JCO_SNC_QOP

static final java.lang.String JCO_SNC_QOP
SNC quality of protection.
Valid values:
    1: Authentication only
    2: Authentication and integrity protection
    3: Authentication, integrity and privacy protection (encryption)
    8: Global default configuration (usually: 3)
    9: Maximum protection

See Also:
Constant Field Values

JCO_SNC_LIBRARY

static final java.lang.String JCO_SNC_LIBRARY
Full path to the library which provides the SNC service. If this property is not provided, the value from the JCo middleware property jco.middleware.snc_lib is used insteadm, which is not set per default.

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 this maximum value is reached or the server could be started successfully. If this property is not provided, the value from the JCo middleware property jco.middleware.max_startup_delay is used instead, whose default is 3600 seconds (= 60 minutes).

See Also:
Constant Field Values

JCO_SAPROUTER

static final java.lang.String JCO_SAPROUTER
SAP router string to use for registering at a gateway that is located behind a firewall and hence can only be reached via a SAProuter. For example: /H/hostname_firewall1/H/hostname_firewall2

See Also:
Constant Field Values

JCO_REP_DEST

static final java.lang.String JCO_REP_DEST
Destination name for obtaining the default JCoRepository.

See Also:
Constant Field Values

JCO_REP_MAP

static final java.lang.String JCO_REP_MAP
Mapping rule for destination names from ABAP system IDs and clients in order to obtain a matching JCoRepository depending on the incoming RFC requests.

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.

Repository map definition:

    jco.server.repository_map=<single_map>(';'<single_map>)*
    <single_map> := <SID>['('<CLIENT>')'](,<SID>['('<CLIENT>')'])*=<DESTINATION>
    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_DEST 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_DEST
    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_DEST, 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 server connections to register at the gateway. If your ServerDataProvider implementation supports events, you can adjust the number 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 this connection count you actually configure how many concurrent stateless connections shall be offered.

See Also:
Constant Field Values

JCO_WORKER_THREAD_COUNT

static final java.lang.String JCO_WORKER_THREAD_COUNT
The maximum number of worker threads used by the JCoServer. If not set, the number of server connections (the connection count) is used as the maximum number of worker threads. Initially, the JCo runtime starts JCO_WORKER_THREAD_MIN_COUNT worker threads. Further threads are then started on demand until this maximum is reached.
If your ServerDataProvider implementation supports events, you can adjust the maximum number of worker threads at runtime by firing the update event.

Note: The maximum number of worker threads must not exceed 99 threads.

See Also:
Constant Field Values

JCO_WORKER_THREAD_MIN_COUNT

static final java.lang.String JCO_WORKER_THREAD_MIN_COUNT
The minimum number of worker threads used by the JCo server. If not set, the number of server connections (the connection count) is used as the minimum number of worker threads.
If your ServerDataProvider implementation supports events, you can adjust the minimum number of worker threads at runtime by firing the update event.

See Also:
Constant Field Values

JCO_APPLICATION

static final java.lang.String JCO_APPLICATION
Associated or owning application name for the configuration. This property is only informative and ignored at runtime. It may be used by infrastructure components for configuration management purposes.

Since:
JCo 3.0.14
See Also:
Constant Field Values
Method Detail

getServerProperties

java.util.Properties getServerProperties(java.lang.String serverName)
                                         throws DataProviderException
This method shall return a properties object that contains a subset of the supported properties mentioned above which represent the configuration of the given JCoServer in your server configuration repository. Returning null means that the server configuration is not available. In this case a JCoException with the key JCO_ERROR_RESOURCE will be thrown.

The implementation may throw a DataProviderException in order to signal an internal error like a severe technical issue that prevents returning the requested properties data. As a consequence the method JCoServerFactory.getServer() will then throw a JCoException with an appropriate key to the JCo application.

Parameters:
serverName - the name of the JCoServer for which the provider should return the properties
Returns:
Properties for the JCoServer or null if the server configuration was not found
Throws:
DataProviderException - if an internal error occurred or a severe configuration error was detected.

supportsEvents

boolean supportsEvents()
Returns true if the implementation can support ServerDataEvents that allow a better integration into the JCo runtime management. If the implementation cannot support events it must return false. If you're not sure about the ability that your ServerDataProvider can guarantee to fire all events you may return false to be on the safe side.

If the implementation can support ServerDataEvents, the JCo runtime will set a ServerDataEventListener that is implemented by JCo.

Returns:
whether the implementation fully supports ServerDataEvents
See Also:
setServerDataEventListener(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-2016 SAP SE. All Rights Reserved.