Package org.drasyl
Class DrasylConfig
java.lang.Object
org.drasyl.DrasylConfig
This class represents the configuration for a
DrasylNode. For example, it defines the
identity and the Super Peer.
This is an immutable object.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder class to create aDrasylConfigwith custom values. -
Constructor Summary
ConstructorsConstructorDescriptionDrasylConfig(com.typesafe.config.Config config) Creates a new config for a drasyl node. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanstatic Class<io.netty.channel.ChannelInitializer<io.netty.channel.socket.SocketChannel>>getChannelInitializer(com.typesafe.config.Config config, String path) Class<? extends io.netty.channel.ChannelInitializer<io.netty.channel.socket.SocketChannel>>shortintgetEndpointList(com.typesafe.config.Config config, String path) intstatic InetAddressgetInetAddress(com.typesafe.config.Config config, String path) shortintintstatic PathGets thePathat the given path.static Set<DrasylPlugin>getPlugins(com.typesafe.config.Config config, String path) static CompressedPrivateKeygetPrivateKey(com.typesafe.config.Config config, String path) Gets theCompressedPrivateKeyat the given path.static ProofOfWorkgetProofOfWork(com.typesafe.config.Config config, String path) Gets theProofOfWorkat the given path.static CompressedPublicKeygetPublicKey(com.typesafe.config.Config config, String path) Gets theCompressedPublicKeyat the given path.intClass<? extends io.netty.channel.ChannelInitializer<io.netty.channel.socket.SocketChannel>>shortbooleanstatic shortGets the short at the given path.Class<? extends io.netty.channel.ChannelInitializer<io.netty.channel.socket.SocketChannel>>shortstatic URIGets theURIat the given path.inthashCode()booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanstatic DrasylConfig.BuilderCreates a new builder to build a customDrasylConfig.static DrasylConfig.BuildernewBuilder(DrasylConfig config) static DrasylConfigtoString()
-
Constructor Details
-
DrasylConfig
public DrasylConfig() -
DrasylConfig
public DrasylConfig(com.typesafe.config.Config config) Creates a new config for a drasyl node.- Parameters:
config- config to be loaded
-
-
Method Details
-
getProofOfWork
Gets theProofOfWorkat the given path. Similar toConfig, an exception is thrown for an invalid value.- Parameters:
config- the application's portion of the configurationpath- path expression- Returns:
- the
ProofOfWorkvalue at the requested path - Throws:
com.typesafe.config.ConfigException.Missing- if value is absent or nullcom.typesafe.config.ConfigException.WrongType- if value is not convertible to aProofOfWork
-
getPublicKey
Gets theCompressedPublicKeyat the given path. Similar toConfig, an exception is thrown for an invalid value.- Parameters:
config- the application's portion of the configurationpath- path expression- Returns:
- the
CompressedPublicKeyvalue at the requested path - Throws:
com.typesafe.config.ConfigException.Missing- if value is absent or nullcom.typesafe.config.ConfigException.WrongType- if value is not convertible to aCompressedPublicKey
-
getPrivateKey
Gets theCompressedPrivateKeyat the given path. Similar toConfig, an exception is thrown for an invalid value.- Parameters:
config- the application's portion of the configurationpath- path expression- Returns:
- the
CompressedPrivateKeyvalue at the requested path - Throws:
com.typesafe.config.ConfigException.Missing- if value is absent or nullcom.typesafe.config.ConfigException.WrongType- if value is not convertible to aCompressedPrivateKey
-
getPath
Gets thePathat the given path.- Parameters:
config- the application's portion of the configurationpath- path expression- Returns:
- the
Pathvalue at the requested path - Throws:
com.typesafe.config.ConfigException- if value at path is invalid
-
getShort
Gets the short at the given path. Similar toConfig, an exception is thrown for an out-of-range value.- Parameters:
config- the application's portion of the configurationpath- path expression- Returns:
- the short value at the requested path
- Throws:
com.typesafe.config.ConfigException.Missing- if value is absent or nullcom.typesafe.config.ConfigException.WrongType- if value is not convertible to a short
-
getEndpointList
- Throws:
com.typesafe.config.ConfigException- if value at path is invalid
-
getChannelInitializer
public static Class<io.netty.channel.ChannelInitializer<io.netty.channel.socket.SocketChannel>> getChannelInitializer(com.typesafe.config.Config config, String path) - Throws:
com.typesafe.config.ConfigException- if value at path is invalid
-
getPlugins
- Throws:
com.typesafe.config.ConfigException- if value at path is invalid
-
getInetAddress
- Throws:
com.typesafe.config.ConfigException- if value at path is invalid
-
getURI
Gets theURIat the given path.- Parameters:
config- the application's portion of the configurationpath- path expression- Returns:
- the
URIvalue at the requested path - Throws:
com.typesafe.config.ConfigException- if value at path is invalid
-
getNetworkId
public int getNetworkId() -
isMonitoringEnabled
public boolean isMonitoringEnabled() -
getMonitoringInfluxUri
-
getMonitoringInfluxUser
-
getMonitoringInfluxPassword
-
getMonitoringInfluxDatabase
-
getMonitoringInfluxReportingFrequency
-
getServerBindHost
-
getServerBindPort
public int getServerBindPort() -
getIdentityProofOfWork
-
getIdentityPublicKey
-
getIdentityPrivateKey
-
getIdentityPath
-
isServerEnabled
public boolean isServerEnabled() -
getServerSSLEnabled
public boolean getServerSSLEnabled() -
getServerIdleRetries
public short getServerIdleRetries() -
getSuperPeerHandshakeTimeout
-
getServerIdleTimeout
-
getFlushBufferSize
public int getFlushBufferSize() -
getServerSSLProtocols
-
getServerHandshakeTimeout
-
getServerEndpoints
-
getServerChannelInitializer
public Class<? extends io.netty.channel.ChannelInitializer<io.netty.channel.socket.SocketChannel>> getServerChannelInitializer() -
getMessageMaxContentLength
public int getMessageMaxContentLength() -
getMessageHopLimit
public short getMessageHopLimit() -
getMessageComposedMessageTransferTimeout
-
isSuperPeerEnabled
public boolean isSuperPeerEnabled() -
getSuperPeerEndpoints
-
getSuperPeerRetryDelays
-
getSuperPeerChannelInitializer
public Class<? extends io.netty.channel.ChannelInitializer<io.netty.channel.socket.SocketChannel>> getSuperPeerChannelInitializer() -
getSuperPeerIdleRetries
public short getSuperPeerIdleRetries() -
getSuperPeerIdleTimeout
-
isIntraVmDiscoveryEnabled
public boolean isIntraVmDiscoveryEnabled() -
isLocalHostDiscoveryEnabled
public boolean isLocalHostDiscoveryEnabled() -
getLocalHostDiscoveryPath
-
getLocalHostDiscoveryLeaseTime
-
areDirectConnectionsEnabled
public boolean areDirectConnectionsEnabled() -
getDirectConnectionsMaxConcurrentConnections
public int getDirectConnectionsMaxConcurrentConnections() -
getDirectConnectionsIdleTimeout
-
getDirectConnectionsIdleRetries
public short getDirectConnectionsIdleRetries() -
getDirectConnectionsHandshakeTimeout
-
getDirectConnectionsRetryDelays
-
getPlugins
-
getDirectConnectionsChannelInitializer
public Class<? extends io.netty.channel.ChannelInitializer<io.netty.channel.socket.SocketChannel>> getDirectConnectionsChannelInitializer() -
getMarshallingInboundAllowedTypes
-
isMarshallingInboundAllowAllPrimitives
public boolean isMarshallingInboundAllowAllPrimitives() -
isMarshallingInboundAllowArrayOfDefinedTypes
public boolean isMarshallingInboundAllowArrayOfDefinedTypes() -
getMarshallingInboundAllowedPackages
-
getMarshallingOutboundAllowedTypes
-
isMarshallingOutboundAllowAllPrimitives
public boolean isMarshallingOutboundAllowAllPrimitives() -
isMarshallingOutboundAllowArrayOfDefinedTypes
public boolean isMarshallingOutboundAllowArrayOfDefinedTypes() -
getMarshallingOutboundAllowedPackages
-
isServerExposeEnabled
public boolean isServerExposeEnabled() -
hashCode
public int hashCode() -
equals
-
toString
-
parseFile
-
newBuilder
Creates a new builder to build a customDrasylConfig. The built configuration is derived from the default configuration. The builder must be finalized by callingDrasylConfig.Builder.build()to create the resultingDrasylConfig.- Returns:
- the new builder
-
newBuilder
-