public interface PropertyIO extends Serializable
AbstractPropertyIO
.AbstractPropertyIO
Modifier and Type | Method and Description |
---|---|
String |
backup()
Returns a string containing all the properties [name=value] in the PropertyIO seperated by a line feed [
|
long |
getCacheTime()
How often the typed value cache for a PropertyIO should be automatically flushed every X milliseconds.
|
Date |
getLastLoaded()
The date for when a property was last loaded not using cache.
|
Date |
getLastSaved()
The date for when a property was last saved.
|
org.apache.commons.logging.Log |
getLogger()
Gets a logger
|
String |
getName()
A short descriptive name of the Property IO.
|
Properties |
getProperties()
Gets all the name,value pair in a Properties class instance.
|
String |
getSource()
A detailed description of the source of the property data.
|
<T> Object |
getTypedValue(String propertyName)
Gets type converted object value from the cache by the property name.
|
String |
getValue(String propertyName)
Gets the string value of the name.
|
boolean |
isCached()
A boolean that determines if the PropertyIO shall cache the name,value pairs and the type converted properties.
|
boolean |
isReadonly()
Determines if the IO is readonly or not.
|
void |
reload()
Reloads the name,value pairs for the PropertyIO, or forces the values to reload when read next time.
|
void |
setCacheTime(long cacheTimeInMs)
Sets the amount of milliseconds between flushing og typed value cache for the PropertyIO.
|
void |
setValue(String propertyName,
String value)
Sets the name,value as String in the IO.
|
void |
storeTypedValue(String propertyName,
Object value)
Stores a type converted value in the IO cache, if cache option is implemented.
|
void |
validate()
Validates the PropertyIO.
|
String getName()
String getSource()
String getValue(String propertyName)
${name}
in the value, will be passed by the StringUtils.replaceInlinedProperties(String)
method, to replace ${name} where name can either be
a System.getProperty(String) or System.getenv(String).propertyName
- the name of the property.null
is returned.StringUtils.replaceInlinedProperties(String)
,
PropertyFrameworkGlobals
<T> Object getTypedValue(String propertyName)
propertyName
- the name of Propertynull
.void storeTypedValue(String propertyName, Object value)
propertyName
- the name of the property.value
- the object value to store in cache.boolean isCached()
true
if it shall use cache, otherwise false
.boolean isReadonly()
true
if the PropertyIO is readonly, otherwise false
.void setValue(String propertyName, String value) throws PropertyIOException
propertyName
- the name of the propertyvalue
- the string value of the property.PropertyIOException
- if the IO is readonly or failed to write the value.void validate() throws PropertyIOException
PropertyIOException
void reload()
Properties getProperties()
Properties
Date getLastLoaded()
getProperties
method, if not loaded new Date(0)
shall be returned.Date getLastSaved()
org.apache.commons.logging.Log getLogger()
String backup()
\n].
long getCacheTime()
reload()
void setCacheTime(long cacheTimeInMs)
cacheTimeInMs
- the amount of milliseconds between the typed value cache is flushed. if less than or equal to zero no automatic cache flush is performed and must be done manually with reload.