Class EdgeConfig


  • public class EdgeConfig
    extends java.lang.Object
    Holds the configuration of an Edge.
    • Constructor Detail

      • EdgeConfig

        public EdgeConfig()
    • Method Detail

      • removeComponent

        public void removeComponent​(java.lang.String id)
        Removes a EdgeConfig.Component from the EdgeConfig.
        Parameters:
        id - the Component-ID
      • getComponentIdsByFactory

        public java.util.List<java.lang.String> getComponentIdsByFactory​(java.lang.String factoryId)
        Get Component-IDs of Component instances by the given Factory.
        Parameters:
        factoryId - the given Factory.
        Returns:
        a List of Component-IDs.
      • getComponentsByFactory

        public java.util.List<EdgeConfig.Component> getComponentsByFactory​(java.lang.String factoryId)
        Get Component instances by the given Factory.
        Parameters:
        factoryId - the given Factory PID.
        Returns:
        a List of Components.
      • getComponentsImplementingNature

        public java.util.List<java.lang.String> getComponentsImplementingNature​(java.lang.String nature)
        Get Component-IDs of Components that implement the given Nature.
        Parameters:
        nature - the given Nature.
        Returns:
        a List of Component-IDs.
      • toJson

        public com.google.gson.JsonObject toJson()
        Returns the configuration as a JSON Object.
         {
           components: { toJson() }, 
           factories: {
             [: string]: {
               natureIds: string[]
             }
           }
         }
         
        Returns:
        configuration as a JSON Object
      • factoriesToJson

        public com.google.gson.JsonObject factoriesToJson()
        Returns the configuration Factories as a JSON Object.
         {
           [id: string]: {
             natureIds: string[]
           }
         }
         
        Returns:
        Factories as a JSON Object
      • isStateChannel

        public boolean isStateChannel​(ChannelAddress channelAddress)
        Is the given Channel-Address a StateChannel?.
        Parameters:
        channelAddress - the ChannelAddress
        Returns:
        true if it is a StateChannel
      • getStateChannel

        public java.util.Optional<EdgeConfig.Component.Channel> getStateChannel​(ChannelAddress channelAddress)
        Get the StateChannel with the given Channel-Address.
        Parameters:
        channelAddress - the ChannelAddress
        Returns:
        the Channel; or empty if the Channel does not exist or is not a StateChannel.
      • ignorePropertyKey

        public static boolean ignorePropertyKey​(java.lang.String key)
        Internal Method to decide whether a configuration property should be ignored.
        Parameters:
        key - the property key
        Returns:
        true if it should get ignored