Class MQTTWorkflowEventSource

All Implemented Interfaces:
IActivatableWorkflowObject, de.uplanet.lucy.server.workflow.IImpersonateUser, ILogLevelAware, INamedWorkflowObject, de.uplanet.lucy.server.workflow.INeedClusterInfo, INeedWorkflow, IRunnableWorkflowObject, IStartableWorkflowObject, ISupportAfterStopEvent, ISupportBeforeStartEvent, ISupportGlobalSharedState, IWorkflowEventSource, IWorkflowObject, Serializable

public final class MQTTWorkflowEventSource extends AbstractSingleThreadedWorkflowEventSource implements de.uplanet.lucy.server.workflow.INeedClusterInfo, ISupportGlobalSharedState, ISupportBeforeStartEvent, ISupportAfterStopEvent
See Also:
  • Constructor Details

    • MQTTWorkflowEventSource

      public MQTTWorkflowEventSource(String p_strGuid)
  • Method Details

    • getClusterInfo

      public de.uplanet.lucy.server.workflow.IClusterInfo getClusterInfo()
      Specified by:
      getClusterInfo in interface de.uplanet.lucy.server.workflow.INeedClusterInfo
    • setClusterInfo

      public void setClusterInfo(de.uplanet.lucy.server.workflow.IClusterInfo p_clusterInfo)
      Specified by:
      setClusterInfo in interface de.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.
    • isGlobalSharedState

      public boolean isGlobalSharedState()
      Description copied from interface: ISupportGlobalSharedState
      This property determines if a global shared state should be used for all events created by this event source.
      Specified by:
      isGlobalSharedState in interface ISupportGlobalSharedState
      Returns:
      true if a global shared state should be used, or false otherwise.
    • setGlobalSharedState

      public void setGlobalSharedState(boolean p_bGlobalSharedState)
      Description copied from interface: ISupportGlobalSharedState
      This property determines if a global shared state should be used for all events created by this event source.
      Specified by:
      setGlobalSharedState in interface ISupportGlobalSharedState
      Parameters:
      p_bGlobalSharedState - true if a global shared state should be used, or false otherwise.
    • isSendBeforeStartEvent

      public boolean isSendBeforeStartEvent()
      Description copied from interface: ISupportBeforeStartEvent
      This property determines if an before-start event should be sent.
      Specified by:
      isSendBeforeStartEvent in interface ISupportBeforeStartEvent
      Returns:
      true if an event should be sent before the workflow object's activity is about to being started, or false 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 interface ISupportBeforeStartEvent
      Parameters:
      p_bSendBeforeStartEvent - true if an event should be sent before the workflow object's activity is about to being started, or false 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 interface ISupportAfterStopEvent
      Returns:
      true if an event should be sent after the workflow object's activity has been stopped, or false 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 interface ISupportAfterStopEvent
      Parameters:
      p_bSendAfterStopEvent - true if an event should be sent after the workflow object's activity has been stopped, or false otherwise.
    • 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.
    • 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.
    • getClientId

      public String 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

      public void setClientId(String p_strClientId)
      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.
    • 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, or false 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, or false otherwise.
    • 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.
    • 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

      public boolean isReconnect()
      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, or false otherwise.
    • setReconnect

      public void setReconnect(boolean p_bReconnect)
      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, or false otherwise.
    • 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.