Package org.corpus_tools.pepper.cli
Class OSGiConsole
- java.lang.Object
-
- org.corpus_tools.pepper.cli.OSGiConsole
-
public class OSGiConsole extends Object
This class represents a simple console for accessing the underlying OSGi environment of aPepperOSGiConnector. It allows simple commands.- Author:
- Florian Zipser
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOSGiConsole.COMMAND
-
Constructor Summary
Constructors Constructor Description OSGiConsole(PepperOSGiConnector connector, String prefixPrompt)Initializes an object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PepperOSGiConnectorgetConnector()Stringhelp()Returns the help page for this console.Longinstall(List<String> params, PrintStream out)Executes OSGi command 'install'.voidinstallAndStart(List<String> params, PrintStream out)Executes command 'launch', calling the OSGi command 'install' and 'start'.voidls(List<String> params, PrintStream out)Executes OSGi command 'ls'.voidremove(List<String> params, PrintStream out)Executes command 'remove'.voidss(List<String> params, PrintStream out)Executes OSGi command 'ss'.voidstart()Starts this console, using std in and std out.voidstart(BufferedReader in, PrintStream out)voidstart(List<String> params, PrintStream out)Executes OSGi command 'start'.voidstop(List<String> params, PrintStream out)Executes OSGi command 'stop'.StringtransformState(int state)voiduninstall(List<String> params, PrintStream out)Executes OSGi command 'uninstall'.voidupdate(List<String> params, PrintStream out)Executes command 'update', calling the OSGi commands 'uninstall', 'install' and 'start'.
-
-
-
Constructor Detail
-
OSGiConsole
public OSGiConsole(PepperOSGiConnector connector, String prefixPrompt)
Initializes an object.- Parameters:
connector- thePepperOSGiConnectorto be used to access the OSGi environmentprefixPrompt- the prefix prompt to be displayed, before the prompt of this console.
-
-
Method Detail
-
getConnector
public PepperOSGiConnector getConnector()
-
start
public void start()
Starts this console, using std in and std out.
-
help
public String help()
Returns the help page for this console.- Returns:
-
start
public void start(BufferedReader in, PrintStream out)
-
ss
public void ss(List<String> params, PrintStream out)
Executes OSGi command 'ss'.- Parameters:
params-out-
-
ls
public void ls(List<String> params, PrintStream out)
Executes OSGi command 'ls'.- Parameters:
params-out-
-
install
public Long install(List<String> params, PrintStream out)
Executes OSGi command 'install'.- Parameters:
params-out-
-
start
public void start(List<String> params, PrintStream out)
Executes OSGi command 'start'.- Parameters:
params-out-
-
installAndStart
public void installAndStart(List<String> params, PrintStream out)
Executes command 'launch', calling the OSGi command 'install' and 'start'.- Parameters:
params-out-
-
update
public void update(List<String> params, PrintStream out)
Executes command 'update', calling the OSGi commands 'uninstall', 'install' and 'start'.- Parameters:
params-out-
-
stop
public void stop(List<String> params, PrintStream out)
Executes OSGi command 'stop'.- Parameters:
params-out-
-
uninstall
public void uninstall(List<String> params, PrintStream out)
Executes OSGi command 'uninstall'.- Parameters:
params-out-
-
remove
public void remove(List<String> params, PrintStream out)
Executes command 'remove'.- Parameters:
params-out-
-
transformState
public String transformState(int state)
-
-