A C D E G I L M N O P Q R S T V W Z

A

acceptConnection(InetSocketAddress) - Method in interface naga.ConnectionAcceptor
Return true if the connection should be accepted, false otherwise.
acceptFailed(IOException) - Method in interface naga.ServerSocketObserver
Called by the NIOService on the NIO thread when an accept fails on the socket.
acceptFailed(IOException) - Method in class naga.ServerSocketObserverAdapter
 
ALLOW - Static variable in interface naga.ConnectionAcceptor
A connection acceptor that accepts all connections.
AsciiLinePacketReader - Class in naga.packetreader
Reads a bytestream delimited by '\n'.
AsciiLinePacketReader() - Constructor for class naga.packetreader.AsciiLinePacketReader
Creates a '\n' delimited reader with default min buffer size and unlimited max buffer size.
AsciiLinePacketReader(int, int) - Constructor for class naga.packetreader.AsciiLinePacketReader
Creates a '\n' delimited reader with the given max line length and read buffer size.
AsciiLinePacketReader(int) - Constructor for class naga.packetreader.AsciiLinePacketReader
Creates a '\n' delimited reader with the given max line length and default read buffer size.
asyncExecute(Runnable) - Method in class naga.eventmachine.EventMachine
Execute a runnable on the Event/NIO thread.

C

cancel() - Method in interface naga.eventmachine.DelayedEvent
Cancels this delayed event.
cancelKeySilently(SelectionKey) - Static method in class naga.NIOUtils
Silently cancel a key.
close() - Method in interface naga.NIOAbstractSocket
Closes this socket (the actual disconnect will occur on the NIOService thread)
close() - Method in class naga.NIOService
Close the entire service.
closeAfterWrite() - Method in interface naga.NIOSocket
Causes the socket to close after writing the current entries in the queue (consequent entries will be thrown away).
closeChannelSilently(Channel) - Static method in class naga.NIOUtils
Silently close a channel.
closeKeyAndChannelSilently(SelectionKey, Channel) - Static method in class naga.NIOUtils
Silently close both a key and a channel.
ConnectionAcceptor - Interface in naga
The ConnectionAcceptor is used by the NIOServerSocket to determine if a connection should be accepted or refused.
connectionBroken(NIOSocket, Exception) - Method in interface naga.SocketObserver
Called by the NIOService on the NIO thread when a connection is disconnected.
connectionBroken(NIOSocket, Exception) - Method in class naga.SocketObserverAdapter
 
connectionOpened(NIOSocket) - Method in interface naga.SocketObserver
Called by the NIOService on the NIO thread when a connection completes on a socket.
connectionOpened(NIOSocket) - Method in class naga.SocketObserverAdapter
 

D

DEFAULT - Static variable in interface naga.eventmachine.ExceptionObserver
 
DEFAULT_BUFFER_SIZE - Static variable in class naga.packetreader.RawPacketReader
 
DEFAULT_READ_BUFFER_SIZE - Static variable in class naga.packetreader.DelimiterPacketReader
 
DelayedEvent - Interface in naga.eventmachine
A cancellable, delayed event posted to the event service.
DelimiterPacketReader - Class in naga.packetreader
Class to read a byte stream delimited by a byte marking the end of a packet.
DelimiterPacketReader(byte) - Constructor for class naga.packetreader.DelimiterPacketReader
Create a new reader with the default min buffer size and unlimited max buffer size.
DelimiterPacketReader(byte, int, int) - Constructor for class naga.packetreader.DelimiterPacketReader
Create a new reader with the given min and max buffer size delimited by the given byte.
DENY - Static variable in interface naga.ConnectionAcceptor
A connection acceptor that refuses all connections.

E

EchoServer - Class in naga.examples
Creates a very simple echo server.
EventMachine - Class in naga.eventmachine
EventMachine is a simple event service for driving asynchronous and delayed tasks together with the a Naga NIOService.
EventMachine() - Constructor for class naga.eventmachine.EventMachine
Creates a new EventMachine with an embedded NIOService.
ExceptionObserver - Interface in naga.eventmachine
Implemented by observers of event exceptions.
executeAt(Runnable, Date) - Method in class naga.eventmachine.EventMachine
Execute a runnable on the Event/NIO thread after at a certain time.
executeLater(Runnable, long) - Method in class naga.eventmachine.EventMachine
Execute a runnable on the Event/NIO thread after a delay.

