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 Summary

      Constructors 
      Constructor Description
      RfcConnectionManager​(com.redwood.scheduler.api.model.SAPSystem sapSystem)
      Create an RFC connection manager for the given SAP system.
      RfcConnectionManager​(com.redwood.scheduler.api.model.SAPSystem sapSystem, String clientNumber)
      Create an RFC connection manager for the given SAP system.
      RfcConnectionManager​(com.redwood.scheduler.api.model.SAPSystem sapSystem, String clientNumber, com.redwood.scheduler.api.model.Credential credential)
      Create an RFC connection manager for the given SAP system.
      RfcConnectionManager​(com.redwood.scheduler.api.model.SAPSystem sapSystem, String clientNumber, String language)
      Create an RFC connection manager for the given SAP system.
      RfcConnectionManager​(com.redwood.scheduler.api.model.SAPSystem sapSystem, String clientNumber, String language, com.redwood.scheduler.api.model.Credential credential)
      Create an RFC connection manager for the given SAP system.
      RfcConnectionManager​(com.redwood.scheduler.api.model.SAPSystem sapSystem, String clientNumber, String user, String password)
      Create an RFC connection manager for the given SAP system.
      RfcConnectionManager​(com.redwood.scheduler.api.model.SAPSystem sapSystem, String clientNumber, String user, String password, String language)
      Create an RFC connection manager for the given SAP system.
      RfcConnectionManager​(com.redwood.scheduler.api.model.SchedulerSession session, String sapSystemName)
      Create an RFC connection manager for the given SAP system name.
      RfcConnectionManager​(com.redwood.scheduler.api.model.SchedulerSession session, String sapSystemName, String clientNumber)
      Create an RFC connection manager for the given SAP system name.
      RfcConnectionManager​(com.redwood.scheduler.api.model.SchedulerSession session, String sapSystemName, String clientNumber, com.redwood.scheduler.api.model.Credential credential)
      Create an RFC connection manager for the given SAP system.
      RfcConnectionManager​(com.redwood.scheduler.api.model.SchedulerSession session, String sapSystemName, String clientNumber, String language)
      Create an RFC connection manager for the given SAP system name.
      RfcConnectionManager​(com.redwood.scheduler.api.model.SchedulerSession session, String sapSystemName, String clientNumber, String language, com.redwood.scheduler.api.model.Credential credential)
      Create an RFC connection manager for the given SAP system.
      RfcConnectionManager​(com.redwood.scheduler.api.model.SchedulerSession session, String sapSystemName, String clientNumber, String user, String password)
      Create an RFC connection manager for the given SAP system.
      RfcConnectionManager​(com.redwood.scheduler.api.model.SchedulerSession session, String sapSystemName, String clientNumber, String user, String password, String language)
      Create an RFC connection manager for the given SAP system.
    • Constructor Detail

      • RfcConnectionManager

        public RfcConnectionManager​(com.redwood.scheduler.api.model.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​(com.redwood.scheduler.api.model.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​(com.redwood.scheduler.api.model.SAPSystem sapSystem,
                                    String clientNumber,
                                    com.redwood.scheduler.api.model.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​(com.redwood.scheduler.api.model.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​(com.redwood.scheduler.api.model.SAPSystem sapSystem,
                                    String clientNumber,
                                    String language,
                                    com.redwood.scheduler.api.model.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​(com.redwood.scheduler.api.model.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​(com.redwood.scheduler.api.model.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​(com.redwood.scheduler.api.model.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​(com.redwood.scheduler.api.model.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​(com.redwood.scheduler.api.model.SchedulerSession session,
                                    String sapSystemName,
                                    String clientNumber,
                                    com.redwood.scheduler.api.model.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​(com.redwood.scheduler.api.model.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​(com.redwood.scheduler.api.model.SchedulerSession session,
                                    String sapSystemName,
                                    String clientNumber,
                                    String language,
                                    com.redwood.scheduler.api.model.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​(com.redwood.scheduler.api.model.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​(com.redwood.scheduler.api.model.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

      • getSapSystem

        public static com.redwood.scheduler.api.model.SAPSystem getSapSystem​(com.redwood.scheduler.api.model.SchedulerSession session,
                                                                             String sapSystemName)
        Fetches the SAPSystem with the given businessKey.
        Parameters:
        session - the SchedulerSession to use to do the lookup.
        sapSystemName - the businessKey of the SAPSystem
        Returns:
        the SAPSystem with the given name.
      • getXBPClient

        public static com.redwood.scheduler.api.model.SAPXBP getXBPClient​(com.redwood.scheduler.api.model.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
      • callRFC

        public void callRFC​(RfcWork rfcWork)
        Establish an RFC connection and execute the script.
        Parameters:
        rfcWork -
      • 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

        @Deprecated
        public void callXBP​(XbpWork xbpWork,
                            String xbpVersion)
        Deprecated.
        use (@link callXbp} instead, xbpVersion is not set, the interface uses the highest version available
        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