Index

A B C D F G H I L N O P Q R S T U V W 
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form

A

accept(Runnable) - Method in class org.omegazero.net.util.SyncWorker
Runs the given Runnable.
accept(T) - Method in interface org.omegazero.net.common.ThrowingConsumer
 
addDefaultCertificates(KeyStore) - Static method in class org.omegazero.net.util.TrustManagerUtil
Adds the certificates that the default trust manager trusts to the given KeyStore.
addReadData(byte[]) - Method in class org.omegazero.net.socket.provider.DatagramChannelProvider
Used for incoming connections on servers.

B

backlog - Variable in class org.omegazero.net.server.TCPServer
 
bindAddresses - Variable in class org.omegazero.net.server.TCPServer
 
bindAddresses - Variable in class org.omegazero.net.server.UDPServer
 

C

ChannelConnection - Class in org.omegazero.net.socket
Represents a SocketConnection based on a java.nio SocketChannel or DatagramChannel.
ChannelConnection(SelectionKey, ChannelProvider) - Constructor for class org.omegazero.net.socket.ChannelConnection
 
ChannelConnection(SelectionKey, ChannelProvider, SocketAddress) - Constructor for class org.omegazero.net.socket.ChannelConnection
 
ChannelProvider - Interface in org.omegazero.net.socket.provider
Used by ChannelConnections for I/O and wraps a java.nio channel.
close() - Method in class org.omegazero.net.client.TCPClientManager
 
close() - Method in class org.omegazero.net.client.UDPClientManager
 
close() - Method in interface org.omegazero.net.common.NetworkApplication
Closes this application, closing all bound and connected sockets and stopping the main loop, causing a call to NetworkApplication.start() to return.
close() - Method in class org.omegazero.net.server.TCPServer
 
close() - Method in class org.omegazero.net.server.UDPServer
 
close() - Method in class org.omegazero.net.socket.ChannelConnection
 
close() - Method in interface org.omegazero.net.socket.provider.ChannelProvider
Closes the underlying java.nio channel.
close() - Method in class org.omegazero.net.socket.provider.DatagramChannelProvider
 
close() - Method in class org.omegazero.net.socket.provider.SocketChannelProvider
 
close() - Method in class org.omegazero.net.socket.SocketConnection
Closes this connection after all remaining data has been flushed to the socket, which may not be immediately.
close0() - Method in class org.omegazero.net.socket.ChannelConnection
Forcibly closes this connection.
close0() - Method in class org.omegazero.net.socket.impl.TLSConnection
 
closeSelector() - Method in class org.omegazero.net.common.SelectorHandler
Stops the selector loop, closes all channels registered with this selector and closes the Selector instance.
connect(int) - Method in class org.omegazero.net.socket.ChannelConnection
 
connect(int) - Method in class org.omegazero.net.socket.SocketConnection
Connects this SocketConnection to the previously specified remote address in the constructor.
connect(SocketAddress, int) - Method in interface org.omegazero.net.socket.provider.ChannelProvider
Connects the underlying java.nio channel to the given remote address.
connect(SocketAddress, int) - Method in class org.omegazero.net.socket.provider.DatagramChannelProvider
 
connect(SocketAddress, int) - Method in class org.omegazero.net.socket.provider.SocketChannelProvider
 
connection(ConnectionParameters) - Method in interface org.omegazero.net.client.NetClientManager
Creates a new connection instance based on the given parameters to be managed by this NetClientManager.

SocketConnection.connect(int) will need to be called on the returned connection instance to initiate the connection.
connection(ConnectionParameters) - Method in class org.omegazero.net.client.TCPClientManager
 
connection(ConnectionParameters) - Method in class org.omegazero.net.client.UDPClientManager
 
ConnectionParameters - Class in org.omegazero.net.client.params
Contains parameters for creating outgoing connections.
ConnectionParameters(SocketAddress) - Constructor for class org.omegazero.net.client.params.ConnectionParameters
ConnectionParameters(SocketAddress, SocketAddress) - Constructor for class org.omegazero.net.client.params.ConnectionParameters
ConnectionSelectorHandler - Class in org.omegazero.net.common
 
ConnectionSelectorHandler() - Constructor for class org.omegazero.net.common.ConnectionSelectorHandler
 
createBuffers() - Method in class org.omegazero.net.socket.ChannelConnection
Must be called by subclass constructors.
createBuffers() - Method in class org.omegazero.net.socket.impl.PlainConnection
 
createBuffers() - Method in class org.omegazero.net.socket.impl.TLSConnection
 
createConnection(SelectionKey, ConnectionParameters) - Method in class org.omegazero.net.client.DTLSClientManager
 
createConnection(SelectionKey, ConnectionParameters) - Method in class org.omegazero.net.client.PlainTCPClientManager
 
createConnection(SelectionKey, ConnectionParameters) - Method in class org.omegazero.net.client.PlainUDPClientManager
 
