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.
        Parameters:
        file - the file to parse
        Returns:
        the parsed configuration
        Throws:
        DrasylConfigException - on IO or parse errors
      • parseFile

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

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

        public static DrasylConfig parseString​(String s)
        Parses a string into a Config instance.
        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 Set<PeerEndpoint> 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 Set<PeerEndpoint> getRemoteSuperPeerEndpoints()
      • getRemoteHandshakeTimeout

        public abstract Duration getRemoteHandshakeTimeout()
      • 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()
      • isRemoteMessageArmProtocolEnabled

        public abstract boolean isRemoteMessageArmProtocolEnabled()
      • getRemoteMessageArmProtocolSessionMaxCount

        public abstract int getRemoteMessageArmProtocolSessionMaxCount()
      • getRemoteMessageArmProtocolSessionExpireAfter

        public abstract Duration getRemoteMessageArmProtocolSessionExpireAfter()
      • isRemoteMessageArmApplicationEnabled

        public abstract boolean isRemoteMessageArmApplicationEnabled()
      • getRemoteMessageArmApplicationAgreementMaxCount

        public abstract int getRemoteMessageArmApplicationAgreementMaxCount()
      • getRemoteMessageArmApplicationAgreementExpireAfter

        public abstract Duration getRemoteMessageArmApplicationAgreementExpireAfter()
      • getRemoteMessageArmApplicationAgreementRetryInterval

        public abstract Duration getRemoteMessageArmApplicationAgreementRetryInterval()
      • isRemoteMessageArqEnabled

        public abstract boolean isRemoteMessageArqEnabled()
      • getRemoteMessageArqWindowSize

        public abstract int getRemoteMessageArqWindowSize()
      • getRemoteMessageArqRetryTimeout

        public abstract Duration getRemoteMessageArqRetryTimeout()
      • getRemoteMessageArqDeadPeerTimeout

        public abstract Duration getRemoteMessageArqDeadPeerTimeout()
      • getRemoteMessageArqClock

        public abstract Duration getRemoteMessageArqClock()
      • 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()
      • getSerializationSerializers

        public abstract Map<String,​Serializer> getSerializationSerializers()
      • getSerializationsBindingsInbound

        public abstract Map<Class<?>,​String> getSerializationsBindingsInbound()
      • getSerializationsBindingsOutbound

        public abstract Map<Class<?>,​String> getSerializationsBindingsOutbound()
      • getChannelInactivityTimeout

        public abstract Duration getChannelInactivityTimeout()