public final class RundeckMonitorConfiguration extends Object
Modifier and Type | Field and Description |
---|---|
private String |
dateFormat
Displayed date format.
|
private int |
failedJobNumber
Number of displayed failed jobs.
|
private String |
interfaceType
Type of GUI interface used.
|
private String |
jobTabRedirection
Job tab redirection.
|
private int |
lateThreshold
Threshold for detecting long execution.
|
private int |
refreshDelay
Delay between 2 refresh of rundeck's data.
|
static String |
RUNDECK_MONITOR_PROPERTIES_FILE
Configuration file name.
|
static String |
RUNDECK_MONITOR_PROPERTY_API_KEY
RunDeck API key property name.
|
private static String |
RUNDECK_MONITOR_PROPERTY_API_VERSION
RunDeck monitor API version property name.
|
private static int |
RUNDECK_MONITOR_PROPERTY_API_VERSION_DEFAULT_VALUE
RunDeck monitor API version default value.
|
private static String |
RUNDECK_MONITOR_PROPERTY_DATE_FORMAT
RunDeck monitor date format property name.
|
static String |
RUNDECK_MONITOR_PROPERTY_DATE_FORMAT_DEFAULT_VALUE
RunDeck monitor date format default value.
|
private static String |
RUNDECK_MONITOR_PROPERTY_DISABLE_VERSION_CHECKER
RunDeck monitor version checker property name.
|
private static boolean |
RUNDECK_MONITOR_PROPERTY_DISABLE_VERSION_CHECKER_DEFAULT_VALUE
RunDeck monitor version checker default value.
|
private static String |
RUNDECK_MONITOR_PROPERTY_EXECUTION_LATE_THRESHOLD
RunDeck monitor late threshold property name.
|
private static int |
RUNDECK_MONITOR_PROPERTY_EXECUTION_LATE_THRESHOLD_DEFAULT_VALUE
RunDeck monitor late threshold default value.
|
private static String |
RUNDECK_MONITOR_PROPERTY_FAILED_JOB_NUMBER
RunDeck monitor failed job number property name.
|
private static int |
RUNDECK_MONITOR_PROPERTY_FAILED_JOB_NUMBER_DEFAULT_VALUE
RunDeck monitor failed job number default value.
|
private static String |
RUNDECK_MONITOR_PROPERTY_FAILED_JOB_REDIRECTION
RunDeck monitor job redirection property name.
|
private static String |
RUNDECK_MONITOR_PROPERTY_FAILED_JOB_REDIRECTION_DEFAULT_VALUE
RunDeck monitor job redirection default value.
|
private static String |
RUNDECK_MONITOR_PROPERTY_INTERFACE_TYPE
RunDeck monitor GUI type property name.
|
private static String |
RUNDECK_MONITOR_PROPERTY_INTERFACE_TYPE_DEFAULT_VALUE
RunDeck monitor GUI type default value.
|
static String |
RUNDECK_MONITOR_PROPERTY_LOGIN
RunDeck login property name.
|
private static String |
RUNDECK_MONITOR_PROPERTY_NAME
RunDeck monitor name property name.
|
static String |
RUNDECK_MONITOR_PROPERTY_NAME_DEFAULT_VALUE
RunDeck monitor name default value.
|
static String |
RUNDECK_MONITOR_PROPERTY_PASSWORD
RunDeck password property name.
|
static String |
RUNDECK_MONITOR_PROPERTY_PROJECT
RunDeck project property name.
|
private static String |
RUNDECK_MONITOR_PROPERTY_REFRESH_DELAY
RunDeck monitor refresh delay property name.
|
private static int |
RUNDECK_MONITOR_PROPERTY_REFRESH_DELAY_DEFAULT_VALUE
RunDeck monitor refresh delay default value.
|
static String |
RUNDECK_MONITOR_PROPERTY_URL
RunDeck URL property name.
|
private String |
rundeckAPIKey
Rundeck API key.
|
private int |
rundeckAPIversion
RunDeck API version.
|
private String |
rundeckLogin
RunDeck login.
|
private String |
rundeckMonitorName
RunDeck monitor name.
|
private String |
rundeckPassword
RunDeck password.
|
private String |
rundeckProject
Name of the rundeck project to access.
|
private String |
rundeckUrl
RunDeck URL.
|
private boolean |
versionCheckerDisabled
Version checker flag.
|
Constructor and Description |
---|
RundeckMonitorConfiguration()
Default constructor.
|
RundeckMonitorConfiguration(RundeckMonitorConfiguration rundeckMonitorConfiguration)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
private static void |
checkMandatoryStringProperty(String property,
String propertyName)
Check a property value.
|
void |
disableVersionChecker()
Disable the version checker.
|
private static boolean |
getBooleanProperty(Properties properties,
String propertyName,
boolean defaultValue)
Get an optional boolean property.
|
String |
getDateFormat()
Return the RunDeck monitor date format.
|
int |
getFailedJobNumber()
Return the RunDeck monitor failed job number.
|
private static int |
getIntegerProperty(Properties properties,
String propertyName,
int defaultValue)
Get an optional integer property.
|
String |
getInterfaceType()
Return the RunDeck monitor GUI type.
|
String |
getJobTabRedirection()
Return the RunDeck monitor job tab redirection.
|
int |
getLateThreshold()
Return the RunDeck monitor late threshold.
|
int |
getRefreshDelay()
Return the RunDeck monitor refresh delay.
|
String |
getRundeckAPIKey()
Return the RunDeck API key.
|
int |
getRundeckAPIversion()
Return the RunDeck monitor API version.
|
String |
getRundeckLogin()
Return the RunDeck login.
|
String |
getRundeckMonitorName()
Return the RunDeck monitor name.
|
String |
getRundeckPassword()
Return the RunDeck paswword.
|
String |
getRundeckProject()
Return the RunDeck project.
|
String |
getRundeckUrl()
Return the RunDeck URL.
|
boolean |
isVersionCheckerEnabled()
Return the RunDeck monitor version checker flag.
|
void |
loadConfigurationPropertieFile()
Load configuration.
|
static boolean |
propertiesFileExists()
Check if the configuration file exists and is readable.
|
static boolean |
propertiesFileUpdated(Date date)
Check if the configuration file has been updated.
|
void |
saveMonitorConfigurationPropertieFile()
Save the current loaded configuration to the configuration file.
|
void |
setDateFormat(String dateFormatArg)
Set the RunDeck monitor date format.
|
void |
setFailedJobNumber(int failedJobNumberArg)
Set the RunDeck monitor failed job number.
|
void |
setInterfaceType(String interfaceTypeArg)
Set the RunDeck monitor GUI type.
|
void |
setJobTabRedirection(String jobTabRedirectionArg)
Set the RunDeck monitor job tab redirection.
|
void |
setLateThreshold(int lateThresholdArg)
Set the RunDeck monitor late threshold.
|
void |
setRefreshDelay(int refreshDelayArg)
Set the RunDeck monitor refresh delay.
|
void |
setRundeckAPIKey(String rundeckAPIKeyArg)
Set the RunDeck API key.
|
void |
setRundeckAPIversion(int rundeckAPIversionArg)
Set the RunDeck monitor API version.
|
void |
setRundeckLogin(String rundeckLoginArg)
Set the RunDeck login.
|
void |
setRundeckMonitorName(String rundeckMonitorNameArg)
Set the RunDeck monitor name.
|
void |
setRundeckPassword(String rundeckPasswordArg)
Set the RunDeck password.
|
void |
setRundeckProject(String rundeckProjectArg)
Set the RunDeck project.
|
void |
setRundeckUrl(String rundeckUrlArg)
Set the RunDeck URL.
|
void |
verifyConfiguration()
Check loaded configuration.
|
public static final String RUNDECK_MONITOR_PROPERTIES_FILE
public static final String RUNDECK_MONITOR_PROPERTY_URL
public static final String RUNDECK_MONITOR_PROPERTY_API_KEY
public static final String RUNDECK_MONITOR_PROPERTY_LOGIN
public static final String RUNDECK_MONITOR_PROPERTY_PASSWORD
public static final String RUNDECK_MONITOR_PROPERTY_PROJECT
private static final String RUNDECK_MONITOR_PROPERTY_NAME
public static final String RUNDECK_MONITOR_PROPERTY_NAME_DEFAULT_VALUE
private static final String RUNDECK_MONITOR_PROPERTY_REFRESH_DELAY
private static final int RUNDECK_MONITOR_PROPERTY_REFRESH_DELAY_DEFAULT_VALUE
private static final String RUNDECK_MONITOR_PROPERTY_EXECUTION_LATE_THRESHOLD
private static final int RUNDECK_MONITOR_PROPERTY_EXECUTION_LATE_THRESHOLD_DEFAULT_VALUE
private static final String RUNDECK_MONITOR_PROPERTY_FAILED_JOB_NUMBER
private static final int RUNDECK_MONITOR_PROPERTY_FAILED_JOB_NUMBER_DEFAULT_VALUE
private static final String RUNDECK_MONITOR_PROPERTY_DATE_FORMAT
public static final String RUNDECK_MONITOR_PROPERTY_DATE_FORMAT_DEFAULT_VALUE
private static final String RUNDECK_MONITOR_PROPERTY_API_VERSION
private static final int RUNDECK_MONITOR_PROPERTY_API_VERSION_DEFAULT_VALUE
private static final String RUNDECK_MONITOR_PROPERTY_FAILED_JOB_REDIRECTION
private static final String RUNDECK_MONITOR_PROPERTY_FAILED_JOB_REDIRECTION_DEFAULT_VALUE
private static final String RUNDECK_MONITOR_PROPERTY_DISABLE_VERSION_CHECKER
private static final boolean RUNDECK_MONITOR_PROPERTY_DISABLE_VERSION_CHECKER_DEFAULT_VALUE
private static final String RUNDECK_MONITOR_PROPERTY_INTERFACE_TYPE
private static final String RUNDECK_MONITOR_PROPERTY_INTERFACE_TYPE_DEFAULT_VALUE
private String rundeckUrl
private String rundeckAPIKey
private String rundeckLogin
private String rundeckPassword
private String rundeckProject
private String rundeckMonitorName
private int refreshDelay
private int lateThreshold
private int failedJobNumber
private String dateFormat
private int rundeckAPIversion
private String jobTabRedirection
private boolean versionCheckerDisabled
private String interfaceType
public RundeckMonitorConfiguration()
public RundeckMonitorConfiguration(RundeckMonitorConfiguration rundeckMonitorConfiguration)
rundeckMonitorConfiguration
- configuration to copypublic void loadConfigurationPropertieFile() throws IOException
IOException
- in case of loading configuration errorpublic void verifyConfiguration() throws MissingPropertyException, InvalidPropertyException
InvalidPropertyException
- in case of loading configuration property errorMissingPropertyException
- in case of loading configuration property errorprivate static void checkMandatoryStringProperty(String property, String propertyName) throws MissingPropertyException, InvalidPropertyException
property
- property loaded (can be null)propertyName
- name of the loaded propertyMissingPropertyException
- if the property is nullInvalidPropertyException
- if the property is emptyprivate static int getIntegerProperty(Properties properties, String propertyName, int defaultValue)
properties
- loaded propertiespropertyName
- property name to getdefaultValue
- value to set if the property is missing or is invalidprivate static boolean getBooleanProperty(Properties properties, String propertyName, boolean defaultValue)
properties
- loaded propertiespropertyName
- property name to getdefaultValue
- value to set if the property is missing or is invalidpublic void saveMonitorConfigurationPropertieFile() throws IOException
IOException
- in case of writing errorpublic void disableVersionChecker()
public static boolean propertiesFileExists()
public static boolean propertiesFileUpdated(Date date)
date
- date of the last configuration loadingpublic String getRundeckUrl()
public String getRundeckAPIKey()
public String getRundeckLogin()
public String getRundeckPassword()
public String getRundeckProject()
public String getRundeckMonitorName()
public int getRefreshDelay()
public int getLateThreshold()
public int getFailedJobNumber()
public String getDateFormat()
public int getRundeckAPIversion()
public String getJobTabRedirection()
public String getInterfaceType()
public boolean isVersionCheckerEnabled()
public void setRundeckUrl(String rundeckUrlArg)
rundeckUrlArg
- RunDeck URL to setpublic void setRundeckAPIKey(String rundeckAPIKeyArg)
rundeckAPIKeyArg
- API key to setpublic void setRundeckLogin(String rundeckLoginArg)
rundeckLoginArg
- login to setpublic void setRundeckPassword(String rundeckPasswordArg)
rundeckPasswordArg
- password to setpublic void setRundeckProject(String rundeckProjectArg)
rundeckProjectArg
- project to setpublic void setRundeckMonitorName(String rundeckMonitorNameArg)
rundeckMonitorNameArg
- monitor name to setpublic void setRefreshDelay(int refreshDelayArg)
refreshDelayArg
- refresh delay to setpublic void setLateThreshold(int lateThresholdArg)
lateThresholdArg
- late threashold to setpublic void setFailedJobNumber(int failedJobNumberArg)
failedJobNumberArg
- failed job number to setpublic void setDateFormat(String dateFormatArg)
dateFormatArg
- date format to setpublic void setRundeckAPIversion(int rundeckAPIversionArg)
rundeckAPIversionArg
- API version to setpublic void setJobTabRedirection(String jobTabRedirectionArg)
jobTabRedirectionArg
- job tab redirection to setpublic void setInterfaceType(String interfaceTypeArg)
interfaceTypeArg
- GUI type to setCopyright © 2013–2015. All rights reserved.