createConnection(SelectionKey, ConnectionParameters) - Method in class org.omegazero.net.client.TCPClientManager
 
createConnection(SelectionKey, ConnectionParameters) - Method in class org.omegazero.net.client.TLSClientManager
 
createConnection(SelectionKey, ConnectionParameters) - Method in class org.omegazero.net.client.UDPClientManager
 

D

DatagramChannelProvider - Class in org.omegazero.net.socket.provider
DatagramChannelProvider() - Constructor for class org.omegazero.net.socket.provider.DatagramChannelProvider
This constructor should be used if the datagram channel is used as a client which is about to be connected to a server.
DatagramChannelProvider(SocketAddress, Consumer<ChannelConnection>) - Constructor for class org.omegazero.net.socket.provider.DatagramChannelProvider
This constructor should be used if the datagram channel is used as a server.
destroy() - Method in class org.omegazero.net.socket.ChannelConnection
 
destroy() - Method in class org.omegazero.net.socket.SocketConnection
Similar to SocketConnection.close(), except that the connection is closed immediately, without waiting for data to be flushed to the socket.
doTLSHandshake() - Method in class org.omegazero.net.socket.impl.TLSConnection
 
DTLSClientManager - Class in org.omegazero.net.client
 
DTLSClientManager() - Constructor for class org.omegazero.net.client.DTLSClientManager
 
DTLSClientManager(Consumer<Runnable>) - Constructor for class org.omegazero.net.client.DTLSClientManager
 
DTLSClientManager(Consumer<Runnable>, Collection<X509Certificate>) - Constructor for class org.omegazero.net.client.DTLSClientManager
 
DTLSClientManager(Consumer<Runnable>, TrustManager[]) - Constructor for class org.omegazero.net.client.DTLSClientManager
 
DTLSServer - Class in org.omegazero.net.server
TLS server for UDP sockets (DTLS).
DTLSServer(Collection<Integer>, SSLContext) - Constructor for class org.omegazero.net.server.DTLSServer
 
DTLSServer(Collection<InetAddress>, Collection<Integer>, Consumer<Runnable>, long, int, SSLContext) - Constructor for class org.omegazero.net.server.DTLSServer
 

F

flush() - Method in class org.omegazero.net.socket.ChannelConnection
Attempts to flush any queued data after a call to SocketConnection.writeQueue(byte[]) or data that could not be written previously because the socket was busy.
flush() - Method in class org.omegazero.net.socket.impl.PlainConnection
 
flush() - Method in class org.omegazero.net.socket.impl.TLSConnection
 
flush() - Method in class org.omegazero.net.socket.SocketConnection
Attempts to flush any queued data after a call to SocketConnection.writeQueue(byte[]) or data that could not be written previously because the socket was busy.
flushWriteBacklog() - Method in class org.omegazero.net.socket.ChannelConnection
Attempts to write any remaining data in the write buffer and write backlog to the socket and returns true if all data could be written.

This method is equivalent to ChannelConnection.flush().

G

getAlpnNames() - Method in class org.omegazero.net.client.params.TLSConnectionParameters
Returns the configured ALPN options using TLSConnectionParameters.setAlpnNames(String[]).
getAlpnProtocol() - Method in class org.omegazero.net.socket.impl.TLSConnection
 
getApparentRemoteAddress() - Method in class org.omegazero.net.socket.SocketConnection
Returns the apparent remote address previously set by SocketConnection.setApparentRemoteAddress(SocketAddress), or the address returned by SocketConnection.getRemoteAddress() if none was set.
getAttachment() - Method in class org.omegazero.net.socket.SocketConnection
 
getBacklog() - Method in class org.omegazero.net.server.TCPServer
 
getIdleTimeout() - Method in class org.omegazero.net.server.TCPServer
 
getIdleTimeout() - Method in class org.omegazero.net.server.UDPServer
 
getLastIOTime() - Method in class org.omegazero.net.socket.ChannelConnection
 
getLastIOTime() - Method in class org.omegazero.net.socket.SocketConnection
Returns the last time any data was sent over this connection, either incoming or outgoing, as returned by System.currentTimeMillis().
getLocal() - Method in class org.omegazero.net.client.params.ConnectionParameters
Returns the configured local address.
getLocalAddress() - Method in class org.omegazero.net.socket.ChannelConnection
 
getLocalAddress() - Method in class org.omegazero.net.socket.SocketConnection
Returns the local address of this connection.
getProvider() - Method in class org.omegazero.net.socket.ChannelConnection
 
getReadLock() - Method in class org.omegazero.net.socket.SocketConnection
Returns the read lock.
getRemote() - Method in class org.omegazero.net.client.params.ConnectionParameters
Returns the configured remote address.
getRemoteAddress() - Method in class org.omegazero.net.socket.ChannelConnection
 
