Package org.hpccsystems.ws.client
Class HPCCWsStoreClient
- java.lang.Object
-
- java.util.Observable
-
- org.hpccsystems.ws.client.utils.DataSingleton
-
- org.hpccsystems.ws.client.BaseHPCCWsClient
-
- org.hpccsystems.ws.client.HPCCWsStoreClient
-
public class HPCCWsStoreClient extends BaseHPCCWsClient
Facilitates access to HPCC Systems key/value based Storage. 7.x+ HPCC Systems deployments are capable of exposing a light-weight in-memory key/value store system. Supported actions include listing all namespaces, creating key store, setting/fetching/deleting by key, and setting encrypted values, and more.
-
-
Field Summary
Fields Modifier and Type Field Description static String
WSStoreWSDLURI
ConstantWSStoreWSDLURI="/wsstore"
-
Fields inherited from class org.hpccsystems.ws.client.BaseHPCCWsClient
DEAFULTECLWATCHPORT, DEFAULTECLWATCHTLSPORT, initErrMessage, log, stub, targetESPInterfaceVer, targetHPCCBuildVersion, targetsContainerizedHPCC, verbose, wsconn
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
HPCCWsStoreClient(Connection baseConnection)
Instantiates a new HPCC ws store client.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
createStore(String storename, String description, String type)
Creates the store.boolean
deleteNamespace(String storename, String namespace, boolean global, String targetuser)
Delete namespace.boolean
deleteValue(String storename, String namespace, String key, boolean global)
Delete value.Properties
fetchAllNSKeys(String storename, String namespace, boolean global)
Fetch all NS keys.Properties
fetchKeyMetaData(String storename, String namespace, String key, boolean global)
Fetch key meta data.String
fetchValue(String storename, String namespace, String key, boolean global)
Fetch value.String
fetchValueEncrypted(String storename, String namespace, String key, boolean global, String secretKey)
Fetch value encrypted.String
fetchValueEncrypted(String storename, String namespace, String key, boolean global, Cipher cipher)
Fetch value encrypted.static HPCCWsStoreClient
get(String protocol, String targetHost, String targetPort, String user, String pass)
Gets the.static HPCCWsStoreClient
get(String protocol, String targetHost, String targetPort, String user, String pass, int timeout)
Gets the.static HPCCWsStoreClient
get(Connection connection)
Gets the.org.apache.axis2.client.Stub
getDefaultStub()
Gets the default stub.String
getServiceURI()
Gets the service URI.static int
getServiceWSDLPort()
Gets the service WSDL port.static String
getServiceWSDLURL()
Gets the service WSDLURL.String[]
listNamespaces(String storename, boolean global)
List namespaces.String[]
listNSKeys(String storename, String namespace, boolean global)
List NS keys.boolean
ping()
Ping.boolean
setValue(String storename, String namespace, String key, String value, boolean global)
Sets the value.boolean
setValueEncrypted(String storename, String namespace, String key, String value, boolean global, String secretKey)
Sets the value encrypted.boolean
setValueEncrypted(String storename, String namespace, String key, String value, boolean global, Cipher cipher)
Sets the value encrypted.-
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
-
WSStoreWSDLURI
public static final String WSStoreWSDLURI
ConstantWSStoreWSDLURI="/wsstore"
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HPCCWsStoreClient
protected HPCCWsStoreClient(Connection baseConnection)
Instantiates a new HPCC ws store 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 HPCCWsStoreClient get(Connection connection)
Gets the.- Parameters:
connection
- the connection- Returns:
- the HPCC ws store client
-
get
public static HPCCWsStoreClient 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 store client
-
get
public static HPCCWsStoreClient 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 store client
-
ping
public boolean ping() throws Exception
Ping.- Returns:
- true, if successful
- Throws:
Exception
- the exception
-
listNamespaces
public String[] listNamespaces(String storename, boolean global) throws Exception, ArrayOfEspExceptionWrapper
List namespaces.- Parameters:
storename
- the storenameglobal
- the global- Returns:
- the string[]
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp exception wrapper
-
listNSKeys
public String[] listNSKeys(String storename, String namespace, boolean global) throws Exception, ArrayOfEspExceptionWrapper
List NS keys.- Parameters:
storename
- the storenamenamespace
- the namespaceglobal
- the global- Returns:
- the string[]
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp exception wrapper
-
fetchValue
public String fetchValue(String storename, String namespace, String key, boolean global) throws Exception, ArrayOfEspExceptionWrapper
Fetch value.- Parameters:
storename
- the storenamenamespace
- the namespacekey
- the keyglobal
- the global- Returns:
- the string
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp exception wrapper
-
fetchValueEncrypted
public String fetchValueEncrypted(String storename, String namespace, String key, boolean global, Cipher cipher) throws Exception, ArrayOfEspExceptionWrapper
Fetch value encrypted.- Parameters:
storename
- the storenamenamespace
- the namespacekey
- the keyglobal
- the globalcipher
- the cipher- Returns:
- the string
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp exception wrapper
-
fetchValueEncrypted
public String fetchValueEncrypted(String storename, String namespace, String key, boolean global, String secretKey) throws Exception, ArrayOfEspExceptionWrapper
Fetch value encrypted.- Parameters:
storename
- the storenamenamespace
- the namespacekey
- the keyglobal
- the globalsecretKey
- - Must match the secret key used to encrypt this value- Returns:
- the string
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp exception wrapper
-
fetchKeyMetaData
public Properties fetchKeyMetaData(String storename, String namespace, String key, boolean global) throws Exception, ArrayOfEspExceptionWrapper
Fetch key meta data.- Parameters:
storename
- the storenamenamespace
- the namespacekey
- the keyglobal
- the global- Returns:
- the properties
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp exception wrapper
-
fetchAllNSKeys
public Properties fetchAllNSKeys(String storename, String namespace, boolean global) throws Exception, ArrayOfEspExceptionWrapper
Fetch all NS keys.- Parameters:
storename
- the storenamenamespace
- the namespaceglobal
- the global- Returns:
- the properties
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp exception wrapper
-
setValue
public boolean setValue(String storename, String namespace, String key, String value, boolean global) throws Exception, ArrayOfEspExceptionWrapper
Sets the value.- Parameters:
storename
- the storenamenamespace
- the namespacekey
- the keyvalue
- the valueglobal
- the global- Returns:
- true, if successful
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp exception wrapper
-
setValueEncrypted
public boolean setValueEncrypted(String storename, String namespace, String key, String value, boolean global, Cipher cipher) throws Exception, ArrayOfEspExceptionWrapper
Sets the value encrypted.- Parameters:
storename
- the storenamenamespace
- the namespacekey
- the keyvalue
- the valueglobal
- the globalcipher
- the cipher- Returns:
- true, if successful
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp exception wrapper
-
setValueEncrypted
public boolean setValueEncrypted(String storename, String namespace, String key, String value, boolean global, String secretKey) throws Exception, ArrayOfEspExceptionWrapper
Sets the value encrypted.- Parameters:
storename
- the storenamenamespace
- the namespacekey
- the keyvalue
- the valueglobal
- the globalsecretKey
- the secret key- Returns:
- true, if successful
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp exception wrapper
-
deleteValue
public boolean deleteValue(String storename, String namespace, String key, boolean global) throws Exception, ArrayOfEspExceptionWrapper
Delete value.- Parameters:
storename
- the storenamenamespace
- the namespacekey
- the keyglobal
- the global- Returns:
- true, if successful
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp exception wrapper
-
deleteNamespace
public boolean deleteNamespace(String storename, String namespace, boolean global, String targetuser) throws Exception, ArrayOfEspExceptionWrapper
Delete namespace.- Parameters:
storename
- the storenamenamespace
- the namespaceglobal
- the globaltargetuser
- the targetuser- Returns:
- true, if successful
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp exception wrapper
-
createStore
public boolean createStore(String storename, String description, String type) throws Exception, ArrayOfEspExceptionWrapper
Creates the store.- Parameters:
storename
- the storenamedescription
- the descriptiontype
- the type- Returns:
- true, if successful
- Throws:
Exception
- the exceptionArrayOfEspExceptionWrapper
- the array of esp 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
-
-