Skip navigation links
A B C D E F G H I M N O P R S T U V 

A

AuthHandler - Interface in io.nats.client
NATS provides a challenge-response based authentication scheme based on NKeys.
authHandler(AuthHandler) - Method in class io.nats.client.Options.Builder
Set the AuthHandler to sign the server nonce for authentication in nonce-mode.

B

bufferSize(int) - Method in class io.nats.client.Options.Builder
Sets the initial size for buffers in the connection, primarily for testing.
build() - Method in class io.nats.client.Options.Builder
Build an Options object from this Builder.
buildDataPort() - Method in class io.nats.client.Options
 
Builder() - Constructor for class io.nats.client.Options.Builder
Constructs a new Builder with the default values.
Builder(Properties) - Constructor for class io.nats.client.Options.Builder
Constructs a new Builder from a Properties object.
buildProtocolConnectOptionsString(String, boolean, byte[]) - Method in class io.nats.client.Options
Create the options string sent with a connect message.

C

clearDroppedCount() - Method in interface io.nats.client.Consumer
Reset the drop count to 0.
CLIENT_LANGUAGE - Static variable in class io.nats.client.Nats
Current language of the library - "java"
CLIENT_VERSION - Static variable in class io.nats.client.Nats
Current version of the library - "2.1.1"
close() - Method in interface io.nats.client.Connection
Close the connection and release all blocking calls like flush and nextMessage.
closeDispatcher(Dispatcher) - Method in interface io.nats.client.Connection
Close a dispatcher.
connect() - Static method in class io.nats.client.Nats
Connect to the default URL, Options.DEFAULT_URL, with all of the default options.
connect(String) - Static method in class io.nats.client.Nats
The Java client generally expects URLs of the form nats://hostname:port
connect(Options) - Static method in class io.nats.client.Nats
Options can be used to set the server URL, or multiple URLS, callback handlers for various errors, and connection events.
connectAsynchronously(Options, boolean) - Static method in class io.nats.client.Nats
Try to connect in another thread, a connection listener is required to get the connection.
Connection - Interface in io.nats.client
The Connection class is at the heart of the NATS Java client.
Connection.Status - Enum in io.nats.client
 
connectionEvent(Connection, ConnectionListener.Events) - Method in interface io.nats.client.ConnectionListener
Connection related events that occur asynchronously in the client code are sent to a ConnectionListener via a single method.
ConnectionListener - Interface in io.nats.client
Applications can use a ConnectionListener to track the status of a Connection.
connectionListener(ConnectionListener) - Method in class io.nats.client.Options.Builder
Set the ConnectionListener to receive asynchronous notifications of disconnect events.
ConnectionListener.Events - Enum in io.nats.client
 
connectionName(String) - Method in class io.nats.client.Options.Builder
Set the connection's optional Name.
connectionTimeout(Duration) - Method in class io.nats.client.Options.Builder
Set the timeout for connection attempts.
Consumer - Interface in io.nats.client
A Consumer in the NATS library is an object that represents an incoming queue of messages.
createAccount(SecureRandom) - Static method in class io.nats.client.NKey
Create an Account NKey from the provided random number generator.
createCluster(SecureRandom) - Static method in class io.nats.client.NKey
Create an Cluster NKey from the provided random number generator.
createDispatcher(MessageHandler) - Method in interface io.nats.client.Connection
Create a Dispatcher for this connection.
createOperator(SecureRandom) - Static method in class io.nats.client.NKey
Create an Operator NKey from the provided random number generator.
createServer(SecureRandom) - Static method in class io.nats.client.NKey
Create a Server NKey from the provided random number generator.
createUser(SecureRandom) - Static method in class io.nats.client.NKey
Create a User NKey from the provided random number generator.

D

