public enum PASharedProperties extends Enum<PASharedProperties> implements PACommonProperties
Enum Constant and Description |
---|
FAILED_LOGIN_MAX_ATTEMPTS
maximum number of failed attempts accepted in the given time window (to prevent brute force attacks).
|
FAILED_LOGIN_RENEW_MINUTES
time window in minutes after which a failed login attempt is forgotten
|
LAZY_FETCH_SCRIPT
Controls the fetch mode of scripts defined by URL.
|
PROPERTIES_CRYPT_KEY
Key used when decrypting properties
|
SERVER_BACKUP
if backup is enabled
|
SERVER_BACKUP_DESTINATION
a relative or absolute path to a folder (where the backup files should be stored)
|
SERVER_BACKUP_PERIOD
cron expression which defines when backup should be performed (every day by default).
|
SERVER_BACKUP_POSSIBLE_DELAY
backup mechanism may wait possible.delay (in seconds) until all currently running tasks are finished.
|
SERVER_BACKUP_TARGETS
comma-separated list of folder and/or files which need to be backup
|
SERVER_BACKUP_WINDOWS
determines how many backups should be kept
|
SHARED_HOME
reusing existing rm home property
|
Modifier and Type | Field and Description |
---|---|
static String |
PA_SHARED_PROPERTIES_FILEPATH |
static String |
PA_SHARED_PROPERTIES_RELATIVE_FILEPATH |
Modifier and Type | Method and Description |
---|---|
static String |
getAbsolutePath(String userPath)
Get the absolute path of the given path.
It the path is absolute, then it is returned. |
String |
getCmdLine()
Returns the string to be passed on the command line
The property surrounded by '-D' and '='
|
String |
getConfigurationDefaultRelativeFilePath()
Returns the default relative path used to store the property file
|
String |
getConfigurationFilePathPropertyName()
Returns the System property name used to store the configuration file path
|
String |
getKey()
Get the key.
|
static Map<String,Object> |
getPropertiesAsHashMap()
Return all properties as a HashMap.
|
PropertyType |
getType()
Return the type of the given properties.
|
boolean |
getValueAsBoolean()
Returns the value of this property as a boolean.
|
int |
getValueAsInt()
Returns the value of this property as an integer.
|
List<String> |
getValueAsList(String separator)
Returns the value of this property as a List of strings.
|
List<String> |
getValueAsList(String separator,
boolean allowEmpty)
Returns the value of this property as a List of strings.
|
long |
getValueAsLong()
Returns the value of this property as a long integer.
|
String |
getValueAsString()
Returns the value of this property as a string.
|
String |
getValueAsStringOrNull()
Returns the value of this property as a string.
|
boolean |
isSet()
Return true if this property is set or has a default value, false otherwise.
|
protected static void |
loadProperties(String filename)
Load the properties from the given file.
|
void |
loadPropertiesFromFile(String filename)
Load the properties from the given file.
|
static void |
reload() |
void |
reloadConfiguration()
Reload the properties using the default property file configuration
This method will clean every loaded properties before.
|
String |
toString() |
void |
unSet()
Unset this property, if this property has a default value, calling unSet will revert to the default.
|
static void |
updateProperties(String filename)
Override properties defined in the default configuration file,
by properties defined in another file.
|
void |
updateProperty(String value)
Set the value of this property to the given one.
|
static PASharedProperties |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static PASharedProperties[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final PASharedProperties SHARED_HOME
public static final PASharedProperties FAILED_LOGIN_MAX_ATTEMPTS
public static final PASharedProperties FAILED_LOGIN_RENEW_MINUTES
public static final PASharedProperties PROPERTIES_CRYPT_KEY
public static final PASharedProperties SERVER_BACKUP
public static final PASharedProperties SERVER_BACKUP_PERIOD
public static final PASharedProperties SERVER_BACKUP_WINDOWS
public static final PASharedProperties SERVER_BACKUP_DESTINATION
public static final PASharedProperties SERVER_BACKUP_TARGETS
public static final PASharedProperties SERVER_BACKUP_POSSIBLE_DELAY
public static final PASharedProperties LAZY_FETCH_SCRIPT
public static final String PA_SHARED_PROPERTIES_FILEPATH
public static final String PA_SHARED_PROPERTIES_RELATIVE_FILEPATH
public static PASharedProperties[] values()
for (PASharedProperties c : PASharedProperties.values()) System.out.println(c);
public static PASharedProperties valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullprotected static void loadProperties(String filename)
filename
- the file containing the properties to be loaded.public static void reload()
public static void updateProperties(String filename)
filename
- path of file containing some properties to overridepublic static Map<String,Object> getPropertiesAsHashMap()
public static String getAbsolutePath(String userPath)
userPath
- the path to check transform.public String getConfigurationFilePathPropertyName()
PACommonProperties
getConfigurationFilePathPropertyName
in interface PACommonProperties
public String getConfigurationDefaultRelativeFilePath()
PACommonProperties
getConfigurationDefaultRelativeFilePath
in interface PACommonProperties
public void loadPropertiesFromFile(String filename)
PACommonProperties
loadPropertiesFromFile
in interface PACommonProperties
filename
- the file containing the properties to be loaded.public void reloadConfiguration()
PACommonProperties
reloadConfiguration
in interface PACommonProperties
public String getKey()
PACommonProperties
getKey
in interface PACommonProperties
public void updateProperty(String value)
PACommonProperties
updateProperty
in interface PACommonProperties
value
- the new value to set.public boolean isSet()
PACommonProperties
isSet
in interface PACommonProperties
public void unSet()
PACommonProperties
unSet
in interface PACommonProperties
public String getCmdLine()
PACommonProperties
getCmdLine
in interface PACommonProperties
public int getValueAsInt()
PACommonProperties
getValueAsInt
in interface PACommonProperties
public long getValueAsLong()
PACommonProperties
getValueAsLong
in interface PACommonProperties
public String getValueAsString()
PACommonProperties
getValueAsString
in interface PACommonProperties
public String getValueAsStringOrNull()
PACommonProperties
getValueAsStringOrNull
in interface PACommonProperties
public boolean getValueAsBoolean()
PACommonProperties
Boolean.parseBoolean(String s)
.getValueAsBoolean
in interface PACommonProperties
public List<String> getValueAsList(String separator)
PACommonProperties
getValueAsList
in interface PACommonProperties
separator
- the separator to usepublic List<String> getValueAsList(String separator, boolean allowEmpty)
PACommonProperties
getValueAsList
in interface PACommonProperties
separator
- the separator to useallowEmpty
- allow empty values in the listpublic PropertyType getType()
PACommonProperties
getType
in interface PACommonProperties
public String toString()
toString
in class Enum<PASharedProperties>
Enum.toString()