getRemoteAddress() - Method in class org.omegazero.net.socket.SocketConnection
Returns the address of the remote host.
getRSAKeySpec(byte[]) - Static method in class org.omegazero.net.util.PrivateKeyReader
Convert PKCS#1 encoded private key into RSAPrivateCrtKeySpec.
getSecureServerSocketFactory(String, String) - Static method in class org.omegazero.net.util.SSLUtil
getSelectionKey() - Method in interface org.omegazero.net.socket.provider.ChannelProvider
Returns the SelectionKey of this ChannelProvider.
getSelectionKey() - Method in class org.omegazero.net.socket.provider.DatagramChannelProvider
 
getSelectionKey() - Method in class org.omegazero.net.socket.provider.SocketChannelProvider
 
getServerSocketFactory() - Static method in class org.omegazero.net.util.SSLUtil
getSniOptions() - Method in class org.omegazero.net.client.params.TLSConnectionParameters
Returns the configured SNI options using TLSConnectionParameters.setSniOptions(String[]).
getSSLContextFromKeyStore(String, String, String) - Static method in class org.omegazero.net.util.SSLUtil
Creates a SSLContext with the "TLS" protocol from a Java key store stored in a file identified by filename.
getSSLContextFromKeyStore(String, String, String, String) - Static method in class org.omegazero.net.util.SSLUtil
Creates a SSLContext from a Java key store stored in a file identified by filename.
getSSLContextFromPEM(String, String) - Static method in class org.omegazero.net.util.SSLUtil
Creates a SSLContext with the "TLS" protocol from PEM-encoded key and certificate files.
getSSLContextFromPEM(String, String, String) - Static method in class org.omegazero.net.util.SSLUtil
Creates a SSLContext from PEM-encoded key and certificate files.
getSSLEngineWithPEM(String, String) - Static method in class org.omegazero.net.util.SSLUtil
getSupportedApplicationLayerProtocols() - Method in class org.omegazero.net.server.DTLSServer
 
getSupportedApplicationLayerProtocols() - Method in class org.omegazero.net.server.TLSServer
 
getTrustAllManager() - Static method in class org.omegazero.net.util.TrustManagerUtil
Returns a trust manager array containing a single trust manager that accepts all certificates.

Warning: Trusting all certificates when using SSL is inherently dangerous as it defeats most of the purpose of it.
getTrustManagersWithAdditionalCertificateFiles(Collection<String>) - Static method in class org.omegazero.net.util.TrustManagerUtil
Loads the certificates from the given file paths using SSLUtil.loadCertificateFromPEM(String) and generates an array of trust managers using TrustManagerUtil.getTrustManagersWithAdditionalCertificates(Collection).

The given certificate files must only contain a single certificate each.
getTrustManagersWithAdditionalCertificates(Collection<X509Certificate>) - Static method in class org.omegazero.net.util.TrustManagerUtil
Generates an array of trust managers which are configured to accept all certificates that the default trust manager trusts in addition to the certificates passed in additionalTrustCertificates.
getWriteLock() - Method in class org.omegazero.net.socket.SocketConnection
Returns the write lock.

H

handleClose() - Method in class org.omegazero.net.socket.SocketConnection
Called by subclasses or classes managing this SocketConnection if this connection closed.
handleConnect() - Method in class org.omegazero.net.socket.SocketConnection
 
handleConnect(ChannelConnection) - Method in class org.omegazero.net.client.DTLSClientManager
 
handleConnect(ChannelConnection) - Method in class org.omegazero.net.client.PlainTCPClientManager
 
handleConnect(ChannelConnection) - Method in class org.omegazero.net.client.PlainUDPClientManager
 
handleConnect(ChannelConnection) - Method in class org.omegazero.net.client.TCPClientManager
Called when a connection was established.
handleConnect(ChannelConnection) - Method in class org.omegazero.net.client.TLSClientManager
 
handleConnect(ChannelConnection) - Method in class org.omegazero.net.client.UDPClientManager
Called after a connect request on a connection.
handleConnection(SelectionKey) - Method in class org.omegazero.net.server.PlainTCPServer
 
handleConnection(SelectionKey) - Method in class org.omegazero.net.server.TCPServer
 
handleConnection(SelectionKey) - Method in class org.omegazero.net.server.TLSServer
 
handleConnection(SelectionKey, SocketAddress) - Method in class org.omegazero.net.server.DTLSServer
 
handleConnection(SelectionKey, SocketAddress) - Method in class org.omegazero.net.server.PlainUDPServer
 
handleConnection(SelectionKey, SocketAddress) - Method in class org.omegazero.net.server.UDPServer
 
handleConnectionClosed(SocketConnection) - Method in class org.omegazero.net.common.ConnectionSelectorHandler
Called when a connection closed.
handleConnectionClosed(SocketConnection) - Method in class org.omegazero.net.server.TCPServer
 
handleConnectionPost(ChannelConnection) - Method in class org.omegazero.net.server.PlainTCPServer
 
handleConnectionPost(ChannelConnection) - Method in class org.omegazero.net.server.PlainUDPServer
 
