openlsd.network.client.move
Class LSDClientMove

java.lang.Object
  extended by openlsd.network.client.common.LSDClientCommon
      extended by openlsd.network.client.move.LSDClientMove
Direct Known Subclasses:
LSDPoolClientMove

public class LSDClientMove
extends LSDClientCommon

Class LSDClientMove is the class that defines function to offer service to client part for Move.

Author:
Frederic Bregier LGPL

Field Summary
 java.lang.String md5
          MD5 data
 
Fields inherited from class openlsd.network.client.common.LSDClientCommon
clientCompressed, connector, executorChainService, hostname, idip, ls, lscsh, poolConnection, serverCompressed, serverPort, session
 
Constructor Summary
LSDClientMove(java.lang.String Hostname, int ServerPort, boolean immediate, boolean keepalived)
          Create a new ClientMove using a specific Hostname and serverPort.
LSDClientMove(java.lang.String Hostname, int ServerPort, boolean ServerCompressed, boolean ClientCompressed, boolean immediate, boolean keepalived)
          Create a new ClientMove using a specific Hostname and serverPort and the properties of compression for server and client part.
 
Method Summary
protected  LSDClientCommonSessionHandler createSessionHandler()
          Create a SessionHandler.
 boolean move(java.lang.String key, boolean unique, long legacy, long storage, long document, long legacydest, long storagedest, long documentdest)
          Ask to Move a file identified by the triple legacy, storage and document to another triple, and return its status.
 boolean moveInLegacy(java.lang.String key, boolean unique, long legacy, long storage, long document, long storagedest, long documentdest)
          Ask to Move a file identified by the triple legacy, storage and document to another triple (with the same legacy), and return its status.
 
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

Constructor Detail

LSDClientMove

public LSDClientMove(java.lang.String Hostname,
                     int ServerPort,
                     boolean immediate,
                     boolean keepalived)
Create a new ClientMove using a specific Hostname and serverPort. The client is immediately connected.

Parameters:
Hostname -
ServerPort -
immediate -
keepalived -

LSDClientMove

public LSDClientMove(java.lang.String Hostname,
                     int ServerPort,
                     boolean ServerCompressed,
                     boolean ClientCompressed,
                     boolean immediate,
                     boolean keepalived)
Create a new ClientMove using a specific Hostname and serverPort and the properties of compression for server and client part. The client is immediately connected.

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

move

public boolean move(java.lang.String key,
                    boolean unique,
                    long legacy,
                    long storage,
                    long document,
                    long legacydest,
                    long storagedest,
                    long documentdest)
Ask to Move a file identified by the triple legacy, storage and document to another triple, and return its status. 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 MD5 in String.

Parameters:
key -
unique -
legacy -
storage -
document -
legacydest -
storagedest -
documentdest -
Returns:
True if the file is moved, else False.

moveInLegacy

public boolean moveInLegacy(java.lang.String key,
                            boolean unique,
                            long legacy,
                            long storage,
                            long document,
                            long storagedest,
                            long documentdest)
Ask to Move a file identified by the triple legacy, storage and document to another triple (with the same legacy), and return its status. 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 MD5 in String.

Parameters:
key -
unique -
legacy -
storage -
document -
storagedest -
documentdest -
Returns:
True if the file is moved, else False.