|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.ucsb.nceas.metacat.shared.BaseService
edu.ucsb.nceas.metacat.properties.PropertyService
public class PropertyService
A suite of utility classes for the metadata configuration utility
| Field Summary | |
|---|---|
static java.lang.String |
BYPASSED
|
static java.lang.String |
CONFIG_FILE_DIR
|
static java.lang.String |
CONFIG_FILE_NAME
|
static java.lang.String |
CONFIG_FILE_PATH
|
static java.lang.String |
CONFIGURED
|
static java.lang.String |
TEST_CONFIG_FILE_NAME
|
static java.lang.String |
UNCONFIGURED
|
| Fields inherited from class edu.ucsb.nceas.metacat.shared.BaseService |
|---|
_serviceName |
| Method Summary | |
|---|---|
static boolean |
arePropertiesConfigured()
Reports whether properties are fully configured. |
static void |
bypassConfiguration()
Reports whether the metacat configuration utility should be run. |
static void |
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. |
static boolean |
doBypass()
Determine if the system is configured to bypass configuration. |
void |
doRefresh()
|
static edu.ucsb.nceas.utilities.SortedProperties |
getAuthBackupProperties()
Get the auth backup properties file. |
static edu.ucsb.nceas.utilities.PropertiesMetaData |
getAuthMetaData()
Get the auth properties metadata. |
static PropertyService |
getInstance()
Get the single instance of PropertyService for test purposes. |
static PropertyService |
getInstance(javax.servlet.ServletContext context)
Get the single instance of PropertyService. |
static PropertyService |
getInstance(java.lang.String testConfigFileDir)
Get the single instance of PropertyService for test purposes. |
static edu.ucsb.nceas.utilities.SortedProperties |
getMainBackupProperties()
Get the main backup properties file. |
static edu.ucsb.nceas.utilities.PropertiesMetaData |
getMainMetaData()
Get the main properties metadata. |
static 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. |
static java.lang.String |
getProperty(java.lang.String propertyName)
Utility method to get a property value from the properties file |
static java.util.Vector<java.lang.String> |
getPropertyNames()
Get a set of all property names. |
static java.util.Vector<java.lang.String> |
getPropertyNamesByGroup(java.lang.String groupName)
Get a Set of all property names that start with the groupName prefix. |
static java.lang.String |
getRecommendedExternalDir()
Returns the recommended external base directory. |
static void |
persistAuthBackupProperties(javax.servlet.ServletContext servletContext)
Writes out backup configurable properties to a file. |
static void |
persistMainBackupProperties()
Writes out backup configurable properties to a file. |
static void |
persistProperties()
Save the properties to a properties file. |
boolean |
refreshable()
|
static 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 |
static void |
setPropertyNoPersist(java.lang.String propertyName,
java.lang.String newValue)
Utility method to set a property value in memory. |
static void |
setRecommendedExternalDir(java.lang.String extBaseDir)
Sets the recommended external directory. |
void |
stop()
|
| Methods inherited from class edu.ucsb.nceas.metacat.shared.BaseService |
|---|
refresh |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String CONFIGURED
public static final java.lang.String UNCONFIGURED
public static final java.lang.String BYPASSED
public static java.lang.String CONFIG_FILE_DIR
public static java.lang.String CONFIG_FILE_NAME
public static java.lang.String CONFIG_FILE_PATH
public static java.lang.String TEST_CONFIG_FILE_NAME
| Method Detail |
|---|
public static PropertyService getInstance(javax.servlet.ServletContext context)
throws ServiceException
ServiceException
public static PropertyService getInstance(java.lang.String testConfigFileDir)
throws ServiceException
configDir - the configuration directory we need to look in
ServiceException
public static PropertyService getInstance()
throws ServiceException
configDir - the configuration directory we need to look in
ServiceExceptionpublic boolean refreshable()
refreshable in class BaseService
public void doRefresh()
throws ServiceException
doRefresh in class BaseServiceServiceException
public void stop()
throws ServiceException
stop in class BaseServiceServiceException
public static java.lang.String getProperty(java.lang.String propertyName)
throws edu.ucsb.nceas.utilities.PropertyNotFoundException
propertyName - the name of the property requested
edu.ucsb.nceas.utilities.PropertyNotFoundExceptionpublic static java.util.Vector<java.lang.String> getPropertyNames()
public static java.util.Vector<java.lang.String> getPropertyNamesByGroup(java.lang.String groupName)
groupName - the prefix of the keys to search for.
public static java.util.Map<java.lang.String,java.lang.String> getPropertiesByGroup(java.lang.String groupName)
throws edu.ucsb.nceas.utilities.PropertyNotFoundException
groupName - the prefix of the keys to search for.
edu.ucsb.nceas.utilities.PropertyNotFoundException
public static void setProperty(java.lang.String propertyName,
java.lang.String newValue)
throws edu.ucsb.nceas.utilities.GeneralPropertyException
propertyName - the name of the property requestednewValue - the new value for the property
edu.ucsb.nceas.utilities.GeneralPropertyException
public static void setPropertyNoPersist(java.lang.String propertyName,
java.lang.String newValue)
throws edu.ucsb.nceas.utilities.GeneralPropertyException
propertyName - the name of the property requestednewValue - the new value for the property
edu.ucsb.nceas.utilities.GeneralPropertyException
public static void persistProperties()
throws edu.ucsb.nceas.utilities.GeneralPropertyException
edu.ucsb.nceas.utilities.GeneralPropertyException
public static edu.ucsb.nceas.utilities.SortedProperties getMainBackupProperties()
throws edu.ucsb.nceas.utilities.GeneralPropertyException
edu.ucsb.nceas.utilities.GeneralPropertyException
public static edu.ucsb.nceas.utilities.SortedProperties getAuthBackupProperties()
throws edu.ucsb.nceas.utilities.GeneralPropertyException
edu.ucsb.nceas.utilities.GeneralPropertyException
public static edu.ucsb.nceas.utilities.PropertiesMetaData getMainMetaData()
throws edu.ucsb.nceas.utilities.GeneralPropertyException
edu.ucsb.nceas.utilities.GeneralPropertyException
public static edu.ucsb.nceas.utilities.PropertiesMetaData getAuthMetaData()
throws edu.ucsb.nceas.utilities.GeneralPropertyException
edu.ucsb.nceas.utilities.GeneralPropertyException
public static void persistMainBackupProperties()
throws edu.ucsb.nceas.utilities.GeneralPropertyException
edu.ucsb.nceas.utilities.GeneralPropertyException
public static void persistAuthBackupProperties(javax.servlet.ServletContext servletContext)
throws edu.ucsb.nceas.utilities.GeneralPropertyException
edu.ucsb.nceas.utilities.GeneralPropertyException
public static boolean arePropertiesConfigured()
throws edu.ucsb.nceas.utilities.GeneralPropertyException
edu.ucsb.nceas.utilities.GeneralPropertyException
public static boolean doBypass()
throws edu.ucsb.nceas.utilities.GeneralPropertyException
edu.ucsb.nceas.utilities.GeneralPropertyException
public static void bypassConfiguration()
throws edu.ucsb.nceas.utilities.GeneralPropertyException
edu.ucsb.nceas.utilities.GeneralPropertyException
public static void checkAndSetProperty(javax.servlet.http.HttpServletRequest request,
java.lang.String propertyName)
throws edu.ucsb.nceas.utilities.GeneralPropertyException
request - that was generated by the userresponse - to send output back to the userpropertyName - the name of the property to be checked and set
edu.ucsb.nceas.utilities.GeneralPropertyExceptionpublic static void setRecommendedExternalDir(java.lang.String extBaseDir)
public static java.lang.String getRecommendedExternalDir()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||