handleConnectionPost(ChannelConnection) - Method in class org.omegazero.net.server.TCPServer
 
handleConnectionPost(ChannelConnection) - Method in class org.omegazero.net.server.UDPServer
 
handleData(byte[]) - Method in class org.omegazero.net.socket.SocketConnection
Called by classes managing this SocketConnection if data was received using SocketConnection.read().
handleError(Throwable) - Method in class org.omegazero.net.socket.SocketConnection
Called by subclasses or classes managing this SocketConnection if an error occurred in a callback.
handleSelectedKey(SelectionKey) - Method in class org.omegazero.net.client.TCPClientManager
 
handleSelectedKey(SelectionKey) - Method in class org.omegazero.net.client.UDPClientManager
 
handleSelectedKey(SelectionKey) - Method in class org.omegazero.net.common.SelectorHandler
Called when a key was selected in a select call in the SelectorHandler.runSelectorLoop() method.
handleSelectedKey(SelectionKey) - Method in class org.omegazero.net.server.TCPServer
 
handleSelectedKey(SelectionKey) - Method in class org.omegazero.net.server.UDPServer
 
handleTimeout() - Method in class org.omegazero.net.socket.SocketConnection
 
handleWritable() - Method in class org.omegazero.net.socket.SocketConnection
Called by subclasses if this socket is writable.
hasConnected() - Method in class org.omegazero.net.socket.SocketConnection
Returns true if the onConnect event has ever executed.
hasDisconnected() - Method in class org.omegazero.net.socket.SocketConnection
Returns true if this socket has connected but is no longer connected.

I

init() - Method in class org.omegazero.net.client.TCPClientManager
 
init() - Method in class org.omegazero.net.client.UDPClientManager
 
init() - Method in interface org.omegazero.net.common.NetworkApplication
Initializes this application.
init() - Method in class org.omegazero.net.server.TCPServer
 
init() - Method in class org.omegazero.net.server.UDPServer
 
init(ChannelConnection, SelectionKey) - Method in interface org.omegazero.net.socket.provider.ChannelProvider
Initialized this ChannelProvider.
init(ChannelConnection, SelectionKey) - Method in class org.omegazero.net.socket.provider.DatagramChannelProvider
 
init(ChannelConnection, SelectionKey) - Method in class org.omegazero.net.socket.provider.SocketChannelProvider
 
initSelector() - Method in class org.omegazero.net.common.SelectorHandler
Initializes the Selector and sets this instance as running.

After this method has been called successfully, SelectorHandler#selectorLoop() should be called to start performing IO operations.
isAvailable() - Method in interface org.omegazero.net.socket.provider.ChannelProvider
Returns true if the underlying java.nio channel is connected.
isAvailable() - Method in class org.omegazero.net.socket.provider.DatagramChannelProvider
 
isAvailable() - Method in class org.omegazero.net.socket.provider.SocketChannelProvider
 
isConnected() - Method in class org.omegazero.net.socket.ChannelConnection
Returns true if this socket is connected.
isConnected() - Method in class org.omegazero.net.socket.impl.TLSConnection
 
isConnected() - Method in class org.omegazero.net.socket.SocketConnection
Returns true if this socket is connected.
isPrintStackTraces() - Static method in class org.omegazero.net.common.NetCommon
Deprecated.
Access NetCommon.PRINT_STACK_TRACES directly instead
isRunning() - Method in class org.omegazero.net.common.SelectorHandler
 
isWritable() - Method in class org.omegazero.net.socket.ChannelConnection
 
isWritable() - Method in class org.omegazero.net.socket.SocketConnection
Returns true if this socket is writable, meaning data passed to SocketConnection.write(byte[]) will not be buffered but written to the socket directly.

L

loadCertificateFromPEM(String) - Static method in class org.omegazero.net.util.SSLUtil
Reads a single X509Certificate from the given certFile.
loadCertificatesFromPEM(String) - Static method in class org.omegazero.net.util.SSLUtil
Reads one or more X509Certificate from the given certFile.
loadPrivateKeyFromPEM(String) - Static method in class org.omegazero.net.util.SSLUtil
Reads a PrivateKey from the given keyFile.
localClose() - Method in class org.omegazero.net.socket.SocketConnection
Called by implementing classes when this connection was closed using any close method (SocketConnection.close() or SocketConnection.destroy()).
localConnect() - Method in class org.omegazero.net.socket.SocketConnection
Called by implementing classes if this connection was established immediately upon calling SocketConnection.connect(int).
logSocketError(Logger, String, SocketConnection, Throwable) - Static method in class org.omegazero.net.common.NetCommon
 
loopIteration() - Method in class org.omegazero.net.client.TCPClientManager
 
loopIteration() - Method in class org.omegazero.net.common.ConnectionSelectorHandler
 
loopIteration() - Method in class org.omegazero.net.common.SelectorHandler
Called every loop iteration in SelectorHandler.runSelectorLoop(), which is every time Selector.select() returns, either because a SelectionKey was selected or the selector was woken up for any other reason (for example after a call to SelectorHandler.selectorWakeup()).

