openlsd.network.client.info
Class LSDClientInfo

java.lang.Object
  extended by openlsd.network.client.common.LSDClientCommon
      extended by openlsd.network.client.info.LSDClientInfo
Direct Known Subclasses:
LSDExtClientInfo, LSDPoolClientInfo

public class LSDClientInfo
extends LSDClientCommon

Class LSDClientInfo is the class that defines function to offer service to client part for Info.

Author:
Frederic Bregier LGPL

Field Summary
 java.lang.String md5
          MD5 Data
 long size
          Size of the file
 
Fields inherited from class openlsd.network.client.common.LSDClientCommon
clientCompressed, connector, executorChainService, hostname, idip, ls, lscsh, poolConnection, serverCompressed, serverPort, session
 
Constructor Summary
LSDClientInfo(LSDClientInfoSessionHandler lscshext, java.lang.String Hostname, int ServerPort, boolean ServerCompressed, boolean ClientCompressed, boolean immediate, boolean keepalived)
          Create a new ClientInfo using a specific SessionHandler that extends the LSDClientInfoSessionHandler class and a specific Hostname and serverPort and the properties of compression for server and client part.
LSDClientInfo(java.lang.String Hostname, int ServerPort, boolean immediate, boolean keepalived)
          Create a new ClientInfo using a specific Hostname and serverPort.
LSDClientInfo(java.lang.String Hostname, int ServerPort, boolean ServerCompressed, boolean ClientCompressed, boolean immediate, boolean keepalived)
          Create a new ClientInfo using a specific Hostname and serverPort and the properties of compression for server and client part.
 