dataPortType(String) - Method in class io.nats.client.Options.Builder
The class to use for this connections data port.
DEFAULT_BUFFER_SIZE - Static variable in class io.nats.client.Options
Default size for buffers in the connection, not as available as other settings, this is primarily changed for testing, getBufferSize().
DEFAULT_CONNECTION_TIMEOUT - Static variable in class io.nats.client.Options
Default connection timeout, see getConnectionTimeout().
DEFAULT_DATA_PORT_TYPE - Static variable in class io.nats.client.Options
Default dataport class, which will use a TCP socket, getDataPortType().
DEFAULT_MAX_BYTES - Static variable in interface io.nats.client.Consumer
The default number of bytes a consumer will hold before it starts to drop messages.
DEFAULT_MAX_CONTROL_LINE - Static variable in class io.nats.client.Options
The default length, 1024 bytes, the client will allow in an outgoing protocol control line, getMaxControlLine().
DEFAULT_MAX_MESSAGES - Static variable in interface io.nats.client.Consumer
The default number of messages a consumer will hold before it starts to drop them.
DEFAULT_MAX_PINGS_OUT - Static variable in class io.nats.client.Options
Default maximum number of pings have not received a response allowed by the client, getMaxPingsOut().
DEFAULT_MAX_RECONNECT - Static variable in class io.nats.client.Options
Default maximum number of reconnect attempts, see getMaxReconnect().
DEFAULT_PING_INTERVAL - Static variable in class io.nats.client.Options
Default server ping interval.
DEFAULT_PORT - Static variable in class io.nats.client.Options
Default server port.
DEFAULT_RECONNECT_BUF_SIZE - Static variable in class io.nats.client.Options
Default of pending message buffer that is used for buffering messages that are published during a disconnect/reconnect, getReconnectBufferSize().
DEFAULT_RECONNECT_WAIT - Static variable in class io.nats.client.Options
Default wait time before attempting reconnection to the same server, see getReconnectWait().
DEFAULT_REQUEST_CLEANUP_INTERVAL - Static variable in class io.nats.client.Options
Default interval to clean up cancelled/timed out requests.
DEFAULT_SSL_PROTOCOL - Static variable in class io.nats.client.Options
Default SSL protocol used to create an SSLContext if the secure property is used.
DEFAULT_URL - Static variable in class io.nats.client.Options
Default server URL.
Dispatcher - Interface in io.nats.client
This library uses the concept of a Dispatcher to organize message callbacks in a way that the application can control.
drain(Duration) - Method in interface io.nats.client.Connection
Drain tells the connection to process in flight messages before closing.
drain(Duration) - Method in interface io.nats.client.Consumer
Drain tells the consumer to process in flight, or cached messages, but stop receiving new ones.

E

equals(Object) - Method in class io.nats.client.NKey
 
ErrorListener - Interface in io.nats.client
This library groups problems into three categories: Errors The server sent an error message using the -err protocol operation. Exceptions A Java exception occurred, and was handled by the library. Slow Consumers One of the connections consumers, Subscription or Dispatcher, is slow, and starting to drop messages.
errorListener(ErrorListener) - Method in class io.nats.client.Options.Builder
Set the ErrorListener to receive asynchronous error events related to this connection.
errorOccurred(Connection, String) - Method in interface io.nats.client.ErrorListener
NATs related errors that occur asynchronously in the client library are sent to an ErrorListener via errorOccurred.
exceptionOccurred(Connection, Exception) - Method in interface io.nats.client.ErrorListener
Exceptions that occur in the "normal" course of operations are sent to the ErrorListener using exceptionOccurred.

F

flush(Duration) - Method in interface io.nats.client.Connection
Flush the connection's buffer of outgoing messages, including sending a protocol message to and from the server.
fromPrefix(int) - Static method in enum io.nats.client.NKey.Type
 
fromPublicKey(String) - Static method in class io.nats.client.NKey
Create an NKey object from the encoded public key.
fromSeed(String) - Static method in class io.nats.client.NKey
Creates an NKey object from a string encoded seed.

G

getAuthHandler() - Method in class io.nats.client.Options
 
getBufferSize() - Method in class io.nats.client.Options
 
getConnectedUrl() - Method in interface io.nats.client.Connection
 
getConnectionListener() - Method in class io.nats.client.Options
 
getConnectionName() - Method in class io.nats.client.Options
 
getConnectionTimeout() - Method in class io.nats.client.Options
 
getData() - Method in interface io.nats.client.Message
 
getDataPortType() - Method in class io.nats.client.Options
 
getDeliveredCount() - Method in interface io.nats.client.Consumer
 
getDispatcher() - Method in interface io.nats.client.Subscription
 
getDroppedCount() - Method in interface io.nats.client.Consumer
 
getDroppedCount() - Method in interface io.nats.client.Statistics
 
getErrorListener() - Method in class io.nats.client.Options
 
getID() - Method in interface io.nats.client.AuthHandler
getID should return a public key associated with a client key known to the server.
getInBytes() - Method in interface io.nats.client.Statistics
 
getInMsgs() - Method in interface io.nats.client.Statistics
 
getKeyPair() - Method in class io.nats.client.NKey
 
