| java.lang.Object org.apache.derby.iapi.services.property.PropertyUtil
PropertyUtil | public class PropertyUtil (Code) | | There are 5 property objects within a JBMS system.
1) JVM - JVM set - those in System.getProperties
2) APP - Application set - derby.properties file
3) SRV - Persistent Service set - Those stored in service.properties
4) TRAN - Persistent Transactional set - Those stored via the AccessManager interface
5) BOOT - Set by a boot method (rare)
This class has a set of static methods to find a property using a consistent search order
from the above set.
getSystem*() methods use the search order.
- JVM
- APP
getService* methods use the search order
- JVM
- TRAN
- SRV
- APP
|
Method Summary | |
public static boolean | booleanProperty(String p, Serializable v, boolean defaultValue) Parse and validate and return a boolean property value. | public static String | getDatabaseProperty(PersistentSet set, String key) Get a property only looking in the Persistent Transactional (database) set.
exception: StandardException - Standard Cloudscape error handling. | public static String | getPropertyFromSet(Properties set, String key) Get a property from the passed in set. | public static Serializable | getPropertyFromSet(Dictionary set, String key) | public static Serializable | getPropertyFromSet(boolean dbOnly, Dictionary set, String key) | public static String | getPropertyFromSet(boolean dbOnly, Properties set, String key) | public static boolean | getServiceBoolean(PersistentSet set, String key, boolean defValue) Get a service wide property as a boolean.
true of the property is set to 'true, TRUE', false otherwise exception: StandardException - Standard Cloudscape error handling. | public static int | getServiceInt(PersistentSet set, String key, int min, int max, int defaultValue) Get a service wide property as a int.
value of the property if set subject to min and max, defaultValue ifit is not set or set to a non-integer value. exception: StandardException - Standard Cloudscape error handling. | public static int | getServiceInt(PersistentSet set, Properties props, String key, int min, int max, int defaultValue) Get a service wide property as a int. | public static String | getServiceProperty(PersistentSet set, String key, String defaultValue) Find a service wide property with a default. | public static String | getServiceProperty(PersistentSet set, String key) Find a service wide property. | public static boolean | getSystemBoolean(String key) Get a system wide property as a boolean. | public static int | getSystemInt(String key, int min, int max, int defaultValue) s
Get a system wide property as a int. | public static int | getSystemInt(String key, int defaultValue) Get a system wide property as a int. | public static String | getSystemProperty(String key) Find a system wide property. | public static String | getSystemProperty(String key, String defaultValue) Find a system wide property with a default. | public static int | handleInt(String value, int min, int max, int defaultValue) Parse an string as an int based property value. | public static int | intPropertyValue(String p, Serializable v, int minValue, int maxValue, int defaultValue) Parse, validate and return an integer property value. | public static boolean | isDBOnly(Dictionary set) | public static boolean | isDBOnly(Properties set) | public static boolean | isServiceProperty(String key) Return true iff the key is the name of a database property that is
stored in services.properties. | static int | whereSet(String key, Dictionary set) |
NOT_SET | final public static int NOT_SET(Code) | | Property is not set.
|
SET_IN_APPLICATION | final public static int SET_IN_APPLICATION(Code) | | Property is set in APPLICATION (derby.properties) set
|
SET_IN_DATABASE | final public static int SET_IN_DATABASE(Code) | | Property is set in DATABASE set
|
SET_IN_JVM | final public static int SET_IN_JVM(Code) | | Property is set in JVM set
|
servicePropertyList | final public static String[] servicePropertyList(Code) | | |
booleanProperty | public static boolean booleanProperty(String p, Serializable v, boolean defaultValue) throws StandardException(Code) | | Parse and validate and return a boolean property value. If the value is invalid
raise an exception.
The following are valid property values.
- null - returns defaultValue
- "true" - returns true (in any case without the quotes)
- "false" - return true (in any case without the quotes)
exception: StandardException - Oops |
getPropertyFromSet | public static String getPropertyFromSet(Properties set, String key)(Code) | | Get a property from the passed in set. The passed in set is
either:
- The properties object passed into ModuleControl.boot()
after the database has been booted. This set will be a DoubleProperties
object with the per-database transaction set as the read set
and the service.properties as the write set.
-
The Dictionary set returned/passed in by a method of BasicService.Properties.
This method uses the same search order as the getService() calls.
|
getServiceBoolean | public static boolean getServiceBoolean(PersistentSet set, String key, boolean defValue) throws StandardException(Code) | | Get a service wide property as a boolean.
true of the property is set to 'true, TRUE', false otherwise exception: StandardException - Standard Cloudscape error handling. |
getServiceInt | public static int getServiceInt(PersistentSet set, String key, int min, int max, int defaultValue) throws StandardException(Code) | | Get a service wide property as a int.
value of the property if set subject to min and max, defaultValue ifit is not set or set to a non-integer value. exception: StandardException - Standard Cloudscape error handling. |
getServiceInt | public static int getServiceInt(PersistentSet set, Properties props, String key, int min, int max, int defaultValue) throws StandardException(Code) | | Get a service wide property as a int. The passed in Properties
set overrides any system, applcation or per-database properties.
value of the property if set subject to min and max, defaultValue ifit is not set or set to a non-integer value. exception: StandardException - Standard Cloudscape error handling. |
getServiceProperty | public static String getServiceProperty(PersistentSet set, String key, String defaultValue) throws StandardException(Code) | | Find a service wide property with a default. Search order is
The service is the persistent service associated with the
current context stack.
the value of the property or defaultValue if it does not exist. exception: StandardException - Standard Cloudscape error handling. |
getServiceProperty | public static String getServiceProperty(PersistentSet set, String key) throws StandardException(Code) | | Find a service wide property.
The service is the persistent service associated with the
current context stack.
the value of the property or null if it does not exist. exception: StandardException - Standard Cloudscape error handling. |
getSystemBoolean | public static boolean getSystemBoolean(String key)(Code) | | Get a system wide property as a boolean.
true of the property is set to 'true, TRUE', false otherwise |
getSystemInt | public static int getSystemInt(String key, int min, int max, int defaultValue)(Code) | | s
Get a system wide property as a int.
value of the property if set subject to min and max, defaultValue ifit is not set or set to a non-integer value. |
getSystemInt | public static int getSystemInt(String key, int defaultValue)(Code) | | Get a system wide property as a int.
value of the property if, defaultValue ifit is not set or set to a non-integer value. |
getSystemProperty | public static String getSystemProperty(String key, String defaultValue)(Code) | | Find a system wide property with a default. Search order is
- JVM property
- derby.properties
This method can be used by a system that is not running Cloudscape,
just to maintain the same lookup logic and security manager concerns
for finding derby.properties and reading system properties.
the value of the property or defaultValue if it does not exist. |
handleInt | public static int handleInt(String value, int min, int max, int defaultValue)(Code) | | Parse an string as an int based property value.
|
intPropertyValue | public static int intPropertyValue(String p, Serializable v, int minValue, int maxValue, int defaultValue) throws StandardException(Code) | | Parse, validate and return an integer property value. If the value is invalid
raise an exception. If the value passed in is null return a default value.
exception: StandardException - Oops |
isServiceProperty | public static boolean isServiceProperty(String key)(Code) | | Return true iff the key is the name of a database property that is
stored in services.properties.
|
|
|