Package org.hpccsystems.ws.client
Class HPCCWsFileIOClient
- java.lang.Object
-
- java.util.Observable
-
- org.hpccsystems.ws.client.utils.DataSingleton
-
- org.hpccsystems.ws.client.BaseHPCCWsClient
-
- org.hpccsystems.ws.client.HPCCWsFileIOClient
-
public class HPCCWsFileIOClient extends BaseHPCCWsClient
Facilitates File I/O actions on target HPCC instance. Actions supported include creating a new file, and appending data to a file in the given HPCC System.
-
-
Field Summary
Fields Modifier and Type Field Description static StringFILEIOWSDLURIConstantFILEIOWSDLURI="/WsFileIO"-
Fields inherited from class org.hpccsystems.ws.client.BaseHPCCWsClient
DEAFULTECLWATCHPORT, DEFAULTECLWATCHTLSPORT, initErrMessage, stub, targetESPInterfaceVer, targetHPCCBuildVersion, targetsContainerizedHPCC, verbose, wsconn
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedHPCCWsFileIOClient(Connection baseConnection)Instantiates a new HPCC ws file IO client.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancreateHPCCFile(String fileName, String targetLandingZone, boolean overwritefile)Creates the HPCC file.static HPCCWsFileIOClientget(String protocol, String targetHost, String targetPort, String user, String pass)Gets the.static HPCCWsFileIOClientget(String protocol, String targetHost, String targetPort, String user, String pass, int timeout)Gets the.static HPCCWsFileIOClientget(Connection connection)Gets the.org.apache.axis2.client.StubgetDefaultStub()Gets the default stub.StringgetServiceURI()Gets the service URI.static intgetServiceWSDLPort()Gets the service WSDL port.static StringgetServiceWSDLURL()Gets the service WSDLURL.booleanping()Ping.StringreadFileData(String dropzone, String fileName, long datasize, long offset)Read file data.booleanwriteHPCCFileData(byte[] data, String fileName, String targetLandingZone, boolean append, long offset, int uploadchunksize)Write HPCC file data.-
Methods inherited from class org.hpccsystems.ws.client.BaseHPCCWsClient
compatibilityCheck, compatibilityCheck, equals, fastRefresh, fullRefresh, getConnectionURL, getInitError, getServiceVersion, getServiceVersion, getServiceWSDLPort, getServiceWSDLURL, getStubConnectionTO, getTargetESPInterfaceVersion, getTargetHPCCBuildVersion, getVerbose, handleECLExceptions, handleECLExceptions, handleEspExceptions, handleEspExceptions, handleEspSoapFaults, handleEspSoapFaults, hashCode, hasInitError, initBaseWsClient, 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
-
FILEIOWSDLURI
public static final String FILEIOWSDLURI
ConstantFILEIOWSDLURI="/WsFileIO"- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HPCCWsFileIOClient
protected HPCCWsFileIOClient(Connection baseConnection)
Instantiates a new HPCC ws file IO client.- Parameters:
baseConnection- the base connection
-
-
Method Detail
-
getServiceURI
public String getServiceURI()
Gets the service URI.- Specified by:
getServiceURIin 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
-
getDefaultStub
public org.apache.axis2.client.Stub getDefaultStub() throws org.apache.axis2.AxisFaultGets the default stub.- Specified by:
getDefaultStubin classBaseHPCCWsClient- Returns:
- the default stub
- Throws:
org.apache.axis2.AxisFault- the axis fault
-
get
public static HPCCWsFileIOClient get(Connection connection)
Gets the.- Parameters:
connection- the connection- Returns:
- the HPCC ws file IO client
-
get
public static HPCCWsFileIOClient 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 file IO client
-
get
public static HPCCWsFileIOClient 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 file IO client
-
ping
public boolean ping() throws ExceptionPing.- Returns:
- true, if successful
- Throws:
Exception- the exception
-
createHPCCFile
public boolean createHPCCFile(String fileName, String targetLandingZone, boolean overwritefile) throws Exception, ArrayOfEspExceptionWrapper
Creates the HPCC file.- Parameters:
fileName- - The target HPCC file nametargetLandingZone- - The "netaddress" of the target landing, can be localhost, should be fetched from landingzones in filesprayclientoverwritefile- - If the file exists, should it be overwritten?- Returns:
- true, if successful
- Throws:
Exception- - Caller should handle exception in case of errorsArrayOfEspExceptionWrapper- the array of esp exception wrapper
-
writeHPCCFileData
public boolean writeHPCCFileData(byte[] data, String fileName, String targetLandingZone, boolean append, long offset, int uploadchunksize) throws Exception, ArrayOfEspExceptionWrapperWrite HPCC file data.- Parameters:
data- - The data to writefileName- - The target HPCC file to write totargetLandingZone- - The "netaddress" of the target landing, can be localhost, should be fetched from landingzones in filesprayclientappend- - Should this data be appended?offset- - At what offset should this be written - Specify 0 if necessaryuploadchunksize- - Chunksize to upload the data- Returns:
- true, if successful
- Throws:
Exception- the exceptionArrayOfEspExceptionWrapper- the array of esp exception wrapper
-
readFileData
public String readFileData(String dropzone, String fileName, long datasize, long offset) throws Exception, ArrayOfEspExceptionWrapper
Read file data.- Parameters:
dropzone- the dropzonefileName- the file namedatasize- the datasizeoffset- the offset- Returns:
- the string
- Throws:
Exception- the exceptionArrayOfEspExceptionWrapper- the array of esp exception wrapper
-
-