java.lang.Object
org.eclipse.milo.opcua.sdk.client.subscriptions.OpcUaMonitoredItem

public class OpcUaMonitoredItem extends Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    A callback that receives notification of new values for an OpcUaMonitoredItem.
    static interface 
    A callback that receives notification of new events for an OpcUaMonitoredItem.
    static class 
    The state of the MonitoredItem as it exists on the server, after the recent successful operation.
    static enum 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    OpcUaMonitoredItem(org.eclipse.milo.opcua.stack.core.types.structured.ReadValueId readValueId)
     
    OpcUaMonitoredItem(org.eclipse.milo.opcua.stack.core.types.structured.ReadValueId readValueId, org.eclipse.milo.opcua.stack.core.types.enumerated.MonitoringMode monitoringMode)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Optional<org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger>
    Get the Client-assigned id for this MonitoredItem.
    Optional<org.eclipse.milo.opcua.stack.core.types.builtin.StatusCode>
    Get the result of the most recent CreateMonitoredItems service call, if one has been made.
    Optional<org.eclipse.milo.opcua.stack.core.types.builtin.StatusCode>
    Get the result of the most recent DeleteMonitoredItems service call, if one has been made.
    boolean
    Get the most recent DiscardOldest this MonitoredItem was configured with.
    @Nullable org.eclipse.milo.opcua.stack.core.types.structured.MonitoringFilter
    Get the most recent Filter this MonitoredItem was configured with.
    Optional<org.eclipse.milo.opcua.stack.core.types.builtin.ExtensionObject>
    Get the filter result structure for the most recently configured monitoring filter.
    Optional<org.eclipse.milo.opcua.stack.core.types.builtin.StatusCode>
    Get the result of the most recent ModifyMonitoredItems service call, if one has been made.
    Optional<org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger>
    Get the Server-assigned id for this MonitoredItem.
    org.eclipse.milo.opcua.stack.core.types.enumerated.MonitoringMode
    Get the current MonitoringMode for this MonitoredItem.
    org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger
    Get the most recent QueueSize this MonitoredItem was configured with.
    org.eclipse.milo.opcua.stack.core.types.structured.ReadValueId
    Get the ReadValueId for this MonitoredItem.
    Optional<org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger>
    Get the revised QueueSize that the server is using for this MonitoredItem.
    Get the revised SamplingInterval that the server is using for this MonitoredItem.
    Get the most recent SamplingInterval this MonitoredItem was configured with.
     
    Optional<org.eclipse.milo.opcua.stack.core.types.builtin.StatusCode>
    Get the result of the most recent SetMonitoringMode service call, if one has been made.
     
     
    newDataItem(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId nodeId)
    Create a new MonitoredItem for the Value attribute of the Node identified by nodeId.
    newDataItem(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId nodeId, org.eclipse.milo.opcua.stack.core.types.enumerated.MonitoringMode monitoringMode)
    Create a new MonitoredItem for the Value attribute of the Node identified by nodeId, with the specified monitoringMode.
    newEventItem(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId nodeId)
    Create a new MonitoredItem for the EventNotifier attribute of the Node identified by nodeId.
    newEventItem(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId nodeId, @Nullable org.eclipse.milo.opcua.stack.core.types.structured.EventFilter eventFilter)
    Create a new MonitoredItem for the EventNotifier attribute of the Node identified by nodeId, with the specified eventFilter.
    newEventItem(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId nodeId, org.eclipse.milo.opcua.stack.core.types.enumerated.MonitoringMode monitoringMode, @Nullable org.eclipse.milo.opcua.stack.core.types.structured.EventFilter eventFilter)
    Create a new MonitoredItem for the EventNotifier attribute of the Node identified by nodeId, with the specified monitoringMode and eventFilter.
    void
    Set the OpcUaMonitoredItem.DataValueListener for this MonitoredItem.
    void
    setDiscardOldest(boolean discardOldest)
    Modify the DiscardOldest parameter for this MonitoredItem.
    void
    Set the OpcUaMonitoredItem.EventValueListener for this MonitoredItem.
    void
    setFilter(@Nullable org.eclipse.milo.opcua.stack.core.types.structured.MonitoringFilter filter)
    Modify the Filter parameter for this MonitoredItem.
    void
    setQueueSize(org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger queueSize)
    Modify the QueueSize parameter for this MonitoredItem.
    void
    setSamplingInterval(double samplingInterval)
    Set the SamplingInterval parameter for this MonitoredItem.
    void
    setUserObject(@Nullable Object userObject)
    Associate an arbitrary user object with this MonitoredItem.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OpcUaMonitoredItem

      public OpcUaMonitoredItem(org.eclipse.milo.opcua.stack.core.types.structured.ReadValueId readValueId)
    • OpcUaMonitoredItem

      public OpcUaMonitoredItem(org.eclipse.milo.opcua.stack.core.types.structured.ReadValueId readValueId, org.eclipse.milo.opcua.stack.core.types.enumerated.MonitoringMode monitoringMode)
  • Method Details

    • setSamplingInterval

      public void setSamplingInterval(double samplingInterval)
      Set the SamplingInterval parameter for this MonitoredItem.

      This change must be synchronized to the server before it takes effect.

      Parameters:
      samplingInterval - the new SamplingInterval parameter value.
      See Also:
    • setQueueSize

      public void setQueueSize(org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger queueSize)
      Modify the QueueSize parameter for this MonitoredItem.

      This change must be synchronized to the server before it takes effect.

      Parameters:
      queueSize - the new QueueSize parameter value.
      See Also:
    • setDiscardOldest

      public void setDiscardOldest(boolean discardOldest)
      Modify the DiscardOldest parameter for this MonitoredItem.

      This change must be synchronized to the server before it takes effect.

      Parameters:
      discardOldest - the new DiscardOldest parameter value.
    • setFilter

      public void setFilter(@Nullable org.eclipse.milo.opcua.stack.core.types.structured.MonitoringFilter filter)
      Modify the Filter parameter for this MonitoredItem.

      This change must be synchronized to the server before it takes effect.

      Parameters:
      filter - the new Filter parameter value.
      See Also:
    • getReadValueId

      public org.eclipse.milo.opcua.stack.core.types.structured.ReadValueId getReadValueId()
      Get the ReadValueId for this MonitoredItem.
      Returns:
      the ReadValueId for this MonitoredItem.
    • getClientHandle

      public Optional<org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger> getClientHandle()
      Get the Client-assigned id for this MonitoredItem.

      Present only if the MonitoredItem has been added to a Subscription, see OpcUaSubscription.addMonitoredItem(OpcUaMonitoredItem).

      Returns:
      the Client-assigned id for this MonitoredItem.
    • getMonitoredItemId

      public Optional<org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger> getMonitoredItemId()
      Get the Server-assigned id for this MonitoredItem.

      Present only if the MonitoredItem has been created.

      Returns:
      the Server-assigned id for this MonitoredItem.
    • getSamplingInterval

      public Double getSamplingInterval()
      Get the most recent SamplingInterval this MonitoredItem was configured with.

      It may differ from the actual SamplingInterval that the server is using, see getRevisedSamplingInterval().

      Returns:
      the most recent SamplingInterval this MonitoredItem was configured with.
    • getQueueSize

      public org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger getQueueSize()
      Get the most recent QueueSize this MonitoredItem was configured with.

      It may differ from the actual QueueSize that the server is using, see getRevisedQueueSize().

      Returns:
      the most recent QueueSize this MonitoredItem was configured with.
    • getDiscardOldest

      public boolean getDiscardOldest()
      Get the most recent DiscardOldest this MonitoredItem was configured with.
      Returns:
      the most recent DiscardOldest this MonitoredItem was configured with.
    • getFilter

      public @Nullable org.eclipse.milo.opcua.stack.core.types.structured.MonitoringFilter getFilter()
      Get the most recent Filter this MonitoredItem was configured with.
      Returns:
      the most recent Filter this MonitoredItem was configured with.
    • getRevisedSamplingInterval

      public Optional<Double> getRevisedSamplingInterval()
      Get the revised SamplingInterval that the server is using for this MonitoredItem.

      Present only if the MonitoredItem has been created or modified.

      Returns:
      the revised SamplingInterval that the server is using for this MonitoredItem.
    • getRevisedQueueSize

      public Optional<org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger> getRevisedQueueSize()
      Get the revised QueueSize that the server is using for this MonitoredItem.

      Present only if the MonitoredItem has been created or modified.

      Returns:
      the revised QueueSize that the server is using for this MonitoredItem.
    • getFilterResult

      public Optional<org.eclipse.milo.opcua.stack.core.types.builtin.ExtensionObject> getFilterResult()
      Get the filter result structure for the most recently configured monitoring filter.
      Returns:
      the filter result structure for the most recently configured monitoring filter.
    • getMonitoringMode

      public org.eclipse.milo.opcua.stack.core.types.enumerated.MonitoringMode getMonitoringMode()
      Get the current MonitoringMode for this MonitoredItem.
      Returns:
      the current MonitoringMode for this MonitoredItem.
    • getCreateResult

      public Optional<org.eclipse.milo.opcua.stack.core.types.builtin.StatusCode> getCreateResult()
      Get the result of the most recent CreateMonitoredItems service call, if one has been made.
      Returns:
      the result of the most recent CreateMonitoredItems service call, if one has been made.
    • getModifyResult

      public Optional<org.eclipse.milo.opcua.stack.core.types.builtin.StatusCode> getModifyResult()
      Get the result of the most recent ModifyMonitoredItems service call, if one has been made.
      Returns:
      the result of the most recent ModifyMonitoredItems service call, if one has been made.
    • getDeleteResult

      public Optional<org.eclipse.milo.opcua.stack.core.types.builtin.StatusCode> getDeleteResult()
      Get the result of the most recent DeleteMonitoredItems service call, if one has been made.
      Returns:
      the result of the most recent DeleteMonitoredItems service call, if one has been made.
    • getSetMonitoringModeResult

      public Optional<org.eclipse.milo.opcua.stack.core.types.builtin.StatusCode> getSetMonitoringModeResult()
      Get the result of the most recent SetMonitoringMode service call, if one has been made.
      Returns:
      the result of the most recent SetMonitoringMode service call, if one has been made.
    • setDataValueListener

      public void setDataValueListener(@Nullable OpcUaMonitoredItem.DataValueListener listener)
      Set the OpcUaMonitoredItem.DataValueListener for this MonitoredItem.
      Parameters:
      listener - the OpcUaMonitoredItem.DataValueListener for this MonitoredItem.
    • setEventValueListener

      public void setEventValueListener(@Nullable OpcUaMonitoredItem.EventValueListener listener)
      Set the OpcUaMonitoredItem.EventValueListener for this MonitoredItem.
      Parameters:
      listener - the OpcUaMonitoredItem.EventValueListener for this MonitoredItem.
    • setUserObject

      public void setUserObject(@Nullable Object userObject)
      Associate an arbitrary user object with this MonitoredItem.
      Parameters:
      userObject - the user object to associate with this MonitoredItem.
    • getUserObject

      public Optional<Object> getUserObject()
      Returns:
      the user object associated with this MonitoredItem.
    • getSyncState

      public OpcUaMonitoredItem.SyncState getSyncState()
      Returns:
      the current OpcUaMonitoredItem.SyncState of this MonitoredItem.
    • getServerState

      public Optional<OpcUaMonitoredItem.ServerState> getServerState()
      Returns:
      the current OpcUaMonitoredItem.ServerState of this MonitoredItem, if it exists on the server.
    • newDataItem

      public static OpcUaMonitoredItem newDataItem(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId nodeId)
      Create a new MonitoredItem for the Value attribute of the Node identified by nodeId.

      This item will not exist on the server until it has been added to an OpcUaSubscription and the subscription has been synchronized.

      Parameters:
      nodeId - the NodeId of the Node to monitor.
      Returns:
      a new MonitoredItem for the Value attribute of the Node identified by nodeId.
      See Also:
    • newDataItem

      public static OpcUaMonitoredItem newDataItem(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId nodeId, org.eclipse.milo.opcua.stack.core.types.enumerated.MonitoringMode monitoringMode)
      Create a new MonitoredItem for the Value attribute of the Node identified by nodeId, with the specified monitoringMode.

      This item will not exist on the server until it has been added to an OpcUaSubscription and the subscription has been synchronized.

      Parameters:
      nodeId - the NodeId of the Node to monitor.
      monitoringMode - the initial MonitoringMode to use when the MonitoredItem is created.
      Returns:
      a new MonitoredItem for the Value attribute of the Node identified by nodeId, with the specified monitoringMode.
      See Also:
    • newEventItem

      public static OpcUaMonitoredItem newEventItem(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId nodeId)
      Create a new MonitoredItem for the EventNotifier attribute of the Node identified by nodeId.

      This item will not exist on the server until it has been added to an OpcUaSubscription and the subscription has been synchronized.

      Parameters:
      nodeId - the NodeId of the Node to monitor.
      Returns:
      a new MonitoredItem for the EventNotifier attribute of the Node identified by nodeId.
      See Also:
    • newEventItem

      public static OpcUaMonitoredItem newEventItem(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId nodeId, @Nullable org.eclipse.milo.opcua.stack.core.types.structured.EventFilter eventFilter)
      Create a new MonitoredItem for the EventNotifier attribute of the Node identified by nodeId, with the specified eventFilter.

      This item will not exist on the server until it has been added to an OpcUaSubscription and the subscription has been synchronized.

      Parameters:
      nodeId - the NodeId of the Node to monitor.
      eventFilter - the EventFilter to use for the MonitoredItem.
      Returns:
      a new MonitoredItem for the EventNotifier attribute of the Node identified by nodeId, with the specified eventFilter.
      See Also:
    • newEventItem

      public static OpcUaMonitoredItem newEventItem(org.eclipse.milo.opcua.stack.core.types.builtin.NodeId nodeId, org.eclipse.milo.opcua.stack.core.types.enumerated.MonitoringMode monitoringMode, @Nullable org.eclipse.milo.opcua.stack.core.types.structured.EventFilter eventFilter)
      Create a new MonitoredItem for the EventNotifier attribute of the Node identified by nodeId, with the specified monitoringMode and eventFilter.

      This item will not exist on the server until it has been added to an OpcUaSubscription and the subscription has been synchronized.

      Parameters:
      nodeId - the NodeId of the Node to monitor.
      monitoringMode - the initial MonitoringMode to use when the MonitoredItem is created.
      eventFilter - the EventFilter to use for the MonitoredItem.
      Returns:
      a new MonitoredItem for the EventNotifier attribute of the Node identified by nodeId, with the specified monitoringMode and eventFilter.
      See Also: