public class PropertyUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
NOT_SET
Property is not set.
|
private static java.lang.String[] |
servicePropertyList |
static int |
SET_IN_APPLICATION
Property is set in APPLICATION (derby.properties) set
|
static int |
SET_IN_DATABASE
Property is set in DATABASE set
|
static int |
SET_IN_JVM
Property is set in JVM set
|
Constructor and Description |
---|
PropertyUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
booleanProperty(java.lang.String p,
java.io.Serializable v,
boolean defaultValue)
Parse and validate and return a boolean property value.
|
static boolean |
existsBuiltinUser(PersistentSet set,
java.lang.String username)
Return
true if username is defined as a built-in user
i.e. there exists a property derby.user. |
static java.lang.String |
getDatabaseProperty(PersistentSet set,
java.lang.String key)
Get a property only looking in the Persistent Transactional (database) set.
|
private static ModuleFactory |
getMonitor()
Privileged Monitor lookup.
|
private static ModuleFactory |
getMonitorLite()
Privileged Monitor lookup.
|
static java.io.Serializable |
getPropertyFromSet(boolean dbOnly,
java.util.Dictionary set,
java.lang.String key) |
static java.lang.String |
getPropertyFromSet(boolean dbOnly,
java.util.Properties set,
java.lang.String key) |
static java.io.Serializable |
getPropertyFromSet(java.util.Dictionary set,
java.lang.String key) |
static java.lang.String |
getPropertyFromSet(java.util.Properties set,
java.lang.String key)
Get a property from the passed in set.
|
static boolean |
getServiceBoolean(PersistentSet set,
java.lang.String key,
boolean defValue)
Get a service wide property as a boolean.
|
static int |
getServiceInt(PersistentSet set,
java.util.Properties props,
java.lang.String key,
int min,
int max,
int defaultValue)
Get a service wide property as a int.
|
static int |
getServiceInt(PersistentSet set,
java.lang.String key,
int min,
int max,
int defaultValue)
Get a service wide property as a int.
|
static java.lang.String |
getServiceProperty(PersistentSet set,
java.lang.String key)
Find a service wide property.
|
static java.lang.String |
getServiceProperty(PersistentSet set,
java.lang.String key,
java.lang.String defaultValue)
Find a service wide property with a default.
|
static java.lang.String[] |
getServicePropertyList()
Get the list of properties which are normally stored in service.properties
|
static boolean |
getSystemBoolean(java.lang.String key)
Get a system wide property as a boolean.
|
static boolean |
getSystemBoolean(java.lang.String key,
boolean defaultValue)
Get a system wide property as a boolean.
|
static int |
getSystemInt(java.lang.String key,
int defaultValue)
Get a system wide property as a int.
|
static int |
getSystemInt(java.lang.String key,
int min,
int max,
int defaultValue)
s
Get a system wide property as a int.
|
static java.lang.String |
getSystemProperty(java.lang.String key)
Find a system wide property.
|
static java.lang.String |
getSystemProperty(java.lang.String key,
java.lang.String defaultValue)
Find a system wide property with a default.
|
static int |
handleInt(java.lang.String value,
int min,
int max,
int defaultValue)
Parse an string as an int based property value.
|
static int |
intPropertyValue(java.lang.String p,
java.io.Serializable v,
int minValue,
int maxValue,
int defaultValue)
Parse, validate and return an integer property value.
|
static boolean |
isDBOnly(java.util.Dictionary set) |
static boolean |
isDBOnly(java.util.Properties set) |
static boolean |
isServiceProperty(java.lang.String key)
Return true iff the key is the name of a database property that is
stored in services.properties.
|
static boolean |
localNativeAuthenticationEnabled(java.util.Properties properties)
Return true if the passed-in properties specify NATIVE authentication using LOCAL credentials.
|
static boolean |
nativeAuthenticationEnabled(java.util.Properties properties)
Return true if NATIVE authentication has been enabled in the passed-in properties.
|
private static boolean |
nativeAuthenticationEnabled(java.lang.String authenticationProvider)
Return true if NATIVE authentication is turned on for the passed-in
value of Property.AUTHENTICATION_PROVIDER_PARAMETER.
|
private static boolean |
propertiesContainsBuiltinUser(java.util.Properties props,
java.lang.String username) |
private static boolean |
systemPropertiesExistsBuiltinUser(java.lang.String username)
Return true if username is defined as a system property
i.e. there exists a property
derby.user. |
(package private) static int |
whereSet(java.lang.String key,
java.util.Dictionary set) |
private static final java.lang.String[] servicePropertyList
public static final int SET_IN_JVM
public static final int SET_IN_DATABASE
public static final int SET_IN_APPLICATION
public static final int NOT_SET
static int whereSet(java.lang.String key, java.util.Dictionary set)
public static boolean isDBOnly(java.util.Dictionary set)
public static boolean isDBOnly(java.util.Properties set)
public static java.lang.String[] getServicePropertyList()
public static java.lang.String getSystemProperty(java.lang.String key)
getSystemProperty(String,String)
public static java.lang.String getSystemProperty(java.lang.String key, java.lang.String defaultValue)
This method can be used by a system that is not running Derby, just to maintain the same lookup logic and security manager concerns for finding derby.properties and reading system properties.
public static java.lang.String getPropertyFromSet(java.util.Properties set, java.lang.String key)
public static java.io.Serializable getPropertyFromSet(java.util.Dictionary set, java.lang.String key)
public static java.io.Serializable getPropertyFromSet(boolean dbOnly, java.util.Dictionary set, java.lang.String key)
public static java.lang.String getPropertyFromSet(boolean dbOnly, java.util.Properties set, java.lang.String key)
public static java.lang.String getDatabaseProperty(PersistentSet set, java.lang.String key) throws StandardException
StandardException
- Standard Derby error handling.public static java.lang.String getServiceProperty(PersistentSet set, java.lang.String key, java.lang.String defaultValue) throws StandardException
StandardException
- Standard Derby error handling.public static java.lang.String getServiceProperty(PersistentSet set, java.lang.String key) throws StandardException
StandardException
- Standard Derby error handling.public static boolean getSystemBoolean(java.lang.String key)
key
- The name of the system propertypublic static boolean getSystemBoolean(java.lang.String key, boolean defaultValue)
key
- The name of the system propertydefaultValue
- The value to use if the property has not been setpublic static boolean getServiceBoolean(PersistentSet set, java.lang.String key, boolean defValue) throws StandardException
StandardException
- Standard Derby error handling.public static int getSystemInt(java.lang.String key, int min, int max, int defaultValue)
public static int getServiceInt(PersistentSet set, java.lang.String key, int min, int max, int defaultValue) throws StandardException
StandardException
- Standard Derby error handling.public static int getServiceInt(PersistentSet set, java.util.Properties props, java.lang.String key, int min, int max, int defaultValue) throws StandardException
StandardException
- Standard Derby error handling.public static int getSystemInt(java.lang.String key, int defaultValue)
public static int handleInt(java.lang.String value, int min, int max, int defaultValue)
public static boolean booleanProperty(java.lang.String p, java.io.Serializable v, boolean defaultValue) throws StandardException
The following are valid property values.
StandardException
- Oopspublic static int intPropertyValue(java.lang.String p, java.io.Serializable v, int minValue, int maxValue, int defaultValue) throws StandardException
StandardException
- Oopspublic static boolean isServiceProperty(java.lang.String key)
public static boolean existsBuiltinUser(PersistentSet set, java.lang.String username) throws StandardException
true
if username
is defined as a built-in user
i.e. there exists a property derby.user.
<userid> in the
database (or, possibly, in system properties if not forbidden by derby.database.propertiesOnly
). Note that <userid> found in a
property will be normalized to case normal form before comparison is
performed against username, which is presumed normalized already.set
- object which implements PersistentSet interface
(TransactionController)username
- Normalized authorization identifiertrue
if match foundStandardException
public static boolean nativeAuthenticationEnabled(java.util.Properties properties)
private static boolean nativeAuthenticationEnabled(java.lang.String authenticationProvider)
public static boolean localNativeAuthenticationEnabled(java.util.Properties properties)
private static boolean systemPropertiesExistsBuiltinUser(java.lang.String username)
derby.user.
<userid>
in the system properties. Note that <userid> will be
normalized to case normal form before comparison is performed
against username, which is presumed normalized already.username
- Normalized authorization identifiertrue
if match foundprivate static boolean propertiesContainsBuiltinUser(java.util.Properties props, java.lang.String username)
private static ModuleFactory getMonitor()
private static ModuleFactory getMonitorLite()
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.