All Packages Class Hierarchy This Package Previous Next Index
Interface com.netscape.certsrv.base.IConfigStore
- public interface IConfigStore
An interface represents a configuration store.
A configuration store is an abstraction of a hierarchical store
to keep arbitrary data indexed by string names.
In the following example:
param1=value1
configStore1.param11=value11
configStore1.param12=value12
configStore1.subStore1.param111=value111
configStore1.subStore1.param112=value112
configStore2.param21=value21
The top config store has parameters param1 and sub-stores
configStore1 and configStore2.
The following illustrates how a config store is used.
// the top config store is passed to the following method.
public void init(IConfigStore config) throws EBaseException {
IConfigStore store = config;
String valx = config.getString("param1");
// valx is "value1"
IConfigStore substore1 = config.getSubstore("configStore1");
String valy = substore1.getString("param11");
// valy is "value11"
IConfigStore substore2 = config.getSubstore("configStore2");
String valz = substore2.getString("param21");
// valz is "value21"
}
-
getBoolean(String)
- Retrieves the given property as a boolean.
-
getBoolean(String, boolean)
- Retrieves the given property as a boolean.
-
getByteArray(String)
- Retrieves the value of a property as a byte array.
-
getByteArray(String, byte[])
- Retrieves the value of a property as a byte array, using the
given default value if property is not present.
-
getInteger(String)
- Retrieves the given property as an integer.
-
getInteger(String, int)
- Retrieves the given property as an integer.
-
getName()
- Gets the name of this Configuration Store.
-
getPropertyNames()
- Retrives and enumeration of all properties in this config-store.
-
getString(String)
- Retrieves the value of the given property as a string.
-
getString(String, String)
- Retrieves the value of a given property as a string or the
given default value if the property is not present.
-
getSubStore(String)
- Retrieves the given sub-store.
-
getSubStoreNames()
- Returns an enumeration of the names of the substores of
this config-store.
-
makeSubStore(String)
- Creates a nested sub-store with the specified name.
-
putBoolean(String, boolean)
- Stores the given property and its value as a boolean.
-
putByteArray(String, byte[])
- Stores the given property and value as a byte array.
-
putInteger(String, int)
- Sets a property and its value as an integer.
-
putString(String, String)
- Stores a property and its value as a string.
-
removeSubStore(String)
- Removes sub-store with the given name.
getName
public abstract String getName()
- Gets the name of this Configuration Store.
- Returns:
- The name of this Configuration store
getString
public abstract String getString(String name) throws EPropertyNotFound, EBaseException
- Retrieves the value of the given property as a string.
- Parameters:
- name - The name of the property to get
- Returns:
- The value of the property as a String
- Throws: EPropertyNotFound
- If the property is not present
- Throws: EBaseException
- If an internal error occurred
getString
public abstract String getString(String name,
String defval) throws EBaseException
- Retrieves the value of a given property as a string or the
given default value if the property is not present.
- Parameters:
- name - The property to retrive
- defval - The default value to return if the property is not present
- Returns:
- The roperty value as a string
- Throws: EBaseException
- If an internal error occurred
putString
public abstract void putString(String name,
String value)
- Stores a property and its value as a string.
- Parameters:
- name - The name of the property
- value - The value as a string
getByteArray
public abstract byte[] getByteArray(String name) throws EPropertyNotFound, EBaseException
- Retrieves the value of a property as a byte array.
- Parameters:
- name - The property name
- Returns:
- The property value as a byte array
- Throws: EPropertyNotFound
- If the property is not present
- Throws: EBaseException
- If an internal error occurred
getByteArray
public abstract byte[] getByteArray(String name,
byte defval[]) throws EBaseException
- Retrieves the value of a property as a byte array, using the
given default value if property is not present.
- Parameters:
- name - The name of the property
- defval - The default value if the property is not present.
- Returns:
- The property value as a byte array.
- Throws: EBaseException
- If an internal error occurred
putByteArray
public abstract void putByteArray(String name,
byte value[])
- Stores the given property and value as a byte array.
- Parameters:
- name - The property name
- value - The value as a byte array to store
getBoolean
public abstract boolean getBoolean(String name) throws EPropertyNotFound, EBaseException
- Retrieves the given property as a boolean.
- Parameters:
- name - The name of the property as a string.
- Returns:
- The value of the property as a boolean.
- Throws: EPropertyNotFound
- If the property is not present
- Throws: EBaseException
- If an internal error occurred
getBoolean
public abstract boolean getBoolean(String name,
boolean defval) throws EBaseException
- Retrieves the given property as a boolean.
- Parameters:
- name - The name of the property
- defval - The default value to turn as a boolean if
property is not present
- Returns:
- The value of the property as a boolean.
- Throws: EBaseException
- If an internal error occurred
putBoolean
public abstract void putBoolean(String name,
boolean value)
- Stores the given property and its value as a boolean.
- Parameters:
- name - The property name
- value - The value as a boolean
getInteger
public abstract int getInteger(String name) throws EPropertyNotFound, EBaseException
- Retrieves the given property as an integer.
- Parameters:
- name - The property name
- Returns:
- The property value as an integer
- Throws: EPropertyNotFound
- If property is not found
- Throws: EBaseException
- If an internal error occurred
getInteger
public abstract int getInteger(String name,
int defval) throws EBaseException
- Retrieves the given property as an integer.
- Parameters:
- name - The property name
- Returns:
- int The default value to return as an integer
- Throws: EBaseException
- If the value cannot be converted to a
integer
putInteger
public abstract void putInteger(String name,
int value)
- Sets a property and its value as an integer.
- Parameters:
- name - parameter name
- value - integer value
makeSubStore
public abstract IConfigStore makeSubStore(String name)
- Creates a nested sub-store with the specified name.
- Parameters:
- name - The name of the sub-store
- Returns:
- The sub-store created
getSubStore
public abstract IConfigStore getSubStore(String name)
- Retrieves the given sub-store.
- Parameters:
- name - The name of the sub-store
- Returns:
- The sub-store
removeSubStore
public abstract void removeSubStore(String name)
- Removes sub-store with the given name.
(Removes all properties and sub-stores under this sub-store.)
- Parameters:
- name - The name of the sub-store to remove
getPropertyNames
public abstract Enumeration getPropertyNames()
- Retrives and enumeration of all properties in this config-store.
- Returns:
- An enumeration of all properties in this config-store
getSubStoreNames
public abstract Enumeration getSubStoreNames()
- Returns an enumeration of the names of the substores of
this config-store.
- Returns:
- An enumeration of the names of the sub-stores of this
config-store
All Packages Class Hierarchy This Package Previous Next Index