public abstract class AbstractCommand extends Object implements CommandInterface
Constructor and Description |
---|
AbstractCommand() |
Modifier and Type | Method and Description |
---|---|
String |
getArg() |
String[] |
getArgs() |
FtpCommandCode |
getCode() |
String |
getCommand() |
FtpConfiguration |
getConfiguration() |
Object |
getObject() |
FtpSession |
getSession() |
int |
getValue(String argx)
Get an integer value from argument
|
boolean |
hasArg()
Does this command has an argument
|
void |
invalidCurrentCommand()
Set the previous command as the new current command (used after a
incorrect
sequence of commands or unknown
command).
|
boolean |
isNextCommandValid(CommandInterface newCommandArg)
This function is called when a new command is received to check if this
new
command is positive according
to the previous command and status.
|
void |
setArgs(SessionInterface session,
String command,
String arg,
Enum code)
Set the Command from the args
|
void |
setExtraNextCommand(Enum extraNextCommand)
This function is intend to allow to force USER->PASS->ACCT->CDW for
instance
|
void |
setObject(Object object) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
exec
public void setArgs(SessionInterface session, String command, String arg, Enum code)
CommandInterface
setArgs
in interface CommandInterface
public void setExtraNextCommand(Enum extraNextCommand)
CommandInterface
setExtraNextCommand
in interface CommandInterface
extraNextCommand
- the extraNextCommand to setpublic boolean isNextCommandValid(CommandInterface newCommandArg)
CommandInterface
isNextCommandValid
in interface CommandInterface
public Object getObject()
getObject
in interface CommandInterface
public void setObject(Object object)
setObject
in interface CommandInterface
object
- the object to setpublic String getArg()
getArg
in interface CommandInterface
public String[] getArgs()
getArgs
in interface CommandInterface
public int getValue(String argx) throws InvalidArgumentException
CommandInterface
getValue
in interface CommandInterface
InvalidArgumentException
- if the argument is not an
integerpublic String getCommand()
getCommand
in interface CommandInterface
public boolean hasArg()
CommandInterface
hasArg
in interface CommandInterface
public FtpSession getSession()
getSession
in interface CommandInterface
public FtpConfiguration getConfiguration()
public void invalidCurrentCommand()
CommandInterface
invalidCurrentCommand
in interface CommandInterface
public FtpCommandCode getCode()
getCode
in interface CommandInterface
Copyright © 2009–2020 Waarp. All rights reserved.