Package berlin.yuna.natsserver.logic
Class NatsBase
java.lang.Object
berlin.yuna.natsserver.logic.NatsBase
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
Nats
- Since:
- 1.0
- Author:
- Yuna Morgenstern
- See Also:
-
SystemUtil
NatsBase
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionargs()
Get customArgumentsAdds custom arguments to the nats start commandnats binary file which only exists after download or if its already placed therenats download url which is usually a zip fileResolves the config file from the configuration e.g.getValue
(NatsConfig key) Gets resolved config value from keygetValue
(NatsConfig key, Supplier<String> or) Gets resolved config value from keyint
pid()
get process idpidFile()
get process id file which only exists when the process is runningint
port()
Gets the port out of the configurationtoString()
url()
nats server URL from bind to host addressMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.AutoCloseable
close
-
Field Details
-
NATS_PREFIX
- See Also:
-
-
Method Details
-
pid
public int pid()get process id- Returns:
- process id or -1 if process is not running
-
pidFile
get process id file which only exists when the process is running- Returns:
- process id file path
-
binaryFile
nats binary file which only exists after download or if its already placed there- Returns:
- nats binary file path
-
downloadUrl
nats download url which is usually a zip file- Returns:
- nats download url
-
url
nats server URL from bind to host address- Returns:
- nats server url
-
port
public int port()Gets the port out of the configuration- Returns:
- configured port of the server
- Throws:
RuntimeException
- when the port is not configured
-
args
Adds custom arguments to the nats start command- Parameters:
args
- arguments- Returns:
- self
NatsBase
-
args
Get customArguments- Returns:
- list of custom arguments
-
getValue
Gets resolved config value from key- Parameters:
key
- config key- Returns:
- config key value
-
getValue
Gets resolved config value from key- Parameters:
key
- config keyor
- lazy loaded fallback value- Returns:
- config key value
-
getConfigFile
Resolves the config file from the configuration e.g.Nats.config(NatsConfig, String)
- Returns:
- config file as optional path - not empty if file exists
-
toString
-