public class ConfigurableProperties extends BaseService implements PropertiesInterface
_serviceNameBYPASSED, CONFIGURED, UNCONFIGURED| Modifier | Constructor and Description |
|---|---|
protected |
ConfigurableProperties()
private constructor since this is a singleton
|
| Modifier and Type | Method and Description |
|---|---|
void |
addProperty(java.lang.String propertyName,
java.lang.String value)
Utility method to add a property value both in memory and to the
properties file
|
boolean |
arePropertiesConfigured()
Reports whether properties are fully configured.
|
void |
bypassConfiguration()
Reports whether the metacat configuration utility should be run.
|
boolean |
checkAndSetProperty(javax.servlet.http.HttpServletRequest request,
java.lang.String propertyName)
Take input from the user in an HTTP request about an property to be changed
and update the metacat property file with that new value if it has
changed from the value that was originally set.
|
boolean |
doBypass()
Determine if the system is configured to bypass configuration.
|
void |
doRefresh() |
edu.ucsb.nceas.utilities.SortedProperties |
getAuthBackupProperties()
Get the auth backup properties file.
|
edu.ucsb.nceas.utilities.PropertiesMetaData |
getAuthMetaData()
Get the auth properties metadata.
|
edu.ucsb.nceas.utilities.SortedProperties |
getMainBackupProperties()
Get the main backup properties file.
|
edu.ucsb.nceas.utilities.PropertiesMetaData |
getMainMetaData()
Get the main properties metadata.
|
java.util.Map<java.lang.String,java.lang.String> |
getPropertiesByGroup(java.lang.String groupName)
Get a Map of all properties that start with the groupName prefix.
|
java.lang.String |
getProperty(java.lang.String propertyName)
Utility method to get a property value from the properties file
|
java.util.Vector<java.lang.String> |
getPropertyNames()
Get a set of all property names.
|
java.util.Vector<java.lang.String> |
getPropertyNamesByGroup(java.lang.String groupName)
Get a Set of all property names that start with the groupName prefix.
|
void |
persistAuthBackupProperties(javax.servlet.ServletContext servletContext)
Writes out backup configurable properties to a file.
|
void |
persistMainBackupProperties()
Writes out backup configurable properties to a file.
|
void |
persistProperties()
Save the properties to a properties file.
|
boolean |
refreshable() |
void |
setProperty(java.lang.String propertyName,
java.lang.String newValue)
Utility method to set a property value both in memory and to the
properties file
|
void |
setPropertyNoPersist(java.lang.String propertyName,
java.lang.String newValue)
Utility method to set a property value in memory.
|
void |
stop() |
refreshprotected ConfigurableProperties()
throws ServiceException
servletContext - the context we will use to get relative pathsServiceExceptionpublic boolean refreshable()
refreshable in class BaseServicepublic void doRefresh()
throws ServiceException
doRefresh in class BaseServiceServiceExceptionpublic void stop()
throws ServiceException
stop in class BaseServiceServiceExceptionpublic java.lang.String getProperty(java.lang.String propertyName)
throws edu.ucsb.nceas.utilities.PropertyNotFoundException
getProperty in interface PropertiesInterfacepropertyName - the name of the property requestededu.ucsb.nceas.utilities.PropertyNotFoundExceptionpublic java.util.Vector<java.lang.String> getPropertyNames()
getPropertyNames in interface PropertiesInterfacepublic java.util.Vector<java.lang.String> getPropertyNamesByGroup(java.lang.String groupName)
getPropertyNamesByGroup in interface PropertiesInterfacegroupName - the prefix of the keys to search for.public java.util.Map<java.lang.String,java.lang.String> getPropertiesByGroup(java.lang.String groupName)
throws edu.ucsb.nceas.utilities.PropertyNotFoundException
getPropertiesByGroup in interface PropertiesInterfacegroupName - the prefix of the keys to search for.edu.ucsb.nceas.utilities.PropertyNotFoundExceptionpublic void addProperty(java.lang.String propertyName,
java.lang.String value)
throws edu.ucsb.nceas.utilities.GeneralPropertyException
addProperty in interface PropertiesInterfacepropertyName - the name of the property to addnewValue - the value for the propertyedu.ucsb.nceas.utilities.GeneralPropertyExceptionpublic void setProperty(java.lang.String propertyName,
java.lang.String newValue)
throws edu.ucsb.nceas.utilities.GeneralPropertyException
setProperty in interface PropertiesInterfacepropertyName - the name of the property requestednewValue - the new value for the propertyedu.ucsb.nceas.utilities.GeneralPropertyExceptionpublic void setPropertyNoPersist(java.lang.String propertyName,
java.lang.String newValue)
throws edu.ucsb.nceas.utilities.GeneralPropertyException
setPropertyNoPersist in interface PropertiesInterfacepropertyName - the name of the property requestednewValue - the new value for the propertyedu.ucsb.nceas.utilities.GeneralPropertyExceptionpublic void persistProperties()
throws edu.ucsb.nceas.utilities.GeneralPropertyException
persistProperties in interface PropertiesInterfaceedu.ucsb.nceas.utilities.GeneralPropertyExceptionpublic edu.ucsb.nceas.utilities.SortedProperties getMainBackupProperties()
getMainBackupProperties in interface PropertiesInterfacepublic edu.ucsb.nceas.utilities.SortedProperties getAuthBackupProperties()
getAuthBackupProperties in interface PropertiesInterfacepublic edu.ucsb.nceas.utilities.PropertiesMetaData getMainMetaData()
getMainMetaData in interface PropertiesInterfacepublic edu.ucsb.nceas.utilities.PropertiesMetaData getAuthMetaData()
getAuthMetaData in interface PropertiesInterfacepublic void persistMainBackupProperties()
throws edu.ucsb.nceas.utilities.GeneralPropertyException
persistMainBackupProperties in interface PropertiesInterfaceedu.ucsb.nceas.utilities.GeneralPropertyExceptionpublic void persistAuthBackupProperties(javax.servlet.ServletContext servletContext)
throws edu.ucsb.nceas.utilities.GeneralPropertyException
persistAuthBackupProperties in interface PropertiesInterfaceedu.ucsb.nceas.utilities.GeneralPropertyExceptionpublic boolean arePropertiesConfigured()
throws edu.ucsb.nceas.utilities.GeneralPropertyException
arePropertiesConfigured in interface PropertiesInterfaceedu.ucsb.nceas.utilities.GeneralPropertyExceptionpublic boolean doBypass()
throws edu.ucsb.nceas.utilities.PropertyNotFoundException
doBypass in interface PropertiesInterfaceedu.ucsb.nceas.utilities.PropertyNotFoundExceptionpublic void bypassConfiguration()
throws edu.ucsb.nceas.utilities.GeneralPropertyException
bypassConfiguration in interface PropertiesInterfaceedu.ucsb.nceas.utilities.GeneralPropertyExceptionpublic boolean checkAndSetProperty(javax.servlet.http.HttpServletRequest request,
java.lang.String propertyName)
throws edu.ucsb.nceas.utilities.GeneralPropertyException
checkAndSetProperty in interface PropertiesInterfacerequest - that was generated by the userresponse - to send output back to the userpropertyName - the name of the property to be checked and setedu.ucsb.nceas.utilities.GeneralPropertyExceptionCopyright © 2020 Regents of the University of California. All Rights Reserved.