<artifactId>v3po-api</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>data-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>data-utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>data-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>translate-api</artifactId>
--- /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">
+ <parent>
+ <groupId>io.fd.honeycomb.common</groupId>
+ <artifactId>api-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../../common/api-parent</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>io.fd.honeycomb.v3po</groupId>
+ <artifactId>config</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>io.fd.honeycomb.v3po</groupId>
+ <artifactId>translate-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.fd.honeycomb.v3po</groupId>
+ <artifactId>v3po2vpp</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ </dependencies>
+</project>
\ No newline at end of file
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.data;
+package io.fd.honeycomb.v3po.config;
import com.google.common.base.Optional;
import com.google.common.collect.Multimap;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.data;
+package io.fd.honeycomb.v3po.config;
import io.fd.honeycomb.v3po.translate.TranslationException;
import io.fd.honeycomb.v3po.translate.util.RWUtils;
--- /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">
+ <parent>
+ <groupId>io.fd.honeycomb.common</groupId>
+ <artifactId>api-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../../common/api-parent</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>io.fd.honeycomb.v3po</groupId>
+ <artifactId>data-api</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>io.fd.honeycomb.v3po</groupId>
+ <artifactId>translate-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-data-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-common-api</artifactId>
+ <version>1.3.0-Beryllium</version>
+ </dependency>
+
+ </dependencies>
+
+</project>
\ No newline at end of file
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.data;
+package io.fd.honeycomb.v3po.data;
import com.google.common.annotations.Beta;
import com.google.common.base.Optional;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.data;
+package io.fd.honeycomb.v3po.data;
import com.google.common.annotations.Beta;
import io.fd.honeycomb.v3po.translate.TranslationException;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.data;
+package io.fd.honeycomb.v3po.data;
import com.google.common.annotations.Beta;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification;
--- /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">
+ <parent>
+ <artifactId>api-parent</artifactId>
+ <groupId>io.fd.honeycomb.common</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../../common/api-parent</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>io.fd.honeycomb.v3po</groupId>
+ <artifactId>data-impl</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>io.fd.honeycomb.v3po</groupId>
+ <artifactId>data-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.fd.honeycomb.v3po</groupId>
+ <artifactId>translate-utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-binding-dom-codec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-core-api</artifactId>
+ <version>1.3.0-Beryllium</version> <!-- FIXME use dependency management -->
+ </dependency>
+
+ <!-- Testing Dependencies -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- FIXME test should not be dependent on particular models -->
+ <dependency>
+ <groupId>io.fd.honeycomb.v3po</groupId>
+ <artifactId>v3po-api</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ </plugin>
+ <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>
+ io.fd.honeycomb.v3po.data.impl.*
+ </Export-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.data;
+package io.fd.honeycomb.v3po.data.impl;
import com.google.common.base.Preconditions;
import java.util.Collection;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.data;
+package io.fd.honeycomb.v3po.data.impl;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.data;
+package io.fd.honeycomb.v3po.data.impl;
import static com.google.common.base.Preconditions.checkNotNull;
+import static io.fd.honeycomb.v3po.data.impl.DataTreeUtils.childrenFromNormalized;
import com.google.common.base.Optional;
import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.util.concurrent.Futures;
+import io.fd.honeycomb.v3po.data.ReadableVppDataTree;
+import io.fd.honeycomb.v3po.data.VppDataTree;
+import io.fd.honeycomb.v3po.data.VppDataTreeSnapshot;
import io.fd.honeycomb.v3po.translate.TranslationException;
import io.fd.honeycomb.v3po.translate.util.write.TransactionWriteContext;
import io.fd.honeycomb.v3po.translate.write.WriteContext;
+import io.fd.honeycomb.v3po.translate.write.WriterRegistry;
import java.util.Collections;
import java.util.Map;
import javax.annotation.Nonnull;
final Optional<NormalizedNode<?, ?>> parentOptional) {
if (parentOptional.isPresent()) {
final DataContainerNode parent = (DataContainerNode) parentOptional.get();
- return DataTreeUtils.childrenFromNormalized(parent, serializer);
+ return childrenFromNormalized(parent, serializer);
}
return Collections.emptyMap();
}
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.data;
+package io.fd.honeycomb.v3po.data.impl;
import com.google.common.base.Preconditions;
+import io.fd.honeycomb.v3po.data.ReadableVppDataTree;
+import io.fd.honeycomb.v3po.data.VppDataTree;
+import io.fd.honeycomb.v3po.data.VppDataTreeSnapshot;
import java.util.Collections;
import java.util.Map;
import javax.annotation.Nonnull;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.data;
+package io.fd.honeycomb.v3po.data.impl;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.Iterables.getOnlyElement;
import com.google.common.collect.Multimap;
import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.util.concurrent.Futures;
+import io.fd.honeycomb.v3po.data.ReadableVppDataTree;
import io.fd.honeycomb.v3po.translate.Context;
import io.fd.honeycomb.v3po.translate.read.ReadContext;
import io.fd.honeycomb.v3po.translate.read.ReadFailedException;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.data;
+package io.fd.honeycomb.v3po.data.impl;
import com.google.common.base.Function;
import com.google.common.base.Optional;
import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
+import io.fd.honeycomb.v3po.data.ReadableVppDataTree;
+import io.fd.honeycomb.v3po.data.VppDataTreeSnapshot;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.data;
+package io.fd.honeycomb.v3po.data.impl;
import static org.opendaylight.controller.md.sal.common.api.TransactionStatus.CANCELED;
import static org.opendaylight.controller.md.sal.common.api.TransactionStatus.COMMITED;
import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
+import io.fd.honeycomb.v3po.data.VppDataTree;
+import io.fd.honeycomb.v3po.data.VppDataTreeSnapshot;
import io.fd.honeycomb.v3po.translate.TranslationException;
import javax.annotation.Nonnull;
import javax.annotation.concurrent.NotThreadSafe;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.data;
+package io.fd.honeycomb.v3po.data.impl;
import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;
import org.junit.Test;
+import org.mockito.Matchers;
import org.mockito.Mockito;
import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
import org.opendaylight.yangtools.yang.binding.DataObject;
@Test
public void testChildrenFromNormalized() throws Exception {
- final ContainerNode parent = mock(ContainerNode.class);
- final BindingNormalizedNodeSerializer serializer = mock(BindingNormalizedNodeSerializer.class);
+ final ContainerNode parent = Mockito.mock(ContainerNode.class);
+ final BindingNormalizedNodeSerializer serializer = Mockito.mock(BindingNormalizedNodeSerializer.class);
final Collection<DataContainerChild> list = new ArrayList<>();
- doReturn(list).when(parent).getValue();
+ Mockito.doReturn(list).when(parent).getValue();
// init child1 (will not be serialized)
final DataContainerChild child1 = Mockito.mock(DataContainerChild.class);
- when(child1.getIdentifier()).thenReturn(mock(YangInstanceIdentifier.PathArgument.class));
- when(serializer.fromNormalizedNode(any(YangInstanceIdentifier.class), eq(child1))).thenReturn(null);
+ Mockito.when(child1.getIdentifier()).thenReturn(Mockito.mock(YangInstanceIdentifier.PathArgument.class));
+ Mockito.when(serializer.fromNormalizedNode(Matchers.any(YangInstanceIdentifier.class), Matchers.eq(child1))).thenReturn(null);
list.add(child1);
// init child 2 (will be serialized)
- final DataContainerChild child2 = mock(DataContainerChild.class);
- when(child2.getIdentifier()).thenReturn(mock(YangInstanceIdentifier.PathArgument.class));
+ final DataContainerChild child2 = Mockito.mock(DataContainerChild.class);
+ Mockito.when(child2.getIdentifier()).thenReturn(Mockito.mock(YangInstanceIdentifier.PathArgument.class));
- final Map.Entry entry = mock(Map.Entry.class);
- final InstanceIdentifier<?> id = mock(InstanceIdentifier.class);
- doReturn(id).when(entry).getKey();
- final DataObject data = mock(DataObject.class);
- doReturn(data).when(entry).getValue();
- when(serializer.fromNormalizedNode(any(YangInstanceIdentifier.class), eq(child2))).thenReturn(entry);
+ final Map.Entry entry = Mockito.mock(Map.Entry.class);
+ final InstanceIdentifier<?> id = Mockito.mock(InstanceIdentifier.class);
+ Mockito.doReturn(id).when(entry).getKey();
+ final DataObject data = Mockito.mock(DataObject.class);
+ Mockito.doReturn(data).when(entry).getValue();
+ Mockito.when(serializer.fromNormalizedNode(Matchers.any(YangInstanceIdentifier.class), Matchers.eq(child2))).thenReturn(entry);
list.add(child2);
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.data;
+package io.fd.honeycomb.v3po.data.impl;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.verify;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.data;
+package io.fd.honeycomb.v3po.data.impl;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import com.google.common.base.Optional;
import com.google.common.util.concurrent.CheckedFuture;
+import io.fd.honeycomb.v3po.data.VppDataTreeSnapshot;
import io.fd.honeycomb.v3po.translate.TranslationException;
import io.fd.honeycomb.v3po.translate.write.WriteContext;
+import io.fd.honeycomb.v3po.translate.write.WriterRegistry;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.data;
+package io.fd.honeycomb.v3po.data.impl;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
+import io.fd.honeycomb.v3po.data.ReadableVppDataTree;
+import io.fd.honeycomb.v3po.data.VppDataTree;
+import io.fd.honeycomb.v3po.data.VppDataTreeSnapshot;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.data;
+package io.fd.honeycomb.v3po.data.impl;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.data;
+package io.fd.honeycomb.v3po.data.impl;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.mock;
import com.google.common.base.Optional;
import com.google.common.util.concurrent.CheckedFuture;
+import io.fd.honeycomb.v3po.data.ReadableVppDataTree;
+import io.fd.honeycomb.v3po.data.VppDataTreeSnapshot;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.data;
+package io.fd.honeycomb.v3po.data.impl;
import static junit.framework.TestCase.assertTrue;
import static org.junit.Assert.assertFalse;
import static org.mockito.MockitoAnnotations.initMocks;
import com.google.common.util.concurrent.CheckedFuture;
+import io.fd.honeycomb.v3po.data.VppDataTree;
+import io.fd.honeycomb.v3po.data.VppDataTreeSnapshot;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
<artifactId>v3po-api</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>config</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>data-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>data-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>translate-api</artifactId>
<bundle>mvn:io.fd.honeycomb.v3po/translate-spi/${project.version}</bundle>
<bundle>mvn:io.fd.honeycomb.v3po/translate-utils/${project.version}</bundle>
<bundle>mvn:io.fd.honeycomb.v3po/vpp-translate-utils/${project.version}</bundle>
+ <bundle>mvn:io.fd.honeycomb.v3po/config/${project.version}</bundle>
+ <bundle>mvn:io.fd.honeycomb.v3po/data-api/${project.version}</bundle>
+ <bundle>mvn:io.fd.honeycomb.v3po/data-impl/${project.version}</bundle>
<bundle>mvn:io.fd.honeycomb.v3po/translate-impl/${project.version}</bundle>
<bundle>mvn:io.fd.honeycomb.v3po/v3po2vpp/${project.version}</bundle>
<bundle>wrap:mvn:io.fd.vpp/vppjapi/1.0.0-SNAPSHOT</bundle>
<artifactId>v3po2vpp</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>config</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>data-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>io.fd.vpp</groupId>
import com.google.common.collect.Lists;
import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.util.concurrent.Futures;
-import io.fd.honeycomb.v3po.impl.data.VppDataBrokerInitializationProvider;
-import io.fd.honeycomb.v3po.impl.data.ReaderRegistry;
-import io.fd.honeycomb.v3po.impl.data.WriterRegistry;
+import io.fd.honeycomb.v3po.config.ReaderRegistry;
+import io.fd.honeycomb.v3po.config.WriterRegistry;
import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.data;
+package io.fd.honeycomb.v3po.impl;
import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.util.concurrent.AsyncFunction;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
-import io.fd.honeycomb.v3po.impl.LoggingFuturesCallBack;
+import io.fd.honeycomb.v3po.config.WriterRegistry;
+import io.fd.honeycomb.v3po.data.ReadableVppDataTree;
+import io.fd.honeycomb.v3po.data.VppDataTree;
+import io.fd.honeycomb.v3po.data.impl.VppConfigDataTree;
+import io.fd.honeycomb.v3po.data.impl.VppDataBroker;
+import io.fd.honeycomb.v3po.data.impl.VppOperationalDataTree;
import io.fd.honeycomb.v3po.translate.read.ReaderRegistry;
import java.util.Collection;
import java.util.Collections;
import static org.mockito.MockitoAnnotations.initMocks;
import com.google.common.util.concurrent.CheckedFuture;
+import io.fd.honeycomb.v3po.config.WriterRegistry;
+import io.fd.honeycomb.v3po.impl.VppDataBrokerInitializationProvider;
import io.fd.honeycomb.v3po.translate.read.ReaderRegistry;
import org.junit.Before;
import org.junit.Test;
</prerequisites>
<modules>
<module>api</module>
+ <module>config</module>
+ <module>data-api</module>
+ <module>data-impl</module>
<module>translate-spi</module>
<module>translate-api</module>
<module>translate-impl</module>