
public class R66Session extends Object implements SessionInterface
| Constructor and Description | 
|---|
| R66Session()Create the session | 
| R66Session(boolean noBuffer)Create the session without Buffers | 
| Modifier and Type | Method and Description | 
|---|---|
| boolean | addError() | 
| void | clear()Clean the session | 
| R66Auth | getAuth() | 
| int | getBlockSize() | 
| R66BusinessInterface | getBusinessObject() | 
| static ZstdCompressionCodecDataPacket | getCodec() | 
| int | getCompressionMaxSize() | 
| FilesystemBasedDigest | getDigestBlock() | 
| R66Dir | getDir() | 
| HashMap<String,R66Dir> | getDirsFromSession() | 
| boolean | getExtendedProtocol() | 
| R66File | getFile() | 
| FilesystemBasedFileParameterImpl | getFileParameter() | 
| SocketAddress | getLocalAddress() | 
| LocalChannelReference | getLocalChannelReference() | 
| SocketAddress | getRemoteAddress() | 
| R66Restart | getRestart() | 
| byte[] | getReusableBuffer(int length) | 
| byte[] | getReusableDataPacketBuffer(int length) | 
| DbTaskRunner | getRunner() | 
| byte[] | getSessionReusableCompressionBuffer(int length) | 
| R66FiniteDualStates | getState() | 
| String | getUniqueExtension() | 
| void | initializeDigest()Initialize per block digest | 
| boolean | isAuthenticated() | 
| boolean | isCompressionEnabled() | 
| boolean | isReady() | 
| boolean | isSender() | 
| void | newState(R66FiniteDualStates desiredstate)Propose a new State | 
| void | partialClear() | 
| void | renameReceiverFile(String newFilename)Rename the current receive file from the very beginning since the sender
 has a post action that changes its
 name | 
| void | setBadRunner(DbTaskRunner runner,
            ErrorCode code)To be used when a request comes with a bad code so it cannot be set
 normally | 
| void | setBlockSize(int blocksize) | 
| void | setBusinessObject(R66BusinessInterface businessObject) | 
| void | setCompressionEnabled(boolean compressionEnabled) | 
| void | setErrorState() | 
| void | setFileAfterPreRunner(boolean createFile)Set the File from the runner once PRE operation are done | 
| void | setFileAfterPreRunnerReceiver(boolean createFile)Set the File from the runner once PRE operation are done, only for Receiver | 
| void | setFileBeforePreRunner()Set the File from the runner before PRE operation are done | 
| void | setFinalizeTransfer(boolean status,
                   R66Result finalValue)Finalize the transfer step by running the error or post operation
 according
 to the status. | 
| void | setLocalChannelReference(LocalChannelReference localChannelReference) | 
| void | setNoSessionRunner(DbTaskRunner runner,
                  LocalChannelReference localChannelReference)To be called in case of No Session not from a valid LocalChannelHandler | 
