openlsd.network.client.common
Class LSDClientSession

java.lang.Object
  extended by openlsd.network.common.message.LSDMinimalSession
      extended by openlsd.network.client.common.LSDClientSession

public class LSDClientSession
extends LSDMinimalSession

Class for the session stored in server and client context.

Author:
Frederic Bregier LGPL

Field Summary
 byte[] bytesfile
          Data part
 LSDClientCommon lcc
          Associated Common Client object
 com.twmacinta.util.MD5 md5
          MD5 data
 
Fields inherited from class openlsd.network.common.message.LSDMinimalSession
commande, doc, fileblocksize, filesize, isClosed, legacy, object, rankblock, running, session, status, storage, unique
 
Constructor Summary
LSDClientSession(org.apache.mina.common.IoSession session)
          Create a LSDClientSession as empty session with the session
LSDClientSession(org.apache.mina.common.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
 
Method Summary
static LSDClientSession assign(LSDClientSession ls, org.apache.mina.common.IoSession session, byte commande, boolean unique, long legacy, long storage, long doc, byte status, int fileblocksize, int rankblock)
          Set a new session from previous alloacted object from params if object already exists, else same as new LSDClientSession(...)
 boolean sessionStart()
          Change the LSDSession in Ready state and Start the session
 void sessionStop()
          Stop the session (override for poolConnection property)
 
Methods inherited from class openlsd.network.common.message.LSDMinimalSession
clear, clearObject, endedAllBlocks, endNewBlock, getObject, isClosed, isRunning, sessionFinished, setObject, toString, waitForAllBlocks
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

bytesfile

public byte[] bytesfile
Data part


lcc

public LSDClientCommon lcc
Associated Common Client object


md5

public com.twmacinta.util.MD5 md5
MD5 data

Constructor Detail

LSDClientSession

public LSDClientSession(org.apache.mina.common.IoSession session)
Create a LSDClientSession as empty session with the session

Parameters:
session -

LSDClientSession

public LSDClientSession(org.apache.mina.common.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
Method Detail

sessionStart

public boolean sessionStart()
Change the LSDSession in Ready state and Start the session

Overrides:
sessionStart in class LSDMinimalSession
Returns:
True if OK, else False

sessionStop

public void sessionStop()
Stop the session (override for poolConnection property)

Overrides:
sessionStop in class LSDMinimalSession

assign

public static LSDClientSession assign(LSDClientSession ls,
                                      org.apache.mina.common.IoSession session,
                                      byte commande,
                                      boolean unique,
                                      long legacy,
                                      long storage,
                                      long doc,
                                      byte status,
                                      int fileblocksize,
                                      int rankblock)
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.