This method does nothing by default.

N

NetClientManager - Interface in org.omegazero.net.client
 
NetCommon - Class in org.omegazero.net.common
 
NetCommon() - Constructor for class org.omegazero.net.common.NetCommon
 
NetServer - Interface in org.omegazero.net.server
 
NetworkApplication - Interface in org.omegazero.net.common
 

O

onConnectionClosed(SocketConnection) - Method in class org.omegazero.net.common.ConnectionSelectorHandler
Notify this ConnectionSelectorHandler that a ChannelConnection was closed locally by a call to SocketConnection.close().
onConnectionClosed(SocketConnection) - Method in class org.omegazero.net.server.UDPServer
 
org.omegazero.net.client - package org.omegazero.net.client
Provides client manager implementations.
org.omegazero.net.client.params - package org.omegazero.net.client.params
Provides classes for passing client socket creation parameters.
org.omegazero.net.common - package org.omegazero.net.common
Contains base classes of the networking library.
org.omegazero.net.server - package org.omegazero.net.server
Provides server implementations.
org.omegazero.net.socket - package org.omegazero.net.socket
Provides classes representing network sockets.
org.omegazero.net.socket.impl - package org.omegazero.net.socket.impl
 
org.omegazero.net.socket.provider - package org.omegazero.net.socket.provider
 
org.omegazero.net.util - package org.omegazero.net.util
Contains miscellaneous utility classes for networking and security.

P

P1_BEGIN_MARKER - Static variable in class org.omegazero.net.util.PrivateKeyReader
 
P1_END_MARKER - Static variable in class org.omegazero.net.util.PrivateKeyReader
 
P8_BEGIN_MARKER - Static variable in class org.omegazero.net.util.PrivateKeyReader
 
P8_END_MARKER - Static variable in class org.omegazero.net.util.PrivateKeyReader
 
PlainConnection - Class in org.omegazero.net.socket.impl
 
PlainConnection(SelectionKey, ChannelProvider) - Constructor for class org.omegazero.net.socket.impl.PlainConnection
 
PlainConnection(SelectionKey, ChannelProvider, SocketAddress) - Constructor for class org.omegazero.net.socket.impl.PlainConnection
 
PlainTCPClientManager - Class in org.omegazero.net.client
 
PlainTCPClientManager() - Constructor for class org.omegazero.net.client.PlainTCPClientManager
 
PlainTCPClientManager(Consumer<Runnable>) - Constructor for class org.omegazero.net.client.PlainTCPClientManager
 
PlainTCPServer - Class in org.omegazero.net.server
TCPServer implementation for plaintext TCP sockets.
PlainTCPServer(Collection<Integer>) - Constructor for class org.omegazero.net.server.PlainTCPServer
 
PlainTCPServer(Collection<InetAddress>, Collection<Integer>, int, Consumer<Runnable>, long) - Constructor for class org.omegazero.net.server.PlainTCPServer
 
PlainUDPClientManager - Class in org.omegazero.net.client
 
PlainUDPClientManager() - Constructor for class org.omegazero.net.client.PlainUDPClientManager
 
PlainUDPClientManager(Consumer<Runnable>) - Constructor for class org.omegazero.net.client.PlainUDPClientManager
 
PlainUDPServer - Class in org.omegazero.net.server
UDPServer implementation for plaintext UDP sockets.
PlainUDPServer(Collection<Integer>) - Constructor for class org.omegazero.net.server.PlainUDPServer
 
PlainUDPServer(Collection<InetAddress>, Collection<Integer>, Consumer<Runnable>, long, int) - Constructor for class org.omegazero.net.server.PlainUDPServer
 
ports - Variable in class org.omegazero.net.server.TCPServer
 
ports - Variable in class org.omegazero.net.server.UDPServer
 
PRINT_STACK_TRACES - Static variable in class org.omegazero.net.common.NetCommon
System property org.omegazero.net.printStackTraces

Whether the full stack trace of a socket error should be printed instead of just the error message.

Default: false
PrivateKeyReader - Class in org.omegazero.net.util
Class for reading a RSA private key from a PEM-formatted string.

Q

queueWrite(byte[]) - Method in class org.omegazero.net.socket.SocketConnection
Called by implementing classes to queue data for writing before this connection has connected.

R

read() - Method in class org.omegazero.net.socket.impl.PlainConnection
 
read() - Method in class org.omegazero.net.socket.impl.TLSConnection
 
read() - Method in class org.omegazero.net.socket.SocketConnection
Reads data received from the peer host on this connection.
read(String) - Static method in class org.omegazero.net.util.PrivateKeyReader
Parses the given PEM-formatted string representing a private key.
read(ByteBuffer) - Method in interface org.omegazero.net.socket.provider.ChannelProvider
Reads data from the underlying java.nio channel into the given buffer.
read(ByteBuffer) - Method in class org.omegazero.net.socket.provider.DatagramChannelProvider
 
