Interface ConnectOperationsInterface
-
- All Known Subinterfaces:
EngineClientInterface
- All Known Implementing Classes:
EngineClientBean
public interface ConnectOperationsInterface
ConnectOperationsInterface is an interface that specifies methods for connecting an engine as a consumer of another engine.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description 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 disconnectSlow)
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 disconnectSlow, ConnectMode mode)
Connect this engine to another so that it receives events emitted on the specified channels.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(EngineClientBean sourceEngineBean, java.lang.String[] channels, ConnectMode mode)
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, ConnectMode mode)
Disconnect this engine from another so that it not longer receives events emitted on the specified channels.EngineConnection[]
getReceiverConnections()
Get all the persistent connections associated with the engine.void
setPersistentReceiveConnections(EngineConnection... connections)
Deprecated.usesetReceiverConnections(EngineConnection... )
insteadvoid
setReceiverConnections(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).
-
-
-
Method Detail
-
attachAsConsumerOfEngine
void attachAsConsumerOfEngine(EngineClientBean sourceEngineBean, java.lang.String[] channels) throws EngineException
Connect this engine to another (non-persisently) so that it receives events emitted on the specified channels. This is equivalent to the engine_connect command.
Note: If you do not already have a connected EngineClientBean instance for the source engine, it is usually more efficient to call the overloaded ConnectOperationsInterface#attachAsConsumerOfEngine(String, int, String[]) method which takes a source host and port instead.- Parameters:
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.- Throws:
EngineException
- if the engines cannot be connected, or if the channels parameter is invalid.
-
attachAsConsumerOfEngine
void attachAsConsumerOfEngine(java.lang.String sourceHost, int sourcePort, java.lang.String[] channels) throws EngineException
Connect this engine to another (non-persistently) so that it receives events emitted on the specified channels. This is equivalent to the engine_connect command.- Parameters:
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.- Throws:
EngineException
- if the engines cannot be connected, or if the channels parameter is invalid.
-
attachAsConsumerOfEngine
void attachAsConsumerOfEngine(java.lang.String sourceHost, int sourcePort, java.lang.String[] channels, boolean disconnectSlow) throws EngineException
Connect this engine to another so that it receives events emitted on the specified channels. This is equivalent to the engine_connect command.- Parameters:
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.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.- Throws:
EngineException
- if the engines cannot be connected, or if the channels parameter is invalid.
-
attachAsConsumerOfEngine
void attachAsConsumerOfEngine(java.lang.String sourceHost, int sourcePort, java.lang.String[] channels, boolean disconnectSlow, ConnectMode mode) throws EngineException
Connect this engine to another so that it receives events emitted on the specified channels. This is equivalent to the engine_connect command.- Parameters:
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.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.mode
- the connection mode to use, defaults to legacy (single connection, all events delivered to the default channel). Set to PARALLEL for connection per channel and channel values passed through.- Throws:
EngineException
- if the engines cannot be connected, or if the channels parameter is invalid.
-
detachAsConsumerOfEngine
void detachAsConsumerOfEngine(EngineClientBean sourceEngineBean, java.lang.String[] channels) throws EngineException
Disconnect this engine from another so that it not longer receives events emitted on the specified channels. This is equivalent to theengine_connect --disconnect
command, and assumes the connection is non-persistent.- Parameters:
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.- Throws:
EngineException
- if the engines cannot be disconnected, or if the channels parameter is invalid.
-
detachAsConsumerOfEngine
void detachAsConsumerOfEngine(EngineClientBean sourceEngineBean, java.lang.String[] channels, ConnectMode mode) throws EngineException
Disconnect this engine from another so that it not longer receives events emitted on the specified channels. This is equivalent to theengine_connect --disconnect
command, and assumes the connection is non-persistent.- Parameters:
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.mode
- the connection mode to use, defaults to legacy (single connection, all events delivered to the default channel). Set to PARALLEL for connection per channel and channel values passed through.- Throws:
EngineException
- if the engines cannot be disconnected, or if the channels parameter is invalid.
-
detachAsConsumerOfEngine
void detachAsConsumerOfEngine(java.lang.String sourceHost, int sourcePort, java.lang.String[] channels) throws EngineException
Disconnect this engine from another so that it not longer receives events emitted on the specified channels. This is equivalent to theengine_connect --disconnect
command, and assumes the connection is non-persistent.- Parameters:
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.- Throws:
EngineException
- if the engines cannot be disconnected, or if the channels parameter is invalid.
-
detachAsConsumerOfEngine
void detachAsConsumerOfEngine(java.lang.String sourceHost, int sourcePort, java.lang.String[] channels, ConnectMode mode) throws EngineException
Disconnect this engine from another so that it not longer receives events emitted on the specified channels. This is equivalent to theengine_connect --disconnect
command, and assumes the connection is non-persistent.- Parameters:
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.mode
- the connection mode to use, defaults to legacy (single connection, all events delivered to the default channel). Set to PARALLEL for connection per channel and channel values passed through.- Throws:
EngineException
- if the engines cannot be disconnected, or if the channels parameter is invalid.
-
setPersistentReceiveConnections
@Deprecated void setPersistentReceiveConnections(EngineConnection... connections) throws EngineException
Deprecated.usesetReceiverConnections(EngineConnection... )
insteadAttaches 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).- Parameters:
connections
- Must not containnull
elements.- Throws:
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.
-
setReceiverConnections
void setReceiverConnections(EngineConnection... connections) throws EngineException
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).- Parameters:
connections
- Must not containnull
elements.- Throws:
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.
-
getReceiverConnections
EngineConnection[] getReceiverConnections() throws EngineException
Get all the persistent connections associated with the engine.- Returns:
- an array of EngineConnection objects.
- Throws:
EngineException
- Thrown if any exceptions occur in the Client SDK.
-
-