Class MQTTMessageProducerWorkflowAction
- java.lang.Object
-
- de.uplanet.lucy.server.workflow.action.AbstractWorkflowAction
-
- de.uplanet.lucy.server.mqtt.workflow.action.MQTTMessageProducerWorkflowAction
-
- All Implemented Interfaces:
IActivatableWorkflowObject
,INamedWorkflowObject
,INeedWorkflow
,IWorkflowAction
,IWorkflowObject
,Serializable
public final class MQTTMessageProducerWorkflowAction extends AbstractWorkflowAction
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MQTTMessageProducerWorkflowAction.DataCfg
-
Field Summary
-
Fields inherited from interface de.uplanet.lucy.server.workflow.IWorkflowObject
GUID_COMPARATOR
-
-
Constructor Summary
Constructors Constructor Description MQTTMessageProducerWorkflowAction(String p_strGuid)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getClientId()
Get the client identifier for the MQTT connection.int
getConnectionTimeout()
Get the connection timeout in seconds.MQTTMessageProducerWorkflowAction.DataCfg
getData()
Get the message data configuration.String
getPassword()
Get the password that is used when creating the MQTT connection.int
getQos()
Get the quality of service.long
getQuiesceTimeout()
Get the amount of time in milliseconds to allow for existing work to finish before disconnecting.String
getServerUri()
Get the server URI.String
getTopic()
Get the topic name;String
getTopicContextVariableName()
Get the name of a context variable that contains the topic name.String
getUserName()
Get the user identity that used when creating the MQTT connection.boolean
isNoMessageDataIsError()
This property determines if it is an error when no data are available at runtime.WorkflowTransition
process(IWorkflowEvent p_evt, de.uplanet.lucy.server.workflow.IWorkflowProcessingContext p_wfCtx, de.uplanet.lucy.server.IProcessingContext p_ctx)
Process a workflow event in the given context.void
setClientId(String p_strClientId)
Set the client identifier for the MQTT connection.void
setConnectionTimeout(int p_iTimeout)
Set the connection timeout in seconds.void
setData(MQTTMessageProducerWorkflowAction.DataCfg p_dataCfg)
Set the message data configuration.void
setNoMessageDataIsError(boolean p_bNoMessageDataIsError)
This property determines if it is an error when no data are available at runtime.void
setPassword(String p_strPassword)
Set the password that is used when creating the MQTT connection.void
setQos(int p_iQoS)
Set the quality of service.void
setQuiesceTimeout(long p_lTimeout)
Set the amount of time in milliseconds to allow for existing work to finish before disconnecting.void
setServerUri(String p_strServerUri)
Set the server URI.void
setTopic(String p_strTopicName)
Set the topic name;void
setTopicContextVariableName(String p_strContextVariableName)
Set the name of a context variable that contains the topic name.void
setUserName(String p_strUserName)
Set the user identity that used when creating the MQTT connection.-
Methods inherited from class de.uplanet.lucy.server.workflow.action.AbstractWorkflowAction
getAfferentTransition, getEfferentTransition, getGuid, getName, getWorkflow, isActive, setActive, setAfferentTransition, setEfferentTransition, setName, setWorkflow, toString
-
-
-
-
Constructor Detail
-
MQTTMessageProducerWorkflowAction
public MQTTMessageProducerWorkflowAction(String p_strGuid)
- Parameters:
p_strGuid
- The GUID of the workflow action.- Throws:
IllegalArgumentException
- If the GUID parameter isnull
or if it does not represent a valid GUID.
-
-
Method Detail
-
getServerUri
public String getServerUri()
Get the server URI.- Returns:
- The server URI.
-
setServerUri
public void setServerUri(String p_strServerUri)
Set the server URI.- Parameters:
p_strServerUri
- The server URI.
-
getTopic
public String getTopic()
Get the topic name;- Returns:
- The topic name.
-
setTopic
public void setTopic(String p_strTopicName)
Set the topic name;- Parameters:
p_strTopicName
- The topic name.
-
getTopicContextVariableName
public String getTopicContextVariableName()
Get the name of a context variable that contains the topic name.- Returns:
- The name of a context variable that contains the topic name.
-
setTopicContextVariableName
public void setTopicContextVariableName(String p_strContextVariableName)
Set the name of a context variable that contains the topic name.- Parameters:
p_strContextVariableName
- The name of a context variable that contains the topic name.
-
getQos
public int getQos()
Get the quality of service.- Returns:
- The quality of service.
-
setQos
public void setQos(int p_iQoS)
Set the quality of service.- Parameters:
p_iQoS
- The quality of service.
-
getClientId
public String getClientId()
Get the client identifier for the MQTT connection.The default client identifier is prefixed with
ix-mqtt-action-OBJECT_GUID
.- Returns:
- The client identifier for the MQTT connection.
-
setClientId
public void setClientId(String p_strClientId)
Set the client identifier for the MQTT connection.The default client identifier is prefixed with
ix-mqtt-action-OBJECT_GUID
.- Parameters:
p_strClientId
- The client identifier for the MQTT connection.
-
getUserName
public String getUserName()
Get the user identity that used when creating the MQTT connection.- Returns:
- The user identity.
-
setUserName
public void setUserName(String p_strUserName)
Set the user identity that used when creating the MQTT connection.If this property is
null
(default) the default user identity will be used.- Parameters:
p_strUserName
- The user identity.
-
getPassword
public String getPassword()
Get the password that is used when creating the MQTT connection.- Returns:
- The password.
-
setPassword
public void setPassword(String p_strPassword)
Set the password that is used when creating the MQTT connection.- Parameters:
p_strPassword
- The password.
-
getData
public MQTTMessageProducerWorkflowAction.DataCfg getData()
Get the message data configuration.- Returns:
- The message data configuration.
-
setData
public void setData(MQTTMessageProducerWorkflowAction.DataCfg p_dataCfg)
Set the message data configuration.- Parameters:
p_dataCfg
- The message data configuration.
-
isNoMessageDataIsError
public boolean isNoMessageDataIsError()
This property determines if it is an error when no data are available at runtime.If it is an error, an exception is thrown. Otherwise this action does nothing.
- Returns:
true
if it is an error when no data are available, orfalse
otherwise.
-
setNoMessageDataIsError
public void setNoMessageDataIsError(boolean p_bNoMessageDataIsError)
This property determines if it is an error when no data are available at runtime.If it is an error, an exception is thrown. Otherwise this action does nothing.
- Parameters:
p_bNoMessageDataIsError
-true
if it is an error when no data are available, orfalse
otherwise.
-
getConnectionTimeout
public int getConnectionTimeout()
Get the connection timeout in seconds.The default value is 5 seconds. A value of 0 disables timeout processing meaning the client will wait until the network connection is made successfully or fails.
- Returns:
- The connection timeout.
-
setConnectionTimeout
public void setConnectionTimeout(int p_iTimeout)
Set the connection timeout in seconds.The default value is 5 seconds. A value of 0 disables timeout processing meaning the client will wait until the network connection is made successfully or fails.
- Parameters:
p_iTimeout
- The connection timeout.
-
getQuiesceTimeout
public long getQuiesceTimeout()
Get the amount of time in milliseconds to allow for existing work to finish before disconnecting. A value of zero or less means the client will not quiesce.- Returns:
- The quiesce timeout.
-
setQuiesceTimeout
public void setQuiesceTimeout(long p_lTimeout)
Set the amount of time in milliseconds to allow for existing work to finish before disconnecting. A value of zero or less means the client will not quiesce.- Parameters:
p_lTimeout
- The quiesce timeout.
-
process
public WorkflowTransition process(IWorkflowEvent p_evt, de.uplanet.lucy.server.workflow.IWorkflowProcessingContext p_wfCtx, de.uplanet.lucy.server.IProcessingContext p_ctx) throws WorkflowException, de.uplanet.util.InvalidPropertyException, de.uplanet.lucy.server.businesslogic.BlException, org.eclipse.paho.client.mqttv3.MqttException
Description copied from interface:IWorkflowAction
Process a workflow event in the given context.Normally, a workflow action should return its efferent transition, regardless whether it is
active
, or not.- Parameters:
p_evt
- The event to be processed.p_wfCtx
- The workflow processing context.p_ctx
- The processing context.- Returns:
- The efferent transition, or
null
. - Throws:
WorkflowException
de.uplanet.util.InvalidPropertyException
de.uplanet.lucy.server.businesslogic.BlException
org.eclipse.paho.client.mqttv3.MqttException
-
-