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.IClusterInfointGet the keep alive interval.longGet 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.intgetQos()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.voidinternalSetPasswordSupplier(de.uplanet.lucy.server.workflow.authentication.IPasswordSupplier p_passwordSupplier) booleanCheck whether the client and server should remember state across restarts and reconnects.booleanThis property determines if a global shared state should be used for all events created by this event source.booleanThis property determines if the client should connect with a unique randomized identifier.booleanDeprecated.Currently this property is ignored since the MQTT event source always tries to reconnect to the MQTT broker.booleanThis property determines if an after-stop event should be sent.booleanThis property determines if an before-start event should be sent.voidsetCleanSession(boolean p_bCleanSession) Set whether the client and server should remember state across restarts and reconnects.voidsetClientId(String p_strClientId) Set the client identifier for the MQTT connection.voidsetClientIdParamRef(String p_strParamRef) voidsetClusterInfo(de.uplanet.lucy.server.workflow.IClusterInfo p_clusterInfo) voidsetGlobalSharedState(boolean p_bGlobalSharedState) This property determines if a global shared state should be used for all events created by this event source.voidsetKeepAliveInterval(int p_iKeepAliveInterval) Set the keep alive interval.voidsetOnErrorRestartWaitTimeout(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.voidsetPassword(String p_strPassword) Set the password that is used when creating the MQTT connection.voidsetQos(int p_iQoS) Set the quality of service.voidsetRandomizeClientId(boolean p_bRandomizeClientId) This property determines if the client should connect with a unique randomized identifier.voidsetReconnect(boolean p_bReconnect) Deprecated.Currently this property is ignored since the MQTT event source always tries to reconnect to the MQTT broker.voidsetSendAfterStopEvent(boolean p_bSendAfterStopEvent) This property determines if an after-stop event should be sent.voidsetSendBeforeStartEvent(boolean p_bSendBeforeStartEvent) This property determines if an before-start event should be sent.voidsetServerUri(String p_strServerUri) Set the server URI.voidsetServerUriParamRef(String p_strParamRef) voidSet the topic name;voidsetTopicParamRef(String p_strParamRef) voidsetUserName(String p_strUserName) Set the user identity that used when creating the MQTT connection.voidsetUserNameParamRef(String p_strParamRef) voidstop()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, startMethods 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:
getClusterInfoin interfacede.uplanet.lucy.server.workflow.INeedClusterInfo
-
setClusterInfo
public void setClusterInfo(de.uplanet.lucy.server.workflow.IClusterInfo p_clusterInfo) - Specified by:
setClusterInfoin 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:ISupportBeforeStartEventThis property determines if an before-start event should be sent.- Specified by:
isSendBeforeStartEventin interfaceISupportBeforeStartEvent- Returns:
trueif an event should be sent before the workflow object's activity is about to being started, orfalseotherwise.
-
setSendBeforeStartEvent
public void setSendBeforeStartEvent(boolean p_bSendBeforeStartEvent) Description copied from interface:ISupportBeforeStartEventThis property determines if an before-start event should be sent.- Specified by:
setSendBeforeStartEventin interfaceISupportBeforeStartEvent- Parameters:
p_bSendBeforeStartEvent-trueif an event should be sent before the workflow object's activity is about to being started, orfalseotherwise.
-
isSendAfterStopEvent
public boolean isSendAfterStopEvent()Description copied from interface:ISupportAfterStopEventThis property determines if an after-stop event should be sent.- Specified by:
isSendAfterStopEventin interfaceISupportAfterStopEvent- Returns:
trueif an event should be sent after the workflow object's activity has been stopped, orfalseotherwise.
-
setSendAfterStopEvent
public void setSendAfterStopEvent(boolean p_bSendAfterStopEvent) Description copied from interface:ISupportAfterStopEventThis property determines if an after-stop event should be sent.- Specified by:
setSendAfterStopEventin interfaceISupportAfterStopEvent- Parameters:
p_bSendAfterStopEvent-trueif an event should be sent after the workflow object's activity has been stopped, orfalseotherwise.
-
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:
internalSetPasswordSupplierin interfacede.uplanet.lucy.server.workflow.authentication.INeedPasswordSupplier
-
internalGetPassword
- Specified by:
internalGetPasswordin 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:
trueif the client ID is random, orfalseotherwise.
-
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-trueif the client ID should be random, orfalseotherwise.
-
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:
trueif the client will attempt to reconnect, orfalseotherwise.
-
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-trueif the client should attempt to reconnect, orfalseotherwise.
-
isCleanSession
public boolean isCleanSession()Check whether the client and server should remember state across restarts and reconnects.- Returns:
trueif the state should not be maintained, orfalseotherwise.
-
setCleanSession
public void setCleanSession(boolean p_bCleanSession) Set whether the client and server should remember state across restarts and reconnects.- If set to
falseboth 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
QOSeven 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
truethe 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-trueif the state should not be maintained, orfalseotherwise.
- 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:IStartableWorkflowObjectStop the workflow object.A call to this method must not throw an exception if the object is already stopped.
- Specified by:
stopin interfaceIStartableWorkflowObject- Overrides:
stopin classAbstractSingleThreadedWorkflowEventSource
-