<type>cfg</type>
<classifier>datastore</classifier>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-cluster-admin</artifactId>
+ <version>${controller.mdsal.version}</version>
+ </dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>sal-distributed-datastore</artifactId>
<feature version='${project.version}'>odl-mdsal-broker-local</feature>
<feature version='${project.version}'>odl-mdsal-clustering-commons</feature>
<bundle>mvn:org.opendaylight.controller/sal-distributed-datastore/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.controller/sal-cluster-admin/{{VERSION}}</bundle>
</feature>
<feature name ='odl-mdsal-remoterpc-connector' version='${project.version}'>
<feature version='${project.version}'>odl-mdsal-broker-local</feature>
<!-- sal-distributed-datastore -->
<module>sal-distributed-datastore</module>
<module>sal-dummy-distributed-datastore</module>
+ <module>sal-cluster-admin</module>
<!-- XSQL -->
<module>sal-dom-xsql</module>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-parent</artifactId>
+ <version>1.4.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>sal-cluster-admin</artifactId>
+ <packaging>bundle</packaging>
+
+ <dependencies>
+ <!-- Tests -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-akka-raft</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-distributed-datastore</artifactId>
+ <type>test-jar</type>
+ <version>1.4.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- Akka -->
+ <dependency>
+ <groupId>com.typesafe.akka</groupId>
+ <artifactId>akka-actor_${scala.version}</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.typesafe.akka</groupId>
+ <artifactId>akka-testkit_${scala.version}</artifactId>
+ </dependency>
+
+ <!-- Google -->
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </dependency>
+
+ <!-- Scala -->
+ <dependency>
+ <groupId>org.scala-lang</groupId>
+ <artifactId>scala-library</artifactId>
+ </dependency>
+
+ <!-- OpenDaylight -->
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>config-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-binding-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-akka-raft</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-distributed-datastore</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>yang-binding</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
+ <Export-Package></Export-Package>
+ <Import-Package>
+ !*snappy;
+ !org.jboss.*;
+ !com.jcraft.*;
+ !*jetty*;
+ !sun.security.*;
+ *;
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>org.opendaylight.controller.*</include>
+
+ </includes>
+ <excludes>
+ <exclude>org.opendaylight.controller.config.yang.config.*</exclude>
+ </excludes>
+ <check>false</check>
+ </configuration>
+ <executions>
+ <execution>
+ <id>pre-test</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>post-test</id>
+ <goals>
+ <goal>report</goal>
+ </goals>
+ <phase>test</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>config</id>
+ <goals>
+ <goal>generate-sources</goal>
+ </goals>
+ <configuration>
+ <codeGenerators>
+ <generator>
+ <codeGeneratorClass>org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator</codeGeneratorClass>
+ <outputBaseDir>${jmxGeneratorPath}</outputBaseDir>
+ <additionalConfiguration>
+ <namespaceToPackage1>urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang</namespaceToPackage1>
+ </additionalConfiguration>
+ </generator>
+ <generator>
+ <codeGeneratorClass>org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl</codeGeneratorClass>
+ <outputBaseDir>${salGeneratorPath}</outputBaseDir>
+ </generator>
+ </codeGenerators>
+ <inspectDependencies>true</inspectDependencies>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
package org.opendaylight.controller.config.yang.config.cluster_admin_provider;
-import com.google.common.base.Preconditions;
-import org.opendaylight.controller.cluster.datastore.DistributedDataStoreInterface;
-import org.opendaylight.controller.cluster.datastore.admin.ClusterAdminRpcService;
import org.opendaylight.controller.config.api.DependencyResolver;
import org.opendaylight.controller.config.api.ModuleIdentifier;
+import org.opendaylight.controller.sal.common.util.NoopAutoCloseable;
public class ClusterAdminProviderModule extends AbstractClusterAdminProviderModule {
public ClusterAdminProviderModule(ModuleIdentifier identifier, DependencyResolver dependencyResolver) {
}
@Override
- public void customValidation() {
- // add custom validation form module attributes here.
+ public boolean canReuseInstance(AbstractClusterAdminProviderModule oldModule) {
+ return true;
}
@Override
public AutoCloseable createInstance() {
- Preconditions.checkArgument(getConfigDataStoreDependency() instanceof DistributedDataStoreInterface,
- "Injected config DOMStore must be an instance of DistributedDataStoreInterface");
- Preconditions.checkArgument(getOperDataStoreDependency() instanceof DistributedDataStoreInterface,
- "Injected operational DOMStore must be an instance of DistributedDataStoreInterface");
- ClusterAdminRpcService service = new ClusterAdminRpcService(
- (DistributedDataStoreInterface)getConfigDataStoreDependency(),
- (DistributedDataStoreInterface)getOperDataStoreDependency());
- service.start(getRpcRegistryDependency());
- return service;
+ // The ClusterAdminRpcService is created via blueprint so return a noop here for backwards compatibility.
+ return NoopAutoCloseable.INSTANCE;
}
}
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0">
+
+ <!-- ClusterAdminRpcService -->
+
+ <reference id="configDatastore" interface="org.opendaylight.controller.cluster.datastore.DistributedDataStoreInterface"
+ odl:type="distributed-config"/>
+
+ <reference id="operationalDatastore" interface="org.opendaylight.controller.cluster.datastore.DistributedDataStoreInterface"
+ odl:type="distributed-operational"/>
+
+ <bean id="clusterAdminService" class="org.opendaylight.controller.cluster.datastore.admin.ClusterAdminRpcService">
+ <argument ref="configDatastore"/>
+ <argument ref="operationalDatastore"/>
+ </bean>
+
+ <odl:rpc-implementation ref="clusterAdminService"/>
+
+</blueprint>
\ No newline at end of file
container config-data-store {
uses config:service-ref {
refine type {
- mandatory true;
+ mandatory false;
config:required-identity config-dom-store-spi:config-dom-datastore;
}
}
container oper-data-store {
uses config:service-ref {
refine type {
- mandatory true;
+ mandatory false;
config:required-identity operational-dom-store-spi:operational-dom-datastore;
}
}
container rpc-registry {
uses config:service-ref {
refine type {
- mandatory true;
+ mandatory false;
config:required-identity mdsal:binding-rpc-registry;
}
}
+++ /dev/null
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.controller.cluster.datastore;
-
-import akka.japi.Procedure;
-import akka.persistence.SnapshotSelectionCriteria;
-import java.util.concurrent.CountDownLatch;
-import org.opendaylight.controller.cluster.DataPersistenceProvider;
-
-/**
- * This class is intended for testing purposes. It just triggers CountDownLatch's in each method.
- * This class really should be under src/test/java but it was problematic trying to uses it in other projects.
- */
-public class DataPersistenceProviderMonitor implements DataPersistenceProvider {
-
- private CountDownLatch persistLatch = new CountDownLatch(1);
- private CountDownLatch saveSnapshotLatch = new CountDownLatch(1);
- private CountDownLatch deleteSnapshotsLatch = new CountDownLatch(1);;
- private CountDownLatch deleteMessagesLatch = new CountDownLatch(1);;
-
- @Override
- public boolean isRecoveryApplicable() {
- return false;
- }
-
- @Override
- public <T> void persist(T o, Procedure<T> procedure) {
- persistLatch.countDown();
- }
-
- @Override
- public void saveSnapshot(Object o) {
- saveSnapshotLatch.countDown();
- }
-
- @Override
- public void deleteSnapshots(SnapshotSelectionCriteria criteria) {
- deleteSnapshotsLatch.countDown();
- }
-
- @Override
- public void deleteMessages(long sequenceNumber) {
- deleteMessagesLatch.countDown();
- }
-
- public void setPersistLatch(CountDownLatch persistLatch) {
- this.persistLatch = persistLatch;
- }
-
- public void setSaveSnapshotLatch(CountDownLatch saveSnapshotLatch) {
- this.saveSnapshotLatch = saveSnapshotLatch;
- }
-
- public void setDeleteSnapshotsLatch(CountDownLatch deleteSnapshotsLatch) {
- this.deleteSnapshotsLatch = deleteSnapshotsLatch;
- }
-
- public void setDeleteMessagesLatch(CountDownLatch deleteMessagesLatch) {
- this.deleteMessagesLatch = deleteMessagesLatch;
- }
-
- @Override
- public long getLastSequenceNumber() {
- return -1;
- }
-}
<instructions>
<Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
<Bundle-Activator>org.opendaylight.controller.cluster.datastore.osgi.Activator</Bundle-Activator>
- <Export-Package></Export-Package>
+ <Export-Package>
+ org.opendaylight.controller.cluster.datastore;
+ org.opendaylight.controller.cluster.datastore.config;
+ org.opendaylight.controller.cluster.datastore.messages;
+ org.opendaylight.controller.cluster.datastore.utils;
+ </Export-Package>
<Import-Package>
!*snappy;
!org.jboss.*;