org.siebengeisslein.net
Class ConnectionState

java.lang.Object
  extended by org.siebengeisslein.util.HasLog
      extended by org.siebengeisslein.net.ConnectionState

public class ConnectionState
extends HasLog


Field Summary
static int STATE_CLOSED
           
static int STATE_CONNECTED
           
static int STATE_INITIAL
           
static int STATE_INITIALIZED
           
 
Constructor Summary
protected ConnectionState()
          Needed for TestCases.
  ConnectionState(java.nio.channels.SelectionKey key, Server server, MessageDispatcher dispatcher, Authenticator authenticator, java.nio.channels.SocketChannel channel)
           
 
Method Summary
 void addConfirmation(int requestId)
           
 void close()
           
 void close(java.lang.Exception e)
           
 RemoteTransaction createTransaction()
           
 void dispatcherFinished()
           
 LocalConnection getConnection()
           
 java.io.DataInputStream getInput()
           
 int getState()
           
 Transaction getTransaction(RemoteTransaction t)
           
 void init(java.lang.String version, java.lang.String protocol)
           
 void login(java.lang.String username, java.lang.String password)
           
 void removeTransaction(RemoteTransaction transaction)
           
 void sendMessage(Message message)
           
 void write(byte[] data)
           
 
Methods inherited from class org.siebengeisslein.util.HasLog
getLog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATE_INITIAL

public static final int STATE_INITIAL
See Also:
Constant Field Values

STATE_INITIALIZED

public static final int STATE_INITIALIZED
See Also:
Constant Field Values

STATE_CONNECTED

public static final int STATE_CONNECTED
See Also:
Constant Field Values

STATE_CLOSED

public static final int STATE_CLOSED
See Also:
Constant Field Values
Constructor Detail

ConnectionState

protected ConnectionState()
Needed for TestCases.


ConnectionState

public ConnectionState(java.nio.channels.SelectionKey key,
                       Server server,
                       MessageDispatcher dispatcher,
                       Authenticator authenticator,
                       java.nio.channels.SocketChannel channel)
                throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getInput

public java.io.DataInputStream getInput()

getState

public int getState()

init

public void init(java.lang.String version,
                 java.lang.String protocol)

login

public void login(java.lang.String username,
                  java.lang.String password)
           throws java.io.IOException,
                  CoreException
Throws:
java.io.IOException
CoreException

addConfirmation

public void addConfirmation(int requestId)

getTransaction

public Transaction getTransaction(RemoteTransaction t)

createTransaction

public RemoteTransaction createTransaction()
                                    throws java.io.IOException,
                                           CoreException
Throws:
java.io.IOException
CoreException

getConnection

public LocalConnection getConnection()

sendMessage

public void sendMessage(Message message)

write

public void write(byte[] data)
           throws java.io.IOException
Throws:
java.io.IOException

dispatcherFinished

public void dispatcherFinished()

close

public void close()

close

public void close(java.lang.Exception e)

removeTransaction

public void removeTransaction(RemoteTransaction transaction)