Class BaseHPCCWsClient

    • Field Detail

      • log

        protected static final org.apache.logging.log4j.Logger log
        Constant log
      • DEAFULTECLWATCHPORT

        public static final String DEAFULTECLWATCHPORT
        Constant DEAFULTECLWATCHPORT="8010"
        See Also:
        Constant Field Values
      • DEFAULTECLWATCHTLSPORT

        public static final String DEFAULTECLWATCHTLSPORT
        Constant DEFAULTECLWATCHTLSPORT="18010"
        See Also:
        Constant Field Values
      • DEFAULTSERVICEPORT

        public static String DEFAULTSERVICEPORT
        Constant DEFAULTSERVICEPORT="DEAFULTECLWATCHPORT"
      • verbose

        protected boolean verbose
      • initErrMessage

        protected String initErrMessage
      • targetHPCCBuildVersion

        protected Version targetHPCCBuildVersion
      • targetESPInterfaceVer

        protected Double targetESPInterfaceVer
      • targetsContainerizedHPCC

        protected Boolean targetsContainerizedHPCC
      • stub

        protected org.apache.axis2.client.Stub stub
    • Constructor Detail

      • BaseHPCCWsClient

        public BaseHPCCWsClient()
    • Method Detail

      • isTargetHPCCContainerized

        public boolean isTargetHPCCContainerized()
                                          throws Exception
        Throws:
        Exception
      • getTargetHPCCBuildVersion

        public Version getTargetHPCCBuildVersion()
        Gets the target HPCC build version
        Returns:
        the HPCC version
      • initBaseWsClient

        protected boolean initBaseWsClient​(Connection connection,
                                           boolean fetchVersionAndContainerMode)
        All instances of HPCCWsXYZClient should utilize this init function Attempts to establish the target HPCC build version and its container mode Populates initErrMessage if any issues are encountered.
        Parameters:
        connection - the WsClient connection
        fetchVersionAndContainerMode - services can choose not to fetch build version/containerized mode
        Returns:
        true if target HPCC cluster is Containerized, otherwise false
      • getDefaultStub

        public abstract org.apache.axis2.client.Stub getDefaultStub()
                                                             throws org.apache.axis2.AxisFault
        Gets the default stub.
        Returns:
        the default stub
        Throws:
        org.apache.axis2.AxisFault - the axis fault
      • getServiceVersion

        public static String getServiceVersion​(BaseHPCCWsClient client)
        Gets the service version.
        Parameters:
        client - the client
        Returns:
        the service version
      • getServiceVersion

        public static String getServiceVersion​(org.apache.axis2.client.Stub stub)
        Gets the service version.
        Parameters:
        stub - the stub
        Returns:
        the service version
      • getServiceWSDLURL

        public static String getServiceWSDLURL​(org.apache.axis2.client.Stub stub)
        Gets the service WSDLURL.
        Parameters:
        stub - the stub
        Returns:
        the service WSDLURL
      • getServiceWSDLPort

        public static int getServiceWSDLPort​(org.apache.axis2.client.Stub stub)
                                      throws MalformedURLException
        Gets the service WSDL port.
        Parameters:
        stub - the stub
        Returns:
        the service WSDL port
        Throws:
        MalformedURLException - the malformed URL exception
      • getConnectionURL

        public URL getConnectionURL()
                             throws Exception
        Gets the connection URL.
        Returns:
        the connection URL
        Throws:
        Exception - the exception
      • setVerbose

        public void setVerbose​(boolean verbose)
        Sets the verbose.
        Parameters:
        verbose - - sets verbose mode
      • getVerbose

        public boolean getVerbose()
        Gets the verbose.
        Returns:
        the verbose
      • hasInitError

        public boolean hasInitError()
        Should be called after instantiation to confirm Successful initialization. The client init can fail due to many different types of issues including invalid connectivity options, invalid credentials, etc
        Returns:
        true, if successful
      • getInitError

        public String getInitError()
        Returns error message encountered during initialization of wsdfuclient. Empty string if no error encountered
        Returns:
        the inits the error
      • verifyStub

        protected org.apache.axis2.client.Stub verifyStub()
                                                   throws Exception
        Provides Stub object if available, otherwise throws Object can be used to access the web service methods directly.
        Returns:
        the stub
        Throws:
        Exception - the exception
      • setStubConnectionTO

        protected void setStubConnectionTO​(int millis)
                                    throws org.apache.axis2.AxisFault
        Sets the stub connection TO.
        Parameters:
        millis - the new stub connection TO
        Throws:
        org.apache.axis2.AxisFault - the axis fault
      • getStubConnectionTO

        protected Integer getStubConnectionTO()
                                       throws org.apache.axis2.AxisFault
        Gets the stub connection TO.
        Returns:
        the stub connection TO
        Throws:
        org.apache.axis2.AxisFault - the axis fault
      • setStubOptions

        public static org.apache.axis2.client.Stub setStubOptions​(org.apache.axis2.client.Stub thestub,
                                                                  Connection connection)
                                                           throws org.apache.axis2.AxisFault
        Sets the stub options defaults preemptiveauth to 'true;
        Parameters:
        thestub - The Axis generated service stub
        connection - The connection
        Returns:
        the stub
        Throws:
        org.apache.axis2.AxisFault - the axis fault
      • setClientAuth

        public static org.apache.axis2.client.Options setClientAuth​(String user,
                                                                    String pass,
                                                                    org.apache.axis2.client.Options opt)
        Sets the client auth.
        Parameters:
        user - the user
        pass - the pass
        opt - the opt
        Returns:
        the options
      • handleEspSoapFaults

        protected void handleEspSoapFaults​(EspSoapFaultWrapper e,
                                           String message)
                                    throws EspSoapFaultWrapper
        Logs and throws EspSoapFaultWrapper, if local message provided, added as wsclientmessage.
        Parameters:
        e - the e
        message - the message
        Throws:
        EspSoapFaultWrapper - the esp soap fault wrapper
      • getTargetESPInterfaceVersion

        public double getTargetESPInterfaceVersion()
        Provides the target ESP Interface version
        Returns:
        The runtime ESP interface default version
      • setActiveConnectionInfo

        protected void setActiveConnectionInfo​(Connection conn)
        Stores active connection information for post-initialization use
        Parameters:
        conn - Connection object
      • getServiceURI

        public abstract String getServiceURI()
        All implementations must provide the target web service URI
        Returns:
        a String object.
      • loadESPRuntimeInterfaceVer

        protected void loadESPRuntimeInterfaceVer()
        Attempts to retrieve the default WSDL version of the target runtime ESP service Appends the target ESP service path and the "version_" literal to the connection's base URL
      • compatibilityCheck

        protected boolean compatibilityCheck​(int major,
                                             int minor,
                                             int point)
        Determine if target HPCC's build version is compatible with a given version.
        Parameters:
        major - a int.
        minor - a int.
        point - a int.
        Returns:
        boolean true if server build version >= input version
      • compatibilityCheck

        protected boolean compatibilityCheck​(Version input)
        Determine if target HPCC's build version is compatible with a given version.
        Parameters:
        input - the input
        Returns:
        boolean true if server build version >= input version