| void | setReady(boolean isReady) | 
| void | setRunner(DbTaskRunner runner)Set the runner, and setup the directory first. | 
| void | setStatus(int stat)Debugging purpose (trace) | 
| void | startup(boolean checkNotExternal)START from the PreTask if necessary, and prepare the file | 
| String | toString() | 
| void | tryFinalizeRequest(R66Result errorValue)Try to finalize the request if possible | 
public R66Session()
public R66Session(boolean noBuffer)
public static ZstdCompressionCodecDataPacket getCodec()
public final boolean getExtendedProtocol()
public final R66BusinessInterface getBusinessObject()
public final void setBusinessObject(R66BusinessInterface businessObject)
businessObject - the businessObject to setpublic final void newState(R66FiniteDualStates desiredstate)
desiredstate - IllegalFiniteStateException - if the new status if not okpublic final void setErrorState()
public final R66FiniteDualStates getState()
public final void setStatus(int stat)
stat - public final void clear()
SessionInterfaceclear in interface SessionInterfacepublic final void partialClear()
public final R66Auth getAuth()
getAuth in interface SessionInterfacepublic final int getBlockSize()
getBlockSize in interface SessionInterfacepublic final void setBlockSize(int blocksize)
blocksize - the blocksize to setpublic final byte[] getReusableBuffer(int length)
length - the target sizepublic final byte[] getReusableDataPacketBuffer(int length)
length - the target sizepublic final byte[] getSessionReusableCompressionBuffer(int length)
length - the original sizepublic final boolean isCompressionEnabled()
public final void setCompressionEnabled(boolean compressionEnabled)
compressionEnabled - True if compression is enabled in this sessionpublic final int getCompressionMaxSize()
public final void initializeDigest()
public final FilesystemBasedDigest getDigestBlock()
public final R66Dir getDir()
getDir in interface SessionInterfacepublic final FilesystemBasedFileParameterImpl getFileParameter()
getFileParameter in interface SessionInterfacepublic final R66Restart getRestart()
getRestart in interface SessionInterfacepublic final boolean isAuthenticated()
public final boolean isReady()
public final void setReady(boolean isReady)
isReady - the isReady for transfer to setpublic final DbTaskRunner getRunner()
public final void setLocalChannelReference(LocalChannelReference localChannelReference)
localChannelReference - the localChannelReference to setpublic final SocketAddress getRemoteAddress()
public final SocketAddress getLocalAddress()
public final LocalChannelReference getLocalChannelReference()
public final void setNoSessionRunner(DbTaskRunner runner, LocalChannelReference localChannelReference)
runner - localChannelReference - public final void setFileBeforePreRunner()
                                  throws OpenR66RunnerErrorException
OpenR66RunnerErrorExceptionpublic final void setFileAfterPreRunnerReceiver(boolean createFile)
                                         throws OpenR66RunnerErrorException,
                                                CommandAbstractException
createFile - When True, the file can be newly created if
     needed.
     If False, no new file will be
     created, thus having an Exception.OpenR66RunnerErrorExceptionCommandAbstractException - only when new received created
     file
     cannot be createdpublic final void setFileAfterPreRunner(boolean createFile)
                                 throws OpenR66RunnerErrorException,
                                        CommandAbstractException
createFile - When True, the file can be newly created if
     needed.
     If False, no new file will be
     created, thus having an Exception.OpenR66RunnerErrorExceptionCommandAbstractException - only when new received created
     file
     cannot be createdpublic final void setBadRunner(DbTaskRunner runner, ErrorCode code)
runner - code - public final void setRunner(DbTaskRunner runner) throws OpenR66RunnerErrorException
This call should be followed by a startup() call.
runner - the runner to setOpenR66RunnerErrorExceptionpublic final void startup(boolean checkNotExternal)
                   throws OpenR66RunnerErrorException
checkNotExternal - if True, the file as Sender should not be
     external to current directoryOpenR66RunnerErrorExceptionpublic final void renameReceiverFile(String newFilename) throws OpenR66RunnerErrorException
newFilename - OpenR66RunnerErrorExceptionpublic final void setFinalizeTransfer(boolean status,
                                      R66Result finalValue)
                               throws OpenR66RunnerErrorException,
                                      OpenR66ProtocolSystemException
status - finalValue - OpenR66RunnerErrorExceptionOpenR66ProtocolSystemExceptionpublic final void tryFinalizeRequest(R66Result errorValue) throws OpenR66RunnerErrorException, OpenR66ProtocolSystemException
errorValue - OpenR66RunnerErrorExceptionOpenR66ProtocolSystemExceptionpublic final R66File getFile()
public final boolean addError()
public final String getUniqueExtension()
getUniqueExtension in interface SessionInterfacepublic final HashMap<String,R66Dir> getDirsFromSession()
public final boolean isSender()
Copyright © 2009–2022 Waarp. All rights reserved.