Package org.hpccsystems.ws.client
Class HPCCWsSQLClient
- java.lang.Object
-
- java.util.Observable
-
- org.hpccsystems.ws.client.utils.DataSingleton
-
- org.hpccsystems.ws.client.BaseHPCCWsClient
-
- org.hpccsystems.ws.client.HPCCWsSQLClient
-
public class HPCCWsSQLClient extends BaseHPCCWsClient
Facilitates SQL based action onto target HPCC Systems instance. All actions supported treat HPCC Systems as a standard database system. Supported actions include fetching HPCC 'database' metadata, tables, and stored procedures. Client can submit SQL based queries, execute prepared SQL queries, fetch results, and more.
-
-
Field Summary
Fields Modifier and Type Field Description static String
WSSQLURI
ConstantWSSQLURI="/WsSQL"
-
Fields inherited from class org.hpccsystems.ws.client.BaseHPCCWsClient
DEAFULTECLWATCHPORT, DEFAULTECLWATCHTLSPORT, initErrMessage, PROJECT_NAME, stub, targetESPInterfaceVer, targetHPCCBuildVersion, targetsContainerizedHPCC, verbose, wsconn
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
HPCCWsSQLClient(Connection baseConnection)
Instantiates a new HPCC ws SQL client.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.hpccsystems.ws.client.wrappers.gen.wssql.ExecutePreparedSQLResponseWrapper
executePreparedSQL(String wuid, String targetCluster, org.hpccsystems.ws.client.wrappers.gen.wssql.NamedValueWrapper[] variables, Integer wait, Integer resultLimit, Integer resultWindowStart, Integer resultWindowCount, String userName, Boolean suppressXmlSchema, Boolean suppressResults)
Execute prepared SQL.org.hpccsystems.ws.client.wrappers.gen.wssql.ECLWorkunitWrapper
executePreparedSQL(String wuid, String targetCluster, org.hpccsystems.ws.client.wrappers.gen.wssql.NamedValueWrapper[] variables, Integer wait, Integer resultLimit, String userName)
Execute prepared SQL.List<List<Object>>
executePreparedSQL(String wuid, String targetCluster, org.hpccsystems.ws.client.wrappers.gen.wssql.NamedValueWrapper[] variables, Integer wait, Integer resultLimit, String userName, String somesing)
Execute prepared SQL.org.hpccsystems.ws.client.wrappers.gen.wssql.ExecuteSQLResponseWrapper
executeSQLFullResponse(String sqlText, String targetCluster, String targetQuerySet, Integer resultLimit, Integer resultWindowCount, Integer resultWindowStart, Boolean suppressResults, Boolean suppressXmlSchema, String userName, Integer wait)
Execute SQL full response.String
executeSQLWUIDResponse(String sqlText, String targetCluster, String targetQuerySet)
Execute SQLWUID response.org.hpccsystems.ws.client.wrappers.gen.wssql.ECLWorkunitWrapper
executeSQLWUResponse(String sqlText, String targetCluster, String targetQuerySet, Integer resultLimit, Integer resultWindowCount, Integer resultWindowStart, Boolean suppressResults, Boolean suppressXmlSchema, String userName, Integer wait)
Execute SQLWU response.static HPCCWsSQLClient
get(String protocol, String targetHost, String targetPort, String user, String pass)
Gets the.static HPCCWsSQLClient
get(String protocol, String targetHost, String targetPort, String user, String pass, int timeout)
Gets the.static HPCCWsSQLClient
get(Connection connection)
Gets the.org.apache.axis2.client.Stub
getDefaultStub()
Gets the default stub.org.hpccsystems.ws.client.wrappers.gen.wssql.GetResultsResponseWrapper
getResultResponse(String wuid, Integer resultWindowStart, Integer resultWindowCount, Boolean suppressXmlSchema)
Gets the result response.List<List<Object>>
getResults(String wuid, Integer resultWindowStart, Integer resultWindowCount)
Gets the results.List<List<Object>>
getResultSchema(String wuid)
Gets the result schema.String
getResultSchemaXML(String wuid)
Gets the result schema XML.String
getServiceURI()
Gets the service URI.static int
getServiceWSDLPort()
Gets the service WSDL port.static String
getServiceWSDLURL()
Gets the service WSDLURL.org.hpccsystems.ws.client.wrappers.gen.wssql.HPCCQuerySetWrapper[]
getStoredProcedures(String querysetname)
Gets the stored procedures.org.hpccsystems.ws.client.wrappers.gen.wssql.HPCCTableWrapper[]
getTables(String filter)
Gets the tables.String[]
getTargetClusters(String filter)
Gets the target clusters.Version
getVersion()
Gets the version.boolean
isWsSQLReachable()
Checks if is ws SQL reachable.boolean
ping()
Ping.org.hpccsystems.ws.client.wrappers.gen.wssql.ECLWorkunitWrapper
prepareSQL(String sqlText, String targetCluster, String targetQuerySet, Integer wait)
Prepare SQL.-
Methods inherited from class org.hpccsystems.ws.client.BaseHPCCWsClient
compatibilityCheck, compatibilityCheck, equals, fastRefresh, fullRefresh, getConnectionURL, getInitError, getServiceVersion, getServiceVersion, getServiceWSDLPort, getServiceWSDLURL, getStubConnectionTO, getTargetESPInterfaceVersion, getTargetHPCCBuildVersion, getVerbose, getWsClientSpanBuilder, getWsClientTracer, handleECLExceptions, handleECLExceptions, handleEspExceptions, handleEspExceptions, handleEspSoapFaults, handleEspSoapFaults, hashCode, hasInitError, initBaseWsClient, injectCurrentSpanTraceParentHeader, injectCurrentSpanTraceParentHeader, isComplete, isTargetHPCCContainerized, loadESPRuntimeInterfaceVer, setActiveConnectionInfo, setClientAuth, setStubConnectionTO, setStubOptions, setUpBuildVersionParser, setUpContainerizedParser, setUpversionParser, setVerbose, verifyStub
-
Methods inherited from class org.hpccsystems.ws.client.utils.DataSingleton
monitor
-
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
-
-
-
Field Detail
-
WSSQLURI
public static final String WSSQLURI
ConstantWSSQLURI="/WsSQL"
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HPCCWsSQLClient
protected HPCCWsSQLClient(Connection baseConnection)
Instantiates a new HPCC ws SQL client.- Parameters:
baseConnection
- the base connection
-
-
Method Detail
-
getServiceURI
public String getServiceURI()
Gets the service URI.- Specified by:
getServiceURI
in classBaseHPCCWsClient
- Returns:
- the service URI
-
getServiceWSDLURL
public static String getServiceWSDLURL()
Gets the service WSDLURL.- Returns:
- the service WSDLURL
-
getServiceWSDLPort
public static int getServiceWSDLPort()
Gets the service WSDL port.- Returns:
- the service WSDL port
-
get
public static HPCCWsSQLClient get(Connection connection)
Gets the.- Parameters:
connection
- the connection- Returns:
- the HPCC ws SQL client
-
get
public static HPCCWsSQLClient get(String protocol, String targetHost, String targetPort, String user, String pass)
Gets the.- Parameters:
protocol
- the protocoltargetHost
- the target hosttargetPort
- the target portuser
- the userpass
- the pass- Returns:
- the HPCC ws SQL client
-
get
public static HPCCWsSQLClient get(String protocol, String targetHost, String targetPort, String user, String pass, int timeout)
Gets the.- Parameters:
protocol
- the protocoltargetHost
- the target hosttargetPort
- the target portuser
- the userpass
- the passtimeout
- the timeout- Returns:
- the HPCC ws SQL client
-
ping
public boolean ping() throws Exception
Ping.- Returns:
- true, if successful
- Throws:
Exception
- the exception
-
isWsSQLReachable
public boolean isWsSQLReachable()
Checks if is ws SQL reachable.- Returns:
- true, if is ws SQL reachable
-
getTargetClusters
public String[] getTargetClusters(String filter) throws Exception, ArrayOfEspExceptionWrapper
Gets the target clusters.- Parameters:
filter
- the filter- Returns:
- the target clusters
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp exception wrapper
-
getTables
public org.hpccsystems.ws.client.wrappers.gen.wssql.HPCCTableWrapper[] getTables(String filter) throws Exception, ArrayOfEspExceptionWrapper
Gets the tables.- Parameters:
filter
- the filter- Returns:
- the tables
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp exception wrapper
-
getStoredProcedures
public org.hpccsystems.ws.client.wrappers.gen.wssql.HPCCQuerySetWrapper[] getStoredProcedures(String querysetname) throws Exception, ArrayOfEspExceptionWrapper
Gets the stored procedures.- Parameters:
querysetname
- the querysetname- Returns:
- the stored procedures
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp exception wrapper
-
getVersion
public Version getVersion()
Gets the version.- Returns:
- the version
-
executeSQLWUIDResponse
public String executeSQLWUIDResponse(String sqlText, String targetCluster, String targetQuerySet) throws Exception, ArrayOfEspExceptionWrapper, ArrayOfECLExceptionWrapper
Execute SQLWUID response.- Parameters:
sqlText
- the sql texttargetCluster
- the target clustertargetQuerySet
- the target query set- Returns:
- the string
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp exception wrapperArrayOfECLExceptionWrapper
- the array of ECL exception wrapper
-
executeSQLFullResponse
public org.hpccsystems.ws.client.wrappers.gen.wssql.ExecuteSQLResponseWrapper executeSQLFullResponse(String sqlText, String targetCluster, String targetQuerySet, Integer resultLimit, Integer resultWindowCount, Integer resultWindowStart, Boolean suppressResults, Boolean suppressXmlSchema, String userName, Integer wait) throws Exception, ArrayOfEspExceptionWrapper, ArrayOfECLExceptionWrapper
Execute SQL full response.- Parameters:
sqlText
- the sql texttargetCluster
- the target clustertargetQuerySet
- the target query setresultLimit
- the result limitresultWindowCount
- the result window countresultWindowStart
- the result window startsuppressResults
- the suppress resultssuppressXmlSchema
- the suppress xml schemauserName
- the user namewait
- the wait- Returns:
- the execute SQL response wrapper
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp exception wrapperArrayOfECLExceptionWrapper
- the array of ECL exception wrapper
-
executeSQLWUResponse
public org.hpccsystems.ws.client.wrappers.gen.wssql.ECLWorkunitWrapper executeSQLWUResponse(String sqlText, String targetCluster, String targetQuerySet, Integer resultLimit, Integer resultWindowCount, Integer resultWindowStart, Boolean suppressResults, Boolean suppressXmlSchema, String userName, Integer wait) throws Exception, ArrayOfEspExceptionWrapper, ArrayOfECLExceptionWrapper
Execute SQLWU response.- Parameters:
sqlText
- the sql texttargetCluster
- the target clustertargetQuerySet
- the target query setresultLimit
- the result limitresultWindowCount
- the result window countresultWindowStart
- the result window startsuppressResults
- the suppress resultssuppressXmlSchema
- the suppress xml schemauserName
- the user namewait
- the wait- Returns:
- the ECL workunit wrapper
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp exception wrapperArrayOfECLExceptionWrapper
- the array of ECL exception wrapper
-
getResults
public List<List<Object>> getResults(String wuid, Integer resultWindowStart, Integer resultWindowCount) throws Exception, ArrayOfEspExceptionWrapper, ArrayOfECLExceptionWrapper
Gets the results.- Parameters:
wuid
- the wuidresultWindowStart
- the result window startresultWindowCount
- the result window count- Returns:
- the results
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp exception wrapperArrayOfECLExceptionWrapper
- the array of ECL exception wrapper
-
getResultResponse
public org.hpccsystems.ws.client.wrappers.gen.wssql.GetResultsResponseWrapper getResultResponse(String wuid, Integer resultWindowStart, Integer resultWindowCount, Boolean suppressXmlSchema) throws Exception, ArrayOfEspExceptionWrapper, ArrayOfECLExceptionWrapper
Gets the result response.- Parameters:
wuid
- the wuidresultWindowStart
- the result window startresultWindowCount
- the result window countsuppressXmlSchema
- the suppress xml schema- Returns:
- the result response
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp exception wrapperArrayOfECLExceptionWrapper
- the array of ECL exception wrapper
-
getResultSchemaXML
public String getResultSchemaXML(String wuid) throws Exception, ArrayOfEspExceptionWrapper, ArrayOfECLExceptionWrapper
Gets the result schema XML.- Parameters:
wuid
- the wuid- Returns:
- the result schema XML
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp exception wrapperArrayOfECLExceptionWrapper
- the array of ECL exception wrapper
-
getResultSchema
public List<List<Object>> getResultSchema(String wuid) throws Exception, ArrayOfEspExceptionWrapper, ArrayOfECLExceptionWrapper
Gets the result schema.- Parameters:
wuid
- the wuid- Returns:
- the result schema
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp exception wrapperArrayOfECLExceptionWrapper
- the array of ECL exception wrapper
-
prepareSQL
public org.hpccsystems.ws.client.wrappers.gen.wssql.ECLWorkunitWrapper prepareSQL(String sqlText, String targetCluster, String targetQuerySet, Integer wait) throws Exception, ArrayOfEspExceptionWrapper, ArrayOfECLExceptionWrapper
Prepare SQL.- Parameters:
sqlText
- the sql texttargetCluster
- the target clustertargetQuerySet
- the target query setwait
- the wait- Returns:
- the ECL workunit wrapper
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp exception wrapperArrayOfECLExceptionWrapper
- the array of ECL exception wrapper
-
executePreparedSQL
public org.hpccsystems.ws.client.wrappers.gen.wssql.ECLWorkunitWrapper executePreparedSQL(String wuid, String targetCluster, org.hpccsystems.ws.client.wrappers.gen.wssql.NamedValueWrapper[] variables, Integer wait, Integer resultLimit, String userName) throws Exception, ArrayOfEspExceptionWrapper, ArrayOfECLExceptionWrapper
Execute prepared SQL.- Parameters:
wuid
- the wuidtargetCluster
- the target clustervariables
- the variableswait
- the waitresultLimit
- the result limituserName
- the user name- Returns:
- the ECL workunit wrapper
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp exception wrapperArrayOfECLExceptionWrapper
- the array of ECL exception wrapper
-
executePreparedSQL
public List<List<Object>> executePreparedSQL(String wuid, String targetCluster, org.hpccsystems.ws.client.wrappers.gen.wssql.NamedValueWrapper[] variables, Integer wait, Integer resultLimit, String userName, String somesing) throws Exception, ArrayOfEspExceptionWrapper, ArrayOfECLExceptionWrapper
Execute prepared SQL.- Parameters:
wuid
- the wuidtargetCluster
- the target clustervariables
- the variableswait
- the waitresultLimit
- the result limituserName
- the user namesomesing
- the somesing- Returns:
- the list
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp exception wrapperArrayOfECLExceptionWrapper
- the array of ECL exception wrapper
-
executePreparedSQL
public org.hpccsystems.ws.client.wrappers.gen.wssql.ExecutePreparedSQLResponseWrapper executePreparedSQL(String wuid, String targetCluster, org.hpccsystems.ws.client.wrappers.gen.wssql.NamedValueWrapper[] variables, Integer wait, Integer resultLimit, Integer resultWindowStart, Integer resultWindowCount, String userName, Boolean suppressXmlSchema, Boolean suppressResults) throws Exception, ArrayOfEspExceptionWrapper, ArrayOfECLExceptionWrapper
Execute prepared SQL.- Parameters:
wuid
- the wuidtargetCluster
- the target clustervariables
- the variableswait
- the waitresultLimit
- the result limitresultWindowStart
- the result window startresultWindowCount
- the result window countuserName
- the user namesuppressXmlSchema
- the suppress xml schemasuppressResults
- the suppress results- Returns:
- the execute prepared SQL response wrapper
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp exception wrapperArrayOfECLExceptionWrapper
- the array of ECL exception wrapper
-
getDefaultStub
public org.apache.axis2.client.Stub getDefaultStub() throws org.apache.axis2.AxisFault
Gets the default stub.- Specified by:
getDefaultStub
in classBaseHPCCWsClient
- Returns:
- the default stub
- Throws:
org.apache.axis2.AxisFault
- the axis fault
-
-