Package org.drasyl

Class DrasylConfig


  • public abstract class DrasylConfig
    extends Object
    This class represents the configuration for a DrasylNode. For example, it defines the identity and the Super Peer.

    This is an immutable object.

    • Constructor Detail

      • DrasylConfig

        public DrasylConfig()
    • Method Detail

      • of

        public static DrasylConfig of​(com.typesafe.config.Config config)
      • getProofOfWork

        public static ProofOfWork getProofOfWork​(com.typesafe.config.Config config,
                                                 String path)
        Gets the ProofOfWork at the given path. Similar to Config, an exception is thrown for an invalid value.
        Parameters:
        config - the application's portion of the configuration
        path - path expression
        Returns:
        the ProofOfWork value at the requested path
        Throws:
        DrasylConfigException - if value is absent or null
      • getPath

        public static Path getPath​(com.typesafe.config.Config config,
                                   String path)
        Gets the Path at the given path.
        Parameters:
        config - the application's portion of the configuration
        path - path expression
        Returns:
        the Path value at the requested path
        Throws:
        DrasylConfigException - if value at path is invalid
      • getShort

        public static short getShort​(com.typesafe.config.Config config,
                                     String path)
        Gets the short at the given path. Similar to Config, an exception is thrown for an out-of-range value.
        Parameters:
        config - the application's portion of the configuration
        path - path expression
        Returns:
        the short value at the requested path
        Throws:
        DrasylConfigException - if value is not convertible to a short
      • getByte

        public static byte getByte​(com.typesafe.config.Config config,
                                   String path)
        Gets the byte at the given path. Similar to Config, an exception is thrown for an out-of-range value.
        Parameters:
        config - the application's portion of the configuration
        path - path expression
        Returns:
        the byte value at the requested path
        Throws:
        DrasylConfigException - if value is not convertible to a short
      • getURI

        public static URI getURI​(com.typesafe.config.Config config,
                                 String path)
        Gets the URI at the given path.
        Parameters:
        config - the application's portion of the configuration
        path - path expression
        Returns:
        the URI value at the requested path
        Throws:
        DrasylConfigException - if value at path is invalid
      • getSerializationSerializers

        public static Map<String,​Serializer> getSerializationSerializers​(com.typesafe.config.Config config,
                                                                               String path)
      • parseFile

        public static DrasylConfig parseFile​(File file)
        Parses a file into a Config instance as with
        Parameters:
        file - the file to parse
        Returns:
        the parsed configuration
        Throws:
        DrasylConfigException - on IO or parse errors
      • parseString

        public static DrasylConfig parseString​(String s)
        Parses a file into a Config instance as with
        Parameters:
        s - string to parse
        Returns:
        the parsed configuration
        Throws:
        DrasylConfigException - on IO or parse errors
      • getNetworkId

        public abstract int getNetworkId()
      • getIdentityPath

        public abstract Path getIdentityPath()
      • getMessageBufferSize

        public abstract int getMessageBufferSize()
      • isRemoteEnabled

        public abstract boolean isRemoteEnabled()
      • getRemoteBindHost

        public abstract InetAddress getRemoteBindHost()
      • getRemoteBindPort

        public abstract int getRemoteBindPort()
      • getRemoteEndpoints

        public abstract com.google.common.collect.ImmutableSet<Endpoint> getRemoteEndpoints()
      • isRemoteExposeEnabled

        public abstract boolean isRemoteExposeEnabled()
      • getRemotePingInterval

        public abstract Duration getRemotePingInterval()
      • getRemotePingTimeout

        public abstract Duration getRemotePingTimeout()
      • getRemotePingCommunicationTimeout

        public abstract Duration getRemotePingCommunicationTimeout()
      • getRemotePingMaxPeers

        public abstract int getRemotePingMaxPeers()
      • getRemoteUniteMinInterval

        public abstract Duration getRemoteUniteMinInterval()
      • isRemoteSuperPeerEnabled

        public abstract boolean isRemoteSuperPeerEnabled()
      • getRemoteSuperPeerEndpoints

        public abstract com.google.common.collect.ImmutableSet<Endpoint> getRemoteSuperPeerEndpoints()
      • isRemoteLocalHostDiscoveryEnabled

        public abstract boolean isRemoteLocalHostDiscoveryEnabled()
      • getRemoteLocalHostDiscoveryPath

        public abstract Path getRemoteLocalHostDiscoveryPath()
      • getRemoteLocalHostDiscoveryLeaseTime

        public abstract Duration getRemoteLocalHostDiscoveryLeaseTime()
      • isRemoteLocalHostDiscoveryWatchEnabled

        public abstract boolean isRemoteLocalHostDiscoveryWatchEnabled()
      • isRemoteLocalNetworkDiscoveryEnabled

        public abstract boolean isRemoteLocalNetworkDiscoveryEnabled()
      • getRemoteMessageMtu

        public abstract int getRemoteMessageMtu()
      • getRemoteMessageMaxContentLength

        public abstract int getRemoteMessageMaxContentLength()
      • getRemoteMessageComposedMessageTransferTimeout

        public abstract Duration getRemoteMessageComposedMessageTransferTimeout()
      • getRemoteMessageHopLimit

        public abstract byte getRemoteMessageHopLimit()
      • isRemoteMessageArmEnabled

        public abstract boolean isRemoteMessageArmEnabled()
      • getRemoteMessageArmSessionMaxCount

        public abstract int getRemoteMessageArmSessionMaxCount()
      • getRemoteMessageArmSessionMaxAgreements

        public abstract int getRemoteMessageArmSessionMaxAgreements()
      • getRemoteMessageArmSessionExpireAfter

        public abstract Duration getRemoteMessageArmSessionExpireAfter()
      • getRemoteMessageArmSessionRetryInterval

        public abstract Duration getRemoteMessageArmSessionRetryInterval()
      • isRemoteTcpFallbackEnabled

        public abstract boolean isRemoteTcpFallbackEnabled()
      • getRemoteTcpFallbackServerBindHost

        public abstract InetAddress getRemoteTcpFallbackServerBindHost()
      • getRemoteTcpFallbackServerBindPort

        public abstract int getRemoteTcpFallbackServerBindPort()
      • getRemoteTcpFallbackClientTimeout

        public abstract Duration getRemoteTcpFallbackClientTimeout()
      • getRemoteTcpFallbackClientAddress

        public abstract InetSocketAddress getRemoteTcpFallbackClientAddress()
      • isIntraVmDiscoveryEnabled

        public abstract boolean isIntraVmDiscoveryEnabled()
      • isMonitoringEnabled

        public abstract boolean isMonitoringEnabled()
      • getMonitoringHostTag

        public abstract String getMonitoringHostTag()
      • getMonitoringInfluxUri

        public abstract URI getMonitoringInfluxUri()
      • getMonitoringInfluxUser

        public abstract String getMonitoringInfluxUser()
      • getMonitoringInfluxPassword

        public abstract MaskedString getMonitoringInfluxPassword()
      • getMonitoringInfluxDatabase

        public abstract String getMonitoringInfluxDatabase()
      • getMonitoringInfluxReportingFrequency

        public abstract Duration getMonitoringInfluxReportingFrequency()
      • getPlugins

        public abstract com.google.common.collect.ImmutableSet<DrasylPlugin> getPlugins()
      • getSerializationSerializers

        public abstract com.google.common.collect.ImmutableMap<String,​Serializer> getSerializationSerializers()
      • getSerializationsBindingsInbound

        public abstract com.google.common.collect.ImmutableMap<Class<?>,​String> getSerializationsBindingsInbound()
      • getSerializationsBindingsOutbound

        public abstract com.google.common.collect.ImmutableMap<Class<?>,​String> getSerializationsBindingsOutbound()