Class BroadcastAndListen
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.transformer.redisaction.AbstractRedisAction
-
- adams.flow.transformer.redisaction.BroadcastAndListen
-
- All Implemented Interfaces:
adams.core.Destroyable,adams.core.GlobalInfoSupporter,adams.core.logging.LoggingLevelHandler,adams.core.logging.LoggingSupporter,adams.core.option.OptionHandler,adams.core.QuickInfoSupporter,adams.core.SizeOfHandler,adams.core.Stoppable,adams.core.StoppableWithFeedback,adams.flow.core.FlowContextHandler,Serializable
public class BroadcastAndListen extends AbstractRedisAction
Broadcasts the incoming data to the specified out channel and listens for data to come through on the in channel.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringm_ChannelInthe channel for receiving data.protected Stringm_ChannelOutthe channel for sending data.protected Objectm_Datathe received data.protected io.lettuce.core.pubsub.StatefulRedisPubSubConnectionm_PubSubConnectionthe pub/sub connection object.protected io.lettuce.core.pubsub.RedisPubSubListenerm_PubSubListenerthe pub/sub listener.protected intm_TimeOutthe timeout in msec.protected RedisDataTypem_TypeInthe data type for the incoming channel.protected RedisDataTypem_TypeOutthe data type for the out channel.-
Fields inherited from class adams.flow.transformer.redisaction.AbstractRedisAction
m_FlowContext, m_Stopped
-
-
Constructor Summary
Constructors Constructor Description BroadcastAndListen()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class[]accepts()Returns the classes the action accepts as input.StringchannelInTipText()Returns the tip text for this property.StringchannelOutTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.protected ObjectdoExecute(RedisConnection connection, Object o, adams.core.MessageCollection errors)Performs the action.Classgenerates()Returns the classes the action generates as output.StringgetChannelIn()Returns the channel for receiving data.StringgetChannelOut()Returns the channel for sending data.StringgetQuickInfo()Returns a quick info about the object, which can be displayed in the GUI.intgetTimeOut()Returns the timeout in msec.RedisDataTypegetTypeIn()Returns the type of the data for the in channel.RedisDataTypegetTypeOut()Returns the type of the data for the out channel.StringglobalInfo()Returns a string describing the object.protected io.lettuce.core.pubsub.RedisPubSubListener<byte[],byte[]>newBytesListener()Returns a new pub/sub listener for byte arrays.protected io.lettuce.core.pubsub.RedisPubSubListener<String,String>newStringListener()Returns a new pub/sub listener for strings.voidsetChannelIn(String value)Sets the channel for receiving data.voidsetChannelOut(String value)Sets the channel for sending data.voidsetTimeOut(int value)Sets the timeout in msec.voidsetTypeIn(RedisDataType value)Sets the type of the data for the in channel.voidsetTypeOut(RedisDataType value)Sets the type of the data for the out channel.StringtimeOutTipText()Returns the tip text for this property.StringtypeInTipText()Returns the tip text for this property.StringtypeOutTipText()Returns the tip text for this property.-
Methods inherited from class adams.flow.transformer.redisaction.AbstractRedisAction
check, execute, getFlowContext, initialize, isStopped, setFlowContext, stopExecution
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_ChannelOut
protected String m_ChannelOut
the channel for sending data.
-
m_TypeOut
protected RedisDataType m_TypeOut
the data type for the out channel.
-
m_ChannelIn
protected String m_ChannelIn
the channel for receiving data.
-
m_TypeIn
protected RedisDataType m_TypeIn
the data type for the incoming channel.
-
m_TimeOut
protected int m_TimeOut
the timeout in msec.
-
m_PubSubConnection
protected transient io.lettuce.core.pubsub.StatefulRedisPubSubConnection m_PubSubConnection
the pub/sub connection object.
-
m_PubSubListener
protected transient io.lettuce.core.pubsub.RedisPubSubListener m_PubSubListener
the pub/sub listener.
-
m_Data
protected transient Object m_Data
the received data.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceadams.core.GlobalInfoSupporter- Specified by:
globalInfoin classadams.core.option.AbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin classadams.core.option.AbstractOptionHandler
-
setChannelOut
public void setChannelOut(String value)
Sets the channel for sending data.- Parameters:
value- the channel
-
getChannelOut
public String getChannelOut()
Returns the channel for sending data.- Returns:
- the channel
-
channelOutTipText
public String channelOutTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setTypeOut
public void setTypeOut(RedisDataType value)
Sets the type of the data for the out channel.- Parameters:
value- the type
-
getTypeOut
public RedisDataType getTypeOut()
Returns the type of the data for the out channel.- Returns:
- the type
-
typeOutTipText
public String typeOutTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setChannelIn
public void setChannelIn(String value)
Sets the channel for receiving data.- Parameters:
value- the channel
-
getChannelIn
public String getChannelIn()
Returns the channel for receiving data.- Returns:
- the channel
-
channelInTipText
public String channelInTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setTypeIn
public void setTypeIn(RedisDataType value)
Sets the type of the data for the in channel.- Parameters:
value- the type
-
getTypeIn
public RedisDataType getTypeIn()
Returns the type of the data for the in channel.- Returns:
- the type
-
typeInTipText
public String typeInTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setTimeOut
public void setTimeOut(int value)
Sets the timeout in msec.- Parameters:
value- the timeout
-
getTimeOut
public int getTimeOut()
Returns the timeout in msec.- Returns:
- the timeout
-
timeOutTipText
public String timeOutTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.- Specified by:
getQuickInfoin interfaceadams.core.QuickInfoSupporter- Overrides:
getQuickInfoin classAbstractRedisAction- Returns:
- null if no info available, otherwise short string
-
accepts
public Class[] accepts()
Returns the classes the action accepts as input.- Specified by:
acceptsin classAbstractRedisAction- Returns:
- the classes
-
generates
public Class generates()
Returns the classes the action generates as output.- Specified by:
generatesin classAbstractRedisAction- Returns:
- the classes
-
newStringListener
protected io.lettuce.core.pubsub.RedisPubSubListener<String,String> newStringListener()
Returns a new pub/sub listener for strings.- Returns:
- the listener
-
newBytesListener
protected io.lettuce.core.pubsub.RedisPubSubListener<byte[],byte[]> newBytesListener()
Returns a new pub/sub listener for byte arrays.- Returns:
- the listener
-
doExecute
protected Object doExecute(RedisConnection connection, Object o, adams.core.MessageCollection errors)
Performs the action.- Specified by:
doExecutein classAbstractRedisAction- Parameters:
connection- the Redis connectiono- the object to processerrors- for collecting errors- Returns:
- the generated object
-
-