Class Edge

  • Direct Known Subclasses:
    MyEdge, MyEdge, MyEdge

    public class Edge
    extends java.lang.Object
    • Constructor Detail

      • Edge

        public Edge​(java.lang.String id,
                    java.lang.String comment,
                    Edge.State state,
                    java.lang.String version,
                    java.lang.String producttype,
                    Level sumState,
                    EdgeConfig config)
    • Method Detail

      • getId

        public java.lang.String getId()
      • getComment

        public java.lang.String getComment()
      • setComment

        public void setComment​(java.lang.String comment)
      • toJsonObject

        public com.google.gson.JsonObject toJsonObject()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • onSetOnline

        public void onSetOnline​(java.util.function.Consumer<java.lang.Boolean> listener)
      • isOnline

        public boolean isOnline()
      • setOnline

        public void setOnline​(boolean isOnline)
        Marks this Edge as being online. This is called by an event listener.
        Parameters:
        isOnline - true if the Edge is online
      • onSetConfig

        public void onSetConfig​(java.util.function.Consumer<EdgeConfig> listener)
        Adds a listener for reception of new EdgeConfig. The listener is called before the new config is applied.
        Parameters:
        listener - the Listener
      • setConfig

        public void setConfig​(EdgeConfig config)
        Sets the configuration for this Edge and calls the SetConfig-Listeners.
        Parameters:
        config - the configuration
      • setConfig

        public void setConfig​(EdgeConfig config,
                              boolean callListeners)
        Sets the configuration for this Edge.
        Parameters:
        config - the configuration
        callListeners - whether to call the SetConfig-Listeners
      • setState

        public void setState​(Edge.State state)
      • onSetLastMessage

        public void onSetLastMessage​(java.lang.Runnable listener)
      • setLastMessageTimestamp

        public void setLastMessageTimestamp()
        Sets the Last-Message-Timestamp and calls the SetLastMessage-Listeners.
      • setLastMessageTimestamp

        public void setLastMessageTimestamp​(boolean callListeners)
        Sets the Last-Message-Timestamp.
        Parameters:
        callListeners - whether to call the SetLastMessage-Listeners
      • getLastMessageTimestamp

        public java.time.ZonedDateTime getLastMessageTimestamp()
      • onSetLastUpdate

        public void onSetLastUpdate​(java.lang.Runnable listener)
      • setLastUpdateTimestamp

        public void setLastUpdateTimestamp()
        Sets the Last-Message-Timestamp and calls the SetLastUpdate-Listeners.
      • setLastUpdateTimestamp

        public void setLastUpdateTimestamp​(boolean callListeners)
        Sets the Last-Update-Timestamp.
        Parameters:
        callListeners - whether to call the SetLastUpdate-Listeners
      • getLastUpdateTimestamp

        public java.time.ZonedDateTime getLastUpdateTimestamp()
      • onSetVersion

        public void onSetVersion​(java.util.function.Consumer<SemanticVersion> listener)
      • setVersion

        public void setVersion​(SemanticVersion version)
        Sets the version and calls the SetVersion-Listeners.
        Parameters:
        version - the version
      • setVersion

        public void setVersion​(SemanticVersion version,
                               boolean callListeners)
        Sets the version.
        Parameters:
        version - the version
        callListeners - whether to call the SetVersion-Listeners
      • getProducttype

        public java.lang.String getProducttype()
      • onSetProducttype

        public void onSetProducttype​(java.util.function.Consumer<java.lang.String> listener)
      • setProducttype

        public void setProducttype​(java.lang.String producttype)
        Sets the Producttype and calls the SetProducttype-Listeners.
        Parameters:
        producttype - the Producttype
      • setProducttype

        public void setProducttype​(java.lang.String producttype,
                                   boolean callListeners)
        Sets the Producttype.
        Parameters:
        producttype - the Producttype
        callListeners - whether to call the SetProducttype-Listeners
      • getSumState

        public Level getSumState()
      • onSetSumState

        public void onSetSumState​(java.util.function.Consumer<Level> listener)
      • setSumState

        public void setSumState​(Level sumState)
        Sets the sumState and calls the SetSumState-Listeners.
        Parameters:
        sumState - the sumState
      • setSumState

        public void setSumState​(Level sumState,
                                boolean callListeners)
        Sets the version.
        Parameters:
        sumState - the sumState
        callListeners - whether to call the SetSumState-Listeners