G

getAddress() - Method in interface naga.NIOAbstractSocket
Returns the InetSocketAddress for this socket.
getBuffer() - Method in class naga.packetreader.DelimiterPacketReader
Return the currently used byte buffer.
getBuffer() - Method in interface naga.PacketReader
Return the currently used byte buffer.
getBuffer() - Method in class naga.packetreader.RawPacketReader
 
getBuffer() - Method in class naga.packetreader.RegularPacketReader
Return the next buffer to use.
getBuffer() - Method in interface naga.PacketWriter
The current byte buffer to write to the socket.
getBuffer() - Method in class naga.packetwriter.RawPacketWriter
 
getBuffer() - Method in class naga.packetwriter.RegularPacketWriter
 
getByteBufferFromPacketSize(int, int, boolean) - Static method in class naga.NIOUtils
Creates a byte buffer with a given length with an encoded value, in either big or little endian encoding (i.e.
getBytesRead() - Method in interface naga.NIOSocket
Return the total number of bytes read on this socket since it was opened.
getBytesWritten() - Method in interface naga.NIOSocket
Return the total number of bytes written on this socket since it was opened.
getCall() - Method in interface naga.eventmachine.DelayedEvent
Returns the actual Runnable to be executed when this event runs.
getIp() - Method in interface naga.NIOAbstractSocket
Reports the IP used by this socket.
getMaxPacketSize() - Method in class naga.packetreader.DelimiterPacketReader
Get the current maximum buffer size.
getMaxQueueSize() - Method in interface naga.NIOSocket
The current maximum queue size in bytes.
getNextPacket() - Method in class naga.packetreader.DelimiterPacketReader
 
getNextPacket() - Method in interface naga.PacketReader
Return the next packet constructed from the data read in the buffers.
getNextPacket() - Method in class naga.packetreader.RawPacketReader
 
getNextPacket() - Method in class naga.packetreader.RegularPacketReader
Return the next packet or null if no complete packet can be constructed.
getNIOService() - Method in class naga.eventmachine.EventMachine
Returns the NIOService used by this event service.
getObserver() - Method in class naga.eventmachine.EventMachine
The current ExceptionObserver used by this service.
getPacketSizeFromByteBuffer(ByteBuffer, boolean) - Static method in class naga.NIOUtils
Converts a value in a header buffer encoded in either big or little endian encoding.
getPort() - Method in interface naga.NIOAbstractSocket
Returns the port in use by this socket.
getQueue() - Method in class naga.eventmachine.EventMachine
Return the current event service queue.
getQueue() - Method in class naga.NIOService
Returns a copy of the internal event queue.
getQueueSize() - Method in class naga.eventmachine.EventMachine
Return the current queue size.
getTime() - Method in interface naga.eventmachine.DelayedEvent
Returns the time when this event will execute.
getTimeOpen() - Method in interface naga.NIOSocket
Return the time this socket has been open.
getTotalAcceptedConnections() - Method in interface naga.NIOServerSocket
Returns the total number of accepted connections on this socket since it opened.
getTotalConnections() - Method in interface naga.NIOServerSocket
Returns the total number of connections made on this socket since it opened.
getTotalFailedConnections() - Method in interface naga.NIOServerSocket
Returns the total number of failed connections on this socket since it opened.
getTotalRefusedConnections() - Method in interface naga.NIOServerSocket
Returns the total number of refused connections on this socket since it opened.
getWriteQueueSize() - Method in interface naga.NIOSocket
This method returns the number of bytes queued for dispatch.

I

isEmpty() - Method in interface naga.PacketWriter
Determines if the packet writer has more data to write.
isEmpty() - Method in class naga.packetwriter.RawPacketWriter
 
isEmpty() - Method in class naga.packetwriter.RegularPacketWriter
 
isOpen() - Method in interface naga.NIOAbstractSocket
Returns the current state of this socket.
isOpen() - Method in class naga.NIOService
Determine if this service is open.

L

listen(ServerSocketObserver) - Method in interface naga.NIOServerSocket
Associates a server socket observer with this server socket and starts accepting connections.
listen(SocketObserver) - Method in interface naga.NIOSocket
Opens the socket for reads.

M

main(String...) - Static method in class naga.examples.EchoServer
Runs the echo server.
main(String...) - Static method in class naga.examples.Rot13Server
Runs the rot13 server.
main(String...) - Static method in class naga.examples.ValidationClient
Make a login request to the server.
main(String...) - Static method in class naga.examples.ValidationServer
 

N

naga - package naga
The main Naga classes.
naga.eventmachine - package naga.eventmachine
An optional simple service for driving asynchronous and delayed tasks integrated with the Naga NIOService.
naga.examples - package naga.examples
Various examples on how to use Naga.
naga.exception - package naga.exception
Exceptions used by Naga.
naga.packetreader - package naga.packetreader
Package containing various ready-to-use PacketReader implementations.
naga.packetwriter - package naga.packetwriter
Package containing various ready-to-use PacketWriter implementations.
newConnection(NIOSocket) - Method in interface naga.ServerSocketObserver
Called by the NIOService on the NIO thread when a new connection has been accepted by the socket.
newConnection(NIOSocket) - Method in class naga.ServerSocketObserverAdapter
 
NIOAbstractSocket - Interface in naga
An interface describing methods common to both NIOSocket and NIOServerSocket.
NIOServerSocket - Interface in naga
Interface for the NIOServerSocket, which is an asynchronous facade to an underlying ServerSocket.
NIOService - Class in naga
This class forms the basis of the NIO handling in Naga.
NIOService() - Constructor for class naga.NIOService
Create a new nio service.
NIOSocket - Interface in naga
Interface for the NIOSocket, which is an asynchronous facade to an underlying Socket.
NIOUtils - Class in naga
A collection of utilites used by various classes.
notifyExceptionThrown(Throwable) - Method in interface naga.eventmachine.ExceptionObserver
Notify the observer that an exception has been thrown.
NULL - Static variable in interface naga.SocketObserver
A null object used as the default observer

O

openServerSocket(int, int) - Method in class naga.NIOService
Open a server socket on the given port.
openServerSocket(int) - Method in class naga.NIOService
Open a server socket on the given port with the default connection backlog.
openServerSocket(InetSocketAddress, int) - Method in class naga.NIOService
Open a server socket on the address.
openSocket(String, int) - Method in class naga.NIOService
Open a normal socket to the host on the given port returning a NIOSocket.
openSocket(InetAddress, int) - Method in class naga.NIOService
Open a normal socket to the host on the given port returning a NIOSocket.

P

PacketReader - Interface in naga
Interface for packet reader plugins to assist a socket in reading.
packetReceived(NIOSocket, byte[]) - Method in interface naga.SocketObserver
Called by the NIOService on the NIO thread when a packet is finished reading.
packetReceived(NIOSocket, byte[]) - Method in class naga.SocketObserverAdapter
 
PacketWriter - Interface in naga
Interface for classes implementing packet writing strategies.
ProtocolViolationException - Exception in naga.exception
Throw an exception due to unexpected data when reading packets.
ProtocolViolationException(String) - Constructor for exception naga.exception.ProtocolViolationException
Create a new exception.

Q

queue(Runnable) - Method in class naga.NIOService
Queues an event on the NIOService queue.

R

RawPacketReader - Class in naga.packetreader
This packet reader reads as many bytes as possible from the stream and then bundles those bytes into a packet.
RawPacketReader(int) - Constructor for class naga.packetreader.RawPacketReader
Create a new reader instance.
RawPacketReader() - Constructor for class naga.packetreader.RawPacketReader
Create a new reader instance with the default buffer size.
RawPacketWriter - Class in naga.packetwriter
Writes a byte packet to the stream without doing any changes to it.
RawPacketWriter() - Constructor for class naga.packetwriter.RawPacketWriter
Creates a new writer.
RegularPacketReader - Class in naga.packetreader
Reads packet of the format
RegularPacketReader(int, boolean) - Constructor for class naga.packetreader.RegularPacketReader
Creates a regular packet reader with the given header size.
RegularPacketWriter - Class in naga.packetwriter
Writes packet of the format
RegularPacketWriter(int, boolean) - Constructor for class naga.packetwriter.RegularPacketWriter
Creates a regular packet writer with the given header size.
Rot13Server - Class in naga.examples
Creates a Rot13Server that takes a line of text and returns the Rot13 version of the text.

S

selectBlocking() - Method in class naga.NIOService
Run all waiting NIO requests, blocking indefinitely until at least one request is handled.
selectBlocking(long) - Method in class naga.NIOService
Run all waiting NIO requests, blocking until at least one request is found, or the method has blocked for the time given by the timeout value, whatever comes first.
selectNonBlocking() - Method in class naga.NIOService
Run all waiting NIO requests, returning immediately if no requests are found.
serverSocketDied(Exception) - Method in interface naga.ServerSocketObserver
Called by the NIOService on the NIO thread when the server socket is closed.
serverSocketDied(Exception) - Method in class naga.ServerSocketObserverAdapter
 
ServerSocketObserver - Interface in naga
Implemented by an observer to a server socket.
ServerSocketObserverAdapter - Class in naga
Class with null-implementations for all callbacks.
ServerSocketObserverAdapter() - Constructor for class naga.ServerSocketObserverAdapter
 
setConnectionAcceptor(ConnectionAcceptor) - Method in interface naga.NIOServerSocket
Sets the connection acceptor for this server socket.
setMaxPacketSize(int) - Method in class naga.packetreader.DelimiterPacketReader
Set the new maximum packet size.
setMaxQueueSize(int) - Method in interface naga.NIOSocket
Sets the maximum number of bytes allowed in the queue for this socket.
setObserver(ExceptionObserver) - Method in class naga.eventmachine.EventMachine
Sets the ExceptionObserver for this service.
setPacket(byte[]) - Method in class naga.packetwriter.RawPacketWriter
 
setPacket(byte[]) - Method in class naga.packetwriter.RegularPacketWriter
 
setPacket(byte[]) - Method in interface naga.PacketWriter
Set the next packet to write.
setPacketReader(PacketReader) - Method in interface naga.NIOSocket
Sets the packet reader for this socket.
setPacketWriter(PacketWriter) - Method in interface naga.NIOSocket
Sets the packet writer for this socket.
socket() - Method in interface naga.NIOServerSocket
Allows access to the underlying server socket.
socket() - Method in interface naga.NIOSocket
Allows access to the underlying socket.
SocketObserver - Interface in naga
This interface contains the callbacks used by a NIOSocket to inform its observer of events.
SocketObserverAdapter - Class in naga
Class with null-implementation of all SocketObserver callbacks.
SocketObserverAdapter() - Constructor for class naga.SocketObserverAdapter
 
start() - Method in class naga.eventmachine.EventMachine
Causes the event machine to start running on a separate thread together with the NIOService.
stop() - Method in class naga.eventmachine.EventMachine
Stops the event machine thread.

T

timeOfNextEvent() - Method in class naga.eventmachine.EventMachine
Returns the time when the next scheduled event will execute.

V

ValidationClient - Class in naga.examples
A client for exercising the validation server.
ValidationServer - Class in naga.examples
An example validation server to validate logins.

W

wakeup() - Method in class naga.NIOService
Runs wakeup on the selector, causing any blocking select to be released.
write(byte[]) - Method in interface naga.NIOSocket
Write a packet of bytes asynchronously on this socket.

Z

ZeroDelimitedPacketReader - Class in naga.packetreader
Reads a bytestream delimited by 0.
ZeroDelimitedPacketReader() - Constructor for class naga.packetreader.ZeroDelimitedPacketReader
Creates zero delimited reader with a default read buffer and unlimited max packet size.
ZeroDelimitedPacketReader(int, int) - Constructor for class naga.packetreader.ZeroDelimitedPacketReader
Creates a zero delimited reader with the given max packet size and read buffer size.
ZeroDelimitedPacketReader(int) - Constructor for class naga.packetreader.ZeroDelimitedPacketReader
Creates a zero delimited reader with the given max packet size and the default read buffer size.

A C D E G I L M N O P Q R S T V W Z