de.smartics.properties.spi.config.ds
Class PropertiesStore

Package class diagram package PropertiesStore
java.lang.Object
  extended by de.smartics.properties.spi.config.ds.AbstractDataSourceDescriptor
      extended by de.smartics.properties.spi.config.ds.DefaultDataSourceManager
          extended by de.smartics.properties.spi.config.ds.PropertiesStore
All Implemented Interfaces:
PropertiesDataSourceAccessor, PropertiesDataSourceDescriptor, PropertiesDataSourceManager, Serializable

public final class PropertiesStore
     
     
extends DefaultDataSourceManager
implements PropertiesDataSourceAccessor

Provides access to properties in a data source.

See Also:
Serialized Form

Nested Class Summary
static class PropertiesStore.Builder
          The builder of manager instances.
 
Field Summary
 
Fields inherited from class de.smartics.properties.spi.config.ds.DefaultDataSourceManager
dropTable, ignoreTableCreationProblems
 
Constructor Summary
protected PropertiesStore(PropertiesStore.Builder builder)
          Default constructor.
 
Method Summary
 boolean containsKey(String name)
          Checks if a property with the given name is stored.
 void deleteProperty(String name)
          Deletes the property from the store.
 PropertyCollection getCollection()
          The collection of all properties stored.
 Property getProperty(String name)
          Reads the property with the given name from the data source.
 void setProperty(String name, String value)
          Sets the property to the given name and value.
 
Methods inherited from class de.smartics.properties.spi.config.ds.DefaultDataSourceManager
createConfigTable, dropConfigTable, getDataSourceId, getDataSourceProxy, print
 
Methods inherited from class de.smartics.properties.spi.config.ds.AbstractDataSourceDescriptor
getNameColumn, getTable, getValueColumn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.smartics.properties.spi.config.ds.PropertiesDataSourceDescriptor
getNameColumn, getTable, getValueColumn
 

Constructor Detail

PropertiesStore

protected PropertiesStore(PropertiesStore.Builder builder)
Default constructor.

Parameters:
builder - the builder of manager instance.
Method Detail

getProperty

public Property getProperty(String name)
                     throws IllegalArgumentException,
                            DataSourceException
Description copied from interface: PropertiesDataSourceAccessor
Reads the property with the given name from the data source.

Specified by:
getProperty in interface PropertiesDataSourceAccessor
Parameters:
name - the name of the property to fetch.
Returns:
the property or null, if no such property is stored in the data source.
Throws:
IllegalArgumentException - if name is blank;
DataSourceException - on any problem accessing the data source.

setProperty

public void setProperty(String name,
                        String value)
                 throws IllegalArgumentException,
                        DataSourceException
Description copied from interface: PropertiesDataSourceAccessor
Sets the property to the given name and value.

Specified by:
setProperty in interface PropertiesDataSourceAccessor
Parameters:
name - the name of the property to set.
value - the value of the property.
Throws:
IllegalArgumentException - if name is blank;
DataSourceException - on any problem accessing the data source.

deleteProperty

public void deleteProperty(String name)
                    throws IllegalArgumentException,
                           DataSourceException
Description copied from interface: PropertiesDataSourceAccessor
Deletes the property from the store.

Specified by:
deleteProperty in interface PropertiesDataSourceAccessor
Parameters:
name - the name of the property to delete.
Throws:
IllegalArgumentException - if name is blank;
DataSourceException - on any problem accessing the data source.

getCollection

public PropertyCollection getCollection()
The collection of all properties stored.

Returns:
the collection of all properties stored.

containsKey

public boolean containsKey(String name)
                    throws IllegalArgumentException
Checks if a property with the given name is stored.

Parameters:
name - the name of the property to check if it is stored.
Returns:
true if there is a property with that name and a non- null value, false otherwise.
Throws:
IllegalArgumentException - if name is blank.


Copyright © 2012-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.