com.maverick.sshd.shell
Class AbstractCommand

java.lang.Object
  extended by com.maverick.sshd.shell.AbstractCommand
All Implemented Interfaces:
ShellCommand, Completor
Direct Known Subclasses:
AbstractUUIDCommand, Alias, Bsh, Cat, Cd, Clear, Connections, Cp, Date, Echo, Edit, Exit, Follow, Forwards, Grant, Help, Ls, Mem, Mkdir, Msh, Mv, Passwd, Pk, Pref, Ps, Pwd, Refresh, Revoke, Rm, Run, Scp, Set, ShowLastError, Shutdown, Sleep, Term, Threads, Watch, Who

public abstract class AbstractCommand
extends Object
implements ShellCommand


Field Summary
protected  int exitCode
           
 
Fields inherited from interface com.maverick.sshd.shell.ShellCommand
STILL_ACTIVE, SUBSYSTEM_CALLBACK, SUBSYSTEM_FILESYSTEM, SUBSYSTEM_HELP, SUBSYSTEM_JVM, SUBSYSTEM_POLICY, SUBSYSTEM_SHELL, SUBSYSTEM_SSHD, SUBSYSTEM_SYSTEM, SUBSYSTEM_TEXT_EDITING
 
Constructor Summary
AbstractCommand(String name, String subsystem)
           
AbstractCommand(String name, String subsystem, String signature)
           
AbstractCommand(String name, String subsystem, String signature, org.apache.commons.cli.Option... options)
           
 
Method Summary
 int complete(String buffer, int cursor, List candidates)
           
 List<String> getCollection(int i)
           
 String getCommandName()
           
 String getDescription()
           
 int getExitCode()
           
 String getName()
           
 org.apache.commons.cli.Options getOptions()
           
 String getSignature()
           
 String getSubsystem()
           
 boolean isBuiltIn()
           
protected  void setBuiltIn(boolean builtIn)
           
protected  void setDescription(String description)
           
protected  void setName(String name)
           
protected  void setSignature(String signature)
           
protected  void setSubsystem(String subsystem)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.maverick.sshd.shell.ShellCommand
run
 

Field Detail

exitCode

protected int exitCode
Constructor Detail

AbstractCommand

public AbstractCommand(String name,
                       String subsystem)

AbstractCommand

public AbstractCommand(String name,
                       String subsystem,
                       String signature)

AbstractCommand

public AbstractCommand(String name,
                       String subsystem,
                       String signature,
                       org.apache.commons.cli.Option... options)
Method Detail

complete

public int complete(String buffer,
                    int cursor,
                    List candidates)
Specified by:
complete in interface Completor

getName

public String getName()

getOptions

public org.apache.commons.cli.Options getOptions()
Specified by:
getOptions in interface ShellCommand

getDescription

public String getDescription()
Specified by:
getDescription in interface ShellCommand

getSubsystem

public String getSubsystem()
Specified by:
getSubsystem in interface ShellCommand

getCommandName

public String getCommandName()
Specified by:
getCommandName in interface ShellCommand

getSignature

public String getSignature()
Specified by:
getSignature in interface ShellCommand

getCollection

public List<String> getCollection(int i)
                           throws Exception
Throws:
Exception

isBuiltIn

public boolean isBuiltIn()
Specified by:
isBuiltIn in interface ShellCommand

setBuiltIn

protected void setBuiltIn(boolean builtIn)

setName

protected void setName(String name)

setSubsystem

protected void setSubsystem(String subsystem)

setSignature

protected void setSignature(String signature)

setDescription

protected void setDescription(String description)

getExitCode

public int getExitCode()
Specified by:
getExitCode in interface ShellCommand


Copyright © 2012. All Rights Reserved.