public abstract class NatsBase extends Object implements AutoCloseable
SystemUtil,
NatsBase| Modifier and Type | Field and Description |
|---|---|
static String |
NATS_PREFIX |
| Modifier and Type | Method and Description |
|---|---|
List<String> |
args()
Get customArguments
|
NatsBase |
args(String... args)
Adds custom arguments to the nats start command
|
Path |
binaryFile()
nats binary file which only exists after download or if its already placed there
|
String |
downloadUrl()
nats download url which is usually a zip file
|
Optional<Path> |
getConfigFile()
Resolves the config file from the configuration e.g.
|
String |
getValue(NatsConfig key)
Gets resolved config value from key
|
String |
getValue(NatsConfig key,
Supplier<String> or)
Gets resolved config value from key
|
int |
pid()
get process id
|
Path |
pidFile()
get process id file which only exists when the process is running
|
int |
port()
Gets the port out of the configuration
|
String |
toString() |
String |
url()
nats server URL from bind to host address
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclosepublic static final String NATS_PREFIX
public int pid()
public Path pidFile()
public Path binaryFile()
public String downloadUrl()
public String url()
public int port()
RuntimeException - when the port is not configuredpublic NatsBase args(String... args)
args - argumentsNatsBasepublic String getValue(NatsConfig key)
key - config keypublic String getValue(NatsConfig key, Supplier<String> or)
key - config keyor - lazy loaded fallback valuepublic Optional<Path> getConfigFile()
Nats.config(NatsConfig, String)Copyright © 2022. All rights reserved.