getLastError() - Method in interface io.nats.client.Connection
 
getMaxControlLine() - Method in class io.nats.client.Options
 
getMaxPayload() - Method in interface io.nats.client.Connection
MaxPayload returns the size limit that a message payload can have.
getMaxPingsOut() - Method in class io.nats.client.Options
 
getMaxReconnect() - Method in class io.nats.client.Options
 
getOptions() - Method in interface io.nats.client.Connection
 
getOutBytes() - Method in interface io.nats.client.Statistics
 
getOutMsgs() - Method in interface io.nats.client.Statistics
 
getPassword() - Method in class io.nats.client.Options
 
getPendingByteCount() - Method in interface io.nats.client.Consumer
 
getPendingByteLimit() - Method in interface io.nats.client.Consumer
 
getPendingMessageCount() - Method in interface io.nats.client.Consumer
 
getPendingMessageLimit() - Method in interface io.nats.client.Consumer
 
getPingInterval() - Method in class io.nats.client.Options
 
getPrivateKey() - Method in class io.nats.client.NKey
 
getPublicKey() - Method in class io.nats.client.NKey
 
getQueueName() - Method in interface io.nats.client.Subscription
 
getReconnectBufferSize() - Method in class io.nats.client.Options
 
getReconnects() - Method in interface io.nats.client.Statistics
 
getReconnectWait() - Method in class io.nats.client.Options
 
getReplyTo() - Method in interface io.nats.client.Message
 
getRequestCleanupInterval() - Method in class io.nats.client.Options
 
getSeed() - Method in class io.nats.client.NKey
 
getServers() - Method in interface io.nats.client.Connection
Return the list of known server urls, including additional servers discovered after a connection has been established.
getServers() - Method in class io.nats.client.Options
 
getSslContext() - Method in class io.nats.client.Options
 
getStatistics() - Method in interface io.nats.client.Connection
 
getStatus() - Method in interface io.nats.client.Connection
Returns the connections current status.
getSubject() - Method in interface io.nats.client.Message
 
getSubject() - Method in interface io.nats.client.Subscription
 
getSubscription() - Method in interface io.nats.client.Message
 
getToken() - Method in class io.nats.client.Options
 
getType() - Method in class io.nats.client.NKey
 
getUsername() - Method in class io.nats.client.Options
 

H

hashCode() - Method in class io.nats.client.NKey
 

I

io.nats.client - package io.nats.client
The Java Nats client is encapsulated into this single package io.nats.client.
isActive() - Method in interface io.nats.client.Consumer
 
isNoEcho() - Method in class io.nats.client.Options
 
isNoRandomize() - Method in class io.nats.client.Options
 
isOldRequestStyle() - Method in class io.nats.client.Options
 
isPedantic() - Method in class io.nats.client.Options
 
isTLSRequired() - Method in class io.nats.client.Options
 
isTrackAdvancedStats() - Method in class io.nats.client.Options
 
isValidPublicAccountKey(String) - Static method in class io.nats.client.NKey
 
isValidPublicClusterKey(String) - Static method in class io.nats.client.NKey
 
isValidPublicOperatorKey(String) - Static method in class io.nats.client.NKey
 
isValidPublicServerKey(String) - Static method in class io.nats.client.NKey
 
isValidPublicUserKey(String) - Static method in class io.nats.client.NKey
 
isVerbose() - Method in class io.nats.client.Options
 

M

maxControlLine(int) - Method in class io.nats.client.Options.Builder
Set the maximum length of a control line sent by this connection.
maxPingsOut(int) - Method in class io.nats.client.Options.Builder
Set the maximum number of pings the client can have in flight.
maxReconnects(int) - Method in class io.nats.client.Options.Builder
Set the maximum number of reconnect attempts.
Message - Interface in io.nats.client
The NATS library uses a Message object to encapsulate incoming messages.
MessageHandler - Interface in io.nats.client
Dispatchers use the MessageHandler interface to define the listener for their messages.

N

Nats - Class in io.nats.client
The Nats class is the entry point into the NATS client for Java.
next() - Method in class io.nats.client.NUID
Generate the next NUID string from this instance.
nextGlobal() - Static method in class io.nats.client.NUID
 
