1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package ch.syabru.nagios.broker.impl;
17
18 import org.apache.commons.lang.Validate;
19
20 import ch.syabru.nagios.broker.ExternalCommand;
21 import ch.syabru.nagios.broker.ExternalCommandFactory;
22
23
24
25
26
27
28
29 public class ProcessServiceCheckResultCommandFactory
30 implements ExternalCommandFactory
31 {
32 private String hostName;
33 private String serviceDescription;
34 private int returnCode;
35 private String pluginOutput;
36
37
38
39
40
41
42
43
44 public ProcessServiceCheckResultCommandFactory(String hostName,
45 String serviceDescription, int returnCode, String pluginOutput)
46 {
47 Validate.notNull(hostName, "hostName must not be null");
48 Validate.notNull(serviceDescription,
49 "serviceDescription must not be null");
50 Validate.notNull(returnCode, "returnCode must not be null");
51 Validate.notNull(pluginOutput, "pluginOutput must not be null");
52 this.hostName = hostName;
53 this.serviceDescription = serviceDescription;
54 this.returnCode = returnCode;
55 this.pluginOutput = pluginOutput;
56 }
57
58 @Override
59 public ExternalCommand createCommand() {
60 return new ProcessServiceCheckResultCommand(
61 hostName, serviceDescription, returnCode, pluginOutput);
62 }
63
64 }