View Javadoc
1   package com.github.sbugat.rundeckmonitor.configuration;
2   
3   import java.io.FileNotFoundException;
4   import java.io.IOException;
5   import java.io.Reader;
6   import java.io.Writer;
7   import java.nio.charset.StandardCharsets;
8   import java.nio.file.Files;
9   import java.nio.file.Path;
10  import java.nio.file.Paths;
11  import java.text.SimpleDateFormat;
12  import java.util.Date;
13  import java.util.Properties;
14  
15  import com.github.sbugat.rundeckmonitor.wizard.InterfaceType;
16  import com.github.sbugat.rundeckmonitor.wizard.JobTabRedirection;
17  
18  /**
19   * Configurationloading class of the RunDeck Monitor.
20   * 
21   * @author Sylvain Bugat
22   * 
23   */
24  public final class RundeckMonitorConfiguration {
25  
26  	/** Configuration file name. */
27  	public static final String RUNDECK_MONITOR_PROPERTIES_FILE = "rundeckMonitor.properties"; //$NON-NLS-1$
28  
29  	/** RunDeck URL property name. */
30  	public static final String RUNDECK_MONITOR_PROPERTY_URL = "rundeck.monitor.url"; //$NON-NLS-1$
31  	/** RunDeck API key property name. */
32  	public static final String RUNDECK_MONITOR_PROPERTY_API_KEY = "rundeck.monitor.api.key"; //$NON-NLS-1$
33  	/** RunDeck login property name. */
34  	public static final String RUNDECK_MONITOR_PROPERTY_LOGIN = "rundeck.monitor.login"; //$NON-NLS-1$
35  	/** RunDeck password property name. */
36  	public static final String RUNDECK_MONITOR_PROPERTY_PASSWORD = "rundeck.monitor.password"; //$NON-NLS-1$
37  	/** RunDeck project property name. */
38  	public static final String RUNDECK_MONITOR_PROPERTY_PROJECT = "rundeck.monitor.project"; //$NON-NLS-1$
39  	/** RunDeck monitor name property name. */
40  	private static final String RUNDECK_MONITOR_PROPERTY_NAME = "rundeck.monitor.name"; //$NON-NLS-1$
41  	/** RunDeck monitor name default value. */
42  	public static final String RUNDECK_MONITOR_PROPERTY_NAME_DEFAULT_VALUE = "RundeckMonitor"; //$NON-NLS-1$
43  	/** RunDeck monitor refresh delay property name. */
44  	private static final String RUNDECK_MONITOR_PROPERTY_REFRESH_DELAY = "rundeck.monitor.refresh.delay"; //$NON-NLS-1$
45  	/** RunDeck monitor refresh delay default value. */
46  	private static final int RUNDECK_MONITOR_PROPERTY_REFRESH_DELAY_DEFAULT_VALUE = 60;
47  	/** RunDeck monitor late threshold property name. */
48  	private static final String RUNDECK_MONITOR_PROPERTY_EXECUTION_LATE_THRESHOLD = "rundeck.monitor.execution.late.threshold"; //$NON-NLS-1$
49  	/** RunDeck monitor late threshold default value. */
50  	private static final int RUNDECK_MONITOR_PROPERTY_EXECUTION_LATE_THRESHOLD_DEFAULT_VALUE = 1800;
51  	/** RunDeck monitor failed job number property name. */
52  	private static final String RUNDECK_MONITOR_PROPERTY_FAILED_JOB_NUMBER = "rundeck.monitor.failed.job.number"; //$NON-NLS-1$
53  	/** RunDeck monitor failed job number default value. */
54  	private static final int RUNDECK_MONITOR_PROPERTY_FAILED_JOB_NUMBER_DEFAULT_VALUE = 10;
55  	/** RunDeck monitor date format property name. */
56  	private static final String RUNDECK_MONITOR_PROPERTY_DATE_FORMAT = "rundeck.monitor.date.format"; //$NON-NLS-1$
57  	/** RunDeck monitor date format default value. */
58  	public static final String RUNDECK_MONITOR_PROPERTY_DATE_FORMAT_DEFAULT_VALUE = "dd/MM/yyyy HH:mm:ss"; //$NON-NLS-1$
59  	/** RunDeck monitor API version property name. */
60  	private static final String RUNDECK_MONITOR_PROPERTY_API_VERSION = "rundeck.monitor.api.version"; //$NON-NLS-1$
61  	/** RunDeck monitor API version default value. */
62  	private static final int RUNDECK_MONITOR_PROPERTY_API_VERSION_DEFAULT_VALUE = 5;
63  	/** RunDeck monitor job redirection property name. */
64  	private static final String RUNDECK_MONITOR_PROPERTY_FAILED_JOB_REDIRECTION = "rundeck.monitor.failed.job.redirection"; //$NON-NLS-1$
65  	/** RunDeck monitor job redirection default value. */
66  	private static final String RUNDECK_MONITOR_PROPERTY_FAILED_JOB_REDIRECTION_DEFAULT_VALUE = JobTabRedirection.SUMMARY.name();
67  	/** RunDeck monitor version checker property name. */
68  	private static final String RUNDECK_MONITOR_PROPERTY_DISABLE_VERSION_CHECKER = "rundeck.monitor.disable.version.checker"; //$NON-NLS-1$
69  	/** RunDeck monitor version checker default value. */
70  	private static final boolean RUNDECK_MONITOR_PROPERTY_DISABLE_VERSION_CHECKER_DEFAULT_VALUE = false;
71  	/** RunDeck monitor GUI type property name. */
72  	private static final String RUNDECK_MONITOR_PROPERTY_INTERFACE_TYPE = "rundeck.monitor.interface.type"; //$NON-NLS-1$
73  	/** RunDeck monitor GUI type default value. */
74  	private static final String RUNDECK_MONITOR_PROPERTY_INTERFACE_TYPE_DEFAULT_VALUE = InterfaceType.SWING.name();
75  
76  	/** RunDeck URL. */
77  	private String rundeckUrl;
78  
79  	/** Rundeck API key. */
80  	private String rundeckAPIKey;
81  
82  	/** RunDeck login. */
83  	private String rundeckLogin;
84  
85  	/** RunDeck password. */
86  	private String rundeckPassword;
87  
88  	/** Name of the rundeck project to access. */
89  	private String rundeckProject;
90  
91  	/** RunDeck monitor name. */
92  	private String rundeckMonitorName;
93  
94  	/** Delay between 2 refresh of rundeck's data. */
95  	private int refreshDelay;
96  
97  	/** Threshold for detecting long execution. */
98  	private int lateThreshold;
99  
100 	/** Number of displayed failed jobs. */
101 	private int failedJobNumber;
102 
103 	/** Displayed date format. */
104 	private String dateFormat;
105 
106 	/** RunDeck API version. */
107 	private int rundeckAPIversion;
108 
109 	/** Job tab redirection. */
110 	private String jobTabRedirection;
111 
112 	/** Version checker flag. */
113 	private boolean versionCheckerDisabled;
114 
115 	/** Type of GUI interface used. */
116 	private String interfaceType;
117 
118 	/**
119 	 * Default constructor.
120 	 */
121 	public RundeckMonitorConfiguration() {
122 		// Nothing to initialize
123 	}
124 
125 	/**
126 	 * Copy constructor.
127 	 * 
128 	 * @param rundeckMonitorConfiguration configuration to copy
129 	 */
130 	public RundeckMonitorConfiguration(final RundeckMonitorConfiguration rundeckMonitorConfiguration) {
131 
132 		rundeckUrl = rundeckMonitorConfiguration.rundeckUrl;
133 		rundeckAPIKey = rundeckMonitorConfiguration.rundeckAPIKey;
134 		rundeckLogin = rundeckMonitorConfiguration.rundeckLogin;
135 		rundeckPassword = rundeckMonitorConfiguration.rundeckPassword;
136 
137 		rundeckProject = rundeckMonitorConfiguration.rundeckProject;
138 		rundeckMonitorName = rundeckMonitorConfiguration.rundeckMonitorName;
139 		refreshDelay = rundeckMonitorConfiguration.refreshDelay;
140 		lateThreshold = rundeckMonitorConfiguration.lateThreshold;
141 		failedJobNumber = rundeckMonitorConfiguration.failedJobNumber;
142 		dateFormat = rundeckMonitorConfiguration.dateFormat;
143 		rundeckAPIversion = rundeckMonitorConfiguration.rundeckAPIversion;
144 		jobTabRedirection = rundeckMonitorConfiguration.jobTabRedirection;
145 		versionCheckerDisabled = rundeckMonitorConfiguration.versionCheckerDisabled;
146 	}
147 
148 	/**
149 	 * Load configuration.
150 	 * 
151 	 * @throws IOException in case of loading configuration error
152 	 */
153 	public void loadConfigurationPropertieFile() throws IOException {
154 
155 		// Configuration loading
156 		final Path propertyFile = Paths.get(RUNDECK_MONITOR_PROPERTIES_FILE);
157 		if (!Files.exists(propertyFile)) {
158 
159 			throw new FileNotFoundException(RUNDECK_MONITOR_PROPERTIES_FILE);
160 		}
161 
162 		// Load the configuration file and extract properties
163 		final Properties properties = new Properties();
164 		try (final Reader propertyFileReader = Files.newBufferedReader(propertyFile, StandardCharsets.UTF_8)) {
165 			properties.load(propertyFileReader);
166 		}
167 
168 		rundeckUrl = properties.getProperty(RUNDECK_MONITOR_PROPERTY_URL);
169 		rundeckProject = properties.getProperty(RUNDECK_MONITOR_PROPERTY_PROJECT);
170 
171 		rundeckAPIKey = properties.getProperty(RUNDECK_MONITOR_PROPERTY_API_KEY);
172 
173 		rundeckLogin = properties.getProperty(RUNDECK_MONITOR_PROPERTY_LOGIN);
174 		rundeckPassword = properties.getProperty(RUNDECK_MONITOR_PROPERTY_PASSWORD);
175 
176 		rundeckMonitorName = properties.getProperty(RUNDECK_MONITOR_PROPERTY_NAME, RUNDECK_MONITOR_PROPERTY_NAME_DEFAULT_VALUE);
177 		refreshDelay = getIntegerProperty(properties, RUNDECK_MONITOR_PROPERTY_REFRESH_DELAY, RUNDECK_MONITOR_PROPERTY_REFRESH_DELAY_DEFAULT_VALUE);
178 		lateThreshold = getIntegerProperty(properties, RUNDECK_MONITOR_PROPERTY_EXECUTION_LATE_THRESHOLD, RUNDECK_MONITOR_PROPERTY_EXECUTION_LATE_THRESHOLD_DEFAULT_VALUE);
179 		failedJobNumber = getIntegerProperty(properties, RUNDECK_MONITOR_PROPERTY_FAILED_JOB_NUMBER, RUNDECK_MONITOR_PROPERTY_FAILED_JOB_NUMBER_DEFAULT_VALUE);
180 		dateFormat = properties.getProperty(RUNDECK_MONITOR_PROPERTY_DATE_FORMAT, RUNDECK_MONITOR_PROPERTY_DATE_FORMAT_DEFAULT_VALUE);
181 		rundeckAPIversion = getIntegerProperty(properties, RUNDECK_MONITOR_PROPERTY_API_VERSION, RUNDECK_MONITOR_PROPERTY_API_VERSION_DEFAULT_VALUE);
182 		jobTabRedirection = properties.getProperty(RUNDECK_MONITOR_PROPERTY_FAILED_JOB_REDIRECTION, RUNDECK_MONITOR_PROPERTY_FAILED_JOB_REDIRECTION_DEFAULT_VALUE);
183 		versionCheckerDisabled = getBooleanProperty(properties, RUNDECK_MONITOR_PROPERTY_DISABLE_VERSION_CHECKER, RUNDECK_MONITOR_PROPERTY_DISABLE_VERSION_CHECKER_DEFAULT_VALUE);
184 		interfaceType = properties.getProperty(RUNDECK_MONITOR_PROPERTY_INTERFACE_TYPE, RUNDECK_MONITOR_PROPERTY_INTERFACE_TYPE_DEFAULT_VALUE);
185 	}
186 
187 	/**
188 	 * Check loaded configuration.
189 	 * 
190 	 * @throws InvalidPropertyException in case of loading configuration property error
191 	 * @throws MissingPropertyException in case of loading configuration property error
192 	 */
193 	public void verifyConfiguration() throws MissingPropertyException, InvalidPropertyException {
194 
195 		// Configuration checking
196 
197 		checkMandatoryStringProperty(rundeckUrl, RUNDECK_MONITOR_PROPERTY_URL);
198 		checkMandatoryStringProperty(rundeckProject, RUNDECK_MONITOR_PROPERTY_PROJECT);
199 
200 		boolean missingAPIKey = false;
201 		try {
202 			checkMandatoryStringProperty(rundeckAPIKey, RUNDECK_MONITOR_PROPERTY_API_KEY);
203 		}
204 		catch (final MissingPropertyException | InvalidPropertyException e) {
205 			missingAPIKey = false;
206 		}
207 
208 		if (missingAPIKey) {
209 			checkMandatoryStringProperty(rundeckLogin, RUNDECK_MONITOR_PROPERTY_LOGIN);
210 			checkMandatoryStringProperty(rundeckPassword, RUNDECK_MONITOR_PROPERTY_PASSWORD);
211 		}
212 
213 		// Test the configured date format
214 		try {
215 			new SimpleDateFormat(dateFormat);
216 		}
217 		catch (final IllegalArgumentException e) {
218 			dateFormat = RUNDECK_MONITOR_PROPERTY_DATE_FORMAT_DEFAULT_VALUE;
219 		}
220 
221 		// Test the configured tab redirection
222 		try {
223 			JobTabRedirection.valueOf(jobTabRedirection);
224 		}
225 		catch (final IllegalArgumentException e) {
226 			jobTabRedirection = RUNDECK_MONITOR_PROPERTY_FAILED_JOB_REDIRECTION_DEFAULT_VALUE;
227 		}
228 
229 	}
230 
231 	/**
232 	 * Check a property value.
233 	 * 
234 	 * @param property property loaded (can be null)
235 	 * @param propertyName name of the loaded property
236 	 * @throws MissingPropertyException if the property is null
237 	 * @throws InvalidPropertyException if the property is empty
238 	 */
239 	private static void checkMandatoryStringProperty(final String property, final String propertyName) throws MissingPropertyException, InvalidPropertyException {
240 
241 		if (null == property) {
242 			throw new MissingPropertyException(propertyName);
243 		}
244 		else if (property.isEmpty()) {
245 			throw new InvalidPropertyException(propertyName, property);
246 		}
247 	}
248 
249 	/**
250 	 * Get an optional integer property.
251 	 * 
252 	 * @param properties loaded properties
253 	 * @param propertyName property name to get
254 	 * @param defaultValue value to set if the property is missing or is invalid
255 	 * @return property value
256 	 */
257 	private static int getIntegerProperty(final Properties properties, final String propertyName, final int defaultValue) {
258 
259 		final String propertyValue = properties.getProperty(propertyName, String.valueOf(defaultValue));
260 
261 		if (propertyValue.isEmpty()) {
262 			return defaultValue;
263 		}
264 
265 		try {
266 			return Integer.parseInt(propertyValue);
267 		}
268 		catch (final NumberFormatException e) {
269 			return defaultValue;
270 		}
271 	}
272 
273 	/**
274 	 * Get an optional boolean property.
275 	 * 
276 	 * @param properties loaded properties
277 	 * @param propertyName property name to get
278 	 * @param defaultValue value to set if the property is missing or is invalid
279 	 * @return property value
280 	 */
281 	private static boolean getBooleanProperty(final Properties properties, final String propertyName, final boolean defaultValue) {
282 
283 		return Boolean.parseBoolean(properties.getProperty(propertyName, String.valueOf(defaultValue)));
284 	}
285 
286 	/**
287 	 * Save the current loaded configuration to the configuration file.
288 	 * 
289 	 * @throws IOException in case of writing error
290 	 */
291 	public void saveMonitorConfigurationPropertieFile() throws IOException {
292 
293 		// Add all properties
294 		final Properties properties = new Properties();
295 
296 		properties.put(RUNDECK_MONITOR_PROPERTY_URL, rundeckUrl);
297 		properties.put(RUNDECK_MONITOR_PROPERTY_API_KEY, rundeckAPIKey);
298 		properties.put(RUNDECK_MONITOR_PROPERTY_LOGIN, rundeckLogin);
299 		properties.put(RUNDECK_MONITOR_PROPERTY_PASSWORD, rundeckPassword);
300 		properties.put(RUNDECK_MONITOR_PROPERTY_PROJECT, rundeckProject);
301 		properties.put(RUNDECK_MONITOR_PROPERTY_NAME, rundeckMonitorName);
302 		properties.put(RUNDECK_MONITOR_PROPERTY_REFRESH_DELAY, String.valueOf(refreshDelay));
303 		properties.put(RUNDECK_MONITOR_PROPERTY_EXECUTION_LATE_THRESHOLD, String.valueOf(lateThreshold));
304 		properties.put(RUNDECK_MONITOR_PROPERTY_FAILED_JOB_NUMBER, String.valueOf(failedJobNumber));
305 		properties.put(RUNDECK_MONITOR_PROPERTY_DATE_FORMAT, dateFormat);
306 		properties.put(RUNDECK_MONITOR_PROPERTY_API_VERSION, String.valueOf(rundeckAPIversion));
307 		properties.put(RUNDECK_MONITOR_PROPERTY_FAILED_JOB_REDIRECTION, jobTabRedirection);
308 		properties.put(RUNDECK_MONITOR_PROPERTY_DISABLE_VERSION_CHECKER, String.valueOf(versionCheckerDisabled));
309 		properties.put(RUNDECK_MONITOR_PROPERTY_INTERFACE_TYPE, interfaceType);
310 
311 		// Comment header
312 		final StringBuilder commentStringBuilder = new StringBuilder();
313 		commentStringBuilder.append("Generated by RundeckMonitor wizard at: "); //$NON-NLS-1$
314 		try {
315 			final SimpleDateFormat formatter = new SimpleDateFormat(dateFormat);
316 			commentStringBuilder.append(formatter.format(new Date()));
317 		}
318 		catch (final IllegalArgumentException e) {
319 			commentStringBuilder.append(new Date());
320 		}
321 		commentStringBuilder.append(System.lineSeparator());
322 		commentStringBuilder.append("-------------------------------------------------------"); //$NON-NLS-1$
323 
324 		// Properties file writing
325 		final Path propertyFile = Paths.get(RUNDECK_MONITOR_PROPERTIES_FILE);
326 		try (final Writer propertyFilewriter = Files.newBufferedWriter(propertyFile, StandardCharsets.UTF_8)) {
327 			properties.store(propertyFilewriter, commentStringBuilder.toString());
328 		}
329 	}
330 
331 	/**
332 	 * Disable the version checker.
333 	 */
334 	public void disableVersionChecker() {
335 
336 		versionCheckerDisabled = true;
337 	}
338 
339 	/**
340 	 * Check if the configuration file exists and is readable.
341 	 * 
342 	 * @return true if the configuration file exists and can be read
343 	 */
344 	public static boolean propertiesFileExists() {
345 
346 		final Path propertyFile = Paths.get(RUNDECK_MONITOR_PROPERTIES_FILE);
347 		return Files.exists(propertyFile) && Files.isReadable(propertyFile);
348 	}
349 
350 	/**
351 	 * Check if the configuration file has been updated.
352 	 * 
353 	 * @param date date of the last configuration loading
354 	 * @return true if the configuration file is newer than the date
355 	 */
356 	public static boolean propertiesFileUpdated(final Date date) {
357 
358 		final Path propertyFile = Paths.get(RUNDECK_MONITOR_PROPERTIES_FILE);
359 		if (Files.exists(propertyFile)) {
360 
361 			final Date fileTime;
362 			try {
363 				fileTime = new Date(Files.getLastModifiedTime(propertyFile).toMillis());
364 			}
365 			catch (final IOException e) {
366 				return false;
367 			}
368 
369 			return fileTime.after(date);
370 		}
371 
372 		return false;
373 	}
374 
375 	/**
376 	 * Return the RunDeck URL.
377 	 * 
378 	 * @return RunDeck URL
379 	 */
380 	public String getRundeckUrl() {
381 		return rundeckUrl;
382 	}
383 
384 	/**
385 	 * Return the RunDeck API key.
386 	 * 
387 	 * @return RunDeck API key
388 	 */
389 	public String getRundeckAPIKey() {
390 		return rundeckAPIKey;
391 	}
392 
393 	/**
394 	 * Return the RunDeck login.
395 	 * 
396 	 * @return RunDeck login
397 	 */
398 	public String getRundeckLogin() {
399 		return rundeckLogin;
400 	}
401 
402 	/**
403 	 * Return the RunDeck paswword.
404 	 * 
405 	 * @return RunDeck paswword
406 	 */
407 	public String getRundeckPassword() {
408 		return rundeckPassword;
409 	}
410 
411 	/**
412 	 * Return the RunDeck project.
413 	 * 
414 	 * @return RunDeck project
415 	 */
416 	public String getRundeckProject() {
417 		return rundeckProject;
418 	}
419 
420 	/**
421 	 * Return the RunDeck monitor name.
422 	 * 
423 	 * @return RunDeck monitor name
424 	 */
425 	public String getRundeckMonitorName() {
426 		return rundeckMonitorName;
427 	}
428 
429 	/**
430 	 * Return the RunDeck monitor refresh delay.
431 	 * 
432 	 * @return RunDeck monitor refresh delay
433 	 */
434 	public int getRefreshDelay() {
435 		return refreshDelay;
436 	}
437 
438 	/**
439 	 * Return the RunDeck monitor late threshold.
440 	 * 
441 	 * @return RunDeck monitor late threshold
442 	 */
443 	public int getLateThreshold() {
444 		return lateThreshold;
445 	}
446 
447 	/**
448 	 * Return the RunDeck monitor failed job number.
449 	 * 
450 	 * @return RunDeck monitor failed job number
451 	 */
452 	public int getFailedJobNumber() {
453 		return failedJobNumber;
454 	}
455 
456 	/**
457 	 * Return the RunDeck monitor date format.
458 	 * 
459 	 * @return RunDeck monitor date format
460 	 */
461 	public String getDateFormat() {
462 		return dateFormat;
463 	}
464 
465 	/**
466 	 * Return the RunDeck monitor API version.
467 	 * 
468 	 * @return RunDeck monitor API version
469 	 */
470 	public int getRundeckAPIversion() {
471 		return rundeckAPIversion;
472 	}
473 
474 	/**
475 	 * Return the RunDeck monitor job tab redirection.
476 	 * 
477 	 * @return RunDeck monitor job tab redirection
478 	 */
479 	public String getJobTabRedirection() {
480 		return jobTabRedirection;
481 	}
482 
483 	/**
484 	 * Return the RunDeck monitor GUI type.
485 	 * 
486 	 * @return RunDeck monitor GUI type
487 	 */
488 	public String getInterfaceType() {
489 		return interfaceType;
490 	}
491 
492 	/**
493 	 * Return the RunDeck monitor version checker flag.
494 	 * 
495 	 * @return true if the version checker is enabled
496 	 */
497 	public boolean isVersionCheckerEnabled() {
498 		return !versionCheckerDisabled;
499 	}
500 
501 	/**
502 	 * Set the RunDeck URL.
503 	 * 
504 	 * @param rundeckUrlArg RunDeck URL to set
505 	 */
506 	public void setRundeckUrl(final String rundeckUrlArg) {
507 		rundeckUrl = rundeckUrlArg;
508 	}
509 
510 	/**
511 	 * Set the RunDeck API key.
512 	 * 
513 	 * @param rundeckAPIKeyArg API key to set
514 	 */
515 	public void setRundeckAPIKey(final String rundeckAPIKeyArg) {
516 		this.rundeckAPIKey = rundeckAPIKeyArg;
517 	}
518 
519 	/**
520 	 * Set the RunDeck login.
521 	 * 
522 	 * @param rundeckLoginArg login to set
523 	 */
524 	public void setRundeckLogin(final String rundeckLoginArg) {
525 		this.rundeckLogin = rundeckLoginArg;
526 	}
527 
528 	/**
529 	 * Set the RunDeck password.
530 	 * 
531 	 * @param rundeckPasswordArg password to set
532 	 */
533 	public void setRundeckPassword(final String rundeckPasswordArg) {
534 		this.rundeckPassword = rundeckPasswordArg;
535 	}
536 
537 	/**
538 	 * Set the RunDeck project.
539 	 * 
540 	 * @param rundeckProjectArg project to set
541 	 */
542 	public void setRundeckProject(final String rundeckProjectArg) {
543 		this.rundeckProject = rundeckProjectArg;
544 	}
545 
546 	/**
547 	 * Set the RunDeck monitor name.
548 	 * 
549 	 * @param rundeckMonitorNameArg monitor name to set
550 	 */
551 	public void setRundeckMonitorName(final String rundeckMonitorNameArg) {
552 		this.rundeckMonitorName = rundeckMonitorNameArg;
553 	}
554 
555 	/**
556 	 * Set the RunDeck monitor refresh delay.
557 	 * 
558 	 * @param refreshDelayArg refresh delay to set
559 	 */
560 	public void setRefreshDelay(final int refreshDelayArg) {
561 		this.refreshDelay = refreshDelayArg;
562 	}
563 
564 	/**
565 	 * Set the RunDeck monitor late threshold.
566 	 * 
567 	 * @param lateThresholdArg late threashold to set
568 	 */
569 	public void setLateThreshold(final int lateThresholdArg) {
570 		this.lateThreshold = lateThresholdArg;
571 	}
572 
573 	/**
574 	 * Set the RunDeck monitor failed job number.
575 	 * 
576 	 * @param failedJobNumberArg failed job number to set
577 	 */
578 	public void setFailedJobNumber(final int failedJobNumberArg) {
579 		this.failedJobNumber = failedJobNumberArg;
580 	}
581 
582 	/**
583 	 * Set the RunDeck monitor date format.
584 	 * 
585 	 * @param dateFormatArg date format to set
586 	 */
587 	public void setDateFormat(final String dateFormatArg) {
588 		this.dateFormat = dateFormatArg;
589 	}
590 
591 	/**
592 	 * Set the RunDeck monitor API version.
593 	 * 
594 	 * @param rundeckAPIversionArg API version to set
595 	 */
596 	public void setRundeckAPIversion(final int rundeckAPIversionArg) {
597 		this.rundeckAPIversion = rundeckAPIversionArg;
598 	}
599 
600 	/**
601 	 * Set the RunDeck monitor job tab redirection.
602 	 * 
603 	 * @param jobTabRedirectionArg job tab redirection to set
604 	 */
605 	public void setJobTabRedirection(final String jobTabRedirectionArg) {
606 		this.jobTabRedirection = jobTabRedirectionArg;
607 	}
608 
609 	/**
610 	 * Set the RunDeck monitor GUI type.
611 	 * 
612 	 * @param interfaceTypeArg GUI type to set
613 	 */
614 	public void setInterfaceType(final String interfaceTypeArg) {
615 		this.interfaceType = interfaceTypeArg;
616 	}
617 
618 }