Ila

org.topoweb.ila.server
Class IlaSession

java.lang.Object
  |
  +--org.topoweb.net.server.PlainSession
        |
        +--org.topoweb.ila.server.IlaSession
All Implemented Interfaces:
org.topoweb.net.server.Session

public class IlaSession
extends org.topoweb.net.server.PlainSession

Encapsulates conversational state in an Ila server.

Author:
Babak Farhang

Constructor Summary
protected IlaSession()
           
  IlaSession(java.nio.channels.SocketChannel channel)
          Creates a new instance with the specified channel.
 
Method Summary
protected  void clear()
          Clears the fields of this instance.
 java.io.OutputStream getOutputStream()
          Returns an in-memory java.io.OutputStream that backs the ByteBuffers returned by this instance.
 java.lang.String getTxnId()
          Returns the transaction ID.
 java.nio.ByteBuffer[] getWriteBuffers()
          Returns the "write buffers".
 boolean isAuthenticated()
          Returns the "authenticated" property.
 void setAuthenticated(boolean auth)
          Sets the "authenticated" property.
 void setTxnId(java.lang.String tid)
          Sets the transaction ID.
 
Methods inherited from class org.topoweb.net.server.PlainSession
appendReadBuffer, getFactory, getReadAmount, getReadArray, getSocketChannel, setSocketChannel, setWriteBuffers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlaSession

protected IlaSession()

IlaSession

public IlaSession(java.nio.channels.SocketChannel channel)
Creates a new instance with the specified channel.

Parameters:
channel - the socket channel
Method Detail

setTxnId

public void setTxnId(java.lang.String tid)
Sets the transaction ID.

Parameters:
tid - the transaction ID
See Also:
getTxnId()

getTxnId

public java.lang.String getTxnId()
Returns the transaction ID.

Returns:
the transaction ID, or null, if not set
See Also:
setTxnId(String)

setAuthenticated

public void setAuthenticated(boolean auth)
Sets the "authenticated" property.

Parameters:
auth - true, if authenticated; false, o.w.

isAuthenticated

public boolean isAuthenticated()
Returns the "authenticated" property.

See Also:
setAuthenticated(boolean)

getOutputStream

public java.io.OutputStream getOutputStream()
Returns an in-memory java.io.OutputStream that backs the ByteBuffers returned by this instance.

Returns:
an in-memory output stream
See Also:
getWriteBuffers()

getWriteBuffers

public java.nio.ByteBuffer[] getWriteBuffers()
Returns the "write buffers". This class returns an array of length 1 containing a ByteBuffer backed by an in-memory output stream.

Specified by:
getWriteBuffers in interface org.topoweb.net.server.Session
Overrides:
getWriteBuffers in class org.topoweb.net.server.PlainSession
Returns:
the write buffers
See Also:
getOutputStream()

clear

protected void clear()
Clears the fields of this instance.

Overrides:
clear in class org.topoweb.net.server.PlainSession

Ila

Copyright (C) 2002 Babak Farhang

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.