read(ByteBuffer) - Method in class org.omegazero.net.socket.provider.SocketChannelProvider
 
readBuf - Variable in class org.omegazero.net.socket.ChannelConnection
 
readBufUnwrapped - Variable in class org.omegazero.net.socket.impl.TLSConnection
 
readCertificatePEM(String) - Static method in class org.omegazero.net.util.SSLUtil
Reads one or more encoded certificates from the given string data and returns the decoded bytes.
readFromSocket() - Method in class org.omegazero.net.socket.ChannelConnection
Reads data into the read buffer using this ChannelConnection's ChannelProvider.
readLock - Variable in class org.omegazero.net.socket.SocketConnection
Lock for read operations.
registerChannel(SelectableChannel, int) - Method in class org.omegazero.net.common.SelectorHandler
See SelectorHandler.registerChannel(SelectableChannel, int, Object).

An invocation of this method of the form
registerChannel(SelectableChannel, int, Object) - Method in class org.omegazero.net.common.SelectorHandler
Registers the given channel with this SelectorHandler's Selector.
rethrowIOException() - Method in exception org.omegazero.net.common.UnhandledException
If this UnhandledException wraps an IOException, this method throws it; otherwise, it does nothing.
run() - Method in interface org.omegazero.net.common.NetworkApplication
Method which implements the Runnable.run() function.

This method is equivalent to NetworkApplication.start(), except that any IOExceptions thrown are wrapped into a RuntimeException.
run() - Method in interface org.omegazero.net.common.ThrowingRunnable
 
runSelectorLoop() - Method in class org.omegazero.net.common.SelectorHandler
Runs the loop that continuously selects channels using the Selector.

Will not return until SelectorHandler.closeSelector() is called.

S

SelectorHandler - Class in org.omegazero.net.common
Wraps a java.nio Selector.

A thread must call SelectorHandler.initSelector() followed by SelectorHandler.runSelectorLoop() to start selecting keys, which can then be handled in the abstract method SelectorHandler.handleSelectedKey(SelectionKey).
SelectorHandler() - Constructor for class org.omegazero.net.common.SelectorHandler
 
selectorKeys() - Method in class org.omegazero.net.common.SelectorHandler
 
selectorWakeup() - Method in class org.omegazero.net.common.SelectorHandler
Wakes up the selector, causing a selection loop iteration.
setAlpnNames(String[]) - Method in class org.omegazero.net.client.params.TLSConnectionParameters
Sets the list of requested application layer protocol names to be negotiated using TLS ALPN (Application Layer Protocol Negotiation).
setApparentRemoteAddress(SocketAddress) - Method in class org.omegazero.net.socket.SocketConnection
Sets a possibly different remote address a client claims to be or act on behalf of.
setAttachment(Object) - Method in class org.omegazero.net.socket.SocketConnection
 
setConnectionCallback(Consumer<SocketConnection>) - Method in interface org.omegazero.net.server.NetServer
Sets the callback for a new incoming request.

The first parameter of this callback is an SocketConnection instance representing the new connection from the client.
setConnectionCallback(Consumer<SocketConnection>) - Method in class org.omegazero.net.server.TCPServer
 
setConnectionCallback(Consumer<SocketConnection>) - Method in class org.omegazero.net.server.UDPServer
 
setIdleTimeout(long) - Method in class org.omegazero.net.server.TCPServer
 
setIdleTimeout(long) - Method in class org.omegazero.net.server.UDPServer
 
setOnClose(ThrowingRunnable) - Method in class org.omegazero.net.socket.SocketConnection
Sets a callback that is called when this connection closes and can no longer receive or send data.
setOnConnect(ThrowingRunnable) - Method in class org.omegazero.net.socket.SocketConnection
Sets a callback that is called when this socket is connected and ready to receive or send data.
setOnData(ThrowingConsumer<byte[]>) - Method in class org.omegazero.net.socket.SocketConnection
Sets a callback that is called when data is received on this connection.
setOnError(Consumer<Throwable>) - Method in class org.omegazero.net.socket.SocketConnection
Sets a callback that is called when an error occurs on this connection.
setOnLocalClose(Consumer<SocketConnection>) - Method in class org.omegazero.net.socket.SocketConnection
 
setOnLocalConnect(Consumer<SocketConnection>) - Method in class org.omegazero.net.socket.SocketConnection
 
setOnTimeout(ThrowingRunnable) - Method in class org.omegazero.net.socket.SocketConnection
Sets a callback that is called when the connect operation started using SocketConnection.connect(int) times out.
setOnWritable(ThrowingRunnable) - Method in class org.omegazero.net.socket.SocketConnection
Sets a callback that is called when this socket is ready for writing after a SocketConnection.write(byte[]) or SocketConnection.connect(int) operation.
setReadBlock(boolean) - Method in class org.omegazero.net.socket.ChannelConnection
 
