Class RfcConnectionManager
- java.lang.Object
-
- com.redwood.scheduler.api.connector.sap.rfc.scripting.RfcConnectionManager
-
public class RfcConnectionManager extends Object
The connection manager allows you to establish an RFC connection to an SAP system.Connecting using the SAP System; will use the default client:
Connecting using the SAP System, client, and credential:{ Partition part = jcsSession.getPartitionByName("MyPartition"); SAPSystem sapSystem = jcsSession.getSAPSystemByName(part, "NSP"); RfcConnectionManager rfcConnectionManager = new RfcConnectionManager(sapSystem); }
{ Partition part = jcsSession.getPartitionByName("MyPartition"); SAPSystem sapSystem = jcsSession.getSAPSystemByName(part, "NSP"); Credential credential = jcsSession.getCredentialByCredentialProtocolEndpointRealUser(part, "SAP_RFC", "MyPartition.NSP", "jdoe"); RfcConnectionManager rfcConnectionManager = new RfcConnectionManager(sapSystem, "000", credential); }
SAP_RFC
, the 'Endpoint' should be filled with the 'partition.name' of the SAP system, the 'Real User' with the SAP user name.Connecting using the SAP System, client, username, and password (here, the password is stored in a parameter of type Password.)
Connecting using the name of the SAP System; will use the default client:{ Partition part = jcsSession.getPartitionByName("MyPartition"); SAPSystem sapSystem = jcsSession.getSAPSystemByName(part, "NSP"); RfcConnectionManager rfcConnectionManager = new RfcConnectionManager(sapSystem, "000", "user", passwordParameter); }
{ RfcConnectionManager rfcConnectionManager = new RfcConnectionManager(jcsSession, "MyPartition.NSP"); }
-
-
Constructor Summary
Constructors Constructor Description RfcConnectionManager(SAPSystem sapSystem)
Create an RFC connection manager for the given SAP system.RfcConnectionManager(SAPSystem sapSystem, String clientNumber)
Create an RFC connection manager for the given SAP system.RfcConnectionManager(SAPSystem sapSystem, String clientNumber, Credential credential)
Create an RFC connection manager for the given SAP system.RfcConnectionManager(SAPSystem sapSystem, String clientNumber, String language)
Create an RFC connection manager for the given SAP system.RfcConnectionManager(SAPSystem sapSystem, String clientNumber, String language, Credential credential)
Create an RFC connection manager for the given SAP system.RfcConnectionManager(SAPSystem sapSystem, String clientNumber, String user, String password)
Create an RFC connection manager for the given SAP system.RfcConnectionManager(SAPSystem sapSystem, String clientNumber, String user, String password, String language)
Create an RFC connection manager for the given SAP system.RfcConnectionManager(SchedulerSession session, String sapSystemName)
Create an RFC connection manager for the given SAP system name.RfcConnectionManager(SchedulerSession session, String sapSystemName, String clientNumber)
Create an RFC connection manager for the given SAP system name.RfcConnectionManager(SchedulerSession session, String sapSystemName, String clientNumber, Credential credential)
Create an RFC connection manager for the given SAP system.RfcConnectionManager(SchedulerSession session, String sapSystemName, String clientNumber, String language)
Create an RFC connection manager for the given SAP system name.RfcConnectionManager(SchedulerSession session, String sapSystemName, String clientNumber, String language, Credential credential)
Create an RFC connection manager for the given SAP system.RfcConnectionManager(SchedulerSession session, String sapSystemName, String clientNumber, String user, String password)
Create an RFC connection manager for the given SAP system.RfcConnectionManager(SchedulerSession session, String sapSystemName, String clientNumber, String user, String password, String language)
Create an RFC connection manager for the given SAP system.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
callXBP(XbpWork xbpWork)
Establish an RFC connection, login to the XBP interface and execute the script.void
callXBP(XbpWork xbpWork, String xbpVersion)
Establish an RFC connection, login to the XBP interface with the given version and execute the script NOTE: only XBP version 1.0 or higher is supportedstatic SAPSystem
getSapSystem(SchedulerSession session, String sapSystemName)
Fetches theSAPSystem
with the given businessKey.static SAPXBP
getXBPClient(SAPSystem sapSystem, String clientNumber)
Returns theSAPXBP
client for the given SAP system and client numbervoid
setMaxReconnectTime(long newMaxReconnectTime)
Change default reconnect time
-
-
-
Constructor Detail
-
RfcConnectionManager
public RfcConnectionManager(SAPSystem sapSystem)
Create an RFC connection manager for the given SAP system. Settings of the default client will be used to establish the RFC connection.- Parameters:
sapSystem
- SAP system to connect to
-
RfcConnectionManager
public RfcConnectionManager(SAPSystem sapSystem, String clientNumber)
Create an RFC connection manager for the given SAP system. Settings of the given client will be used to establish the RFC connection.- Parameters:
sapSystem
- SAP system to connect toclientNumber
- client number to use
-
RfcConnectionManager
public RfcConnectionManager(SAPSystem sapSystem, String clientNumber, Credential credential)
Create an RFC connection manager for the given SAP system. The RFC connection will be established using the given client and credential.- Parameters:
sapSystem
- SAP system to connect toclientNumber
- client number to usecredential
- credential with protocolSAP_RFC
-
RfcConnectionManager
public RfcConnectionManager(SAPSystem sapSystem, String clientNumber, String language)
Create an RFC connection manager for the given SAP system. Settings of the given client will be used to establish the RFC connection.- Parameters:
sapSystem
- SAP system to connect toclientNumber
- client number to uselanguage
- language
-
RfcConnectionManager
public RfcConnectionManager(SAPSystem sapSystem, String clientNumber, String language, Credential credential)
Create an RFC connection manager for the given SAP system. The RFC connection will be established using the given client and credential.- Parameters:
sapSystem
- SAP system to connect toclientNumber
- client number to uselanguage
- languagecredential
- credential with protocolSAP_RFC
-
RfcConnectionManager
public RfcConnectionManager(SAPSystem sapSystem, String clientNumber, String user, String password)
Create an RFC connection manager for the given SAP system. Settings of the given client, user name and password will be used to establish the RFC connection.- Parameters:
sapSystem
- SAP system to connect toclientNumber
- client number to useuser
- SAP user namepassword
- password
-
RfcConnectionManager
public RfcConnectionManager(SAPSystem sapSystem, String clientNumber, String user, String password, String language)
Create an RFC connection manager for the given SAP system. Settings of the given client, user name and password will be used to establish the RFC connection.- Parameters:
sapSystem
- SAP system to connect toclientNumber
- client number to useuser
- user namepassword
- passwordlanguage
- language
-
RfcConnectionManager
public RfcConnectionManager(SchedulerSession session, String sapSystemName)
Create an RFC connection manager for the given SAP system name. Settings of the default client will be used to establish the RFC connection.- Parameters:
session
- scheduler session to retrieve the SAP system objectsapSystemName
- name of SAP system to connect to.
-
RfcConnectionManager
public RfcConnectionManager(SchedulerSession session, String sapSystemName, String clientNumber)
Create an RFC connection manager for the given SAP system name. Settings of the given client will be used to establish the RFC connection.- Parameters:
session
- scheduler session to retrieve the SAP system objectsapSystemName
- name of SAP system to connect to.clientNumber
- client number to use
-
RfcConnectionManager
public RfcConnectionManager(SchedulerSession session, String sapSystemName, String clientNumber, Credential credential)
Create an RFC connection manager for the given SAP system. The RFC connection will be established using the given client and credential.- Parameters:
session
- scheduler session to retrieve the SAP system objectsapSystemName
- name of SAP system to connect to.clientNumber
- client number to usecredential
- credential with protocolSAP_RFC
-
RfcConnectionManager
public RfcConnectionManager(SchedulerSession session, String sapSystemName, String clientNumber, String language)
Create an RFC connection manager for the given SAP system name. Settings of the given client will be used to establish the RFC connection.- Parameters:
session
- scheduler session to retrieve the SAP system objectsapSystemName
- name of SAP system to connect to.clientNumber
- client number to uselanguage
- language
-
RfcConnectionManager
public RfcConnectionManager(SchedulerSession session, String sapSystemName, String clientNumber, String language, Credential credential)
Create an RFC connection manager for the given SAP system. The RFC connection will be established using the given client and credential.- Parameters:
session
- scheduler session to retrieve the SAP system objectsapSystemName
- name of SAP system to connect to.clientNumber
- client number to uselanguage
- languagecredential
- credential with protocolSAP_RFC
-
RfcConnectionManager
public RfcConnectionManager(SchedulerSession session, String sapSystemName, String clientNumber, String user, String password)
Create an RFC connection manager for the given SAP system. Settings of the given client, user name and password will be used to establish the RFC connection.- Parameters:
session
- scheduler session to retrieve the SAP system objectsapSystemName
- name of SAP system to connect to.clientNumber
- client number to useuser
- user namepassword
- password
-
RfcConnectionManager
public RfcConnectionManager(SchedulerSession session, String sapSystemName, String clientNumber, String user, String password, String language)
Create an RFC connection manager for the given SAP system. Settings of the given client, user name and password will be used to establish the RFC connection.- Parameters:
session
- scheduler session to retrieve the SAP system objectsapSystemName
- name of SAP system to connect to.clientNumber
- client number to useuser
- user namepassword
- passwordlanguage
- language
-
-
Method Detail
-
getSapSystem
public static SAPSystem getSapSystem(SchedulerSession session, String sapSystemName)
Fetches theSAPSystem
with the given businessKey.- Parameters:
session
- theSchedulerSession
to use to do the lookup.sapSystemName
- the businessKey of theSAPSystem
- Returns:
- the
SAPSystem
with the given name.
-
getXBPClient
public static SAPXBP getXBPClient(SAPSystem sapSystem, String clientNumber)
Returns theSAPXBP
client for the given SAP system and client number
-
callXBP
public void callXBP(XbpWork xbpWork)
Establish an RFC connection, login to the XBP interface and execute the script. The version of the XBP interface will be taken from the SAP system, or determined automatically. NOTE: only XBP version 1.0 or higher is supported- Parameters:
xbpWork
-
-
callXBP
public void callXBP(XbpWork xbpWork, String xbpVersion)
Establish an RFC connection, login to the XBP interface with the given version and execute the script NOTE: only XBP version 1.0 or higher is supported- Parameters:
xbpWork
-xbpVersion
-
-
setMaxReconnectTime
public void setMaxReconnectTime(long newMaxReconnectTime)
Change default reconnect time- Parameters:
newMaxReconnectTime
- max reconnect time in seconds. If less than zero, then no reconnect will tried, when zero, then reconnect will be tried indefinitely, otherwise reconnect will be tried for the given number of seconds
-
-