Class HPCCWsClient


  • public class HPCCWsClient
    extends DataSingleton
    Convenient interface which exposes most common HPCC-centric activities. More actions, and more flexibility can be added in the future. If neither the HPCCWsClient nor the Service specific client classes expose a desired action, it can be executed by obtaining the SoapProxy from the appropriate client, an executing the web service method request directly.
    • Constructor Detail

      • HPCCWsClient

        protected HPCCWsClient()
        Instantiates HPCCWsClient, attempts to establish all communications on http://localhost:8010.
      • HPCCWsClient

        protected HPCCWsClient​(String protocol)
        Instantiates HPCCWsClient, attempts to establish all communications on <protocol>://localhost:<defaultportonprotocol>.
        Parameters:
        protocol - the protocol
      • HPCCWsClient

        protected HPCCWsClient​(String targetWsECLWatchAddress,
                               String targetWsECLWatchPort)
        Instantiates HPCCWsClient, communicates with HPCC on HTTP protocol.
        Parameters:
        targetWsECLWatchAddress - - The address of the WsECLWatch ESP on the Target HPCC System e.g. 192.168.1.100
        targetWsECLWatchPort - - The port on which WsECLWatch ESP is listening on the Target HPCC System usually 8010
      • HPCCWsClient

        protected HPCCWsClient​(String protocol,
                               String targetWsECLWatchAddress,
                               String targetWsECLWatchPort)
        Instantiates HPCCWsClient, communicates with HPCC over the given protocol.
        Parameters:
        protocol - the protocol
        targetWsECLWatchAddress - - The address of the WsECLWatch ESP on the Target HPCC System e.g. 192.168.1.100
        targetWsECLWatchPort - - The port on which WsECLWatch ESP is listening on the Target HPCC System usually 8010
      • HPCCWsClient

        public HPCCWsClient​(String targetWsECLWatchAddress,
                            String targetWsECLWatchPort,
                            String username,
                            String password)
        Instantiates HPCCWsClient, communicates with HPCC over http, and provides user/pass credentials.
        Parameters:
        targetWsECLWatchAddress - - The address of the WsECLWatch ESP on the Target HPCC System e.g. 192.168.1.100
        targetWsECLWatchPort - - The port on which WsECLWatch ESP is listening on the Target HPCC System usually 8010
        username - - ESP Username
        password - - ESP Password
      • HPCCWsClient

        protected HPCCWsClient​(String protocol,
                               String targetWsECLWatchAddress,
                               String targetWsECLWatchPort,
                               String username,
                               String password)
        Instantiates HPCCWsClient, communicates with HPCC over given protocol, and provides user/pass credentials.
        Parameters:
        protocol - - http | https
        targetWsECLWatchAddress - - The address of the WsECLWatch ESP on the Target HPCC System e.g. 192.168.1.100
        targetWsECLWatchPort - - The port on which WsECLWatch ESP is listening on the Target HPCC System usually 8010
        username - - ESP Username
        password - - ESP Password
      • HPCCWsClient

        protected HPCCWsClient​(Connection conn)
        Instantiates HPCCWsClient, uses contents of connection object to communicate with target HPCC System.
        Parameters:
        conn - the conn
    • Method Detail

      • get

        public static HPCCWsClient get​(String protocol,
                                       String targetWsECLWatchAddress,
                                       int targetWsECLWatchPort,
                                       String user,
                                       String password)
        Fetch pre-existing HPCCWsClient instance from collection, if pre-existing instance with exact connection option doesn't exist, create new instance.
        Parameters:
        protocol - the protocol
        targetWsECLWatchAddress - the target ws ECL watch address
        targetWsECLWatchPort - the target ws ECL watch port
        user - the user
        password - the password
        Returns:
        the HPCC ws client
      • getNoCreate

        public static HPCCWsClient getNoCreate​(String protocol,
                                               String targetWsECLWatchAddress,
                                               int targetWsECLWatchPort,
                                               String user,
                                               String password)
        Fetch pre-existing HPCCWsClient instance from collection, if pre-existing instance with exact connection option doesn't exist return null.
        Parameters:
        protocol - the protocol
        targetWsECLWatchAddress - the target ws ECL watch address
        targetWsECLWatchPort - the target ws ECL watch port
        user - the user
        password - the password
        Returns:
        the no create
      • remove

        public static void remove​(HPCCWsClient p)
        Remove an instance of HPCCWsClient from pool, and therefore from potential re-use.
        Parameters:
        p - the p
      • isVerbosemode

        public boolean isVerbosemode()
        Checks if is verbosemode.
        Returns:
        true if the client is set to be verbose
      • setVerbosemode

        public void setVerbosemode​(boolean verbosemode)
        sets the client verbose mode.
        Parameters:
        verbosemode - the new verbosemode
      • update

        public void update​(String protocol,
                           String targetWsECLWatchAddress,
                           String targetWsECLWatchPort,
                           String username,
                           String password)
        Caller can edit connection properties for this HPCCWsClient, then get appropriate subclient.
        Parameters:
        protocol - the protocol
        targetWsECLWatchAddress - the target ws ECL watch address
        targetWsECLWatchPort - the target ws ECL watch port
        username - the username
        password - the password
      • updateConnection

        public void updateConnection​(Connection conn)
        Caller can edit connection properties for this HPCCWsClient by providing connection object, then get appropriate subclient.
        Parameters:
        conn - the conn
      • getConnection

        protected Connection getConnection()
        get this HPCCWsClient's connection object.
        Returns:
        the connection
      • pingServer

        public boolean pingServer()
                           throws Exception
        Test availability of target HPCC ESP service.
        Returns:
        bool value indicating if ping success
        Throws:
        Exception - the exception
      • isContainerized

        public boolean isContainerized()
        Queries ECLWatch for containerized flag.
        Returns:
        a boolean.
      • getHPCCWsResourcesClient

        public HPCCWsResourcesClient getHPCCWsResourcesClient​(String wsresourcesport)
        Gets the HPCCWsResourcesClient client.
        Parameters:
        wsresourcesport - a String object.
        Returns:
        provides HPCCWsResourcesClient on a port other than ECLWatch port.
      • getHPCCWsResourcesClient

        public HPCCWsResourcesClient getHPCCWsResourcesClient()
        Gets the HPCCWsResourcesClient client.
        Returns:
        provides HPCCWsResourcesClient for direct method execution
      • getHPCCWsResourcesClientVer

        public String getHPCCWsResourcesClientVer()
        Reports the version of the original WSDL used to create the HPCCWsCodeSignClient logic.
        Returns:
        Original WSDL version
      • getWsCodeSignClient

        public HPCCWsCodeSignClient getWsCodeSignClient​(String codeSignPort)
        Gets the WsCodeSign client.
        Parameters:
        codeSignPort - a String object.
        Returns:
        provides WsCodeSign on a port other than ECLWatch port.
      • getWsCodeSignClient

        public HPCCWsCodeSignClient getWsCodeSignClient()
        Gets the WsCodeSign client.
        Returns:
        provides WsCodeSign for direct method execution
      • getHPCCWsCodeSignClientVer

        public String getHPCCWsCodeSignClientVer()
        Reports the version of the original WSDL used to create the HPCCWsCodeSignClient logic.
        Returns:
        Original WSDL version
      • getWsSQLClientVer

        public String getWsSQLClientVer()
        Reports the version of the original WSDL used to create the HPCCWsAttributesClient logic.
        Returns:
        Original WSDL version
      • getWsSQLClient

        public HPCCWsSQLClient getWsSQLClient​(String wsSQLPort)
        Gets the ws SQL client.
        Parameters:
        wsSQLPort - the ws SQL port
        Returns:
        provides wsSQLClient on a port other than ECLWatch port.
      • getWsSQLClient

        public HPCCWsSQLClient getWsSQLClient()
        Gets the ws SQL client.
        Returns:
        provides wsSQLClient for direct method execution
      • getWsAttributesClientVer

        public String getWsAttributesClientVer()
        Reports the version of the original WSDL used to create the HPCCWsAttributesClient logic.
        Returns:
        Original WSDL version
      • getWsAttributesClient

        public HPCCWsAttributesClient getWsAttributesClient​(String wsAttributesPort)
        provides WsAttributesClient for direct method execution.
        Parameters:
        wsAttributesPort - - If wsattributes is not running on eclwatch port
        Returns:
        the ws attributes client
      • getWsAttributesClient

        public HPCCWsAttributesClient getWsAttributesClient()
        Gets the ws attributes client.
        Returns:
        provides WsAttributesClient for direct method execution
      • getFileSprayClient

        public HPCCFileSprayClient getFileSprayClient()
        Gets the file spray client.
        Returns:
        provides fileSprayClient for direct method execution
      • getHPCCWsPackageProcessClientVer

        public String getHPCCWsPackageProcessClientVer()
        Reports the version of the original WSDL used to create the HPCCWsPackageProcessClient logic.
        Returns:
        Original WSDL version
      • getWsFileIOClientVer

        public String getWsFileIOClientVer()
        Reports the version of the original WSDL used to create the HPCCWsFileIOClient logic.
        Returns:
        Original WSDL version
      • getWsFileIOClient

        public HPCCWsFileIOClient getWsFileIOClient()
        Gets the ws file IO client.
        Returns:
        the ws file IO client
      • getWsPackageProcessClient

        public HPCCWsPackageProcessClient getWsPackageProcessClient()
        Gets the ws package process client.
        Returns:
        provides HPCCWsPackageProcessClient for direct method execution
      • getWsTopologyClientVer

        public String getWsTopologyClientVer()
        Reports the version of the original WSDL used to create the HPCCWsTopologyClient logic.
        Returns:
        Original WSDL version
      • getWsTopologyClient

        public HPCCWsTopologyClient getWsTopologyClient()
        Gets the ws topology client.
        Returns:
        the ws topology client
      • getwsDFUClientClientVer

        public String getwsDFUClientClientVer()
        Reports the version of the original WSDL used to create the HPCCWsSMCClient logic.
        Returns:
        Original WSDL version
      • getWsDFUClient

        public HPCCWsDFUClient getWsDFUClient()
        Gets the ws DFU client.
        Returns:
        the ws DFU client
      • getwsDFUXRefClientClientVer

        public String getwsDFUXRefClientClientVer()
        Reports the version of the original WSDL used to create the HPCCWsSMCClient logic.
        Returns:
        Original WSDL version
      • getWsDFUXRefClient

        public HPCCWsDFUXRefClient getWsDFUXRefClient()
        Gets the WsDFUXRef client.
        Returns:
        the WsDFUXRef client
      • getWsSMCClientClientVer

        public String getWsSMCClientClientVer()
        Reports the version of the original WSDL used to create the HPCCWsSMCClient logic.
        Returns:
        Original WSDL version
      • getWsSMCClient

        public HPCCWsSMCClient getWsSMCClient()
        Gets the ws SMC client.
        Returns:
        provides HPCCWsSMCClient for direct method execution
      • getWsWorkunitsClientVer

        public String getWsWorkunitsClientVer()
        Reports the version of the original WSDL used to create the HPCCWsWorkUnitsClient logic.
        Returns:
        Original WSDL version
      • getWsWorkunitsClient

        public HPCCWsWorkUnitsClient getWsWorkunitsClient()
        Gets the ws workunits client.
        Returns:
        provides HPCCWsWorkUnitsClient for direct method execution
      • getAvailableClusterGroups

        public String[] getAvailableClusterGroups()
                                           throws Exception
        Returns all the available cluster groups (hthor, thor, roxie, etc.) on the target HPCC System.
        Returns:
        - The available cluster groups (hthor, thor, roxie, etc.) on the target HPCC System.
        Throws:
        Exception - the exception
      • getAvailableClusterNames

        public String[] getAvailableClusterNames​(String clusterGroupType)
                                          throws Exception,
                                                 ArrayOfEspExceptionWrapper
        Returns all the available target cluster names (mythor, myroxie, etc) given a cluster group type/name (thor, roxie, etc.)
        Parameters:
        clusterGroupType - - The cluster group type/name
        Returns:
        - Names of all available target cluster in the given cluster group
        Throws:
        Exception - the exception
        ArrayOfEspExceptionWrapper - the array of esp exception wrapper
      • sprayFlatHPCCFile

        public boolean sprayFlatHPCCFile​(String fileName,
                                         String targetFileLabel,
                                         int recordSize,
                                         String targetCluster,
                                         boolean overwritesprayedfile)
        Spray a fixed record length data file onto a target cluster on the target HPCC System.
        Parameters:
        fileName - - The existing file (on the target HPCC System) to spray
        targetFileLabel - - The full label the sprayed file will be assigned
        recordSize - - The record length
        targetCluster - - The cluster on which to spray
        overwritesprayedfile - - Boolean, overwrite possibly sprayed file of same name
        Returns:
        - Boolean, success.
      • sprayCustomCSVHPCCFile

        public boolean sprayCustomCSVHPCCFile​(String fileName,
                                              String targetFileLabel,
                                              String targetCluster,
                                              String escapedEscapeSequence,
                                              String escapedFieldDelim,
                                              String escapedQuote,
                                              String escapedRecTerminator,
                                              boolean overwritesprayedfile,
                                              HPCCFileSprayClient.SprayVariableFormat format)
        Spray a variable/delimited data file onto a target cluster on the target HPCC System.
        Parameters:
        fileName - - The existing file (on the target HPCC System) to spray
        targetFileLabel - - The full label the sprayed file will be assigned
        targetCluster - - The cluster on which to spray
        escapedEscapeSequence - - The escape character sequence (must be escaped)
        escapedFieldDelim - - The field delimiter (must be escaped)
        escapedQuote - - The data quote (must be escaped)
        escapedRecTerminator - - The record terminator sequence (must be escaped)
        overwritesprayedfile - - Boolean, overwrite possibly sprayed file of same name
        format - - SprayVariableFormat
        Returns:
        - Boolean, success.
      • sprayDefaultCSVHPCCFile

        public boolean sprayDefaultCSVHPCCFile​(String fileName,
                                               String targetFileLabel,
                                               String targetCluster,
                                               boolean overwritesprayedfile)
        Spray a CSV delimited data file (default CSV options) onto a target cluster on the target HPCC System.
        Parameters:
        fileName - - The existing file (on the target HPCC System) to spray
        targetFileLabel - - The full label the sprayed file will be assigned
        targetCluster - - The cluster on which to spray
        overwritesprayedfile - - Boolean, overwrite possibly sprayed file of same name
        Returns:
        - Boolean, success.
      • sprayVariableHPCCFile

        public boolean sprayVariableHPCCFile​(String fileName,
                                             String targetFileLabel,
                                             String targetCluster,
                                             DelimitedDataOptions options,
                                             boolean overwritesprayedfile,
                                             HPCCFileSprayClient.SprayVariableFormat format)
        Spray a variable/delimited data file onto a target cluster on the target HPCC System.
        Parameters:
        fileName - - The existing file (on the target HPCC System) to spray
        targetFileLabel - - The full label the sprayed file will be assigned
        targetCluster - - The cluster on which to spray
        options - - Delimited file description
        overwritesprayedfile - - Boolean, overwrite possibly sprayed file of same name
        format - - SprayVariableFormat
        Returns:
        - Boolean, success.
      • handleSprayResponse

        public boolean handleSprayResponse​(org.hpccsystems.ws.client.wrappers.gen.filespray.ProgressResponseWrapper progressResponseWrapper)
                                    throws Exception,
                                           ArrayOfEspExceptionWrapper
        Handle spray response.
        Parameters:
        progressResponseWrapper - the progress response wrapper
        Returns:
        true, if successful
        Throws:
        Exception - the exception
        ArrayOfEspExceptionWrapper - the array of esp exception wrapper
      • uploadFileToHPCC

        public boolean uploadFileToHPCC​(String localFileName,
                                        String targetFilename,
                                        String machineLoginUser,
                                        String password)
        Preferred mechanism for uploading files to HPCC landingzone. Utilizes sftp protocol, requires target machine user account
        Parameters:
        localFileName - Fully qualified local file name to be uploaded
        targetFilename - Desired name to apply to uploaded file
        machineLoginUser - Target machine user account name
        password - Target machine user account password
        Returns:
        true, if successful
      • httpUploadFileToFirstHPCCLandingZone

        public boolean httpUploadFileToFirstHPCCLandingZone​(String localFileName)
        NOT the preferred mechanism for uploading files to HPCC landingzone. Utilizes http protocol, targets hpcc ws ONLY USE THIS METHOD for small files and/or when sftp access is not available
        Parameters:
        localFileName - Fully qualified local file name to be uploaded
        Returns:
        true, if successful
      • submitECLandGetResults

        public String submitECLandGetResults​(WorkunitWrapper wu)
                                      throws Exception
        Submits the given ECL to compile/execute on the targetclust, and returns results.
        Parameters:
        wu - - The workunit info object
        Returns:
        - If successful, the resulting dataset(s)
        Throws:
        Exception - the exception
      • submitECLandGetResultsList

        public List<List<Object>> submitECLandGetResultsList​(WorkunitWrapper wu)
                                                      throws Exception
        Submits the given ECL to compile/execute on the targetclust, and returns parsed results.
        Parameters:
        wu - - The workunit info
        Returns:
        - If successful, the resulting dataset(s)
        Throws:
        Exception - the exception
      • submitECLandGetWUID

        public String submitECLandGetWUID​(WorkunitWrapper wu)
        Submits the given ECL to compile/execute on the targetclust and returns WUID to track the query.
        Parameters:
        wu - - The workunit info to be submitted
        Returns:
        - If successful, the resulting WUID, which can be used to query info, including results
      • getProtocol

        public String getProtocol()
        Get this HPCCWsClient's connection protocol (http|https).
        Returns:
        the protocol
      • getHost

        public String getHost()
        Get this HPCCWsClient's connection host address.
        Returns:
        the host
      • getPortInt

        public int getPortInt()
        Get this HPCCWsClient's connection port.
        Returns:
        the port int
      • getUserName

        public String getUserName()
        Get the user name used to by HPCCWsClient to authenticate against target ECLWatch.
        Returns:
        the user name
      • getPassword

        public String getPassword()
        Get the password used to by HPCCWsClient to authenticate against target ECLWatch.
        Returns:
        the password