| Modifier and Type | Field and Description | 
|---|---|
private long | 
dateDelta
Time zone difference between local machine and rundeck server to correctly detect late execution. 
 | 
private Set<Long> | 
knownFailedExecutionIds
Set for all known failed execution identifiers. 
 | 
private Set<Long> | 
knownLateExecutionIds
Set for all known late execution identifiers. 
 | 
private static org.slf4j.ext.XLogger | 
LOG
SLF4J XLogger. 
 | 
private static long | 
ONE_SECOND
One second in mille-seconds. 
 | 
private RundeckClient | 
rundeckClient
Rundeck client API used to interact with rundeck rest API. 
 | 
private RundeckMonitorConfiguration | 
rundeckMonitorConfiguration
Configuration of the rundeck monitor with default values if some properties are missing or are empty. 
 | 
private RundeckMonitorState | 
rundeckMonitorState
Current state (failed job/long process/disconnected) of the rundeck monitor. 
 | 
private RundeckMonitorTrayIcon | 
rundeckMonitorTrayIcon
Tray icon and his menu for updating jobs and state displayed. 
 | 
private VersionChecker | 
versionChecker
Version checker instance. 
 | 
| Constructor and Description | 
|---|
RundeckMonitor(RundeckMonitorConfiguration rundeckMonitorConfigurationArg,
              VersionChecker versionCheckerArg)
Initialize the rundeck monitor, load configuration and try to connect to the configured rundeck. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
private boolean | 
checkNewConfiguration(Date lastConfigurationUpdateDate)
Check if the configuration file has been modified and reload it if needed. 
 | 
private static boolean | 
handleStartupException(Exception exception,
                      boolean initialization)
Rundeck launcher exception handler, display an error message based on the argument exception. 
 | 
private void | 
initRundeckClient()
Check the configuration and initialize a new rundeck client. 
 | 
static void | 
main(String[] args)
RundeckMonitor main method. 
 | 
void | 
reloadConfiguration()
Reload the configuration file and update the RunDeck Moinitor with new datas. 
 | 
void | 
run()
RundeckMonitor background process method executing the main loop. 
 | 
private void | 
updateRundeckHistory(boolean init)
Call Rundeck rest API and update the monitor state and displayed jobs if there are new failed/late jobs. 
 | 
private static final org.slf4j.ext.XLogger LOG
private static final long ONE_SECOND
private final VersionChecker versionChecker
private final RundeckMonitorConfiguration rundeckMonitorConfiguration
private long dateDelta
private RundeckClient rundeckClient
private final RundeckMonitorTrayIcon rundeckMonitorTrayIcon
private final RundeckMonitorState rundeckMonitorState
private final Set<Long> knownLateExecutionIds
public RundeckMonitor(RundeckMonitorConfiguration rundeckMonitorConfigurationArg, VersionChecker versionCheckerArg) throws IOException, MissingPropertyException, InvalidPropertyException, UnknownProjectException, InvalidRundeckVersion
rundeckMonitorConfigurationArg - rundeck monitor loaded configurationversionCheckerArg - optionaly launched automatic version checkerIOException - in case of loading configuration errorInvalidPropertyException - in case of loading configuration property errorMissingPropertyException - in case of loading configuration property errorUnknownProjectException - in case of unknown RunDeck projectInvalidRundeckVersion - if the Rundeck version is not supportedpublic void reloadConfiguration()
                         throws IOException,
                                MissingPropertyException,
                                InvalidPropertyException,
                                UnknownProjectException,
                                InvalidRundeckVersion
IOException - in case of loading configuration errorMissingPropertyException - in case of loading configuration property errorInvalidPropertyException - in case of loading configuration property errorUnknownProjectException - in case of unknown RunDeck projectInvalidRundeckVersion - if the Rundeck version is not supportedprivate void initRundeckClient()
                        throws MissingPropertyException,
                               InvalidPropertyException,
                               UnknownProjectException,
                               InvalidRundeckVersion
MissingPropertyException - when check configurationInvalidPropertyException - when check configurationUnknownProjectException - if the configured project is unknownInvalidRundeckVersion - if the Rundeck version is not supportedprivate boolean checkNewConfiguration(Date lastConfigurationUpdateDate)
lastConfigurationUpdateDate - last configuration update datepublic void run()
private void updateRundeckHistory(boolean init)
init - boolean to indicate if it's the first call to this method for the monitor initializationprivate static boolean handleStartupException(Exception exception, boolean initialization)
exception - exception to analyzeinitialization - indicate if the tray icon is not loaded yetpublic static void main(String[] args)
args - program arguments: none is expected and usedCopyright © 2013–2015. All rights reserved.