openlsd.network.client.common.LSDClientSession Class Reference

Inheritance diagram for openlsd.network.client.common.LSDClientSession:

Inheritance graph
[legend]
Collaboration diagram for openlsd.network.client.common.LSDClientSession:

Collaboration graph
[legend]

List of all members.


Detailed Description

Class for the session stored in server and client context.

Author:
Frederic Bregier LGPL

Public Member Functions

 LSDClientSession (IoSession session)
 LSDClientSession (IoSession session, byte commande, boolean unique, long legacy, long storage, long doc, byte status, int fileblocksize, int rankblock)
boolean sessionStart ()
void sessionStop ()
boolean isClosed ()
void sessionFinished ()
boolean isRunning ()
void endNewBlock ()
void waitForAllBlocks ()
void endedAllBlocks ()
void setObject (Object object)
Object getObject ()
Object clearObject ()
String toString ()
void clear ()

Static Public Member Functions

static LSDClientSession assign (LSDClientSession ls, IoSession session, byte commande, boolean unique, long legacy, long storage, long doc, byte status, int fileblocksize, int rankblock)

Public Attributes

byte[] bytesfile = null
LSDClientCommon lcc = null
MD5 md5 = null
IoSession session = null
byte commande = LSDConstants.LSD_NULL
boolean unique = true
long legacy = LSDConstants.invalide_idx
long storage = LSDConstants.invalide_idx
long doc = LSDConstants.invalide_idx
byte status = LSDConstants.LSD_MSG_KOSYSTEM
int fileblocksize = -1
int rankblock = -1
long filesize = -1
Object object = null
boolean running = false
boolean isClosed = true

Constructor & Destructor Documentation

openlsd.network.client.common.LSDClientSession.LSDClientSession ( IoSession  session  ) 

Create a LSDClientSession as empty session with the session

Parameters:
session 

openlsd.network.client.common.LSDClientSession.LSDClientSession ( IoSession  session,
byte  commande,
boolean  unique,
long  legacy,
long  storage,
long  doc,
byte  status,
int  fileblocksize,
int  rankblock 
)

Create a LSDClientSession from args but not make it running

Parameters:
session the IoSession associated
commande the commande
unique set if this commande close the session at the end or not
legacy the lid
storage the sid
doc the did
status the current status
fileblocksize the fileblock size
rankblock the rank of the current block


Member Function Documentation

boolean openlsd.network.client.common.LSDClientSession.sessionStart (  ) 

Change the LSDSession in Ready state and Start the session

Returns:
True if OK, else False

Reimplemented from openlsd.network.common.message.LSDMinimalSession.

void openlsd.network.client.common.LSDClientSession.sessionStop (  ) 

Stop the session (override for poolConnection property)

Reimplemented from openlsd.network.common.message.LSDMinimalSession.

static LSDClientSession openlsd.network.client.common.LSDClientSession.assign ( LSDClientSession  ls,
IoSession  session,
byte  commande,
boolean  unique,
long  legacy,
long  storage,
long  doc,
byte  status,
int  fileblocksize,
int  rankblock 
) [static]

Set a new session from previous alloacted object from params if object already exists, else same as new LSDClientSession(...) except that it starts the session (sessionStart) if it is possible, if not it stops the session (sessionStop).

Parameters:
ls 
session 
commande 
unique 
legacy 
storage 
doc 
status 
fileblocksize 
rankblock 
Returns:
the same object reinitialized or a new one if ls was null or null if the session is closed.

Returns True if the session is closed

Returns:
if the session is closed

Reimplemented in openlsd.network.server.LSDServerSession.

void openlsd.network.common.message.LSDMinimalSession.sessionFinished (  )  [inherited]

Stop the current session without closing the connection

boolean openlsd.network.common.message.LSDMinimalSession.isRunning (  )  [inherited]

Returns the status of the current session

Returns:
if the session is still running

void openlsd.network.common.message.LSDMinimalSession.endNewBlock (  )  [inherited]

End the current block, and allow the next block to continue

void openlsd.network.common.message.LSDMinimalSession.waitForAllBlocks (  )  [inherited]

Wait that all blocks are done, so the message is completely received or sent

void openlsd.network.common.message.LSDMinimalSession.endedAllBlocks (  )  [inherited]

Release the lock, all blocks are considering received or sent.

void openlsd.network.common.message.LSDMinimalSession.setObject ( Object  object  )  [inherited]

Replace the object or New object for the session

Parameters:
object 

Object openlsd.network.common.message.LSDMinimalSession.getObject (  )  [inherited]

Get the object from the session

Returns:
the object

Object openlsd.network.common.message.LSDMinimalSession.clearObject (  )  [inherited]

clear the object from the session and return the object before clear.

Returns:
the object

String openlsd.network.common.message.LSDMinimalSession.toString (  )  [inherited]

See also:
java.lang.Object.toString()

Reimplemented in openlsd.network.server.LSDServerSession.

void openlsd.network.common.message.LSDMinimalSession.clear (  )  [inherited]

Clear the session and make it not running but do not eraze session information neither close the session. This function make ready the object for a new action.

Reimplemented in openlsd.network.server.LSDServerSession.


Member Data Documentation

Data part

Associated Common Client object

MD5 data

IoSession attached with this session object

The corresponding command

Is this command in a "uniq" mode, that is to say when the command is over, so as the socket session. If false, the socket session is not closed.

The Legacy

The Storage

The Document

The Status of the command

The block size for the file

The block rank for the file

The global file size

Data part of the session: object

For ending and ordering of received: is this session running (first to change when finishing). Allows to do some stuff between the beginning of closing and the end (was for the Mina bug that allowed two thread for the same socket to run on two different message at the same time).

For ending and ordering of received: is this session closed (last to change when finishing)


The documentation for this class was generated from the following file: