openlsd.network.client.get
Class LSDClientGet

java.lang.Object
  extended by openlsd.network.client.common.LSDClientCommon
      extended by openlsd.network.client.get.LSDClientGet
Direct Known Subclasses:
LSDPoolClientGet, LSDWebClientGet

public class LSDClientGet
extends LSDClientCommon

Class LSDClientGet is the class that defines function to offer service to client part for Get.

Author:
Frederic Bregier LGPL

Field Summary
 
Fields inherited from class openlsd.network.client.common.LSDClientCommon
clientCompressed, connector, executorChainService, hostname, idip, ls, lscsh, poolConnection, serverCompressed, serverPort, session
 
Constructor Summary
LSDClientGet(LSDClientGetSessionHandler lscshext, java.lang.String Hostname, int ServerPort, boolean immediate, boolean keepalived)
          Create a new ClientGet using a specific SessionHandler that extends the LSDClientGetSessionHandler class and a specific Hostname and serverPort.
LSDClientGet(LSDClientGetSessionHandler lscshext, java.lang.String Hostname, int ServerPort, boolean ServerCompressed, boolean ClientCompressed, boolean immediate, boolean keepalived)
          Create a new ClientGet using a specific SessionHandler that extends the LSDClientGetSessionHandler class and a specific Hostname and serverPort and the properties of compression for server and client part.
LSDClientGet(java.lang.String Hostname, int ServerPort, boolean immediate, boolean keepalived)
          Create a new ClientGet using a specific Hostname and serverPort.
LSDClientGet(java.lang.String Hostname, int ServerPort, boolean ServerCompressed, boolean ClientCompressed, boolean immediate, boolean keepalived)
          Create a new ClientGet 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 getDataToObject(boolean unique, long legacy, long storage, long document, java.lang.Object object)
          Ask to get Data (file) identified by the triple legacy, storage and document, and put the result in the result object, which is by default an array of byte or another object controled by another object which implies an extend of LSDClientGetSessionHandler with a new version of messageGetBlock.
 int getNoAckDataToObject(boolean unique, long legacy, long storage, long document, java.lang.Object object)
          Ask to get Data (file) identified by the triple legacy, storage and document, and put the result in the result object, which is by default an array of byte or another object controled by another object which implies an extend of LSDClientGetSessionHandler with a new version of messageGetBlock.
 
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
 

Constructor Detail

LSDClientGet

public LSDClientGet(LSDClientGetSessionHandler lscshext,
                    java.lang.String Hostname,
                    int ServerPort,
                    boolean immediate,
                    boolean keepalived)
Create a new ClientGet using a specific SessionHandler that extends the LSDClientGetSessionHandler class and a specific Hostname and serverPort.

Parameters:
lscshext -
Hostname -
ServerPort -
immediate -
keepalived -

LSDClientGet

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

Parameters:
Hostname -
ServerPort -
immediate -
keepalived -

LSDClientGet

public LSDClientGet(LSDClientGetSessionHandler lscshext,
                    java.lang.String Hostname,
                    int ServerPort,
                    boolean ServerCompressed,
                    boolean ClientCompressed,
                    boolean immediate,
                    boolean keepalived)
Create a new ClientGet using a specific SessionHandler that extends the LSDClientGetSessionHandler 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 -

LSDClientGet

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

Parameters:
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

getDataToObject

public int getDataToObject(boolean unique,
                           long legacy,
                           long storage,
                           long document,
                           java.lang.Object object)
Ask to get Data (file) identified by the triple legacy, storage and document, and put the result in the result object, which is by default an array of byte or another object controled by another object which implies an extend of LSDClientGetSessionHandler with a new version of messageGetBlock. The boolean unique set if the get should close the connection after the full reception (true), or not (false). This function uses acknowledge of each block.

Parameters:
unique -
legacy -
storage -
document -
object - (by default, if null becomes an array of byte allocated with "new byte[0]")
Returns:
the status of the operation

getNoAckDataToObject

public int getNoAckDataToObject(boolean unique,
                                long legacy,
                                long storage,
                                long document,
                                java.lang.Object object)
Ask to get Data (file) identified by the triple legacy, storage and document, and put the result in the result object, which is by default an array of byte or another object controled by another object which implies an extend of LSDClientGetSessionHandler with a new version of messageGetBlock. The boolean unique set if the get should close the connection after the full reception (true), or not (false). This function uses no acknowledge for each block (quicker).

Parameters:
unique -
legacy -
storage -
document -
object - (by default, if null becomes an array of byte allocated with "new byte[0]")
Returns:
the status of the operation