public class R66Session extends Object implements SessionInterface
Constructor and Description |
---|
R66Session()
Create the session
|
Modifier and Type | Method and Description |
---|---|
boolean |
addError() |
void |
clear()
Clean the session
|
R66Auth |
getAuth() |
int |
getBlockSize() |
R66BusinessInterface |
getBusinessObject() |
R66Dir |
getDir() |
HashMap<String,R66Dir> |
getDirsFromSession() |
boolean |
getExtendedProtocol() |
R66File |
getFile() |
FilesystemBasedFileParameterImpl |
getFileParameter() |
SocketAddress |
getLocalAddress() |
LocalChannelReference |
getLocalChannelReference() |
SocketAddress |
getRemoteAddress() |
R66Restart |
getRestart() |
DbTaskRunner |
getRunner() |
R66FiniteDualStates |
getState() |
String |
getUniqueExtension() |
boolean |
isAuthenticated() |
boolean |
isReady() |
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 |
setErrorState() |
void |
setFileAfterPreRunner(boolean createFile)
Set the File from the runner once PRE operation are done
|
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 boolean getExtendedProtocol()
public R66BusinessInterface getBusinessObject()
public void setBusinessObject(R66BusinessInterface businessObject)
businessObject
- the businessObject to setpublic void newState(R66FiniteDualStates desiredstate)
desiredstate
- IllegalFiniteStateException
- if the new status if not okpublic void setErrorState()
public R66FiniteDualStates getState()
public void setStatus(int stat)
stat
- public void clear()
SessionInterface
clear
in interface SessionInterface
public void partialClear()
public R66Auth getAuth()
getAuth
in interface SessionInterface
public int getBlockSize()
getBlockSize
in interface SessionInterface
public void setBlockSize(int blocksize)
blocksize
- the blocksize to setpublic R66Dir getDir()
getDir
in interface SessionInterface
public FilesystemBasedFileParameterImpl getFileParameter()
getFileParameter
in interface SessionInterface
public R66Restart getRestart()
getRestart
in interface SessionInterface
public boolean isAuthenticated()
public boolean isReady()
public void setReady(boolean isReady)
isReady
- the isReady for transfer to setpublic DbTaskRunner getRunner()
public void setLocalChannelReference(LocalChannelReference localChannelReference)
localChannelReference
- the localChannelReference to setpublic SocketAddress getRemoteAddress()
public SocketAddress getLocalAddress()
public LocalChannelReference getLocalChannelReference()
public void setNoSessionRunner(DbTaskRunner runner, LocalChannelReference localChannelReference)
runner
- localChannelReference
- public void setFileBeforePreRunner() throws OpenR66RunnerErrorException
OpenR66RunnerErrorException
public 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.OpenR66RunnerErrorException
CommandAbstractException
- only when new received created
file
cannot be createdpublic void setBadRunner(DbTaskRunner runner, ErrorCode code)
runner
- code
- public void setRunner(DbTaskRunner runner) throws OpenR66RunnerErrorException
This call should be followed by a startup() call.
runner
- the runner to setOpenR66RunnerErrorException
public void startup(boolean checkNotExternal) throws OpenR66RunnerErrorException
checkNotExternal
- if True, the file as Sender should not be
external to current directoryOpenR66RunnerErrorException
public void renameReceiverFile(String newFilename) throws OpenR66RunnerErrorException
newFilename
- OpenR66RunnerErrorException
public void setFinalizeTransfer(boolean status, R66Result finalValue) throws OpenR66RunnerErrorException, OpenR66ProtocolSystemException
status
- finalValue
- OpenR66RunnerErrorException
OpenR66ProtocolSystemException
public void tryFinalizeRequest(R66Result errorValue) throws OpenR66RunnerErrorException, OpenR66ProtocolSystemException
errorValue
- OpenR66RunnerErrorException
OpenR66ProtocolSystemException
public R66File getFile()
public boolean addError()
public String getUniqueExtension()
getUniqueExtension
in interface SessionInterface
Copyright © 2009–2020 Waarp. All rights reserved.