openlsd.network.server.LSDDemuxingIoHandler Class Reference

Inheritance diagram for openlsd.network.server.LSDDemuxingIoHandler:

Inheritance graph
[legend]
Collaboration diagram for openlsd.network.server.LSDDemuxingIoHandler:

Collaboration graph
[legend]

List of all members.


Detailed Description

Main Class Handler for Server part

Main info for Status returned by calls to network functions:
Bad Legacy : KOBADREQUEST
Bad Document : KOBADREQUEST if first call or KOSYSTEM if second or next call
For all kind of request : BADREQUEST if a bad request is done (bad command or bad index)

Admin:

Author:
Frederic Bregier LGPL

Public Member Functions

void sessionCreated (IoSession session) throws Exception
void sessionClosed (IoSession session) throws Exception
void sessionIdle (IoSession session, IdleStatus arg1) throws Exception

Static Public Member Functions

static void myExceptionCaught (IoSession session, Throwable arg1)
static void write (IoSession session, LSDMsgAnswear lma, boolean last)

Protected Member Functions

boolean isDIHKO ()

Static Protected Member Functions

static void sessionStop (IoSession session)
static void clearLSDSession (IoSession session)
static boolean isSessionStop (IoSession session)
static LSDServerSession createLSDSession (IoSession session, byte commande, boolean unique, long legacy, long storage, long doc, int rankblock)
static LSDLegacy getLegacy (IoSession session, LSDMsgAnswear lma, LSDServerSession ls, long lid)
static LSDDocument getDocumentFromLegacy (IoSession session, LSDMsgAnswear lma, LSDServerSession ls, LSDLegacy legacy, long sid, long did)
static void waitAllSession (IoAcceptor ioAcceptor)
static void sessionWaitAllRequest (IoSession session)
static void DIHSessionWait (LSDDemuxingIoHandler dih)

Protected Attributes

LSDServerInstance LSI = null

Private Member Functions

boolean sessionStart (IoSession session)

Static Private Member Functions

static void cleanCurrentAction (LSDServerSession ls)

Member Function Documentation

boolean openlsd.network.server.LSDDemuxingIoHandler.isDIHKO (  )  [protected]

Returns the status of the associated server (DIH=DemuxingIoHandler)

Returns:
True if the DIH is KO

void openlsd.network.server.LSDDemuxingIoHandler.sessionCreated ( IoSession  session  )  throws Exception

Check if the session is ok with the status of the server. If not, close the session immediately.

See also:
org.apache.mina.common.IoHandlerAdapter.sessionCreated(org.apache.mina.common.IoSession)

static void openlsd.network.server.LSDDemuxingIoHandler.sessionStop ( IoSession  session  )  [static, protected]

Stop the session.

Parameters:
session the session to stop

boolean openlsd.network.server.LSDDemuxingIoHandler.sessionStart ( IoSession  session  )  [private]

Start the session.

Parameters:
session the session to enable start
Returns:
True if the session is correctly created, else False and close the current IoSession.

static void openlsd.network.server.LSDDemuxingIoHandler.clearLSDSession ( IoSession  session  )  [static, protected]

clear the session attribute from IoSession (clear the attribute)

Parameters:
session the session to clear

static boolean openlsd.network.server.LSDDemuxingIoHandler.isSessionStop ( IoSession  session  )  [static, protected]

Return the status of the current session

Parameters:
session the session to test
Returns:
True if not closed, else False

static LSDServerSession openlsd.network.server.LSDDemuxingIoHandler.createLSDSession ( IoSession  session,
byte  commande,
boolean  unique,
long  legacy,
long  storage,
long  doc,
int  rankblock 
) [static, protected]

Create or retreave the session attribute according to the args.

If rankblock = 1, it creates a new session attribute, clearing the previous one if existing.

If rankblock > 1, it waits that the session attribute is created and get the previous value, without using any value from args, except if status = -1, it returns null. The rankblock is only set if = 1.

Parameters:
session the session to get new LSD session
commande the command to associate with the session
unique Is this session using a unique commande call (closing immediately after)
legacy Which legacy to access
storage Which storage to access in the legacy
doc Which document in the storage
rankblock is the rank of the current block (send or receive)
Returns:
the LSDServerSession created or get from previous

void openlsd.network.server.LSDDemuxingIoHandler.sessionClosed ( IoSession  session  )  throws Exception

Close the session and clear the attribute.

See also:
org.apache.mina.common.IoHandlerAdapter.sessionClosed(org.apache.mina.common.IoSession)

static void openlsd.network.server.LSDDemuxingIoHandler.cleanCurrentAction ( LSDServerSession  ls  )  [static, private]

Clean the current action corresponding to the ServerSession

Parameters:
ls 

void openlsd.network.server.LSDDemuxingIoHandler.sessionIdle ( IoSession  session,
IdleStatus  arg1 
) throws Exception

Close the session and, if there is an attribute, release the lock of the attribute for all blocks.

See also:
org.apache.mina.common.IoHandlerAdapter.sessionIdle(org.apache.mina.common.IoSession, org.apache.mina.common.IdleStatus)

static void openlsd.network.server.LSDDemuxingIoHandler.myExceptionCaught ( IoSession  session,
Throwable  arg1 
) [static]

Close the session and, if there is an attribute, release the lock of the attribute for all blocks.

Parameters:
session 
arg1 
See also:
org.apache.mina.common.IoHandlerAdapter.exceptionCaught(org.apache.mina.common.IoSession, java.lang.Throwable)

static void openlsd.network.server.LSDDemuxingIoHandler.write ( IoSession  session,
LSDMsgAnswear  lma,
boolean  last 
) [static]

Function to encapsulate send operation and if this is the last message, finished the session, even closed the session if the profile is one action by session

Parameters:
session the session used to write
lma the answear object to write
last set if this message is the last one (join is implied if true)

static LSDLegacy openlsd.network.server.LSDDemuxingIoHandler.getLegacy ( IoSession  session,
LSDMsgAnswear  lma,
LSDServerSession  ls,
long  lid 
) [static, protected]

Return the associated Legacy according to lid, or if not found, send an error message using preallocated LSDMsgAnswear and setting the LSDServerSession.

Parameters:
session the associated session
lma the preallocated answear message
ls is the associated session
lid is the Legacy id
Returns:
the requested LSDDbLegacy or null if an error occurs

static LSDDocument openlsd.network.server.LSDDemuxingIoHandler.getDocumentFromLegacy ( IoSession  session,
LSDMsgAnswear  lma,
LSDServerSession  ls,
LSDLegacy  legacy,
long  sid,
long  did 
) [static, protected]

Return the associated Document according to Legacy / sid/did, or if not found, send an error message using preallocated LSDMsgAnswear and setting the LSDServerSession.

Parameters:
session is the associated session
lma the preallocated answear message
ls the session object
legacy the legacy object
sid the Storage id
did the Document id
Returns:
the requested LSDDocument or null if an error occurs

static void openlsd.network.server.LSDDemuxingIoHandler.waitAllSession ( IoAcceptor  ioAcceptor  )  [static, protected]

Wait for one IoAcceptor that all request will end

Parameters:
ioAcceptor 

static void openlsd.network.server.LSDDemuxingIoHandler.sessionWaitAllRequest ( IoSession  session  )  [static, protected]

Wait that all pending requests from the session are done.

Parameters:
session 

static void openlsd.network.server.LSDDemuxingIoHandler.DIHSessionWait ( LSDDemuxingIoHandler  dih  )  [static, protected]

Wait all session associated with one DemuxIoHanler to finished

Parameters:
dih 


Member Data Documentation

Reference to the corresponding Server Instance


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