setReadBlock(boolean) - Method in interface org.omegazero.net.socket.provider.ChannelProvider
If given true, the underlying selection key should stop listening for read ops.
setReadBlock(boolean) - Method in class org.omegazero.net.socket.provider.DatagramChannelProvider
 
setReadBlock(boolean) - Method in class org.omegazero.net.socket.provider.SocketChannelProvider
 
setReadBlock(boolean) - Method in class org.omegazero.net.socket.SocketConnection
Enables or disables read blocking.
setSniOptions(String[]) - Method in class org.omegazero.net.client.params.TLSConnectionParameters
Sets the list of requested server names using TLS SNI (Server Name Indication).
setSupportedApplicationLayerProtocols(String[]) - Method in class org.omegazero.net.server.DTLSServer
Sets the list of supported application layer protocol names to be negotiated using TLS ALPN (Application Layer Protocol Negotiation).
setSupportedApplicationLayerProtocols(String[]) - Method in class org.omegazero.net.server.TLSServer
Sets the list of supported application layer protocol names to be negotiated using TLS ALPN (Application Layer Protocol Negotiation).
SOCKET_ERROR_DEBUG - Static variable in class org.omegazero.net.common.NetCommon
System property org.omegazero.net.socketErrorDebug

Whether the default socket error handler should print socket error messages with log level DEBUG instead of WARN.
SocketChannelProvider - Class in org.omegazero.net.socket.provider
SocketChannelProvider() - Constructor for class org.omegazero.net.socket.provider.SocketChannelProvider
 
SocketConnection - Class in org.omegazero.net.socket
Represents any type of connection between the local and a remote host.
SocketConnection() - Constructor for class org.omegazero.net.socket.SocketConnection
 
SSLUtil - Class in org.omegazero.net.util
Contains utility methods for managing SSL/TLS objects and keys/certificates.
start() - Method in class org.omegazero.net.client.TCPClientManager
 
start() - Method in class org.omegazero.net.client.UDPClientManager
 
start() - Method in interface org.omegazero.net.common.NetworkApplication
Runs the main loop of this instance.
start() - Method in class org.omegazero.net.server.TCPServer
 
start() - Method in class org.omegazero.net.server.UDPServer
 
SyncWorker - Class in org.omegazero.net.util
A Runnable consumer that executes given Runnables synchronously.
SyncWorker() - Constructor for class org.omegazero.net.util.SyncWorker
 

T

TCPClientManager - Class in org.omegazero.net.client
 
TCPClientManager() - Constructor for class org.omegazero.net.client.TCPClientManager
 
TCPClientManager(Consumer<Runnable>) - Constructor for class org.omegazero.net.client.TCPClientManager
 
TCPServer - Class in org.omegazero.net.server
TCP/IP server implementation of a NetServer based on java.nio channels.
TCPServer(Collection<Integer>) - Constructor for class org.omegazero.net.server.TCPServer
 
TCPServer(Collection<InetAddress>, Collection<Integer>, int, Consumer<Runnable>, long) - Constructor for class org.omegazero.net.server.TCPServer
Constructs a new TCPServer instance.

To initialize the server, NetworkApplication.init() of this object must be called.
ThrowingConsumer<T> - Interface in org.omegazero.net.common
 
ThrowingRunnable - Interface in org.omegazero.net.common
 
TLSClientManager - Class in org.omegazero.net.client
 
TLSClientManager() - Constructor for class org.omegazero.net.client.TLSClientManager
 
TLSClientManager(Consumer<Runnable>) - Constructor for class org.omegazero.net.client.TLSClientManager
 
TLSClientManager(Consumer<Runnable>, Collection<X509Certificate>) - Constructor for class org.omegazero.net.client.TLSClientManager
 
TLSClientManager(Consumer<Runnable>, TrustManager[]) - Constructor for class org.omegazero.net.client.TLSClientManager
 
TLSConnection - Class in org.omegazero.net.socket.impl
 
TLSConnection(SelectionKey, ChannelProvider, SocketAddress, SSLContext, boolean, String[], String[]) - Constructor for class org.omegazero.net.socket.impl.TLSConnection
 
TLSConnection(SelectionKey, ChannelProvider, SSLContext, boolean, String[]) - Constructor for class org.omegazero.net.socket.impl.TLSConnection
 
TLSConnectionParameters - Class in org.omegazero.net.client.params
Extended ConnectionParameters for connections encrypted using TLS.
TLSConnectionParameters(SocketAddress) - Constructor for class org.omegazero.net.client.params.TLSConnectionParameters
TLSConnectionParameters(SocketAddress, SocketAddress) - Constructor for class org.omegazero.net.client.params.TLSConnectionParameters
TLSServer - Class in org.omegazero.net.server
TLS server for TCP sockets.
TLSServer(Collection<Integer>, SSLContext) - Constructor for class org.omegazero.net.server.TLSServer
 