nextMessage(Duration) - Method in interface io.nats.client.Subscription
Read the next message for a subscription, or block until one is available.
NKey - Class in io.nats.client
The NATS ecosystem will be moving to Ed25519 keys for identity, authentication and authorization for entities such as Accounts, Users, Servers and Clusters.
NKey.Type - Enum in io.nats.client
NKeys use a prefix byte to indicate their intended owner: 'N' = server, 'C' = cluster, 'A' = account, and 'U' = user.
noEcho() - Method in class io.nats.client.Options.Builder
Turn off echo.
noRandomize() - Method in class io.nats.client.Options.Builder
Turn off server pool randomization.
noReconnect() - Method in class io.nats.client.Options.Builder
Equivalent to calling maxReconnects with 0, maxReconnects.
NUID - Class in io.nats.client
A highly performant unique identifier generator.
NUID() - Constructor for class io.nats.client.NUID
The default NUID constructor.

O

oldRequestStyle() - Method in class io.nats.client.Options.Builder
Turn on the old request style that uses a new inbox and subscriber for each request.
onMessage(Message) - Method in interface io.nats.client.MessageHandler
Called to deliver a message to the handler.
opentls() - Method in class io.nats.client.Options.Builder
Set the SSL context to one that accepts any server certificate and has no client certificates.
Options - Class in io.nats.client
The Options class specifies the connection options for a new NATs connection, including the default options.
Options.Builder - Class in io.nats.client
Options are created using a Builder.

P

pedantic() - Method in class io.nats.client.Options.Builder
Turn on pedantic mode for the server, in relation to this connection.
pingInterval(Duration) - Method in class io.nats.client.Options.Builder
Set the interval between attempts to pings the server.
PROP_CLEANUP_INTERVAL - Static variable in class io.nats.client.Options
Property used to configure a builder from a Properties object.
PROP_CONNECTION_CB - Static variable in class io.nats.client.Options
Property used to configure a builder from a Properties object.
PROP_CONNECTION_NAME - Static variable in class io.nats.client.Options
Property used to configure a builder from a Properties object.
PROP_CONNECTION_TIMEOUT - Static variable in class io.nats.client.Options
Property used to configure a builder from a Properties object.
PROP_DATA_PORT_TYPE - Static variable in class io.nats.client.Options
Property used to configure a builder from a Properties object.
PROP_ERROR_LISTENER - Static variable in class io.nats.client.Options
Property used to configure a builder from a Properties object.
PROP_MAX_CONTROL_LINE - Static variable in class io.nats.client.Options
Property used to configure a builder from a Properties object.
PROP_MAX_PINGS - Static variable in class io.nats.client.Options
Property used to configure a builder from a Properties object.
PROP_MAX_RECONNECT - Static variable in class io.nats.client.Options
Property used to configure a builder from a Properties object.
PROP_NO_ECHO - Static variable in class io.nats.client.Options
Property used to configure a builder from a Properties object.
PROP_NORANDOMIZE - Static variable in class io.nats.client.Options
Property used to configure a builder from a Properties object.
PROP_OPENTLS - Static variable in class io.nats.client.Options
Property used to configure a builder from a Properties object.
PROP_PASSWORD - Static variable in class io.nats.client.Options
Property used to configure a builder from a Properties object.
PROP_PEDANTIC - Static variable in class io.nats.client.Options
Property used to configure a builder from a Properties object.
PROP_PING_INTERVAL - Static variable in class io.nats.client.Options
Property used to configure a builder from a Properties object.
PROP_RECONNECT_BUF_SIZE - Static variable in class io.nats.client.Options
Property used to configure a builder from a Properties object.
PROP_RECONNECT_WAIT - Static variable in class io.nats.client.Options
Property used to configure a builder from a Properties object.
PROP_SECURE - Static variable in class io.nats.client.Options
Property used to configure a builder from a Properties object.
PROP_SERVERS - Static variable in class io.nats.client.Options
Property used to configure a builder from a Properties object.
PROP_TOKEN - Static variable in class io.nats.client.Options
Property used to configure a builder from a Properties object.
PROP_URL - Static variable in class io.nats.client.Options
Property used to configure a builder from a Properties object.
PROP_USE_OLD_REQUEST_STYLE - Static variable in class io.nats.client.Options
Property used to configure a builder from a Properties object.
PROP_USERNAME - Static variable in class io.nats.client.Options
Property used to configure a builder from a Properties object.
PROP_UTF8_SUBJECTS - Static variable in class io.nats.client.Options
This property is used to enable support for UTF8 subjects.
PROP_VERBOSE - Static variable in class io.nats.client.Options
Property used to configure a builder from a Properties object.
publish(String, byte[]) - Method in interface io.nats.client.Connection
Send a message to the specified subject.
publish(String, String, byte[]) - Method in interface io.nats.client.Connection
Send a request to the specified subject, providing a replyTo subject.

