|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.apama.engine.beans.EngineClientBean
public class EngineClientBean
EngineClientBean is a JavaBean for interacting with an Apama engine, typically a Correlator. This includes the ability to send and receive events, inject and delete EPL/MonitorScript, connect Apama engines together, inspect what was injected into correlator and more.
Clients wishing to use the engine client to receive events should do so by
adding one or more named consumers, each of which has its own
independent event listener and list of channels to receive from. The named
consumer methods generally have "consumer" in their name, and are defined by
ReceiveConsumerOperationsInterface
.
Users needing more advanced send/receive functionality should also consider
using the higher level IEventService
rather than the engine client.
Use EventType
and its associated classes to parse and generate
Event
objects for receiving and sending using this class.
Once this engine client has been configured as needed (e.g. setPort(int)
, setHost(String)
),
a connection can be established either synchronously using connectNow()
(which throws an exception on error) or asynchronously using connectInBackground()
(which automatically retries until a connection is established - see setConnectionPollingInterval(int)
and setReconnectPeriod(long)
).
Once the bean connected successfully, a background thread will keep pinging it to ensure
the connection is still up (see setConnectionPollingInterval(int)
). If the entire
bean connection is lost, the BaseClientInterface.PROPERTY_BEAN_CONNECTED
and
ReceiveConsumerOperationsInterface.PROPERTY_ALL_CONSUMERS_CONNECTED
properties will change to false to notify the user of the engine client, and the client will continue to
try to reconnect in the background (with the retry interval configurable using
setConnectionPollingInterval(int)
).
If the client itself remains connected but its named consumers are disconnected by the engine
(due to being slow, if slow consumer disconnection is enabled) then it is the caller's responsibility to
force reconnection of the consumers by disconnecting and reconnecting the client (although applications
with this requirement may be better off using the IEventService
instead).
To prevent reconnecting slow consumers too soon after disconnection, a minimum time between reconnection attempts
can be configured using setReconnectPeriod(long)
.
The engine client can be disconnected using disconnect()
whenever
required, however once it is no longer needed any more, final cleanup should be performed by
calling dispose()
which will disconnect it and also ensure that any background threads
started by the client have been terminated.
This class has locking so that concurrent use by multiple threads is safe.
To avoid synchronization problems, clients should not synchronize on the object
nor call methods on the object within consumer callbacks. If they wish to do
so, the consumer should be added as asynchronous (see addConsumer method).
Please also avoid synchronously calling the engine client from within property change listeners,
especially the ReceiveConsumerOperationsInterface.PROPERTY_ALL_CONSUMERS_CONNECTED
property (the IEventService
may be a better fit for applications that need to do this).
Note that the deprecated "simple bean receiver" (and ReceiveOperationsInterface) feature was removed in the 5.1 release; the named consumer interface should now be used instead.
Field Summary |
---|
Fields inherited from interface com.apama.engine.beans.interfaces.EngineClientInterface |
---|
DEFAULT_MONITOR_ONLY, DEFAULT_RECEIVE_ONLY, PROPERTY_MONITOR_ONLY, PROPERTY_RECEIVE_ONLY |
Fields inherited from interface com.apama.net.beans.interfaces.BaseClientInterface |
---|
COPYRIGHT, DEFAULT_CONNECTION_POLLING_INTERVAL, DEFAULT_HOST, DEFAULT_PORT, DEFAULT_PROCESS_NAME, PRODUCTNAME, PROPERTY_BEAN_CONNECTED, PROPERTY_CONNECTION_POLLING_INTERVAL, PROPERTY_HOST, PROPERTY_PORT, PROPERTY_PROCESS_NAME, PROPERTY_VERBOSE, VERSION |
Fields inherited from interface com.apama.engine.beans.interfaces.InspectOperationsInterface |
---|
DEFAULT_INSPECT_POLLING_INTERVAL, PROPERTY_ENGINE_INFO, PROPERTY_INSPECT_POLLING_INTERVAL |
Fields inherited from interface com.apama.engine.beans.interfaces.WatchOperationsInterface |
---|
DEFAULT_STATUS_POLLING_INTERVAL, PROPERTY_STATUS, PROPERTY_STATUS_POLLING_INTERVAL |
Fields inherited from interface com.apama.engine.beans.interfaces.ReceiveConsumerOperationsInterface |
---|
PROPERTY_ALL_CONSUMERS_CONNECTED |
Constructor Summary | |
---|---|
EngineClientBean()
Default constructor - as required to be a bean. |
Method Summary | |
---|---|
ConsumerOperationsInterface |
addConsumer(java.lang.String uniqueName,
java.lang.String... channels)
Add a new uniquely-named synchronous consumer that listens on a specified set of channels. |
ConsumerOperationsInterface |
addConsumer(java.lang.String uniqueName,
java.lang.String[] channels,
boolean disconnectSlow)
Add a new uniquely-named consumer that listens on a specified set of channels. |
ConsumerOperationsInterface |
addConsumer(java.lang.String uniqueName,
java.lang.String[] channels,
boolean disconnectSlow,
boolean async)
Add a new uniquely-named consumer that listens on a specified set of channels. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a property change listener (without blocking concurrent calls to operations on this bean instance). |
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Add a property change listener for a specific named property (without blocking concurrent calls to operations on this bean instance). |
void |
attachAsConsumerOfEngine(EngineClientBean sourceEngineBean,
java.lang.String[] channels)
Connect this engine to another (non-persisently) so that it receives events emitted on the specified channels. |
void |
attachAsConsumerOfEngine(java.lang.String sourceHost,
int sourcePort,
java.lang.String[] channels)
Connect this engine to another (non-persistently) so that it receives events emitted on the specified channels. |
void |
attachAsConsumerOfEngine(java.lang.String sourceHost,
int sourcePort,
java.lang.String[] channels,
boolean persistent)
Connect this engine to another so that it receives events emitted on the specified channels. |
void |
attachAsConsumerOfEngine(java.lang.String sourceHost,
int sourcePort,
java.lang.String[] channels,
boolean persistent,
boolean disconnectSlow)
Connect this engine to another so that it receives events emitted on the specified channels. |
void |
connectInBackground()
Requests that the bean begins to establish a connection automatically in the background. |
void |
connectNow()
Manually request that the bean connects to the remote server. |
void |
deleteAll()
Deletes everything from the engine. |
void |
deleteName(java.lang.String name,
boolean force)
Delete a name from the engine. |
void |
deleteNames(java.util.List<java.lang.String> names,
boolean force)
Delete a number of names. |
void |
deleteNamesFromFile(java.util.List<java.lang.String> filenames,
boolean force)
Delete a number of names from a file or stdin. |
void |
deleteNamesFromFile(java.util.List<java.lang.String> filenames,
boolean force,
boolean utf8)
Delete a number of names from a file or stdin. |
void |
detachAsConsumerOfEngine(EngineClientBean sourceEngineBean,
java.lang.String[] channels)
Disconnect this engine from another so that it not longer receives events emitted on the specified channels. |
void |
detachAsConsumerOfEngine(java.lang.String sourceHost,
int sourcePort,
java.lang.String[] channels)
Disconnect this engine from another so that it not longer receives events emitted on the specified channels. |
void |
detachAsConsumerOfEngine(java.lang.String sourceHost,
int sourcePort,
java.lang.String[] channels,
boolean persistent)
Disconnect this engine from another so that it not longer receives events emitted on the specified channels. |
void |
disconnect()
Sets the desired state of the bean to disconnected instead of connected, disconnects consumers and stops pinging the remote correlator to keep the connection alive. |
void |
dispose()
Disconnects the client and also waits to ensure that all background threads and other resources associated with this object have been terminated or freed. |
void |
flushEvents()
Wait for any outstanding events from previous SendOperationsInterface.sendEvents(Event...) or
SendOperationsInterface.sendEvents(boolean, Event...)
(where the boolean is true)
calls into the Engine, and then return. |
ConsumerOperationsInterface[] |
getAllConsumers()
Get all existing uniquely-named consumers. |
boolean |
getBeanConnected()
Get the beanConnected property value. |
int |
getConnectionPollingInterval()
Get the polling interval (in milliseconds) for the background connection and ping thread. |
ConsumerOperationsInterface |
getConsumer(java.lang.String uniqueName)
Get an existing uniquely-named consumer. |
EngineInfo |
getEngineInfo()
Get the most recently recorded inspection information. |
java.lang.String |
getHost()
Get the name of the host to be connected to. |
int |
getInspectPollingInterval()
Get the inspectPollingInterval (in milliseconds) that the background thread should wait between calls for new information. |
boolean |
getMonitorOnly()
Getter for the monitorOnly property. |
int |
getPort()
Get the port number to be connected to. |
java.lang.String |
getProcessName()
Get the process Name in use This is the process name in use for this bean The process name is a display name to identify which application is responsible for this connection to the Correlator (this name is included in log files for diagnostic purposes) |
boolean |
getReceiveOnly()
Getter for the receiveOnly property. |
EngineInfo |
getRemoteEngineInfo()
Request the remote Engine inspection info. |
EngineStatus |
getRemoteStatus()
Request the remote Engine status. |
EngineStatus |
getStatus()
Get the most recently recorded status. |
int |
getStatusPollingInterval()
Get the statusPollingInterval (in milliseconds) that the background thread should wait between calls for new status information. |
boolean |
getVerbose()
Getter for the verbose property. |
java.lang.String[] |
injectCDP(byte[] cdpBytes)
Send the bytes of a CDP (Correlator Deployment Package) to the engine without blocking concurrent calls to operations on this bean instance. |
java.lang.String[] |
injectCDP(byte[] cdpBytes,
java.lang.String filename)
Send the bytes of a CDP (Correlator Deployment Package) to the engine without blocking concurrent calls to operations on this bean instance. |
java.lang.String[] |
injectCDPsFromFile(java.util.List<java.lang.String> filenames)
Inject a collection of CDPs read from files (or stdin), without blocking concurrent calls to operations on this bean instance. |
java.lang.String[] |
injectJavaApplication(byte[] jarBytes)
Send the bytes of a JMon application jar to the engine without blocking concurrent calls to operations on this bean instance. |
java.lang.String[] |
injectJavaApplicationsFromFile(java.util.List<java.lang.String> filenames)
Inject a collection of JMon application jars read from files (or stdin), without blocking concurrent calls to operations on this bean instance. |
java.lang.String[] |
injectMonitorScript(MonitorScript script)
Send MonitorScript text to the engine without blocking concurrent calls to operations on this bean instance. |
java.lang.String[] |
injectMonitorScript(MonitorScript script,
java.lang.String filename)
Send a MonitorScript object to the engine. |
java.lang.String[] |
injectMonitorScriptFromFile(java.util.List<java.lang.String> filenames)
Inject a collection of MonitorScript text read from files (or stdin), without blocking concurrent calls to operations on this bean instance. |
java.lang.String[] |
injectMonitorScriptFromFile(java.util.List<java.lang.String> filenames,
boolean utf8)
Inject a number of monitors from a file or stdin. |
java.lang.String[] |
injectMonitorScriptFromFile(java.lang.String... filenames)
Inject a collection of MonitorScript text read from files (or stdin), without blocking concurrent calls to operations on this bean instance. |
boolean |
isAllConsumersConnected()
Determine if the bean and existing uniquely-named consumers are connected. |
boolean |
isBeanConnected()
Another name for the getBeanConnected() method. |
boolean |
isMonitorOnly()
Another name for getMonitorOnly() |
boolean |
isReceiveOnly()
Another name for getReceiveOnly() |
void |
killName(java.lang.String name)
Kill a name from the engine. |
void |
killNames(java.util.List<java.lang.String> names)
Kill a number of names. |
void |
killNamesFromFile(java.util.List<java.lang.String> filenames)
Kill a number of names from a file or stdin. |
void |
killNamesFromFile(java.util.List<java.lang.String> filenames,
boolean utf8)
Kill a number of names from a file or stdin. |
void |
pingServer()
Manually test if the remote engine process is alive and responding to client requests. |
void |
removeAllConsumers()
Disconnect, Destroy, and Remove all existing consumers. |
void |
removeConsumer(java.lang.String uniqueName)
Remove and disconnect an existing uniquely-named consumer. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a property change listener (without blocking concurrent calls to operations on this bean instance). |
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Remove a property change listener for a specific named property (without blocking concurrent calls to operations on this bean instance). |
void |
sendEvents(boolean autoBatch,
Event... events)
Send events into the Engine, optionally not performing auto-batching. |
void |
sendEvents(Event... events)
Send an array of Event objects to the engine (automatically rebatching the actual event sending for efficiency). |
void |
sendEventsFromFile(java.util.List<java.lang.String> filenames,
int loop)
Send a number of events from a file or stdin. |
void |
sendEventsFromFile(java.util.List<java.lang.String> filenames,
int loop,
boolean utf8)
Send a number of events from a file or stdin. |
void |
sendEventsFromFile(java.util.List<java.lang.String> filenames,
int loop,
boolean utf8,
boolean autoBatch)
Send a number of events from a file or stdin, specifying the file encoding detection mode and whether to auto-batch events or not. |
void |
setCancelDeleteFileRead(boolean newCancelFileReadValue)
Setter for the cancelFileRead property for the Delete / Kill operations. |
void |
setCancelInjectFileRead(boolean newCancelFileReadValue)
Setter for the cancelFileRead property for the Inject operations. |
void |
setCancelSendFileRead(boolean newCancelFileReadValue)
Setter for the cancelFileRead property for the Send operations. |
void |
setConnectionPollingInterval(int milliseconds)
Set the polling interval (in milliseconds) for the background connection and ping thread. |
void |
setHost(java.lang.String newHostValue)
Setter for the host property. |
void |
setInspectPollingInterval(int newInspectPollingInterval)
Set the inspectPollingInterval (in milliseconds) that the background thread should wait between calls for new information. |
void |
setMonitorOnly(boolean newMonitorOnlyValue)
Setter for the monitorOnly property. |
void |
setPersistentReceiveConnections(EngineConnection... connections)
Attaches this component as a persistent receiver of the remote components specified in the connections argument, then decrements the reference count of any existing connections (which typically results in their removal). |
void |
setPort(int newPortValue)
Setter for the port property. |
void |
setProcessName(java.lang.String newProcessName)
Setter for the process Name This is the process name property to use. |
void |
setReceiveOnly(boolean newReceiveOnlyValue)
Setter for the receiveOnly property. |
void |
setReconnectPeriod(long t)
Set the minimum period between attempts to reconnect the bean and/or any of the bean's named consumers that have been disconnected (e.g. |
void |
setReconnectPolicy(ReconnectPolicyInterface p)
Set a singleton reconnection policy that will be used to limit when reconnection can be attempted for the bean, and/or any of the bean's named consumers that have been disconnected (e.g. |
void |
setStatusPollingInterval(int newStatusPollingInterval)
Set the statusPollingInterval (in milliseconds) that the background thread should wait between calls for new status information. |
void |
setVerbose(boolean newVerboseValue)
Setter for the verbose property. |
void |
startInspectPollingThread()
Start the local inspect polling thread. |
void |
startStatusPollingThread()
Start the local status polling thread. |
void |
stopInspectPollingThread()
Stop the local inspect polling thread. |
void |
stopStatusPollingThread()
Stop the local status polling thread. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EngineClientBean()
If a bean class is not required, we recommend using the EngineClientFactory
and
the associated interfaces instead.
Method Detail |
---|
public void connectNow() throws com.apama.util.CompoundException
pingServer()
from the PingOperationsInterface.
connectNow
in interface BaseClientInterface
com.apama.util.CompoundException
- Thrown if any exceptions occur in the Client SDK.public void connectInBackground()
Calling disconnect()
will bring connection attempts to an end.
Repeated calls to this method, or calling this method after a connection has already been established will have
no effect.
connectInBackground
in interface EngineClientInterface
public void pingServer() throws com.apama.util.CompoundException
pingServer
in interface PingOperationsInterface
com.apama.util.CompoundException
- when the ping fails.public java.lang.String getHost()
getHost
in interface BaseClientInterface
public void setHost(java.lang.String newHostValue) throws EngineException
setHost
in interface BaseClientInterface
newHostValue
- The new value for the Host property.
EngineException
- Thrown if any exceptions occur in the Client SDK.public int getPort()
getPort
in interface BaseClientInterface
public void setPort(int newPortValue) throws EngineException
setPort
in interface BaseClientInterface
newPortValue
- The new value for the Port property.
EngineException
- Thrown if any exceptions occur in the Client SDK.public java.lang.String getProcessName()
getProcessName
in interface BaseClientInterface
public void setProcessName(java.lang.String newProcessName) throws EngineException
setProcessName
in interface BaseClientInterface
newProcessName
- The new value for the process name property.
EngineException
- Thrown if any exceptions occur in the Client SDK.public boolean getMonitorOnly()
public boolean isMonitorOnly()
public void setMonitorOnly(boolean newMonitorOnlyValue) throws EngineException
newMonitorOnlyValue
- The new value for the monitorOnly property.
EngineException
- If any exceptions occur in the Client SDK.public boolean getReceiveOnly()
public boolean isReceiveOnly()
public void setReceiveOnly(boolean newReceiveOnlyValue) throws EngineException
newReceiveOnlyValue
- The new value for the receiveOnly property.
EngineException
- If any exceptions occur in the Client SDK.public boolean isBeanConnected()
isBeanConnected
in interface BaseClientInterface
public boolean getBeanConnected()
getBeanConnected
in interface BaseClientInterface
public int getConnectionPollingInterval()
getConnectionPollingInterval
in interface BaseClientInterface
public void setConnectionPollingInterval(int milliseconds)
This controls how often the bean pings the engine, and updates the
BaseClientInterface.PROPERTY_BEAN_CONNECTED
property.
If connectInBackground()
is used, if the bean lost its connection to the engine,
or if any named consumers were disconnected (e.g. due to being slow),
the polling interval also controls how often the bean attempts to automatically reconnect
the bean and/or its registered consumers, subject to the minimum reconnect period
specified by setReconnectPeriod(long)
.
setConnectionPollingInterval
in interface BaseClientInterface
milliseconds
- The polling interval in milliseconds.
If negative, then the default value will be used instead.public boolean getVerbose()
public void setVerbose(boolean newVerboseValue)
newVerboseValue
- Set to true for more verbose status output.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface BaseClientInterface
listener
- the listener to be removed.public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface BaseClientInterface
listener
- the listener to be added.public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface BaseClientInterface
propertyName
- the name of the property that was listened on.listener
- the listener to be removed.public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface BaseClientInterface
propertyName
- the name of the property to listen on.listener
- the listener to be added.public java.lang.String toString()
toString
in class java.lang.Object
public void disconnect() throws EngineException
disconnect
in interface BaseClientInterface
EngineException
- Thrown if any exceptions occur in the Client SDK,
specifically during de-registration of the internal EventConsumer.public void dispose()
BaseClientInterface
dispose
in interface BaseClientInterface
public void setReconnectPolicy(ReconnectPolicyInterface p)
EngineClientInterface
In most cases, we recommend using EngineClientInterface.setReconnectPeriod(long)
instead of writing a custom policy object.
setReconnectPolicy
in interface EngineClientInterface
ReconnectPolicyInterface
public void setReconnectPeriod(long t)
EngineClientInterface
By default there is no minimum reconnection period defined, and if any consumers have been disconnected by the engine, the bean will attempt to reconnect them at least as often as the bean's connection polling interval.
Any previously set reconnect policy will be overwritten when this method is called.
setReconnectPeriod
in interface EngineClientInterface
t
- The minimum reconnection period in milliseconds, or 0 to place no limit on
how often we can attempt to reconnect.EngineClientInterface.setReconnectPolicy(ReconnectPolicyInterface)
public void sendEventsFromFile(java.util.List<java.lang.String> filenames, int loop) throws EngineException
SendOperationsInterface
If a connection is not yet established, this method will request a connection.
The current implementation of this method does not perform automatic
batching of the events, but a future release may change this behaviour,
so please use the overloaded SendOperationsInterface.sendEventsFromFile(List, int, boolean, boolean)
method if you require control over this. Auto-batching will usually
provide better throughput.
NOTE: Change in behaviour at Apama 3.0 - previously we ignored any missing files, now an exception is thrown.
sendEventsFromFile
in interface SendOperationsInterface
filenames
- Names of files to read event descriptions from. A file name "-" is taken to be stdin.loop
- Loop count for repeated reading of input data.
EngineException
- Thrown if any exceptions occur in the Client SDK.public void sendEventsFromFile(java.util.List<java.lang.String> filenames, int loop, boolean utf8) throws EngineException
SendOperationsInterface
If a connection is not yet established, this method will request a connection.
The current implementation of this method does not perform automatic
batching of the events, but a future release may change this behaviour,
so please use the overloaded SendOperationsInterface.sendEventsFromFile(List, int, boolean, boolean)
method if you require control over this. Auto-batching will usually
provide better throughput.
NOTE: Change in behaviour at Apama 3.0 - previously we ignored any missing files, now an exception is thrown.
sendEventsFromFile
in interface SendOperationsInterface
filenames
- Names of files to read event descriptions from. A file name "-" is taken to be stdin.loop
- Loop count for repeated reading of input data.utf8
- If true
, the specified files will be read
as UTF-8; otherwise they will be read using the system default encoding
unless they begin with a unicode Byte Order Mark (BOM) character.
EngineException
- Thrown if any exceptions occur in the Client SDK.public void sendEventsFromFile(java.util.List<java.lang.String> filenames, int loop, boolean utf8, boolean autoBatch) throws EngineException
SendOperationsInterface
If a connection is not yet established, this method will request a connection.
NOTE: Change in behaviour at Apama 3.0 - previously we ignored any missing files, now an exception is thrown.
sendEventsFromFile
in interface SendOperationsInterface
filenames
- Names of files to read event descriptions from. A file name "-" is taken to be stdin.loop
- Loop count for repeated reading of input data.utf8
- If true
, the specified files will be read
as UTF-8; otherwise they will be read using the system default encoding
unless they begin with a unicode Byte Order Mark (BOM) character.autoBatch
- If true
, events will be automatically
rebatched to improve throughput
EngineException
- Thrown if any exceptions occur in the Client SDK.public void sendEvents(boolean autoBatch, Event... events) throws EngineException
sendEvents
in interface SendOperationsInterface
autoBatch
- If true
, events will be automatically
rebatched to improve throughput (across separate sendEvents calls)events
- The array of Events to be sent.
EngineException
- Thrown if any exceptions occur in the Client SDK.SendOperationsInterface.flushEvents()
public void sendEvents(Event... events) throws EngineException
SendOperationsInterface
SendOperationsInterface.sendEvents(boolean, Event...)
method if you require control over the rebatching.
If a connection is not yet established, this method will request a connection.
sendEvents
in interface SendOperationsInterface
events
- An array with one or more Events to be sent.
EngineException
- Thrown if any exceptions occur in the Client SDK.SendOperationsInterface.flushEvents()
public void flushEvents() throws EngineException, java.lang.InterruptedException
SendOperationsInterface.sendEvents(Event...)
or
SendOperationsInterface.sendEvents(boolean, Event...)
(where the boolean is true)
calls into the Engine, and then return.
flushEvents
in interface SendOperationsInterface
EngineException
- Thrown if any exceptions occur in the Client SDK.
java.lang.InterruptedException
- Thrown if this thread is interrupted
while waiting for outstanding events to be sent and acknowledged
(see Thread.interrupt()
.SendOperationsInterface.sendEvents(boolean, Event...)
public void setCancelSendFileRead(boolean newCancelFileReadValue)
setCancelSendFileRead
in interface SendOperationsInterface
newCancelFileReadValue
- New value for the cancelFileRead property.public void deleteNames(java.util.List<java.lang.String> names, boolean force) throws EngineException
deleteNames
in interface DeleteOperationsInterface
names
- Names to be deleted.force
- Set to true to forcably delete the names even if in use.
EngineException
public void deleteNamesFromFile(java.util.List<java.lang.String> filenames, boolean force) throws EngineException
deleteNamesFromFile
in interface DeleteOperationsInterface
filenames
- Names of files to read Names from. A file name "-" is taken to be stdin.force
- Set to true to forcably delete the names even if in use.
EngineException
- Thrown if any exceptions occur in the Client SDK.public void deleteNamesFromFile(java.util.List<java.lang.String> filenames, boolean force, boolean utf8) throws EngineException
DeleteOperationsInterface
deleteNamesFromFile
in interface DeleteOperationsInterface
filenames
- Names of files to read Names from. A file name "-" is taken to be stdin.force
- Set to true to forcably delete the names even if in use.utf8
- If true
, the specified files will be read
as UTF-8; otherwise they will be read using the system default encoding
unless they begin with a unicode Byte Order Mark (BOM) character.
EngineException
- Thrown if any exceptions occur in the Client SDK.public void deleteAll() throws EngineException
deleteAll
in interface DeleteOperationsInterface
EngineException
public void deleteName(java.lang.String name, boolean force) throws EngineException
deleteName
in interface DeleteOperationsInterface
name
- The name to be deleted.force
- Set to true to forcably delete the name even if in use.
EngineException
- Thrown if any exceptions occur in the Client SDK.public void killNames(java.util.List<java.lang.String> names) throws EngineException
killNames
in interface DeleteOperationsInterface
names
- Names to be deleted.
EngineException
public void killNamesFromFile(java.util.List<java.lang.String> filenames) throws EngineException
killNamesFromFile
in interface DeleteOperationsInterface
filenames
- Names of files to read Names from. A file name "-" is taken to be stdin.
EngineException
- Thrown if any exceptions occur in the Client SDK.public void killNamesFromFile(java.util.List<java.lang.String> filenames, boolean utf8) throws EngineException
DeleteOperationsInterface
killNamesFromFile
in interface DeleteOperationsInterface
filenames
- Names of files to read Names from. A file name "-" is taken to be stdin.utf8
- If true
, the specified files will be read
as UTF-8; otherwise they will be read using the system default encoding
unless they begin with a unicode Byte Order Mark (BOM) character.
EngineException
- Thrown if any exceptions occur in the Client SDK.public void killName(java.lang.String name) throws EngineException
killName
in interface DeleteOperationsInterface
name
- The name to be deleted.
EngineException
- Thrown if any exceptions occur in the Client SDK.public void setCancelDeleteFileRead(boolean newCancelFileReadValue)
setCancelDeleteFileRead
in interface DeleteOperationsInterface
newCancelFileReadValue
- New value for the cancelFileRead property.public java.lang.String[] injectMonitorScriptFromFile(java.lang.String... filenames) throws EngineException
injectMonitorScriptFromFile
in interface InjectOperationsInterface
filenames
- Names of files containing MonitorScript text to be
injected. Standard input is represented by a filename "-". This special
filename should only occur no more than once in the filename list.
EngineException
- If any of the named files cannot be injected,
either because the file could not be read or because a call to
injectMonitorScriptUnlocked() failed.public java.lang.String[] injectMonitorScriptFromFile(java.util.List<java.lang.String> filenames) throws EngineException
injectMonitorScriptFromFile
in interface InjectOperationsInterface
filenames
- Names of files containing MonitorScript text to be
injected. Standard input is represented by a filename "-". This special
filename should only occur once in the filename vector.
EngineException
- If any of the named files cannot be injected,
either because the file could not be read or because a call to
injectMonitorScriptUnlocked() failed.public java.lang.String[] injectMonitorScriptFromFile(java.util.List<java.lang.String> filenames, boolean utf8) throws EngineException
InjectOperationsInterface
injectMonitorScriptFromFile
in interface InjectOperationsInterface
filenames
- Names of files to read MonitorScript text from. A file name "-" is taken to be stdin.utf8
- If true
, the specified files will be read
as UTF-8; otherwise they will be read using the system default encoding
unless they begin with a unicode Byte Order Mark (BOM) character.
EngineException
- Thrown if any exceptions occur in the Client SDK.
This exception may contain warnings.public java.lang.String[] injectMonitorScript(MonitorScript script) throws EngineException
injectMonitorScript
in interface InjectOperationsInterface
script
- The MonitorScript object to be injected into the engine.
EngineException
- If the MonitorScript is rejected by the engine,
or there is a problem sending the script.public java.lang.String[] injectMonitorScript(MonitorScript script, java.lang.String filename) throws EngineException
InjectOperationsInterface
injectMonitorScript
in interface InjectOperationsInterface
script
- The MonitorScript object to be sent.filename
- The file the monitorscript came from (may be null)
EngineException
- When failures happen.
This exception may contain warnings.public java.lang.String[] injectJavaApplicationsFromFile(java.util.List<java.lang.String> filenames) throws EngineException
injectJavaApplicationsFromFile
in interface InjectOperationsInterface
filenames
- Names of files containing JMon applications to be
injected. Standard input is represented by a filename "-". This special
filename should only occur once in the filename vector.
EngineException
- If any of the named files cannot be injected,
either because the file could not be read or because a call to
injectJavaApplicationUnlocked() failed.public java.lang.String[] injectJavaApplication(byte[] jarBytes) throws EngineException
injectJavaApplication
in interface InjectOperationsInterface
jarBytes
- The contents of the JMon jar to be sent to the engine.
EngineException
- If the JMon application is rejected by the
engine, or there is a problem sending the data.public java.lang.String[] injectCDPsFromFile(java.util.List<java.lang.String> filenames) throws EngineException
injectCDPsFromFile
in interface InjectOperationsInterface
filenames
- Names of files containing CDP files to be
injected. Standard input is represented by a filename "-". This special
filename should only occur once in the filename vector.
EngineException
- If any of the named files cannot be injected,
either because the file could not be read or because a call to
injectJavaApplicationUnlocked() failed.public java.lang.String[] injectCDP(byte[] cdpBytes) throws EngineException
cdpBytes
- The contents of the CDP file to be sent to the engine.
EngineException
- If the CDP file is rejected by the
engine, or there is a problem sending the data.public java.lang.String[] injectCDP(byte[] cdpBytes, java.lang.String filename) throws EngineException
injectCDP
in interface InjectOperationsInterface
cdpBytes
- The contents of the CDP file to be sent to the engine.filename
- The name of the file we are injecting from.
EngineException
- If the CDP file is rejected by the
engine, or there is a problem sending the data.public void setCancelInjectFileRead(boolean newCancelFileReadValue)
setCancelInjectFileRead
in interface InjectOperationsInterface
newCancelFileReadValue
- New value for the cancelFileRead property.public void startInspectPollingThread() throws EngineException
startInspectPollingThread
in interface InspectOperationsInterface
EngineException
- Thrown if any exceptions occur in the Client SDK.public void stopInspectPollingThread()
stopInspectPollingThread
in interface InspectOperationsInterface
public EngineInfo getRemoteEngineInfo() throws EngineException
getRemoteEngineInfo
in interface InspectOperationsInterface
EngineException
- Thrown if any exceptions occur in the Client SDK.public void setInspectPollingInterval(int newInspectPollingInterval)
setInspectPollingInterval
in interface InspectOperationsInterface
newInspectPollingInterval
- Polling interval in milliseconds.public int getInspectPollingInterval()
getInspectPollingInterval
in interface InspectOperationsInterface
public void attachAsConsumerOfEngine(EngineClientBean sourceEngineBean, java.lang.String[] channels) throws EngineException
ConnectOperationsInterface
attachAsConsumerOfEngine
in interface ConnectOperationsInterface
sourceEngineBean
- The EngineClientBean instance for the engine to
receive from.channels
- the list of channels from which the engine should
receive events. Must be non-null, and contain no null elements.
EngineException
- if the engines cannot be connected, or if the
channels parameter is invalid.public void attachAsConsumerOfEngine(java.lang.String sourceHost, int sourcePort, java.lang.String[] channels) throws EngineException
ConnectOperationsInterface
attachAsConsumerOfEngine
in interface ConnectOperationsInterface
sourceHost
- The host of the engine to receive from.sourcePort
- The port of the engine to receive from.channels
- the list of channels from which the engine should
receive events. Must be non-null, and contain no null elements.
EngineException
- if the engines cannot be connected, or if the
channels parameter is invalid.public void attachAsConsumerOfEngine(java.lang.String sourceHost, int sourcePort, java.lang.String[] channels, boolean persistent) throws EngineException
ConnectOperationsInterface
attachAsConsumerOfEngine
in interface ConnectOperationsInterface
sourceHost
- The host of the engine to receive from.sourcePort
- The port of the engine to receive from.channels
- the list of channels from which the engine should
receive events. Must be non-null, and contain no null elements.persistent
- if true
, the connection will be
persistent, meaning that the receiver will automatically reconnect to
the sender whenever the connection is lost.
EngineException
- if the engines cannot be connected, or if the
channels parameter is invalid.public void attachAsConsumerOfEngine(java.lang.String sourceHost, int sourcePort, java.lang.String[] channels, boolean persistent, boolean disconnectSlow) throws EngineException
ConnectOperationsInterface
attachAsConsumerOfEngine
in interface ConnectOperationsInterface
sourceHost
- The host of the engine to receive from.sourcePort
- The port of the engine to receive from.channels
- the list of channels from which the engine should
receive events. Must be non-null, and contain no null elements.persistent
- if true
, the connection will be
persistent, meaning that the receiver will automatically reconnect to
the sender whenever the connection is lost.disconnectSlow
- Whether we should be disconnected if we don't keep up.
Only the first connection's disconnectSlow value is used; subsequent connections
to the same correlator (even if via different EngineManagement objects) share
the connection and thus the disconnect behaviour.
EngineException
- if the engines cannot be connected, or if the
channels parameter is invalid.public void detachAsConsumerOfEngine(EngineClientBean sourceEngineBean, java.lang.String[] channels) throws EngineException
ConnectOperationsInterface
engine_connect --disconnect
command, and assumes the
connection is non-persistent.
detachAsConsumerOfEngine
in interface ConnectOperationsInterface
sourceEngineBean
- The EngineClientBean instance for the engine this
object is currently connected to as a consumer.channels
- the list of channels from which the engine should
receive events. Must be non-null, and contain no null elements.
EngineException
- if the engines cannot be disconnected, or if the
channels parameter is invalid.public void detachAsConsumerOfEngine(java.lang.String sourceHost, int sourcePort, java.lang.String[] channels) throws EngineException
ConnectOperationsInterface
engine_connect --disconnect
command, and assumes the
connection is non-persistent.
detachAsConsumerOfEngine
in interface ConnectOperationsInterface
sourceHost
- The host of the engine this
object is currently connected to as a consumer.sourcePort
- The port of the engine this
object is currently connected to as a consumer.channels
- the list of channels from which the engine should
receive events. Must be non-null, and contain no null elements.
EngineException
- if the engines cannot be disconnected, or if the
channels parameter is invalid.public void detachAsConsumerOfEngine(java.lang.String sourceHost, int sourcePort, java.lang.String[] channels, boolean persistent) throws EngineException
ConnectOperationsInterface
engine_connect --disconnect
or
engine_connect --disconnect --persistent
command.
detachAsConsumerOfEngine
in interface ConnectOperationsInterface
sourceHost
- The host of the engine this
object is currently connected to as a consumer.sourcePort
- The port of the engine this
object is currently connected to as a consumer.channels
- the list of channels from which the engine should
receive events. Must be non-null, and contain no null elements.persistent
- true
if the connection to be removed
was persistent (i.e. the receiver automatically reconnects to
the sender whenever the connection is lost).
EngineException
- if the engines cannot be disconnected, or if the
channels parameter is invalid.public void setPersistentReceiveConnections(EngineConnection... connections) throws EngineException
setPersistentReceiveConnections
in interface ConnectOperationsInterface
connections
- Must not contain null
elements.
EngineException
- If the change in the persistent connection set
failed. Note that no exception is thrown if some of the specified
connections could not be established immediately - in this case the
receiver will simply keep trying to reconnect in the background.public EngineInfo getEngineInfo()
getEngineInfo
in interface InspectOperationsInterface
public void startStatusPollingThread() throws EngineException
startStatusPollingThread
in interface WatchOperationsInterface
EngineException
- Thrown if any exceptions occur in the Client SDK.public void stopStatusPollingThread()
stopStatusPollingThread
in interface WatchOperationsInterface
public EngineStatus getRemoteStatus() throws EngineException
getRemoteStatus
in interface WatchOperationsInterface
EngineException
- Thrown if any exceptions occur in the Client SDK.public void setStatusPollingInterval(int newStatusPollingInterval)
setStatusPollingInterval
in interface WatchOperationsInterface
newStatusPollingInterval
- Polling interval in milliseconds.public int getStatusPollingInterval()
getStatusPollingInterval
in interface WatchOperationsInterface
public EngineStatus getStatus()
getStatus
in interface WatchOperationsInterface
public ConsumerOperationsInterface addConsumer(java.lang.String uniqueName, java.lang.String... channels) throws EngineException
addConsumer
in interface ReceiveConsumerOperationsInterface
uniqueName
- the unique name for the new consumer.channels
- the list of channels on which the consumer should receive events.
EngineException
- if the consumer cannot be added (e.g. if the name is not unique)public ConsumerOperationsInterface addConsumer(java.lang.String uniqueName, java.lang.String[] channels, boolean disconnectSlow) throws EngineException
addConsumer
in interface ReceiveConsumerOperationsInterface
uniqueName
- the unique name for the new consumer.channels
- the list of channels on which the consumer should receive events.disconnectSlow
- whether we should be disconnected if we don't keep up.
EngineException
- if the consumer cannot be added (e.g. if the name is not unique)public ConsumerOperationsInterface addConsumer(java.lang.String uniqueName, java.lang.String[] channels, boolean disconnectSlow, boolean async) throws EngineException
addConsumer
in interface ReceiveConsumerOperationsInterface
uniqueName
- the unique name for the new consumer.channels
- the list of channels on which the consumer should receive events.disconnectSlow
- whether we should be disconnected if we don't keep up.async
- whether the consumer is asynchronous - i.e. disconnect() doesn't wait for it.
Only consumers with async set to true
may call bean methods in their
event listener.
EngineException
- if the consumer cannot be added (e.g. if the name is not unique)public ConsumerOperationsInterface getConsumer(java.lang.String uniqueName)
getConsumer
in interface ReceiveConsumerOperationsInterface
uniqueName
- the unique-name of an existing consumer.
public ConsumerOperationsInterface[] getAllConsumers()
getAllConsumers
in interface ReceiveConsumerOperationsInterface
public boolean isAllConsumersConnected()
ReceiveConsumerOperationsInterface
This is a bound property, so clients may also listen for property changes to ReceiveConsumerOperationsInterface.PROPERTY_ALL_CONSUMERS_CONNECTED. If no named consumers have been added, this property is identical to isBeanConnected.
The method name may sound odd, but "is" is the accepted method-name prefix for testing boolean properties.
isAllConsumersConnected
in interface ReceiveConsumerOperationsInterface
public void removeConsumer(java.lang.String uniqueName) throws EngineException
removeConsumer
in interface ReceiveConsumerOperationsInterface
uniqueName
- the unique-name of an existing consumer.
EngineException
- if there are problems with removing the consumer.public void removeAllConsumers() throws EngineException
removeAllConsumers
in interface ReceiveConsumerOperationsInterface
EngineException
- if there are problems while removing any of the consumers.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |