Use Config Admin to overlay datastore properties 85/15485/11
authortpantelis <tpanteli@brocade.com>
Wed, 18 Feb 2015 12:37:53 +0000 (07:37 -0500)
committerTom Pantelis <tpanteli@brocade.com>
Sun, 22 Feb 2015 09:58:08 +0000 (04:58 -0500)
commit6b9787d26aab04acf95fa30601291380f9b1d5c9
tree89f985ee68cca0b3e7420b53622abae658740c9d
parentff0ca2ab34a016be25fc13fc05bfbd6aa698cee0
Use Config Admin to overlay datastore properties

Added functionality to configure DatastoreContext settings via a
properties file, org.opendaylight.controller.cluster.datastore.cfg, in the karaf
etc dir. The properties are overlayed onto the DatastoreContext that is
initialized via the config yang XML file. This allows for separation of
the wiring in the config yang XML from the user-facing config settings
to facilitate preserving the user-facing config settings on upgrade
while applying wiring changes.

The DatastoreContextIntrospector class is responsible for applying the
property key/values obtained from the Config Admin Configuration to the
current DatastoreContext.

The DatastoreContextConfigAdminOverlay class interfaces with the
ConfigurationAdmin OSGi service to obtain the configuration and calls
into the DatastoreContextIntrospector.

Modified DatastoreContext.Builder to support loading from an existing
DatastoreContext instance and applying changes to it to yield a new
instance on build.

Added a DatastoreConfigurationMXBean that reports the DatastoreContext
settings via JXM. This is useful to see what settings are currently
applied.

Most of the other changes were to wire the new classes from the Module
class to the DistributedDatastore.

Added new unit tests to cover the new code.

Change-Id: I9427907dac576bd416bad677a56fa8259af59a09
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
17 files changed:
features/mdsal/src/main/resources/features.xml
opendaylight/md-sal/sal-clustering-config/pom.xml
opendaylight/md-sal/sal-clustering-config/src/main/resources/initial/datastore.cfg [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContext.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContextConfigAdminOverlay.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContextIntrospector.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DistributedDataStore.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreFactory.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/jmx/mbeans/DatastoreConfigurationMXBean.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/jmx/mbeans/DatastoreConfigurationMXBeanImpl.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/distributed_datastore_provider/DistributedConfigDataStoreProviderModule.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/distributed_datastore_provider/DistributedOperationalDataStoreProviderModule.java
opendaylight/md-sal/sal-distributed-datastore/src/main/yang/distributed-datastore-provider.yang
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DatastoreContextConfigAdminOverlayTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DatastoreContextIntrospectorTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DatastoreContextTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTransactionTest.java