TLSServer(Collection<InetAddress>, Collection<Integer>, int, Consumer<Runnable>, long, SSLContext) - Constructor for class org.omegazero.net.server.TLSServer
 
TrustManagerUtil - Class in org.omegazero.net.util
 
TrustManagerUtil() - Constructor for class org.omegazero.net.util.TrustManagerUtil
 

U

UDPClientManager - Class in org.omegazero.net.client
 
UDPClientManager() - Constructor for class org.omegazero.net.client.UDPClientManager
 
UDPClientManager(Consumer<Runnable>) - Constructor for class org.omegazero.net.client.UDPClientManager
 
UDPServer - Class in org.omegazero.net.server
UDP/IP server implementation of a NetServer based on java.nio channels.
UDPServer(Collection<Integer>) - Constructor for class org.omegazero.net.server.UDPServer
 
UDPServer(Collection<InetAddress>, Collection<Integer>, Consumer<Runnable>, long, int) - Constructor for class org.omegazero.net.server.UDPServer
Constructs a new UDPServer instance.

To initialize the server, NetworkApplication.init() of this object must be called.
UnhandledException - Exception in org.omegazero.net.common
Wraps any Throwable in this unchecked exception, accessible using Throwable.getCause().
UnhandledException(Throwable) - Constructor for exception org.omegazero.net.common.UnhandledException
Creates a new UnhandledException with the given Throwable.

V

VERSION - Static variable in class org.omegazero.net.common.NetCommon
The version string of omz-net-lib.

This value is set by the build CI pipeline based on the event that triggered the build.

W

worker - Variable in class org.omegazero.net.client.TCPClientManager
 
worker - Variable in class org.omegazero.net.client.UDPClientManager
 
worker - Variable in class org.omegazero.net.server.TCPServer
 
worker - Variable in class org.omegazero.net.server.UDPServer
 
write(byte[]) - Method in class org.omegazero.net.socket.SocketConnection
Writes data to this connection for delivery to the peer host.
write(byte[], int, int) - Method in class org.omegazero.net.socket.impl.PlainConnection
 
write(byte[], int, int) - Method in class org.omegazero.net.socket.impl.TLSConnection
 
write(byte[], int, int) - Method in class org.omegazero.net.socket.SocketConnection
Writes data to this connection for delivery to the peer host.
write(String) - Method in class org.omegazero.net.socket.SocketConnection
Writes the given string encoded using UTF-8 to this connection for delivery to the peer host.
write(ByteBuffer) - Method in interface org.omegazero.net.socket.provider.ChannelProvider
Writes data from the given buffer to the underlying java.nio channel.
write(ByteBuffer) - Method in class org.omegazero.net.socket.provider.DatagramChannelProvider
 
write(ByteBuffer) - Method in class org.omegazero.net.socket.provider.SocketChannelProvider
 
writeBacklogEnded() - Method in interface org.omegazero.net.socket.provider.ChannelProvider
Called by the ChannelConnection to indicate write backlog has ended.
writeBacklogEnded() - Method in class org.omegazero.net.socket.provider.DatagramChannelProvider
 
writeBacklogEnded() - Method in class org.omegazero.net.socket.provider.SocketChannelProvider
 
writeBacklogStarted() - Method in interface org.omegazero.net.socket.provider.ChannelProvider
Called by the ChannelConnection to indicate write backlog has started because the outgoing socket buffer is full.
writeBacklogStarted() - Method in class org.omegazero.net.socket.provider.DatagramChannelProvider
 
writeBacklogStarted() - Method in class org.omegazero.net.socket.provider.SocketChannelProvider
 
writeBacklogStarted(ChannelConnection) - Method in class org.omegazero.net.server.UDPServer
 
writeBuf - Variable in class org.omegazero.net.socket.ChannelConnection
 
writeBuffered(byte[], int, int, boolean, ByteBuffer, ThrowingRunnable) - Method in class org.omegazero.net.socket.ChannelConnection
 
writeBufUnwrapped - Variable in class org.omegazero.net.socket.impl.TLSConnection
 
writeLock - Variable in class org.omegazero.net.socket.SocketConnection
Lock for write operations.
writeQueue(byte[]) - Method in class org.omegazero.net.socket.SocketConnection
Similar to SocketConnection.write(byte[]), except that no attempt will be made to immediately flush the data to the socket, if supported by the implementation.
writeQueue(byte[], int, int) - Method in class org.omegazero.net.socket.impl.PlainConnection
 
writeQueue(byte[], int, int) - Method in class org.omegazero.net.socket.impl.TLSConnection
 
writeQueue(byte[], int, int) - Method in class org.omegazero.net.socket.SocketConnection
Similar to SocketConnection.write(byte[], int, int), except that no attempt will be made to immediately flush the data to the socket, if supported by the implementation.
writeToSocket() - Method in class org.omegazero.net.socket.ChannelConnection
Writes data from the write buffer using this ChannelConnection's ChannelProvider.
A B C D F G H I L N O P Q R S T U V W 
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form