1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package it.jnrpe.server.console;
17
18 import java.io.IOException;
19
20 import jline.console.ConsoleReader;
21 import it.jnrpe.JNRPE;
22
23 public class ExitCommand extends ConsoleCommand {
24
25 public final static String NAME="exit";
26
27 public ExitCommand(ConsoleReader consoleReader, JNRPE jnrpe) {
28 super(consoleReader, jnrpe);
29 }
30
31 public boolean execute(String[] args) throws Exception {
32 getJNRPE().shutdown();
33 return true;
34 }
35
36 public String getName() {
37 return NAME;
38 }
39
40 public String getCommandLine() {
41 return "";
42 }
43
44 public void printHelp() throws IOException {
45 getConsole().println("Command Line : exit");
46 getConsole().println(" Exits from the JNRPE console");
47 }
48
49 }