Method Summary
protected  LSDClientCommonSessionHandler createSessionHandler()
          Create a SessionHandler.
 int getAExist(boolean unique, java.lang.String aexist, LSDAdminAndVector adm_vect)
          Get the status of files from DB (lid,sid,did) in lsd.
 int getAExistMD5(boolean unique, java.lang.String aexist, LSDAdminAndVector adm_vect)
          Get the status of files from DB (lid,sid,did,md5) in lsd.
 boolean getExist(boolean unique, long legacy, long storage, long document, java.lang.String md5b)
          Ask to get the existence of the file identified by the triple legacy, storage and document, and return true if it exists, no if not or if an error occurs.
 java.lang.String getInPath(boolean unique, long legacy, long storage, long document)
          Ask to get a copy of the file identified by the triple legacy, storage and document, and return the path if it exists, null if not or if an error occurs.
 int getList(boolean unique, long legacy, LSDAdminAndVector adm_vect)
          Get the list of files (sid,did) under the legacy and would be compared with the DB (with extension of the class LSDClientGetSessionHandler).
 int getListMD5(boolean unique, long legacy, LSDAdminAndVector adm_vect)
          Get the list of files (sid,did,md5) under the legacy and would be compared with the DB (with extension of the class LSDClientGetSessionHandler).
 int getSessionInfo(boolean unique)
          Get the list of sessions (name,remoteAddress,CreationTimeMs,LastReadTimeMs,LastWriteTimeMs, NbReadMsg,NbWriteMsg,isIdle,isConnected,isClosing,Command[,Status,Running,isClosed, unique,legacy,storage,document] if Command !
 long getSize(boolean unique, long legacy, long storage, long document)
          Ask to get Size file identified by the triple legacy, storage and document, and return the result.
 
Methods inherited from class openlsd.network.client.common.LSDClientCommon
clear, clearObject, close, connect, connectionJoin, endClient, endClient, executorsClose, getObject, getStatus, initClient, initShared, isConnected, isSessionOK, lock, realClose, sessionReconnect, setObject, toString, unlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

md5

public java.lang.String md5
MD5 Data


size

public long size
Size of the file

Constructor Detail

LSDClientInfo

public LSDClientInfo(java.lang.String Hostname,
                     int ServerPort,
                     boolean immediate,
                     boolean keepalived)
Create a new ClientInfo using a specific Hostname and serverPort.

Parameters:
Hostname -
ServerPort -
immediate -
keepalived -

LSDClientInfo

public LSDClientInfo(java.lang.String Hostname,
                     int ServerPort,
                     boolean ServerCompressed,
                     boolean ClientCompressed,
                     boolean immediate,
                     boolean keepalived)
Create a new ClientInfo using a specific Hostname and serverPort and the properties of compression for server and client part.

Parameters:
Hostname -
ServerPort -
ServerCompressed -
ClientCompressed -
immediate -
keepalived -

LSDClientInfo

public LSDClientInfo(LSDClientInfoSessionHandler lscshext,
                     java.lang.String Hostname,
                     int ServerPort,
                     boolean ServerCompressed,
                     boolean ClientCompressed,
                     boolean immediate,
                     boolean keepalived)
Create a new ClientInfo using a specific SessionHandler that extends the LSDClientInfoSessionHandler class and a specific Hostname and serverPort and the properties of compression for server and client part.

Parameters:
lscshext -
Hostname -
ServerPort -
ServerCompressed -
ClientCompressed -
immediate -
keepalived -
Method Detail

createSessionHandler

protected LSDClientCommonSessionHandler createSessionHandler()
Create a SessionHandler. This function has to be rewritten by classes that extends this one.

Specified by:
createSessionHandler in class LSDClientCommon
Returns:
a new SessionHandler

getSize

public long getSize(boolean unique,
                    long legacy,
                    long storage,
                    long document)
Ask to get Size file identified by the triple legacy, storage and document, and return the result. The boolean unique set if the get should close the connection after the full reception (true), or not (false).

Parameters:
unique -
legacy -
storage -
document -
Returns:
the size of the file (can be more than the real size once decrypted) or <0 if an error occurs.

getExist

public boolean getExist(boolean unique,
                        long legacy,
                        long storage,
                        long document,
                        java.lang.String md5b)
Ask to get the existence of the file identified by the triple legacy, storage and document, and return true if it exists, no if not or if an error occurs. The boolean unique set if the get should close the connection after the full reception (true), or not (false). At the end, object in session contains the true MD5 in String if the function returns False.

Parameters:
unique -
legacy -
storage -
document -
md5b - (optional)
Returns:
True if the file exists, False if not or if an error occurs

getInPath

public java.lang.String getInPath(boolean unique,
                                  long legacy,
                                  long storage,
                                  long document)
Ask to get a copy of the file identified by the triple legacy, storage and document, and return the path if it exists, null if not or if an error occurs. The boolean unique set if the get should close the connection after the full reception (true), or not (false).

Parameters:
unique -
legacy -
storage -
document -
Returns:
the local access path if the file exists, null if not or if an error occurs

getList

public int getList(boolean unique,
                   long legacy,
                   LSDAdminAndVector adm_vect)
Get the list of files (sid,did) under the legacy and would be compared with the DB (with extension of the class LSDClientGetSessionHandler).

Parameters:
unique -
legacy -
adm_vect - (must be an LSDDbAdminAndVector object)
Returns:
the status of the function

getListMD5

public int getListMD5(boolean unique,
                      long legacy,
                      LSDAdminAndVector adm_vect)
Get the list of files (sid,did,md5) under the legacy and would be compared with the DB (with extension of the class LSDClientGetSessionHandler).

Parameters:
unique -
legacy -
adm_vect - (must be an LSDDbAdminAndVector object)
Returns:
the status of the function

getAExist

public int getAExist(boolean unique,
                     java.lang.String aexist,
                     LSDAdminAndVector adm_vect)
Get the status of files from DB (lid,sid,did) in lsd.

Parameters:
unique -
aexist -
adm_vect - (must be an LSDDbAdminAndVector object)
Returns:
the status of the function

getAExistMD5

public int getAExistMD5(boolean unique,
                        java.lang.String aexist,
                        LSDAdminAndVector adm_vect)
Get the status of files from DB (lid,sid,did,md5) in lsd.

Parameters:
unique -
aexist -
adm_vect - (must be an LSDDbAdminAndVector object)
Returns:
the status of the function

getSessionInfo

public int getSessionInfo(boolean unique)
Get the list of sessions (name,remoteAddress,CreationTimeMs,LastReadTimeMs,LastWriteTimeMs, NbReadMsg,NbWriteMsg,isIdle,isConnected,isClosing,Command[,Status,Running,isClosed, unique,legacy,storage,document] if Command != LSDConstants.LSD_UNAVAILABLE) (in md5 component as a String with LSDConstants.separator as separator). First 2 data are previous free memory -> next free memory (after gc)

Parameters:
unique -
Returns:
the status of the function