R

reconnectBufferSize(long) - Method in class io.nats.client.Options.Builder
Set the maximum number of bytes to buffer in the client when trying to reconnect.
reconnectWait(Duration) - Method in class io.nats.client.Options.Builder
Set the time to wait between reconnect attempts to the same server.
request(String, byte[]) - Method in interface io.nats.client.Connection
Send a request.
request(String, byte[], Duration) - Method in interface io.nats.client.Connection
Send a request and returns the reply or null.
requestCleanupInterval(Duration) - Method in class io.nats.client.Options.Builder
Set the interval between cleaning passes on outstanding request futures that are cancelled or timeout in the application code.

S

secure() - Method in class io.nats.client.Options.Builder
Set the SSL context to the default one.
server(String) - Method in class io.nats.client.Options.Builder
Add a server to the list of known servers.
servers(String[]) - Method in class io.nats.client.Options.Builder
Add an array of servers to the list of known servers.
setPendingLimits(long, long) - Method in interface io.nats.client.Consumer
Set limits on the maximum number of messages, or maximum size of messages this consumer will hold before it starts to drop new messages waiting for the application to drain the queue.
sign(byte[]) - Method in interface io.nats.client.AuthHandler
Sign is called by the library when the server sends a nonce.
sign(byte[]) - Method in class io.nats.client.NKey
Sign aribitrary binary input.
slowConsumerDetected(Connection, Consumer) - Method in interface io.nats.client.ErrorListener
Called by the connection when a "slow" consumer is detected.
sslContext(SSLContext) - Method in class io.nats.client.Options.Builder
Set the SSL context, requires that the server supports TLS connections and the URI specifies TLS.
Statistics - Interface in io.nats.client
Connections can provide an instance of Statistics, getStatistics().
subscribe(String) - Method in interface io.nats.client.Connection
Create a synchronous subscription to the specified subject.
subscribe(String, String) - Method in interface io.nats.client.Connection
Create a synchronous subscription to the specified subject and queue.
subscribe(String) - Method in interface io.nats.client.Dispatcher
Create a subscription to the specified subject under the control of this dispatcher.
subscribe(String, String) - Method in interface io.nats.client.Dispatcher
Create a subscription to the specified subject and queue under the control of this dispatcher.
Subscription - Interface in io.nats.client
A Subscription encapsulates an incoming queue of messages associated with a single subject and optional queue name.
supportUTF8Subjects() - Method in class io.nats.client.Options.Builder
The client protocol is not clear about the encoding for subject names.
supportUTF8Subjects() - Method in class io.nats.client.Options
 

T

token(String) - Method in class io.nats.client.Options.Builder
Set the token for token-based authentication.
toString() - Method in enum io.nats.client.ConnectionListener.Events
 
turnOnAdvancedStats() - Method in class io.nats.client.Options.Builder
Turn on advanced stats, primarily for test/benchmarks.

U

unsubscribe(String) - Method in interface io.nats.client.Dispatcher
Unsubscribe from the specified subject, the queue is implicit.
unsubscribe(String, int) - Method in interface io.nats.client.Dispatcher
Unsubscribe from the specified subject, the queue is implicit, after the specified number of messages.
unsubscribe() - Method in interface io.nats.client.Subscription
Unsubscribe this subscription and stop listening for messages.
unsubscribe(int) - Method in interface io.nats.client.Subscription
Unsubscribe this subscription and stop listening for messages, after the specified number of messages.
userInfo(String, String) - Method in class io.nats.client.Options.Builder
Set the username and password for basic authentication.

V

valueOf(String) - Static method in enum io.nats.client.Connection.Status
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum io.nats.client.ConnectionListener.Events
Returns the enum constant of this type with the specified name.
valueOf(String) - Static method in enum io.nats.client.NKey.Type
Returns the enum constant of this type with the specified name.
values() - Static method in enum io.nats.client.Connection.Status
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum io.nats.client.ConnectionListener.Events
Returns an array containing the constants of this enum type, in the order they are declared.
values() - Static method in enum io.nats.client.NKey.Type
Returns an array containing the constants of this enum type, in the order they are declared.
verbose() - Method in class io.nats.client.Options.Builder
Turn on verbose mode with the server.
verify(byte[], byte[]) - Method in class io.nats.client.NKey
Verify a signature.
A B C D E F G H I M N O P R S T U V 
Skip navigation links