Class MQTTWorkflowEventSource
- All Implemented Interfaces:
de.uplanet.lucy.server.workflow.authentication.INeedCredentialSupplier
,de.uplanet.lucy.server.workflow.authentication.INeedPasswordSupplier
,IActivatableWorkflowObject
,de.uplanet.lucy.server.workflow.IImpersonateUser
,ILogLevelAware
,INamedWorkflowObject
,de.uplanet.lucy.server.workflow.INeedClusterInfo
,INeedWorkflow
,IRunnableWorkflowObject
,IStartableWorkflowObject
,ISupportAfterStopEvent
,ISupportBeforeStartEvent
,ISupportGlobalSharedState
,IWorkflowEventSource
,IWorkflowObject
,Serializable
- See Also:
-
Field Summary
Fields inherited from interface de.uplanet.lucy.server.workflow.IWorkflowObject
GUID_COMPARATOR
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the client identifier for the MQTT connection.de.uplanet.lucy.server.workflow.IClusterInfo
int
Get the keep alive interval.long
Get the time in milliseconds the event source will wait before it tries to restart after an error occurred that prevented it to running the source loop.Get the password that is used when creating the MQTT connection.int
getQos()
Get the quality of service.Get the server URI.getTopic()
Get the topic name;Get the user identity that used when creating the MQTT connection.void
internalSetPasswordSupplier
(de.uplanet.lucy.server.workflow.authentication.IPasswordSupplier p_passwordSupplier) boolean
Check whether the client and server should remember state across restarts and reconnects.boolean
This property determines if a global shared state should be used for all events created by this event source.boolean
This property determines if the client should connect with a unique randomized identifier.boolean
Deprecated.Currently this property is ignored since the MQTT event source always tries to reconnect to the MQTT broker.boolean
This property determines if an after-stop event should be sent.boolean
This property determines if an before-start event should be sent.void
setCleanSession
(boolean p_bCleanSession) Set whether the client and server should remember state across restarts and reconnects.void
setClientId
(String p_strClientId) Set the client identifier for the MQTT connection.void
setClientIdParamRef
(String p_strParamRef) void
setClusterInfo
(de.uplanet.lucy.server.workflow.IClusterInfo p_clusterInfo) void
setGlobalSharedState
(boolean p_bGlobalSharedState) This property determines if a global shared state should be used for all events created by this event source.void
setKeepAliveInterval
(int p_iKeepAliveInterval) Set the keep alive interval.void
setOnErrorRestartWaitTimeout
(long p_lOnErrorRestartWaitTimeout) Set the time in milliseconds the event source will wait before it tries to restart after an error occurred that prevented it to running the source loop.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
setRandomizeClientId
(boolean p_bRandomizeClientId) This property determines if the client should connect with a unique randomized identifier.void
setReconnect
(boolean p_bReconnect) Deprecated.Currently this property is ignored since the MQTT event source always tries to reconnect to the MQTT broker.void
setSendAfterStopEvent
(boolean p_bSendAfterStopEvent) This property determines if an after-stop event should be sent.void
setSendBeforeStartEvent
(boolean p_bSendBeforeStartEvent) This property determines if an before-start event should be sent.void
setServerUri
(String p_strServerUri) Set the server URI.void
setServerUriParamRef
(String p_strParamRef) void
Set the topic name;void
setTopicParamRef
(String p_strParamRef) void
setUserName
(String p_strUserName) Set the user identity that used when creating the MQTT connection.void
setUserNameParamRef
(String p_strParamRef) void
stop()
Stop the workflow object.Methods inherited from class de.uplanet.lucy.server.workflow.eventsource.AbstractSingleThreadedWorkflowEventSource
getDatabaseConnectionFactory, getStartDelay, getStopWaitTimeout, isLogVerbose, isRunning, setDatabaseConnectionFactory, setLogVerbose, setStartDelay, setStopWaitTimeout, shouldRun, start
Methods inherited from class de.uplanet.lucy.server.workflow.eventsource.AbstractWorkflowEventSource
getGuid, getImpersonateUserGuid, getName, getWorkflow, hasImpersonateUserGuid, isActive, isRunWithLocalSystemPrivileges, setActive, setImpersonateUserGuid, setName, setRunWithLocalSystemPrivileges, setWorkflow, toString
-
Constructor Details
-
MQTTWorkflowEventSource
-
-
Method Details
-
getClusterInfo
public de.uplanet.lucy.server.workflow.IClusterInfo getClusterInfo()- Specified by:
getClusterInfo
in interfacede.uplanet.lucy.server.workflow.INeedClusterInfo
-
setClusterInfo
public void setClusterInfo(de.uplanet.lucy.server.workflow.IClusterInfo p_clusterInfo) - Specified by:
setClusterInfo
in interfacede.uplanet.lucy.server.workflow.INeedClusterInfo
-
getOnErrorRestartWaitTimeout
public long getOnErrorRestartWaitTimeout()Get the time in milliseconds the event source will wait before it tries to restart after an error occurred that prevented it to running the source loop.The default value is 60000 milliseconds (one minute).
- Returns:
- The timeout in milliseconds.
-
setOnErrorRestartWaitTimeout
public void setOnErrorRestartWaitTimeout(long p_lOnErrorRestartWaitTimeout) Set the time in milliseconds the event source will wait before it tries to restart after an error occurred that prevented it to running the source loop.- Parameters:
p_lOnErrorRestartWaitTimeout
- The timeout in milliseconds.
-
isSendBeforeStartEvent
public boolean isSendBeforeStartEvent()Description copied from interface:ISupportBeforeStartEvent
This property determines if an before-start event should be sent.- Specified by:
isSendBeforeStartEvent
in interfaceISupportBeforeStartEvent
- Returns:
true
if an event should be sent before the workflow object's activity is about to being started, orfalse
otherwise.
-
setSendBeforeStartEvent
public void setSendBeforeStartEvent(boolean p_bSendBeforeStartEvent) Description copied from interface:ISupportBeforeStartEvent
This property determines if an before-start event should be sent.- Specified by:
setSendBeforeStartEvent
in interfaceISupportBeforeStartEvent
- Parameters:
p_bSendBeforeStartEvent
-true
if an event should be sent before the workflow object's activity is about to being started, orfalse
otherwise.
-
isSendAfterStopEvent
public boolean isSendAfterStopEvent()Description copied from interface:ISupportAfterStopEvent
This property determines if an after-stop event should be sent.- Specified by:
isSendAfterStopEvent
in interfaceISupportAfterStopEvent
- Returns:
true
if an event should be sent after the workflow object's activity has been stopped, orfalse
otherwise.
-
setSendAfterStopEvent
public void setSendAfterStopEvent(boolean p_bSendAfterStopEvent) Description copied from interface:ISupportAfterStopEvent
This property determines if an after-stop event should be sent.- Specified by:
setSendAfterStopEvent
in interfaceISupportAfterStopEvent
- Parameters:
p_bSendAfterStopEvent
-true
if an event should be sent after the workflow object's activity has been stopped, orfalse
otherwise.
-
getServerUri
Get the server URI.- Returns:
- The server URI.
-
setServerUri
Set the server URI.- Parameters:
p_strServerUri
- The server URI.
-
getServerUriParamRef
-
setServerUriParamRef
-
getUserName
Get the user identity that used when creating the MQTT connection.- Returns:
- The user identity.
-
setUserName
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.
-
getUserNameParamRef
-
setUserNameParamRef
-
getPassword
Get the password that is used when creating the MQTT connection.- Returns:
- The password.
-
setPassword
Set the password that is used when creating the MQTT connection.- Parameters:
p_strPassword
- The password.
-
internalSetPasswordSupplier
public void internalSetPasswordSupplier(de.uplanet.lucy.server.workflow.authentication.IPasswordSupplier p_passwordSupplier) - Specified by:
internalSetPasswordSupplier
in interfacede.uplanet.lucy.server.workflow.authentication.INeedPasswordSupplier
-
internalGetPassword
- Specified by:
internalGetPassword
in interfacede.uplanet.lucy.server.workflow.authentication.INeedPasswordSupplier
-
getClientId
Get the client identifier for the MQTT connection.The default client identifier is
ix-mqtt-consumer-OBJECT_GUID
.- Returns:
- The client identifier for the MQTT connection.
-
setClientId
Set the client identifier for the MQTT connection.The default client identifier is
ix-mqtt-consumer-OBJECT_GUID
.- Parameters:
p_strClientId
- The client identifier for the MQTT connection.
-
getClientIdParamRef
-
setClientIdParamRef
-
isRandomizeClientId
public boolean isRandomizeClientId()This property determines if the client should connect with a unique randomized identifier.If
true
(default) a random suffix will be appended to the client ID that would normally be used.- Returns:
true
if the client ID is random, orfalse
otherwise.
-
setRandomizeClientId
public void setRandomizeClientId(boolean p_bRandomizeClientId) This property determines if the client should connect with a unique randomized identifier.If
true
(default) a random suffix will be appended to the client ID that would normally be used.- Parameters:
p_bRandomizeClientId
-true
if the client ID should be random, orfalse
otherwise.
-
getTopic
Get the topic name;- Returns:
- The topic name.
-
setTopic
Set the topic name;- Parameters:
p_strTopicName
- The topic name.
-
getTopicParamRef
-
setTopicParamRef
-
getQos
public int getQos()Get the quality of service.Valid values are either 0, 1, or 2 (see
QOS.AT_MOST_ONCE_DELIVERY
,QOS.AT_LEAST_ONCE_DELIVERY
,QOS.EXACTLY_ONCE_DELIVERY
).- Returns:
- The quality of service.
-
setQos
public void setQos(int p_iQoS) Set the quality of service.Valid values are either 0, 1, or 2 (see
QOS.AT_MOST_ONCE_DELIVERY
,QOS.AT_LEAST_ONCE_DELIVERY
,QOS.EXACTLY_ONCE_DELIVERY
).- Parameters:
p_iQoS
- The quality of service.
-
isReconnect
Deprecated.Currently this property is ignored since the MQTT event source always tries to reconnect to the MQTT broker.Check whether the client will automatically attempt to reconnect to the server if the connection is lost.The default value is
true
.- Returns:
true
if the client will attempt to reconnect, orfalse
otherwise.
-
setReconnect
Deprecated.Currently this property is ignored since the MQTT event source always tries to reconnect to the MQTT broker.Set whether the client will automatically attempt to reconnect to the server if the connection is lost.The default value is
true
.- Parameters:
p_bReconnect
-true
if the client should attempt to reconnect, orfalse
otherwise.
-
isCleanSession
public boolean isCleanSession()Check whether the client and server should remember state across restarts and reconnects.- Returns:
true
if the state should not be maintained, orfalse
otherwise.
-
setCleanSession
public void setCleanSession(boolean p_bCleanSession) Set whether the client and server should remember state across restarts and reconnects.- If set to
false
both the client and server will maintain state across restarts of the client, the server and the connection. As state is maintained:- Message delivery will be reliable meeting the specified
QOS
even if the client, server or connection are restarted. - The server will treat a subscription as durable.
- Message delivery will be reliable meeting the specified
- If set to
true
the client and server will not maintain state across restarts of the client, the server or the connection. This means- Message delivery to the specified QOS cannot be maintained if the client, server or connection are restarted.
- The server will treat a subscription as non-durable.
The default value is
true
.- Parameters:
p_bCleanSession
-true
if the state should not be maintained, orfalse
otherwise.
- If set to
-
getKeepAliveInterval
public int getKeepAliveInterval()Get the keep alive interval.- Returns:
- The keep alive interval.
-
setKeepAliveInterval
public void setKeepAliveInterval(int p_iKeepAliveInterval) Set the keep alive interval.This value, measured in seconds, defines the maximum time interval between messages received. It enables the client to detect if the server is no longer available, without having to wait for the TCP/IP timeout. The client will ensure that at least one ping message travels across the network within each keep alive period.
A value of 0 disables keep alive processing in the client.
- Parameters:
p_iKeepAliveInterval
- the keep alive interval in seconds.
-
stop
public void stop()Description copied from interface:IStartableWorkflowObject
Stop the workflow object.A call to this method must not throw an exception if the object is already stopped.
- Specified by:
stop
in interfaceIStartableWorkflowObject
- Overrides:
stop
in classAbstractSingleThreadedWorkflowEventSource
-