xmlBlaster 2.2.0 API

org.xmlBlaster.contrib.dbwatcher
Class Info

java.lang.Object
  extended by org.xmlBlaster.contrib.dbwatcher.Info
All Implemented Interfaces:
I_Info

public class Info
extends java.lang.Object
implements I_Info

Simple container for environment settings.

This is a dummy implementation for the DbWatcher examples and testsuite.

Author:
Marcel Ruff

Field Summary
(package private)  InfoHelper helper
           
(package private)  java.util.Map objects
           
(package private)  java.util.prefs.Preferences prefs
           
 
Fields inherited from interface org.xmlBlaster.contrib.I_Info
ID, JMX_PREFIX
 
Constructor Summary
Info(java.util.prefs.Preferences prefs)
          Creates a simple implementation based on java's Preferences
Info(java.lang.String id)
           
 
Method Summary
 java.lang.String get(java.lang.String key, java.lang.String def)
          Access a string environment setting.
 boolean getBoolean(java.lang.String key, boolean def)
          Access an environment setting of type boolean.
 int getInt(java.lang.String key, int def)
          Access an environment setting of type int.
 java.util.Set getKeys()
          Gets the keys of the entries stored.
 long getLong(java.lang.String key, long def)
          Access an environment setting of type long.
 java.lang.Object getObject(java.lang.String key)
          Access the remembered object.
 java.util.Set getObjectKeys()
          Gets the keys of the objects registered.
 java.lang.String getRaw(java.lang.String key)
          Returns the value associated to this key.
 void put(java.lang.String key, java.lang.String value)
          Put key/value to environment.
 java.lang.Object putObject(java.lang.String key, java.lang.Object o)
          Store an object.
 void putRaw(java.lang.String key, java.lang.String value)
          Put key/value to environment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prefs

java.util.prefs.Preferences prefs

objects

java.util.Map objects

helper

InfoHelper helper
Constructor Detail

Info

public Info(java.util.prefs.Preferences prefs)
Creates a simple implementation based on java's Preferences

Parameters:
prefs - The configuration store

Info

public Info(java.lang.String id)
Method Detail

get

public java.lang.String get(java.lang.String key,
                            java.lang.String def)
Description copied from interface: I_Info
Access a string environment setting.

Specified by:
get in interface I_Info
Parameters:
key - The parameter key
def - The default used if key is not found
Returns:
The configured value of the parameter
See Also:
I_Info.get(java.lang.String, java.lang.String)

getRaw

public java.lang.String getRaw(java.lang.String key)
Description copied from interface: I_Info
Returns the value associated to this key.

Specified by:
getRaw in interface I_Info
Returns:
See Also:
I_Info.getRaw(java.lang.String)

put

public void put(java.lang.String key,
                java.lang.String value)
Description copied from interface: I_Info
Put key/value to environment.

Specified by:
put in interface I_Info
Parameters:
key - The parameter key
value - The parameter value, if null the parameter is removed.
See Also:
I_Info.put(java.lang.String, java.lang.String)

putRaw

public void putRaw(java.lang.String key,
                   java.lang.String value)
Description copied from interface: I_Info
Put key/value to environment. This put does not modify (replace) the key, nor the value.

Specified by:
putRaw in interface I_Info
Parameters:
key - The parameter key
value - The parameter value, if null the parameter is removed.
See Also:
I_Info.put(java.lang.String, java.lang.String)

getLong

public long getLong(java.lang.String key,
                    long def)
Description copied from interface: I_Info
Access an environment setting of type long.

Specified by:
getLong in interface I_Info
Parameters:
key - The parameter key
def - The default used if key is not found
Returns:
The configured value of the parameter
See Also:
I_Info.getLong(java.lang.String, long)

getInt

public int getInt(java.lang.String key,
                  int def)
Description copied from interface: I_Info
Access an environment setting of type int.

Specified by:
getInt in interface I_Info
Parameters:
key - The parameter key
def - The default used if key is not found
Returns:
The configured value of the parameter
See Also:
I_Info.getInt(java.lang.String, int)

getBoolean

public boolean getBoolean(java.lang.String key,
                          boolean def)
Description copied from interface: I_Info
Access an environment setting of type boolean.

Specified by:
getBoolean in interface I_Info
Parameters:
key - The parameter key
def - The default used if key is not found
Returns:
The configured value of the parameter
See Also:
I_Info.getBoolean(java.lang.String, boolean)

getObject

public java.lang.Object getObject(java.lang.String key)
Description copied from interface: I_Info
Access the remembered object.

Specified by:
getObject in interface I_Info
Parameters:
key - The object key
Returns:
The found object or null
See Also:
I_Info.getObject(java.lang.String)

putObject

public java.lang.Object putObject(java.lang.String key,
                                  java.lang.Object o)
Description copied from interface: I_Info
Store an object.

Specified by:
putObject in interface I_Info
Parameters:
key - The object key
o - The object to remember or null to remove it
Returns:
The old object or null
See Also:
I_Info.putObject(java.lang.String, Object)

getKeys

public java.util.Set getKeys()
Description copied from interface: I_Info
Gets the keys of the entries stored. Note that this does not return the key of the entries stored as objects. To retrieve these use getObjectKeys().

Specified by:
getKeys in interface I_Info
Returns:
See Also:
I_Info.getKeys()

getObjectKeys

public java.util.Set getObjectKeys()
Description copied from interface: I_Info
Gets the keys of the objects registered. Note that this does not return the key of the normal entries. To retrieve these use getKeys().

Specified by:
getObjectKeys in interface I_Info
Returns:
See Also:
I_Info.getObjectKeys()

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.