Class 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:
    
     
       {
         Partition part = jcsSession.getPartitionByName("MyPartition");
         SAPSystem sapSystem = jcsSession.getSAPSystemByName(part, "NSP");
         RfcConnectionManager rfcConnectionManager = new RfcConnectionManager(sapSystem);
       }
      
    Connecting using the SAP System, client, and credential:
     
       {
         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);
       }
     
    The credential protocol must be 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.)
     
       {
         Partition part = jcsSession.getPartitionByName("MyPartition");
         SAPSystem sapSystem = jcsSession.getSAPSystemByName(part, "NSP");
         RfcConnectionManager rfcConnectionManager = new RfcConnectionManager(sapSystem, "000", "user", passwordParameter);
       }
     
    Connecting using the name of the SAP System; will use the default client:
     
       {
         RfcConnectionManager rfcConnectionManager = new RfcConnectionManager(jcsSession, "MyPartition.NSP");
       }
     
    • 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 to
        clientNumber - 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 to
        clientNumber - client number to use
        credential - credential with protocol SAP_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 to
        clientNumber - client number to use
        language - 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 to
        clientNumber - client number to use
        language - language
        credential - credential with protocol SAP_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 to
        clientNumber - client number to use
        user - SAP user name
        password - 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 to
        clientNumber - client number to use
        user - user name
        password - password
        language - 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 object
        sapSystemName - 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 object
        sapSystemName - 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 object
        sapSystemName - name of SAP system to connect to.
        clientNumber - client number to use
        credential - credential with protocol SAP_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 object
        sapSystemName - name of SAP system to connect to.
        clientNumber - client number to use
        language - 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 object
        sapSystemName - name of SAP system to connect to.
        clientNumber - client number to use
        language - language
        credential - credential with protocol SAP_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 object
        sapSystemName - name of SAP system to connect to.
        clientNumber - client number to use
        user - user name
        password - 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 object
        sapSystemName - name of SAP system to connect to.
        clientNumber - client number to use
        user - user name
        password - password
        language - language
    • Method Detail

      • getXBPClient

        public static SAPXBP getXBPClient​(SAPSystem sapSystem,
                                          String clientNumber)
        Returns the SAPXBP client for the given SAP system and client number
        Parameters:
        sapSystem - the SAPSystem SAP System object.
        clientNumber - client number of the SAPSystem
        Returns:
        the SAPXBP object 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