public interface SAClient
extends org.springframework.context.Lifecycle
When one is done communicating with the remote strategy agent,
close() should be invoked to close the connection to the remote
strategy agent.
| Modifier and Type | Method and Description |
|---|---|
void |
addConnectionStatusListener(ConnectionStatusListener inListener)
Adds a connection status listener so that it can receive connection
status notifications.
|
void |
addDataReceiver(DataReceiver inReceiver)
Adds a data receiver so that it can receive all the data received
from the remote source that this client is connected to.
|
void |
close()
Closes the connection to the remote strategy agent.
|
ModuleURN |
createStrategy(CreateStrategyParameters inParameters)
Creates a new strategy module using the given strategy creation parameters.
|
void |
delete(ModuleURN inURN)
Deletes the module instance having the supplied URN.
|
List<ModuleURN> |
getInstances(ModuleURN inProviderURN)
Returns the list of module instances available.
|
ModuleInfo |
getModuleInfo(ModuleURN inURN)
Returns the module information for the module instance with the supplied URN.
|
SAClientParameters |
getParameters()
The parameters that were specified when connecting to the remote
strategy agent.
|
Map<String,Object> |
getProperties(ModuleURN inURN)
Fetches all the available properties of the module with the supplied URN.
|
List<ModuleURN> |
getProviders()
Returns the list of providers available.
|
CreateStrategyParameters |
getStrategyCreateParms(ModuleURN inURN)
Fetches the strategy creation parameters (including the strategy script)
for the strategy with the supplied URN.
|
void |
removeConnectionStatusListener(ConnectionStatusListener inListener)
Removes a connection status listener that was added previously so that
it no longer receives connection status notifications.
|
void |
removeDataReciever(DataReceiver inReceiver)
Removes a data receiver that was previously added so that it no longer
receives data from the remote source.
|
void |
sendData(Object inData)
Sends the given object to the Strategy Agent where registered listeners will receive it.
|
Map<String,Object> |
setProperties(ModuleURN inURN,
Map<String,Object> inProperties)
Sets the supplied properties of the module.
|
void |
start(ModuleURN inURN)
Starts the module instance having the supplied URN.
|
void |
stop(ModuleURN inURN)
Stops the module instance having the supplied URN.
|
List<ModuleURN> getProviders() throws ConnectionException
If no providers are available this list is empty.
ConnectionException - if there were errors completing the operation.List<ModuleURN> getInstances(ModuleURN inProviderURN) throws ConnectionException
If no instances are found, an empty list is returned.
inProviderURN - the URN of the provider whose instances should be returned. If null, all available instances are returned.ConnectionException - if there were errors completing the operation.ModuleInfo getModuleInfo(ModuleURN inURN) throws ConnectionException
inURN - the module instance URN. Cannot be null.ConnectionException - if there were errors completing the operation.void start(ModuleURN inURN) throws ConnectionException
Only strategy module instances can be started. Attempts to start modules that are not strategy modules will fail.
inURN - the URN of the module that needs to be started. Cannot be null.ConnectionException - if there were errors completing the operation.void stop(ModuleURN inURN) throws ConnectionException
Only strategy module instances can be stopped. Attempts to stop modules that are not strategy modules will fail.
inURN - the URN of the module that needs to be stopped. Cannot be null.ConnectionException - if there were errors completing the operation.void delete(ModuleURN inURN) throws ConnectionException
Only strategy module instances can be deleted. Attempts to delete modules that are not strategy modules will fail.
inURN - the URN of the module that needs to be deleted. Cannot be null.ConnectionException - if there were errors completing the operation.Map<String,Object> getProperties(ModuleURN inURN) throws ConnectionException
Note that the property values may not be in the same type as is
declared on the module's MXBean. The return types are open data types.
Refer to the type mapping rules in MXBean
documentation to figure out the return type for a particular property
type. For example, enum property types are returned as string values.
inURN - the module URN. Cannot be null.ConnectionException - if there were errors completing the operation.Map<String,Object> setProperties(ModuleURN inURN, Map<String,Object> inProperties) throws ConnectionException
Only the following properties of strategy module can be set. Attempts to set the properties of a module that is not a strategy module or a strategy module property that is not in this list will fail.
RemoteProperties instance that has
details on the error encountered when setting the property.inURN - the URN of the module whose properties are being set. Cannot be null.inProperties - the new property values for the module. Cannot be null.RemoteProperties
instance that has details on the failure.ConnectionException - if there were errors completing the operation.ModuleURN createStrategy(CreateStrategyParameters inParameters) throws ConnectionException
inParameters - the strategy creation parameters. Cannot be null.ConnectionException - if there were errors completing the operation.CreateStrategyParameters getStrategyCreateParms(ModuleURN inURN) throws ConnectionException
This method is made available to enable a client to export strategy
script contents. It's recommended that getProperties(ModuleURN)
be used for fetching the current values of strategy properties as
getStrategyCreateParms(org.marketcetera.module.ModuleURN)
may yield stale values for certain strategy attributes like
parameters.
inURN - the strategy module instnace URN. Cannot be null.ConnectionException - if there were errors completing the operation.void sendData(Object inData) throws ConnectionException
inData - an Object valueConnectionException - if there were errors completing the operation.void addDataReceiver(DataReceiver inReceiver)
If the same receiver is added more than once, it will receive data as many times as it's been added.
The receivers are notified in the reverse order of their addition.
inReceiver - the receiver to add. Cannot be null.void removeDataReciever(DataReceiver inReceiver)
If the receiver was added more than once, only its most recently added occurrence will be removed.
inReceiver - the receiver to remove. Cannot be null.void addConnectionStatusListener(ConnectionStatusListener inListener)
If the same listener is added more than once, it will receive notifications as many times as it's been added.
The listeners are notified in the reverse order of their addition.
inListener - the listener to add. Cannot be null.void removeConnectionStatusListener(ConnectionStatusListener inListener)
If the listener was added more than once, only its most recently added occurrence will be removed.
inListener - the listener to remove. Cannot be null.SAClientParameters getParameters()
void close()
This operation does not throw any exceptions. If any failures are encountered when closing the connection, they are logged.
Copyright © 2017. All Rights Reserved.