public class ServerInfo
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static ServerInfo |
EMPTY_INFO
Constant representing an empty info.
|
| Constructor and Description |
|---|
ServerInfo(java.lang.String json)
Construct a ServerInfo instance from json
|
| Modifier and Type | Method and Description |
|---|---|
int |
getClientId()
the client id as determined by the server
|
@NonNull java.lang.String |
getClientIp()
the client ip address as determined by the server
|
@Nullable java.lang.String |
getCluster()
the cluster name the server is in
|
@NonNull java.util.List<java.lang.String> |
getConnectURLs()
the connectable urls in the cluster
|
@NonNull java.lang.String |
getGoVersion()
the go version the server is built with
|
@NonNull java.lang.String |
getHost()
the server host
|
long |
getMaxPayload()
the server configured max payload
|
byte[] |
getNonce()
the nonce to use in authentication
|
int |
getPort()
the server port
|
int |
getProtocolVersion()
the server protocol version
|
@NonNull java.lang.String |
getServerId()
the server id
|
@NonNull java.lang.String |
getServerName()
the server name
|
@NonNull java.lang.String |
getVersion()
the server version
|
boolean |
isAuthRequired()
true if authorization is required by the server
|
boolean |
isHeadersSupported()
true if headers are supported by the server
|
boolean |
isJetStreamAvailable()
true if the server supports JetStream
|
boolean |
isLameDuckMode()
true if server is in lame duck mode
|
boolean |
isNewerVersionThan(java.lang.String vTarget)
function to determine is the server version is newer than the input
|
boolean |
isOlderThanVersion(java.lang.String vTarget)
function to determine is the server version is older than the input
|
boolean |
isSameOrNewerThanVersion(java.lang.String vTarget)
function to determine is the server version is same or newer than the input
|
boolean |
isSameOrOlderThanVersion(java.lang.String vTarget)
function to determine is the server version is the same or older than the input
|
boolean |
isSameVersion(java.lang.String vTarget)
function to determine is the server version is same as the input
|
boolean |
isTLSAvailable()
true if TLS is available on the server
|
boolean |
isTLSRequired()
true if TLS is required by the server
|
java.lang.String |
toString() |
public static final ServerInfo EMPTY_INFO
public ServerInfo(java.lang.String json)
json - the jsonpublic boolean isLameDuckMode()
public @NonNull java.lang.String getServerId()
public @NonNull java.lang.String getServerName()
public @NonNull java.lang.String getVersion()
public @NonNull java.lang.String getGoVersion()
public @NonNull java.lang.String getHost()
public int getPort()
public int getProtocolVersion()
public boolean isHeadersSupported()
public boolean isAuthRequired()
public boolean isTLSRequired()
public boolean isTLSAvailable()
public long getMaxPayload()
public @NonNull java.util.List<java.lang.String> getConnectURLs()
public byte[] getNonce()
public boolean isJetStreamAvailable()
public int getClientId()
public @NonNull java.lang.String getClientIp()
public @Nullable java.lang.String getCluster()
public boolean isNewerVersionThan(java.lang.String vTarget)
vTarget - the target version to comparepublic boolean isSameVersion(java.lang.String vTarget)
vTarget - the target version to comparepublic boolean isOlderThanVersion(java.lang.String vTarget)
vTarget - the target version to comparepublic boolean isSameOrOlderThanVersion(java.lang.String vTarget)
vTarget - the target version to comparepublic boolean isSameOrNewerThanVersion(java.lang.String vTarget)
vTarget - the target version to comparepublic java.lang.String toString()
toString in class java.lang.Object