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 String
m_ChannelIn
the channel for receiving data.protected String
m_ChannelOut
the channel for sending data.protected Object
m_Data
the received data.protected io.lettuce.core.pubsub.StatefulRedisPubSubConnection
m_PubSubConnection
the pub/sub connection object.protected io.lettuce.core.pubsub.RedisPubSubListener
m_PubSubListener
the pub/sub listener.protected int
m_TimeOut
the timeout in msec.protected RedisDataType
m_TypeIn
the data type for the incoming channel.protected RedisDataType
m_TypeOut
the 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.String
channelInTipText()
Returns the tip text for this property.String
channelOutTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.protected Object
doExecute(RedisConnection connection, Object o, adams.core.MessageCollection errors)
Performs the action.Class
generates()
Returns the classes the action generates as output.String
getChannelIn()
Returns the channel for receiving data.String
getChannelOut()
Returns the channel for sending data.String
getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.int
getTimeOut()
Returns the timeout in msec.RedisDataType
getTypeIn()
Returns the type of the data for the in channel.RedisDataType
getTypeOut()
Returns the type of the data for the out channel.String
globalInfo()
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.void
setChannelIn(String value)
Sets the channel for receiving data.void
setChannelOut(String value)
Sets the channel for sending data.void
setTimeOut(int value)
Sets the timeout in msec.void
setTypeIn(RedisDataType value)
Sets the type of the data for the in channel.void
setTypeOut(RedisDataType value)
Sets the type of the data for the out channel.String
timeOutTipText()
Returns the tip text for this property.String
typeInTipText()
Returns the tip text for this property.String
typeOutTipText()
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:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in 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:
defineOptions
in interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in 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:
getQuickInfo
in interfaceadams.core.QuickInfoSupporter
- Overrides:
getQuickInfo
in classAbstractRedisAction
- Returns:
- null if no info available, otherwise short string
-
accepts
public Class[] accepts()
Returns the classes the action accepts as input.- Specified by:
accepts
in classAbstractRedisAction
- Returns:
- the classes
-
generates
public Class generates()
Returns the classes the action generates as output.- Specified by:
generates
in 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:
doExecute
in classAbstractRedisAction
- Parameters:
connection
- the Redis connectiono
- the object to processerrors
- for collecting errors- Returns:
- the generated object
-
-