<artifactId>v3po-api</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>vpp-facade-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>vpp-facade-spi</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>vpp-facade-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>vpp-facade-utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>v3po2vpp</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>v3po-impl</artifactId>
<artifactId>v3po-api</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>vpp-facade-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>vpp-facade-spi</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>vpp-facade-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>vpp-facade-utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>v3po2vpp</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>io.fd.vpp</groupId>
<artifactId>vppjapi</artifactId>
<feature version='${netconf.version}'>odl-netconf-connector-ssh</feature>
<feature version='${mdsal.version}'>odl-netconf-mdsal</feature>
<bundle>mvn:io.fd.honeycomb.v3po/v3po-impl/${project.version}</bundle>
+ <bundle>mvn:io.fd.honeycomb.v3po/vpp-facade-api/${project.version}</bundle>
+ <bundle>mvn:io.fd.honeycomb.v3po/vpp-facade-spi/${project.version}</bundle>
+ <bundle>mvn:io.fd.honeycomb.v3po/vpp-facade-utils/${project.version}</bundle>
+ <bundle>mvn:io.fd.honeycomb.v3po/vpp-facade-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>
<configfile finalname="${configfile.directory}/v3po.xml">mvn:io.fd.honeycomb.v3po/v3po-impl/${project.version}/xml/config</configfile>
<configfile finalname="${configfile.directory}/v3po-netconf.xml">mvn:io.fd.honeycomb.v3po/v3po-impl/${project.version}/xml/netconf</configfile>
<artifactId>v3po-api</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>vpp-facade-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>v3po2vpp</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>io.fd.vpp</groupId>
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.impl.trans.VppException;
-import io.fd.honeycomb.v3po.impl.trans.w.WriteContext;
-import io.fd.honeycomb.v3po.impl.trans.w.WriterRegistry;
-import io.fd.honeycomb.v3po.impl.trans.w.util.TransactionWriteContext;
+import io.fd.honeycomb.v3po.vpp.facade.VppException;
+import io.fd.honeycomb.v3po.vpp.facade.impl.write.util.TransactionWriteContext;
+import io.fd.honeycomb.v3po.vpp.facade.write.WriteContext;
+import io.fd.honeycomb.v3po.vpp.facade.write.WriterRegistry;
import java.util.Collections;
import java.util.Map;
import javax.annotation.Nonnull;
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.impl.trans.r.ReaderRegistry;
+import io.fd.honeycomb.v3po.vpp.facade.read.ReaderRegistry;
import java.util.Collection;
import java.util.Collections;
import javassist.ClassPool;
package io.fd.honeycomb.v3po.impl.data;
import com.google.common.annotations.Beta;
-import io.fd.honeycomb.v3po.impl.trans.VppException;
+import io.fd.honeycomb.v3po.vpp.facade.VppException;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException;
* @throws DataValidationFailedException if modification data is not valid
* @throws VppException if commit failed while updating VPP state
*/
- void commit(final DataTreeModification modification) throws DataValidationFailedException,
- VppException;
+ void commit(final DataTreeModification modification) throws DataValidationFailedException, VppException;
/**
* Creates read-only snapshot of a VppDataTree.
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.impl.trans.ReadFailedException;
-import io.fd.honeycomb.v3po.impl.trans.r.ReadContext;
-import io.fd.honeycomb.v3po.impl.trans.r.ReaderRegistry;
-import io.fd.honeycomb.v3po.impl.trans.util.Context;
+import io.fd.honeycomb.v3po.vpp.facade.Context;
+import io.fd.honeycomb.v3po.vpp.facade.read.ReadContext;
+import io.fd.honeycomb.v3po.vpp.facade.read.ReadFailedException;
+import io.fd.honeycomb.v3po.vpp.facade.read.ReaderRegistry;
import java.util.Collection;
import java.util.Map;
import javax.annotation.Nonnull;
import com.google.common.base.Optional;
import com.google.common.collect.Multimap;
-import io.fd.honeycomb.v3po.impl.trans.ReadFailedException;
-import io.fd.honeycomb.v3po.impl.trans.r.ChildVppReader;
-import io.fd.honeycomb.v3po.impl.trans.r.ReadContext;
-import io.fd.honeycomb.v3po.impl.trans.r.ReaderRegistry;
-import io.fd.honeycomb.v3po.impl.trans.r.VppReader;
-import io.fd.honeycomb.v3po.impl.trans.r.impl.CompositeChildVppReader;
-import io.fd.honeycomb.v3po.impl.trans.r.impl.CompositeListVppReader;
-import io.fd.honeycomb.v3po.impl.trans.r.impl.CompositeRootVppReader;
-import io.fd.honeycomb.v3po.impl.trans.r.util.DelegatingReaderRegistry;
-import io.fd.honeycomb.v3po.impl.trans.r.util.ReflexiveChildReaderCustomizer;
-import io.fd.honeycomb.v3po.impl.trans.r.util.ReflexiveRootReaderCustomizer;
-import io.fd.honeycomb.v3po.impl.trans.util.VppRWUtils;
-import io.fd.honeycomb.v3po.impl.vppstate.BridgeDomainCustomizer;
-import io.fd.honeycomb.v3po.impl.vppstate.VersionCustomizer;
+import io.fd.honeycomb.v3po.vpp.facade.impl.read.CompositeChildVppReader;
+import io.fd.honeycomb.v3po.vpp.facade.impl.read.CompositeListVppReader;
+import io.fd.honeycomb.v3po.vpp.facade.impl.read.CompositeRootVppReader;
+import io.fd.honeycomb.v3po.vpp.facade.impl.read.util.DelegatingReaderRegistry;
+import io.fd.honeycomb.v3po.vpp.facade.impl.read.util.ReflexiveChildReaderCustomizer;
+import io.fd.honeycomb.v3po.vpp.facade.impl.read.util.ReflexiveRootReaderCustomizer;
+import io.fd.honeycomb.v3po.vpp.facade.impl.util.VppRWUtils;
+import io.fd.honeycomb.v3po.vpp.facade.read.ChildVppReader;
+import io.fd.honeycomb.v3po.vpp.facade.read.ReadContext;
+import io.fd.honeycomb.v3po.vpp.facade.read.ReadFailedException;
+import io.fd.honeycomb.v3po.vpp.facade.read.ReaderRegistry;
+import io.fd.honeycomb.v3po.vpp.facade.read.VppReader;
+import io.fd.honeycomb.v3po.vpp.facade.v3po.vppstate.BridgeDomainCustomizer;
+import io.fd.honeycomb.v3po.vpp.facade.v3po.vppstate.VersionCustomizer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@Nonnull
@Override
public Multimap<InstanceIdentifier<? extends DataObject>, ? extends DataObject> readAll(
- @Nonnull final ReadContext ctx) throws io.fd.honeycomb.v3po.impl.trans.ReadFailedException {
+ @Nonnull final ReadContext ctx) throws ReadFailedException {
return reader.readAll(ctx);
}
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.impl.trans.VppException;
+import io.fd.honeycomb.v3po.vpp.facade.VppException;
import javax.annotation.Nonnull;
import javax.annotation.concurrent.NotThreadSafe;
import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
package io.fd.honeycomb.v3po.impl.data;
-import io.fd.honeycomb.v3po.impl.trans.VppException;
-import io.fd.honeycomb.v3po.impl.trans.util.VppRWUtils;
-import io.fd.honeycomb.v3po.impl.trans.w.ChildVppWriter;
-import io.fd.honeycomb.v3po.impl.trans.w.VppWriter;
-import io.fd.honeycomb.v3po.impl.trans.w.WriteContext;
-import io.fd.honeycomb.v3po.impl.trans.w.WriterRegistry;
-import io.fd.honeycomb.v3po.impl.trans.w.impl.CompositeChildVppWriter;
-import io.fd.honeycomb.v3po.impl.trans.w.impl.CompositeListVppWriter;
-import io.fd.honeycomb.v3po.impl.trans.w.impl.CompositeRootVppWriter;
-import io.fd.honeycomb.v3po.impl.trans.w.util.DelegatingWriterRegistry;
-import io.fd.honeycomb.v3po.impl.trans.w.util.NoopWriterCustomizer;
-import io.fd.honeycomb.v3po.impl.trans.w.util.ReflexiveChildWriterCustomizer;
+import io.fd.honeycomb.v3po.vpp.facade.VppException;
+import io.fd.honeycomb.v3po.vpp.facade.impl.util.VppRWUtils;
+import io.fd.honeycomb.v3po.vpp.facade.impl.write.CompositeChildVppWriter;
+import io.fd.honeycomb.v3po.vpp.facade.impl.write.CompositeListVppWriter;
+import io.fd.honeycomb.v3po.vpp.facade.impl.write.CompositeRootVppWriter;
+import io.fd.honeycomb.v3po.vpp.facade.impl.write.util.DelegatingWriterRegistry;
+import io.fd.honeycomb.v3po.vpp.facade.impl.write.util.NoopWriterCustomizer;
+import io.fd.honeycomb.v3po.vpp.facade.impl.write.util.ReflexiveChildWriterCustomizer;
+import io.fd.honeycomb.v3po.vpp.facade.v3po.vpp.BridgeDomainCustomizer;
+import io.fd.honeycomb.v3po.vpp.facade.write.ChildVppWriter;
+import io.fd.honeycomb.v3po.vpp.facade.write.VppWriter;
+import io.fd.honeycomb.v3po.vpp.facade.write.WriteContext;
+import io.fd.honeycomb.v3po.vpp.facade.write.WriterRegistry;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
private static CompositeRootVppWriter<Vpp> initVppStateWriter(@Nonnull final vppApi vppApi) {
final CompositeListVppWriter<BridgeDomain, BridgeDomainKey> bridgeDomainWriter = new CompositeListVppWriter<>(
BridgeDomain.class,
- new io.fd.honeycomb.v3po.impl.vpp.BridgeDomainCustomizer(vppApi));
+ new BridgeDomainCustomizer(vppApi));
final ChildVppWriter<BridgeDomains> bridgeDomainsWriter = new CompositeChildVppWriter<>(
BridgeDomains.class,
import com.google.common.base.Optional;
import com.google.common.util.concurrent.CheckedFuture;
-import io.fd.honeycomb.v3po.impl.trans.VppException;
-import io.fd.honeycomb.v3po.impl.trans.w.WriteContext;
-import io.fd.honeycomb.v3po.impl.trans.w.WriterRegistry;
+import io.fd.honeycomb.v3po.vpp.facade.VppException;
+import io.fd.honeycomb.v3po.vpp.facade.write.WriteContext;
+import io.fd.honeycomb.v3po.vpp.facade.write.WriterRegistry;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import static org.mockito.MockitoAnnotations.initMocks;
import com.google.common.util.concurrent.CheckedFuture;
-import io.fd.honeycomb.v3po.impl.trans.r.ReaderRegistry;
+import io.fd.honeycomb.v3po.vpp.facade.read.ReaderRegistry;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import com.google.common.collect.LinkedListMultimap;
import com.google.common.collect.Multimap;
import com.google.common.util.concurrent.CheckedFuture;
-import io.fd.honeycomb.v3po.impl.trans.r.ReadContext;
-import io.fd.honeycomb.v3po.impl.trans.r.ReaderRegistry;
+import io.fd.honeycomb.v3po.vpp.facade.read.ReadContext;
+import io.fd.honeycomb.v3po.vpp.facade.read.ReaderRegistry;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
@Test
public void testReadFailed() throws Exception{
- doThrow(io.fd.honeycomb.v3po.impl.trans.ReadFailedException.class).when(reader).readAll(any(ReadContext.class));
+ doThrow(io.fd.honeycomb.v3po.vpp.facade.read.ReadFailedException.class).when(reader).readAll(any(ReadContext.class));
final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> future =
operationalData.read( YangInstanceIdentifier.EMPTY);
try {
future.checkedGet();
} catch (ReadFailedException e) {
- assertTrue(e.getCause() instanceof io.fd.honeycomb.v3po.impl.trans.ReadFailedException);
+ assertTrue(e.getCause() instanceof io.fd.honeycomb.v3po.vpp.facade.read.ReadFailedException);
return;
}
fail("ReadFailedException was expected");
</prerequisites>
<modules>
<module>api</module>
+ <module>vpp-facade-spi</module>
+ <module>vpp-facade-api</module>
+ <module>vpp-facade-impl</module>
+ <module>vpp-facade-utils</module>
+ <module>v3po2vpp</module>
<module>impl</module>
<module>karaf</module>
<module>features</module>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2015 Cisco and/or its affiliates.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at:
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>v3po2vpp</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>vpp-facade-spi</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>vpp-facade-utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>v3po-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.fd.vpp</groupId>
+ <artifactId>vppjapi</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Testing Dependencies -->
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>vpp-facade-impl</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <!--Needed due to final vppAPI, TODO remove once vppAPi refactored-->
+ <dependency>
+ <groupId>org.powermock</groupId>
+ <artifactId>powermock-api-mockito</artifactId>
+ <version>1.5.6</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.powermock</groupId>
+ <artifactId>powermock-module-junit4</artifactId>
+ <version>1.5.6</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.skinny-framework</groupId>
+ <artifactId>skinny-logback</artifactId>
+ <version>1.0.8</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.vpp;
+package io.fd.honeycomb.v3po.vpp.facade.v3po.vpp;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
-import io.fd.honeycomb.v3po.impl.trans.util.Context;
-import io.fd.honeycomb.v3po.impl.trans.util.VppApiCustomizer;
-import io.fd.honeycomb.v3po.impl.trans.w.impl.spi.ListVppWriterCustomizer;
+import io.fd.honeycomb.v3po.vpp.facade.impl.util.VppApiCustomizer;
+import io.fd.honeycomb.v3po.vpp.facade.Context;
+import io.fd.honeycomb.v3po.vpp.facade.spi.write.ListVppWriterCustomizer;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.vppstate;
+package io.fd.honeycomb.v3po.vpp.facade.v3po.vppstate;
import com.google.common.collect.Lists;
-import io.fd.honeycomb.v3po.impl.trans.r.impl.spi.ListVppReaderCustomizer;
-import io.fd.honeycomb.v3po.impl.trans.util.Context;
-import io.fd.honeycomb.v3po.impl.trans.util.VppApiCustomizer;
+import io.fd.honeycomb.v3po.vpp.facade.impl.util.VppApiCustomizer;
+import io.fd.honeycomb.v3po.vpp.facade.Context;
+import io.fd.honeycomb.v3po.vpp.facade.spi.read.ListVppReaderCustomizer;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nonnull;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.vppstate;
+package io.fd.honeycomb.v3po.vpp.facade.v3po.vppstate;
-import io.fd.honeycomb.v3po.impl.trans.r.impl.spi.ChildVppReaderCustomizer;
-import io.fd.honeycomb.v3po.impl.trans.util.Context;
-import io.fd.honeycomb.v3po.impl.trans.util.VppApiCustomizer;
+import io.fd.honeycomb.v3po.vpp.facade.Context;
+import io.fd.honeycomb.v3po.vpp.facade.impl.util.VppApiCustomizer;
+import io.fd.honeycomb.v3po.vpp.facade.spi.read.ChildVppReaderCustomizer;
import javax.annotation.Nonnull;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppStateBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.state.Version;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.vpp;
+package io.fd.honeycomb.v3po.vpp.facade.v3po.vpp;
-import static io.fd.honeycomb.v3po.impl.vpp.BridgeDomainTestUtils.BD_NAME_TO_ID_ANSWER;
-import static io.fd.honeycomb.v3po.impl.vpp.BridgeDomainTestUtils.bdIdentifierForName;
-import static io.fd.honeycomb.v3po.impl.vpp.BridgeDomainTestUtils.bdNameToID;
-import static io.fd.honeycomb.v3po.impl.vpp.BridgeDomainTestUtils.booleanToByte;
-import static io.fd.honeycomb.v3po.impl.vpp.BridgeDomainTestUtils.intToBoolean;
+import static io.fd.honeycomb.v3po.vpp.facade.v3po.vpp.BridgeDomainTestUtils.BD_NAME_TO_ID_ANSWER;
+import static io.fd.honeycomb.v3po.vpp.facade.v3po.vpp.BridgeDomainTestUtils.bdIdentifierForName;
+import static io.fd.honeycomb.v3po.vpp.facade.v3po.vpp.BridgeDomainTestUtils.bdNameToID;
+import static io.fd.honeycomb.v3po.vpp.facade.v3po.vpp.BridgeDomainTestUtils.booleanToByte;
+import static io.fd.honeycomb.v3po.vpp.facade.v3po.vpp.BridgeDomainTestUtils.intToBoolean;
import static org.junit.Assert.fail;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.verify;
import static org.mockito.MockitoAnnotations.initMocks;
-import io.fd.honeycomb.v3po.impl.trans.util.Context;
+import io.fd.honeycomb.v3po.vpp.facade.Context;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.vpp;
+package io.fd.honeycomb.v3po.vpp.facade.v3po.vpp;
import javax.annotation.Nullable;
import org.mockito.invocation.InvocationOnMock;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.vpp;
+package io.fd.honeycomb.v3po.vpp.facade.v3po.vpp;
-import static io.fd.honeycomb.v3po.impl.vpp.BridgeDomainTestUtils.BD_NAME_TO_ID_ANSWER;
+import static io.fd.honeycomb.v3po.vpp.facade.v3po.vpp.BridgeDomainTestUtils.BD_NAME_TO_ID_ANSWER;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verifyZeroInteractions;
import com.google.common.collect.Lists;
-import io.fd.honeycomb.v3po.impl.trans.w.VppWriter;
-import io.fd.honeycomb.v3po.impl.trans.w.WriteContext;
-import io.fd.honeycomb.v3po.impl.trans.w.impl.CompositeRootVppWriter;
-import io.fd.honeycomb.v3po.impl.trans.w.util.DelegatingWriterRegistry;
+import io.fd.honeycomb.v3po.vpp.facade.impl.write.CompositeRootVppWriter;
+import io.fd.honeycomb.v3po.vpp.facade.impl.write.util.DelegatingWriterRegistry;
+import io.fd.honeycomb.v3po.vpp.facade.write.VppWriter;
+import io.fd.honeycomb.v3po.vpp.facade.write.WriteContext;
import java.util.Collections;
import java.util.List;
import org.junit.Before;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.vpp;
-
-import io.fd.honeycomb.v3po.impl.trans.util.VppRWUtils;
-import io.fd.honeycomb.v3po.impl.trans.w.ChildVppWriter;
-import io.fd.honeycomb.v3po.impl.trans.w.impl.CompositeChildVppWriter;
-import io.fd.honeycomb.v3po.impl.trans.w.impl.CompositeListVppWriter;
-import io.fd.honeycomb.v3po.impl.trans.w.impl.CompositeRootVppWriter;
-import io.fd.honeycomb.v3po.impl.trans.w.util.NoopWriterCustomizer;
-import io.fd.honeycomb.v3po.impl.trans.w.util.ReflexiveChildWriterCustomizer;
+package io.fd.honeycomb.v3po.vpp.facade.v3po.vpp;
+
+import io.fd.honeycomb.v3po.vpp.facade.impl.util.VppRWUtils;
+import io.fd.honeycomb.v3po.vpp.facade.impl.write.CompositeChildVppWriter;
+import io.fd.honeycomb.v3po.vpp.facade.impl.write.CompositeListVppWriter;
+import io.fd.honeycomb.v3po.vpp.facade.impl.write.CompositeRootVppWriter;
+import io.fd.honeycomb.v3po.vpp.facade.impl.write.util.NoopWriterCustomizer;
+import io.fd.honeycomb.v3po.vpp.facade.impl.write.util.ReflexiveChildWriterCustomizer;
+import io.fd.honeycomb.v3po.vpp.facade.write.ChildVppWriter;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nonnull;
final CompositeListVppWriter<BridgeDomain, BridgeDomainKey> bridgeDomainWriter = new CompositeListVppWriter<>(
BridgeDomain.class,
- new io.fd.honeycomb.v3po.impl.vpp.BridgeDomainCustomizer(vppApi));
+ new BridgeDomainCustomizer(vppApi));
final ChildVppWriter<BridgeDomains> bridgeDomainsReader = new CompositeChildVppWriter<>(
BridgeDomains.class,
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.vppstate;
+package io.fd.honeycomb.v3po.vpp.facade.v3po.vppstate;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import com.google.common.collect.Multimap;
-import io.fd.honeycomb.v3po.impl.trans.r.ReadContext;
-import io.fd.honeycomb.v3po.impl.trans.r.VppReader;
-import io.fd.honeycomb.v3po.impl.trans.r.impl.CompositeListVppReader;
-import io.fd.honeycomb.v3po.impl.trans.r.impl.CompositeRootVppReader;
-import io.fd.honeycomb.v3po.impl.trans.r.util.DelegatingReaderRegistry;
+import io.fd.honeycomb.v3po.vpp.facade.impl.read.CompositeListVppReader;
+import io.fd.honeycomb.v3po.vpp.facade.impl.read.CompositeRootVppReader;
+import io.fd.honeycomb.v3po.vpp.facade.impl.read.util.DelegatingReaderRegistry;
+import io.fd.honeycomb.v3po.vpp.facade.read.ReadContext;
+import io.fd.honeycomb.v3po.vpp.facade.read.VppReader;
import java.util.Collections;
import java.util.List;
import org.junit.Before;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.vppstate;
+package io.fd.honeycomb.v3po.vpp.facade.v3po.vppstate;
-import io.fd.honeycomb.v3po.impl.trans.r.ChildVppReader;
-import io.fd.honeycomb.v3po.impl.trans.r.impl.CompositeChildVppReader;
-import io.fd.honeycomb.v3po.impl.trans.r.impl.CompositeListVppReader;
-import io.fd.honeycomb.v3po.impl.trans.r.impl.CompositeRootVppReader;
-import io.fd.honeycomb.v3po.impl.trans.r.util.ReflexiveChildReaderCustomizer;
-import io.fd.honeycomb.v3po.impl.trans.r.util.ReflexiveRootReaderCustomizer;
-import io.fd.honeycomb.v3po.impl.trans.util.VppRWUtils;
+import io.fd.honeycomb.v3po.vpp.facade.impl.read.CompositeChildVppReader;
+import io.fd.honeycomb.v3po.vpp.facade.impl.read.CompositeListVppReader;
+import io.fd.honeycomb.v3po.vpp.facade.impl.read.CompositeRootVppReader;
+import io.fd.honeycomb.v3po.vpp.facade.impl.read.util.ReflexiveChildReaderCustomizer;
+import io.fd.honeycomb.v3po.vpp.facade.impl.read.util.ReflexiveRootReaderCustomizer;
+import io.fd.honeycomb.v3po.vpp.facade.impl.util.VppRWUtils;
+import io.fd.honeycomb.v3po.vpp.facade.read.ChildVppReader;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nonnull;
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2015 Cisco and/or its affiliates.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at:
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>vpp-facade-api</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-artifacts</artifactId>
+ <version>2.0.0-Beryllium</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-binding-api</artifactId>
+ </dependency>
+
+ <!-- Testing Dependencies -->
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>v3po-api</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.util;
+package io.fd.honeycomb.v3po.vpp.facade;
import com.google.common.collect.Maps;
import java.util.HashMap;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans;
+package io.fd.honeycomb.v3po.vpp.facade;
import com.google.common.annotations.Beta;
import javax.annotation.Nonnull;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans;
+package io.fd.honeycomb.v3po.vpp.facade;
import com.google.common.annotations.Beta;
import com.google.common.base.Preconditions;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans;
+package io.fd.honeycomb.v3po.vpp.facade;
import com.google.common.annotations.Beta;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.r;
+package io.fd.honeycomb.v3po.vpp.facade.read;
import com.google.common.annotations.Beta;
-import io.fd.honeycomb.v3po.impl.trans.ReadFailedException;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.DataObject;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.r;
+package io.fd.honeycomb.v3po.vpp.facade.read;
import com.google.common.annotations.Beta;
-import io.fd.honeycomb.v3po.impl.trans.ReadFailedException;
import java.util.List;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.yang.binding.DataObject;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.r;
+package io.fd.honeycomb.v3po.vpp.facade.read;
-import io.fd.honeycomb.v3po.impl.trans.util.Context;
+import io.fd.honeycomb.v3po.vpp.facade.Context;
import javax.annotation.Nonnull;
/**
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans;
+package io.fd.honeycomb.v3po.vpp.facade.read;
import static com.google.common.base.Preconditions.checkNotNull;
+import io.fd.honeycomb.v3po.vpp.facade.VppException;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.r;
+package io.fd.honeycomb.v3po.vpp.facade.read;
import com.google.common.annotations.Beta;
import com.google.common.collect.Multimap;
-import io.fd.honeycomb.v3po.impl.trans.ReadFailedException;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.r;
+package io.fd.honeycomb.v3po.vpp.facade.read;
import com.google.common.annotations.Beta;
import com.google.common.base.Optional;
-import io.fd.honeycomb.v3po.impl.trans.ReadFailedException;
-import io.fd.honeycomb.v3po.impl.trans.SubtreeManager;
+import io.fd.honeycomb.v3po.vpp.facade.SubtreeManager;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.w;
+package io.fd.honeycomb.v3po.vpp.facade.write;
import com.google.common.annotations.Beta;
import javax.annotation.Nonnull;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.w;
+package io.fd.honeycomb.v3po.vpp.facade.write;
import com.google.common.annotations.Beta;
-import io.fd.honeycomb.v3po.impl.trans.SubtreeManager;
-import io.fd.honeycomb.v3po.impl.trans.VppException;
+import io.fd.honeycomb.v3po.vpp.facade.SubtreeManager;
+import io.fd.honeycomb.v3po.vpp.facade.VppException;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opendaylight.yangtools.yang.binding.DataObject;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.w;
+package io.fd.honeycomb.v3po.vpp.facade.write;
import com.google.common.annotations.Beta;
import com.google.common.base.Optional;
-import io.fd.honeycomb.v3po.impl.trans.util.Context;
+import io.fd.honeycomb.v3po.vpp.facade.Context;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.w;
+package io.fd.honeycomb.v3po.vpp.facade.write;
import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.annotations.Beta;
import com.google.common.collect.ImmutableList;
-import io.fd.honeycomb.v3po.impl.trans.VppException;
+import io.fd.honeycomb.v3po.vpp.facade.VppException;
import java.util.List;
import java.util.Map;
import javax.annotation.Nonnull;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+package io.fd.honeycomb.v3po.vpp.facade;
+import io.fd.honeycomb.v3po.vpp.facade.read.ReadFailedException;
+import org.junit.Assert;
import org.junit.Test;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.state.bridge.domains.BridgeDomain;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.state.bridge.domains.bridge.domain.Interface;
public void testInstantiation() {
final InstanceIdentifier<BridgeDomain> id = InstanceIdentifier.create(BridgeDomain.class);
ReadFailedException e = new ReadFailedException(id);
- assertEquals(id, e.getFailedId());
- assertNull(e.getCause());
- assertTrue(e.getMessage().contains(id.toString()));
+ Assert.assertEquals(id, e.getFailedId());
+ Assert.assertNull(e.getCause());
+ Assert.assertTrue(e.getMessage().contains(id.toString()));
}
@Test
final InstanceIdentifier<Interface> id = InstanceIdentifier.create(Interface.class);
final RuntimeException cause = new RuntimeException();
ReadFailedException e = new ReadFailedException(id, cause);
- assertEquals(id, e.getFailedId());
- assertEquals(cause, e.getCause());
- assertTrue(e.getMessage().contains(id.toString()));
+ Assert.assertEquals(id, e.getFailedId());
+ Assert.assertEquals(cause, e.getCause());
+ Assert.assertTrue(e.getMessage().contains(id.toString()));
}
@Test(expected = NullPointerException.class)
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+package io.fd.honeycomb.v3po.vpp.facade;
import java.util.Random;
+import org.junit.Assert;
import org.junit.Test;
public class VppApiInvocationExceptionTest {
final int ctxId = 1;
final int code = -1;
VppApiInvocationException e = new VppApiInvocationException(apiMethodName, ctxId, code);
- assertEquals(apiMethodName, e.getMethodName());
- assertEquals(ctxId, e.getCtxId());
- assertEquals(code, e.getErrorCode());
- assertTrue(e.getMessage().contains(apiMethodName));
- assertTrue(e.getMessage().contains(String.valueOf(code)));
- assertTrue(e.getMessage().contains(String.valueOf(ctxId)));
+ Assert.assertEquals(apiMethodName, e.getMethodName());
+ Assert.assertEquals(ctxId, e.getCtxId());
+ Assert.assertEquals(code, e.getErrorCode());
+ Assert.assertTrue(e.getMessage().contains(apiMethodName));
+ Assert.assertTrue(e.getMessage().contains(String.valueOf(code)));
+ Assert.assertTrue(e.getMessage().contains(String.valueOf(ctxId)));
}
@Test(expected = IllegalArgumentException.class)
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2015 Cisco and/or its affiliates.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at:
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>vpp-facade-impl</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>vpp-facade-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>vpp-facade-spi</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>vpp-facade-utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <!-- Testing Dependencies -->
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>v3po-api</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <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.vpp.facade.impl.*
+ </Export-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.r.impl;
+package io.fd.honeycomb.v3po.vpp.facade.impl.read;
import static com.google.common.base.Preconditions.checkArgument;
import com.google.common.base.Optional;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
-import io.fd.honeycomb.v3po.impl.trans.ReadFailedException;
-import io.fd.honeycomb.v3po.impl.trans.r.ChildVppReader;
-import io.fd.honeycomb.v3po.impl.trans.r.ReadContext;
-import io.fd.honeycomb.v3po.impl.trans.r.VppReader;
-import io.fd.honeycomb.v3po.impl.trans.util.ReflectionUtils;
-import io.fd.honeycomb.v3po.impl.trans.util.VppRWUtils;
+import io.fd.honeycomb.v3po.vpp.facade.impl.util.ReflectionUtils;
+import io.fd.honeycomb.v3po.vpp.facade.impl.util.VppRWUtils;
+import io.fd.honeycomb.v3po.vpp.facade.read.ChildVppReader;
+import io.fd.honeycomb.v3po.vpp.facade.read.ReadContext;
+import io.fd.honeycomb.v3po.vpp.facade.read.ReadFailedException;
+import io.fd.honeycomb.v3po.vpp.facade.read.VppReader;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Collections;
*
*/
protected Optional<D> readCurrent(final InstanceIdentifier<D> id,
- @Nonnull final ReadContext ctx) throws
- ReadFailedException {
+ @Nonnull final ReadContext ctx) throws ReadFailedException {
LOG.debug("{}: Reading current: {}", this, id);
final B builder = getBuilder(id);
// Cache empty value to determine if anything has changed later TODO cache in a field
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.r.impl;
+package io.fd.honeycomb.v3po.vpp.facade.impl.read;
import com.google.common.annotations.Beta;
import com.google.common.base.Optional;
-import io.fd.honeycomb.v3po.impl.trans.ReadFailedException;
-import io.fd.honeycomb.v3po.impl.trans.r.ChildVppReader;
-import io.fd.honeycomb.v3po.impl.trans.r.ReadContext;
-import io.fd.honeycomb.v3po.impl.trans.r.impl.spi.ChildVppReaderCustomizer;
-import io.fd.honeycomb.v3po.impl.trans.util.VppRWUtils;
+import io.fd.honeycomb.v3po.vpp.facade.impl.util.VppRWUtils;
+import io.fd.honeycomb.v3po.vpp.facade.read.ChildVppReader;
+import io.fd.honeycomb.v3po.vpp.facade.read.ReadContext;
+import io.fd.honeycomb.v3po.vpp.facade.read.ReadFailedException;
+import io.fd.honeycomb.v3po.vpp.facade.spi.read.ChildVppReaderCustomizer;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.concurrent.ThreadSafe;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.r.impl;
+package io.fd.honeycomb.v3po.vpp.facade.impl.read;
import static com.google.common.base.Preconditions.checkArgument;
import com.google.common.annotations.Beta;
import com.google.common.base.Optional;
-import io.fd.honeycomb.v3po.impl.trans.ReadFailedException;
-import io.fd.honeycomb.v3po.impl.trans.r.ChildVppReader;
-import io.fd.honeycomb.v3po.impl.trans.r.ListVppReader;
-import io.fd.honeycomb.v3po.impl.trans.r.ReadContext;
-import io.fd.honeycomb.v3po.impl.trans.r.impl.spi.ListVppReaderCustomizer;
-import io.fd.honeycomb.v3po.impl.trans.util.VppRWUtils;
+import io.fd.honeycomb.v3po.vpp.facade.impl.util.VppRWUtils;
+import io.fd.honeycomb.v3po.vpp.facade.read.ChildVppReader;
+import io.fd.honeycomb.v3po.vpp.facade.read.ListVppReader;
+import io.fd.honeycomb.v3po.vpp.facade.read.ReadContext;
+import io.fd.honeycomb.v3po.vpp.facade.read.ReadFailedException;
+import io.fd.honeycomb.v3po.vpp.facade.spi.read.ListVppReaderCustomizer;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nonnull;
import org.slf4j.LoggerFactory;
/**
- * Composite implementation of {@link ChildVppReader} able to place the read result into parent builder object intended
+ * Composite implementation of {@link io.fd.honeycomb.v3po.vpp.facade.read.ChildVppReader} able to place the read result into parent builder object intended
* for list node type.
*
* This reader checks if the IDs are wildcarded in which case it performs read of all list entries. In case the ID has a
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.r.impl;
+package io.fd.honeycomb.v3po.vpp.facade.impl.read;
import com.google.common.annotations.Beta;
-import io.fd.honeycomb.v3po.impl.trans.ReadFailedException;
-import io.fd.honeycomb.v3po.impl.trans.r.ChildVppReader;
-import io.fd.honeycomb.v3po.impl.trans.r.ReadContext;
-import io.fd.honeycomb.v3po.impl.trans.r.VppReader;
-import io.fd.honeycomb.v3po.impl.trans.r.impl.spi.RootVppReaderCustomizer;
-import io.fd.honeycomb.v3po.impl.trans.util.VppRWUtils;
+import io.fd.honeycomb.v3po.vpp.facade.impl.util.VppRWUtils;
+import io.fd.honeycomb.v3po.vpp.facade.read.ChildVppReader;
+import io.fd.honeycomb.v3po.vpp.facade.read.ReadContext;
+import io.fd.honeycomb.v3po.vpp.facade.read.ReadFailedException;
+import io.fd.honeycomb.v3po.vpp.facade.read.VppReader;
+import io.fd.honeycomb.v3po.vpp.facade.spi.read.RootVppReaderCustomizer;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.concurrent.ThreadSafe;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/**
- * Composite implementation of {@link VppReader}
+ * Composite implementation of {@link io.fd.honeycomb.v3po.vpp.facade.read.VppReader}
*/
@Beta
@ThreadSafe
@Override
protected void readCurrentAttributes(@Nonnull final InstanceIdentifier<C> id, @Nonnull final B builder,
- @Nonnull final ReadContext ctx)
- throws ReadFailedException {
+ @Nonnull final ReadContext ctx) throws ReadFailedException {
customizer.readCurrentAttributes(id, builder, ctx.getContext());
}
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.w.impl;
+package io.fd.honeycomb.v3po.vpp.facade.impl.write;
import static com.google.common.base.Preconditions.checkArgument;
import com.google.common.base.Optional;
import com.google.common.collect.Lists;
-import io.fd.honeycomb.v3po.impl.trans.VppException;
-import io.fd.honeycomb.v3po.impl.trans.util.VppRWUtils;
-import io.fd.honeycomb.v3po.impl.trans.w.ChildVppWriter;
-import io.fd.honeycomb.v3po.impl.trans.w.VppWriter;
-import io.fd.honeycomb.v3po.impl.trans.w.WriteContext;
+import io.fd.honeycomb.v3po.vpp.facade.VppException;
+import io.fd.honeycomb.v3po.vpp.facade.impl.util.VppRWUtils;
+import io.fd.honeycomb.v3po.vpp.facade.write.ChildVppWriter;
+import io.fd.honeycomb.v3po.vpp.facade.write.VppWriter;
+import io.fd.honeycomb.v3po.vpp.facade.write.WriteContext;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.w.impl;
+package io.fd.honeycomb.v3po.vpp.facade.impl.write;
import com.google.common.base.Optional;
-import io.fd.honeycomb.v3po.impl.trans.util.VppRWUtils;
-import io.fd.honeycomb.v3po.impl.trans.w.ChildVppWriter;
-import io.fd.honeycomb.v3po.impl.trans.w.WriteContext;
-import io.fd.honeycomb.v3po.impl.trans.w.impl.spi.ChildVppWriterCustomizer;
+import io.fd.honeycomb.v3po.vpp.facade.impl.util.VppRWUtils;
+import io.fd.honeycomb.v3po.vpp.facade.spi.write.ChildVppWriterCustomizer;
+import io.fd.honeycomb.v3po.vpp.facade.write.ChildVppWriter;
+import io.fd.honeycomb.v3po.vpp.facade.write.WriteContext;
import java.util.List;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.yang.binding.Augmentation;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.w.impl;
+package io.fd.honeycomb.v3po.vpp.facade.impl.write;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
-import io.fd.honeycomb.v3po.impl.trans.util.VppRWUtils;
-import io.fd.honeycomb.v3po.impl.trans.w.ChildVppWriter;
-import io.fd.honeycomb.v3po.impl.trans.w.WriteContext;
-import io.fd.honeycomb.v3po.impl.trans.w.impl.spi.ListVppWriterCustomizer;
+import io.fd.honeycomb.v3po.vpp.facade.impl.util.VppRWUtils;
+import io.fd.honeycomb.v3po.vpp.facade.spi.write.ListVppWriterCustomizer;
+import io.fd.honeycomb.v3po.vpp.facade.write.ChildVppWriter;
+import io.fd.honeycomb.v3po.vpp.facade.write.WriteContext;
import java.util.List;
import java.util.Map;
import javax.annotation.Nonnull;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.w.impl;
+package io.fd.honeycomb.v3po.vpp.facade.impl.write;
-import io.fd.honeycomb.v3po.impl.trans.util.VppRWUtils;
-import io.fd.honeycomb.v3po.impl.trans.w.ChildVppWriter;
-import io.fd.honeycomb.v3po.impl.trans.w.WriteContext;
-import io.fd.honeycomb.v3po.impl.trans.w.impl.spi.RootVppWriterCustomizer;
+import io.fd.honeycomb.v3po.vpp.facade.impl.util.VppRWUtils;
+import io.fd.honeycomb.v3po.vpp.facade.spi.write.RootVppWriterCustomizer;
+import io.fd.honeycomb.v3po.vpp.facade.write.ChildVppWriter;
+import io.fd.honeycomb.v3po.vpp.facade.write.WriteContext;
import java.util.List;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.yang.binding.Augmentation;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.w.util;
+package io.fd.honeycomb.v3po.vpp.facade.impl.write.util;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
-import io.fd.honeycomb.v3po.impl.trans.VppException;
-import io.fd.honeycomb.v3po.impl.trans.w.VppWriter;
-import io.fd.honeycomb.v3po.impl.trans.w.WriteContext;
-import io.fd.honeycomb.v3po.impl.trans.w.WriterRegistry;
-import io.fd.honeycomb.v3po.impl.trans.w.impl.CompositeRootVppWriter;
+import io.fd.honeycomb.v3po.vpp.facade.VppException;
+import io.fd.honeycomb.v3po.vpp.facade.impl.write.CompositeRootVppWriter;
+import io.fd.honeycomb.v3po.vpp.facade.write.VppWriter;
+import io.fd.honeycomb.v3po.vpp.facade.write.WriteContext;
+import io.fd.honeycomb.v3po.vpp.facade.write.WriterRegistry;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
-package io.fd.honeycomb.v3po.impl.trans.w.util;
+/*
+ * Copyright (c) 2016 Cisco and/or its affiliates.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package io.fd.honeycomb.v3po.vpp.facade.impl.write.util;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import com.google.common.base.Optional;
import com.google.common.util.concurrent.CheckedFuture;
-import io.fd.honeycomb.v3po.impl.trans.util.Context;
+import io.fd.honeycomb.v3po.vpp.facade.Context;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2015 Cisco and/or its affiliates.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at:
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>vpp-facade-spi</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-artifacts</artifactId>
+ <version>2.0.0-Beryllium</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>vpp-facade-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-binding-api</artifactId>
+ </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>
+
+ </dependencies>
+
+</project>
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.r.impl.spi;
+package io.fd.honeycomb.v3po.vpp.facade.spi.read;
import com.google.common.annotations.Beta;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.yang.binding.DataObject;
/**
- * {@link io.fd.honeycomb.v3po.impl.trans.r.impl.CompositeChildVppReader} SPI to customize its behavior
+ * CompositeChildVppReader SPI to customize its behavior
*
* @param <C> Specific DataObject derived type (Identifiable), that is handled by this customizer
* @param <B> Specific Builder for handled type (C)
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.r.impl.spi;
+package io.fd.honeycomb.v3po.vpp.facade.spi.read;
import com.google.common.annotations.Beta;
-import io.fd.honeycomb.v3po.impl.trans.util.Context;
+import io.fd.honeycomb.v3po.vpp.facade.Context;
import java.util.List;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/**
- * {@link io.fd.honeycomb.v3po.impl.trans.r.impl.CompositeListVppReader} SPI to customize its behavior
+ * CompositeListVppReader SPI to customize its behavior
*
* @param <C> Specific DataObject derived type (Identifiable), that is handled by this customizer
* @param <K> Specific Identifier for handled type (C)
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.r.impl.spi;
+package io.fd.honeycomb.v3po.vpp.facade.spi.read;
import com.google.common.annotations.Beta;
-import io.fd.honeycomb.v3po.impl.trans.ReadFailedException;
-import io.fd.honeycomb.v3po.impl.trans.util.Context;
+import io.fd.honeycomb.v3po.vpp.facade.Context;
+import io.fd.honeycomb.v3po.vpp.facade.read.ReadFailedException;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/**
- * {@link io.fd.honeycomb.v3po.impl.trans.r.impl.CompositeRootVppReader} SPI to customize its behavior
+ * CompositeRootVppReader SPI to customize its behavior
*
* @param <C> Specific DataObject derived type, that is handled by this customizer
* @param <B> Specific Builder for handled type (C)
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.w.impl.spi;
+package io.fd.honeycomb.v3po.vpp.facade.spi.write;
import com.google.common.annotations.Beta;
import com.google.common.base.Optional;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/**
- * {@link io.fd.honeycomb.v3po.impl.trans.w.impl.CompositeChildVppWriter} SPI to customize its behavior
+ * CompositeChildVppWriter SPI to customize its behavior
*
* @param <D> Specific DataObject derived type (Identifiable), that is handled by this customizer
*/
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.w.impl.spi;
+package io.fd.honeycomb.v3po.vpp.facade.spi.write;
import com.google.common.annotations.Beta;
import java.util.List;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/**
- * {@link io.fd.honeycomb.v3po.impl.trans.w.impl.CompositeListVppWriter} SPI to customize its behavior
+ * CompositeListVppWriter SPI to customize its behavior
*
* @param <C> Specific DataObject derived type (Identifiable), that is handled by this customizer
* @param <K> Specific Identifier for handled type (C)
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.w.impl.spi;
+package io.fd.honeycomb.v3po.vpp.facade.spi.write;
import com.google.common.annotations.Beta;
-import io.fd.honeycomb.v3po.impl.trans.util.Context;
+import io.fd.honeycomb.v3po.vpp.facade.Context;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/**
- * {@link io.fd.honeycomb.v3po.impl.trans.w.impl.CompositeRootVppWriter} SPI to customize its behavior
+ * CompositeRootVppReader SPI to customize its behavior
*
* @param <D> Specific DataObject derived type, that is handled by this customizer
*/
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2015 Cisco and/or its affiliates.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at:
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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>vpp-facade-utils</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-artifacts</artifactId>
+ <version>2.0.0-Beryllium</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>mdsal-artifacts</artifactId>
+ <version>1.3.0-Beryllium</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>vpp-facade-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>vpp-facade-spi</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.fd.vpp</groupId>
+ <artifactId>vppjapi</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-core-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-binding-dom-codec</artifactId>
+ </dependency>
+
+ <!-- Testing Dependencies -->
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>v3po-api</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.r.util;
+package io.fd.honeycomb.v3po.vpp.facade.impl.read.util;
import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.collect.Iterables;
import com.google.common.collect.LinkedListMultimap;
import com.google.common.collect.Multimap;
-import io.fd.honeycomb.v3po.impl.trans.ReadFailedException;
-import io.fd.honeycomb.v3po.impl.trans.r.ListVppReader;
-import io.fd.honeycomb.v3po.impl.trans.r.ReadContext;
-import io.fd.honeycomb.v3po.impl.trans.r.ReaderRegistry;
-import io.fd.honeycomb.v3po.impl.trans.r.VppReader;
-import io.fd.honeycomb.v3po.impl.trans.util.VppRWUtils;
+import io.fd.honeycomb.v3po.vpp.facade.impl.util.VppRWUtils;
+import io.fd.honeycomb.v3po.vpp.facade.read.ListVppReader;
+import io.fd.honeycomb.v3po.vpp.facade.read.ReadContext;
+import io.fd.honeycomb.v3po.vpp.facade.read.ReadFailedException;
+import io.fd.honeycomb.v3po.vpp.facade.read.ReaderRegistry;
+import io.fd.honeycomb.v3po.vpp.facade.read.VppReader;
import java.util.Collections;
import java.util.List;
import java.util.Map;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.r.util;
+package io.fd.honeycomb.v3po.vpp.facade.impl.read.util;
-import io.fd.honeycomb.v3po.impl.trans.r.impl.spi.RootVppReaderCustomizer;
-import io.fd.honeycomb.v3po.impl.trans.util.Context;
+import io.fd.honeycomb.v3po.vpp.facade.Context;
+import io.fd.honeycomb.v3po.vpp.facade.spi.read.RootVppReaderCustomizer;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-public abstract class NoopReaderCustomizer<C extends DataObject, B extends Builder<C>> implements RootVppReaderCustomizer<C, B> {
+public abstract class NoopReaderCustomizer<C extends DataObject, B extends Builder<C>> implements
+ RootVppReaderCustomizer<C, B> {
@Override
public void readCurrentAttributes(InstanceIdentifier<C> id, final B builder, final Context context) {
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.r.util;
+package io.fd.honeycomb.v3po.vpp.facade.impl.read.util;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
-import io.fd.honeycomb.v3po.impl.trans.r.impl.spi.ChildVppReaderCustomizer;
-import io.fd.honeycomb.v3po.impl.trans.util.ReflectionUtils;
+import io.fd.honeycomb.v3po.vpp.facade.impl.util.ReflectionUtils;
+import io.fd.honeycomb.v3po.vpp.facade.spi.read.ChildVppReaderCustomizer;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Collections;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.r.util;
+package io.fd.honeycomb.v3po.vpp.facade.impl.read.util;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.DataObject;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.util;
+package io.fd.honeycomb.v3po.vpp.facade.impl.util;
import com.google.common.base.Optional;
import java.lang.reflect.Method;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.util;
+package io.fd.honeycomb.v3po.vpp.facade.impl.util;
import com.google.common.annotations.Beta;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.util;
+package io.fd.honeycomb.v3po.vpp.facade.impl.util;
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import com.google.common.collect.Maps;
-import io.fd.honeycomb.v3po.impl.trans.SubtreeManager;
-import io.fd.honeycomb.v3po.impl.trans.r.ChildVppReader;
-import io.fd.honeycomb.v3po.impl.trans.w.ChildVppWriter;
+import io.fd.honeycomb.v3po.vpp.facade.SubtreeManager;
+import io.fd.honeycomb.v3po.vpp.facade.read.ChildVppReader;
+import io.fd.honeycomb.v3po.vpp.facade.write.ChildVppWriter;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.w.util;
+package io.fd.honeycomb.v3po.vpp.facade.impl.write.util;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
-import io.fd.honeycomb.v3po.impl.trans.VppException;
-import io.fd.honeycomb.v3po.impl.trans.util.VppRWUtils;
-import io.fd.honeycomb.v3po.impl.trans.w.VppWriter;
-import io.fd.honeycomb.v3po.impl.trans.w.WriteContext;
-import io.fd.honeycomb.v3po.impl.trans.w.WriterRegistry;
+import io.fd.honeycomb.v3po.vpp.facade.VppException;
+import io.fd.honeycomb.v3po.vpp.facade.impl.util.VppRWUtils;
+import io.fd.honeycomb.v3po.vpp.facade.write.VppWriter;
+import io.fd.honeycomb.v3po.vpp.facade.write.WriteContext;
+import io.fd.honeycomb.v3po.vpp.facade.write.WriterRegistry;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.w.util;
+package io.fd.honeycomb.v3po.vpp.facade.impl.write.util;
-import io.fd.honeycomb.v3po.impl.trans.util.Context;
-import io.fd.honeycomb.v3po.impl.trans.w.impl.spi.RootVppWriterCustomizer;
+import io.fd.honeycomb.v3po.vpp.facade.Context;
+import io.fd.honeycomb.v3po.vpp.facade.spi.write.RootVppWriterCustomizer;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.w.util;
+package io.fd.honeycomb.v3po.vpp.facade.impl.write.util;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.collect.Iterables;
-import io.fd.honeycomb.v3po.impl.trans.util.ReflectionUtils;
-import io.fd.honeycomb.v3po.impl.trans.w.impl.spi.ChildVppWriterCustomizer;
+import io.fd.honeycomb.v3po.vpp.facade.impl.util.ReflectionUtils;
+import io.fd.honeycomb.v3po.vpp.facade.spi.write.ChildVppWriterCustomizer;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Collections;
* limitations under the License.
*/
-package io.fd.honeycomb.v3po.impl.trans.w.util;
+package io.fd.honeycomb.v3po.vpp.facade.impl.write.util;
import com.google.common.base.Optional;
import com.google.common.util.concurrent.CheckedFuture;
-import io.fd.honeycomb.v3po.impl.trans.util.Context;
-import io.fd.honeycomb.v3po.impl.trans.w.WriteContext;
+import io.fd.honeycomb.v3po.vpp.facade.Context;
+import io.fd.honeycomb.v3po.vpp.facade.write.WriteContext;
import java.util.Map;
import javax.annotation.Nonnull;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
--- /dev/null
+/*
+ * Copyright (c) 2016 Cisco and/or its affiliates.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package io.fd.honeycomb.v3po.vpp.facade.impl.write.util;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+
+import io.fd.honeycomb.v3po.vpp.facade.VppException;
+import io.fd.honeycomb.v3po.vpp.facade.write.VppWriter;
+import io.fd.honeycomb.v3po.vpp.facade.write.WriteContext;
+import io.fd.honeycomb.v3po.vpp.facade.write.WriterRegistry;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.Vpp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppState;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+
+public class DelegatingWriterRegistryTest {
+
+ private final InstanceIdentifier<Vpp> vppId;
+ private final InstanceIdentifier<VppState> vppStateId;
+ private final InstanceIdentifier<Interfaces> interfaceId;
+
+ private WriteContext ctx;
+ private VppWriter<Vpp> vppWriter;
+ private VppWriter<VppState> vppStateWriter;
+ private VppWriter<Interfaces> interfacesWriter;
+
+ private DelegatingWriterRegistry registry;
+
+ public DelegatingWriterRegistryTest() {
+ vppId = InstanceIdentifier.create(Vpp.class);
+ vppStateId = InstanceIdentifier.create(VppState.class);
+ interfaceId = InstanceIdentifier.create(Interfaces.class);
+ }
+
+ @SuppressWarnings("unchecked")
+ private <D extends DataObject> VppWriter<D> mockWriter(Class<D> clazz) {
+ final VppWriter<D> mock = (VppWriter<D>) Mockito.mock(VppWriter.class);
+ doReturn(InstanceIdentifier.create(clazz)).when(mock).getManagedDataObjectType();
+ return mock;
+ }
+
+ private DataObject mockDataObject(final String name, final Class<? extends DataObject> classToMock) {
+ final DataObject dataBefore = mock(classToMock, name);
+ doReturn(classToMock).when(dataBefore).getImplementedInterface();
+ return dataBefore;
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map<InstanceIdentifier<?>, DataObject> asMap(DataObject... objects) {
+ final Map<InstanceIdentifier<?>, DataObject> map = new HashMap<>();
+ for (DataObject object : objects) {
+ final Class<? extends DataObject> implementedInterface =
+ (Class<? extends DataObject>) object.getImplementedInterface();
+ final InstanceIdentifier<?> id = InstanceIdentifier.create(implementedInterface);
+ map.put(id, object);
+ }
+ return map;
+ }
+
+ @Before
+ public void setUp() {
+ ctx = mock(WriteContext.class);
+ vppWriter = mockWriter(Vpp.class);
+ vppStateWriter = mockWriter(VppState.class);
+ interfacesWriter = mockWriter(Interfaces.class);
+
+ final List<VppWriter<? extends DataObject>> writers = new ArrayList<>();
+ writers.add(vppWriter);
+ writers.add(vppStateWriter);
+ writers.add(interfacesWriter);
+
+ registry = new DelegatingWriterRegistry(writers);
+ }
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void testGetManagedDataObjectType() {
+ registry.getManagedDataObjectType();
+ }
+
+ @Test
+ public void testBulkUpdateRevert() throws Exception {
+ // Prepare data changes:
+ final DataObject dataBefore1 = mockDataObject("Vpp before", Vpp.class);
+ final DataObject dataAfter1 = mockDataObject("Vpp after", Vpp.class);
+
+ final DataObject dataBefore2 = mockDataObject("VppState before", VppState.class);
+ final DataObject dataAfter2 = mockDataObject("VppState after", VppState.class);
+
+ // Fail on update
+ doThrow(new VppException("vpp failed")).when(vppStateWriter)
+ .update(vppStateId, dataBefore2, dataAfter2, ctx);
+
+ // Run the test
+ try {
+ registry.update(asMap(dataBefore1, dataBefore2), asMap(dataAfter1, dataAfter2), ctx);
+ } catch (WriterRegistry.BulkUpdateException e) {
+ // Check second update failed
+ assertEquals(vppStateId, e.getFailedId());
+ verify(vppWriter).update(vppId, dataBefore1, dataAfter1, ctx);
+ verify(vppStateWriter).update(vppStateId, dataBefore2, dataAfter2, ctx);
+
+ // Try to revert changes
+ e.revertChanges();
+
+ // Check revert was successful
+ verify(vppWriter).update(vppId, dataAfter1, dataBefore1, ctx);
+ verify(vppStateWriter, never()).update(vppStateId, dataAfter2, dataBefore2, ctx);
+
+ return;
+ }
+ fail("BulkUpdateException expected");
+ }
+
+ @Test
+ public void testBulkUpdateRevertFail() throws Exception {
+ // Prepare data changes:
+ final DataObject dataBefore1 = mockDataObject("Vpp before", Vpp.class);
+ final DataObject dataAfter1 = mockDataObject("Vpp after", Vpp.class);
+
+ final DataObject dataBefore2 = mockDataObject("VppState before", VppState.class);
+ final DataObject dataAfter2 = mockDataObject("VppState after", VppState.class);
+
+ final DataObject dataBefore3 = mockDataObject("Interfaces before", Interfaces.class);
+ final DataObject dataAfter3 = mockDataObject("Interfaces after", Interfaces.class);
+
+ // Fail on the third update
+ doThrow(new VppException("vpp failed")).when(interfacesWriter)
+ .update(interfaceId, dataBefore3, dataAfter3, ctx);
+
+ // Fail on the second revert
+ doThrow(new VppException("vpp failed again")).when(vppWriter)
+ .update(vppId, dataAfter1, dataBefore1, ctx);
+
+ // Run the test
+ try {
+ registry.update(asMap(dataBefore1, dataBefore2, dataBefore3), asMap(dataAfter1, dataAfter2, dataAfter3), ctx);
+ } catch (WriterRegistry.BulkUpdateException e) {
+ // Check third update failed
+ assertEquals(interfaceId, e.getFailedId());
+ verify(vppWriter).update(vppId, dataBefore1, dataAfter1, ctx);
+ verify(vppStateWriter).update(vppStateId, dataBefore2, dataAfter2, ctx);
+ verify(interfacesWriter).update(interfaceId, dataBefore3, dataAfter3, ctx);
+
+ // Try to revert changes
+ try {
+ e.revertChanges();
+ } catch (WriterRegistry.Reverter.RevertFailedException e2) {
+ // Check second revert failed
+ assertEquals(Collections.singletonList(vppId), e2.getNotRevertedChanges());
+ verify(vppWriter).update(vppId, dataAfter1, dataBefore1, ctx);
+ verify(vppStateWriter).update(vppStateId, dataAfter2, dataBefore2, ctx);
+ verify(interfacesWriter, never()).update(interfaceId, dataAfter3, dataBefore3, ctx);
+ return;
+ }
+ fail("WriterRegistry.Revert.RevertFailedException expected");
+ }
+ fail("BulkUpdateException expected");
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2016 Cisco and/or its affiliates.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package io.fd.honeycomb.v3po.vpp.facade.impl.write.util;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.mockito.MockitoAnnotations.initMocks;
+
+import com.google.common.base.Optional;
+import com.google.common.util.concurrent.CheckedFuture;
+import io.fd.honeycomb.v3po.vpp.facade.Context;
+import java.util.Map;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
+import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
+import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.Vpp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppState;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.BridgeDomains;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.bridge.domains.BridgeDomain;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+
+public class TransactionWriteContextTest {
+
+ @Mock
+ private BindingNormalizedNodeSerializer serializer;
+ @Mock
+ private DOMDataReadOnlyTransaction beforeTx;
+ @Mock
+ private DOMDataReadOnlyTransaction afterTx;
+ @Mock
+ private CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> future;
+ @Mock
+ private Optional<org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?, ?>> optional;
+ @Mock
+ private Map.Entry entry;
+
+ private TransactionWriteContext transactionWriteContext;
+
+ @Before
+ public void setUp() {
+ initMocks(this);
+ transactionWriteContext = new TransactionWriteContext(serializer, beforeTx, afterTx);
+ }
+
+ @Test
+ public void testReadBeforeNoData() throws Exception {
+ when(beforeTx.read(eq(LogicalDatastoreType.CONFIGURATION), any(YangInstanceIdentifier.class))).thenReturn(future);
+ when(future.checkedGet()).thenReturn(optional);
+ when(optional.isPresent()).thenReturn(false);
+
+ final InstanceIdentifier<BridgeDomain> instanceId =
+ InstanceIdentifier.create(Vpp.class).child(BridgeDomains.class).child(BridgeDomain.class);
+
+ final Optional<DataObject> dataObjects = transactionWriteContext.readBefore(instanceId);
+ assertNotNull(dataObjects);
+ assertFalse(dataObjects.isPresent());
+
+ verify(serializer).toYangInstanceIdentifier(instanceId);
+ verify(serializer, never()).fromNormalizedNode(any(YangInstanceIdentifier.class), any(NormalizedNode.class));
+ }
+
+
+ @Test
+ public void testReadBefore() throws Exception {
+ when(beforeTx.read(eq(LogicalDatastoreType.CONFIGURATION), any(YangInstanceIdentifier.class))).thenReturn(future);
+ when(future.checkedGet()).thenReturn(optional);
+ when(optional.isPresent()).thenReturn(true);
+
+ final InstanceIdentifier<BridgeDomain> instanceId =
+ InstanceIdentifier.create(Vpp.class).child(BridgeDomains.class).child(BridgeDomain.class);
+ final YangInstanceIdentifier yangId = YangInstanceIdentifier.builder().node(VppState.QNAME).node(
+ BridgeDomains.QNAME).node(BridgeDomain.QNAME).build();
+ when(serializer.toYangInstanceIdentifier(any(InstanceIdentifier.class))).thenReturn(yangId);
+ when(serializer.fromNormalizedNode(eq(yangId), any(NormalizedNode.class))).thenReturn(entry);
+ when(entry.getValue()).thenReturn(mock(DataObject.class));
+
+ final Optional<DataObject> dataObjects = transactionWriteContext.readBefore(instanceId);
+ assertNotNull(dataObjects);
+ assertTrue(dataObjects.isPresent());
+
+ verify(serializer).toYangInstanceIdentifier(instanceId);
+ verify(serializer).fromNormalizedNode(eq(yangId), any(NormalizedNode.class));
+ }
+
+ @Test(expected = IllegalStateException.class)
+ public void testReadBeforeFailed() throws Exception {
+ when(beforeTx.read(eq(LogicalDatastoreType.CONFIGURATION), any(YangInstanceIdentifier.class))).thenReturn(future);
+ when(future.checkedGet()).thenThrow(ReadFailedException.class);
+ transactionWriteContext.readBefore(mock(InstanceIdentifier.class));
+ }
+
+ @Test(expected = IllegalStateException.class)
+ public void testReadAfterFailed() throws Exception {
+ when(afterTx.read(eq(LogicalDatastoreType.CONFIGURATION), any(YangInstanceIdentifier.class))).thenReturn(future);
+ when(future.checkedGet()).thenThrow(ReadFailedException.class);
+ transactionWriteContext.readAfter(mock(InstanceIdentifier.class));
+ }
+
+ @Test
+ public void testGetContext() throws Exception {
+ assertNotNull(transactionWriteContext.getContext());
+ }
+
+ @Test
+ public void testClose() throws Exception {
+ final Context context = transactionWriteContext.getContext();
+ transactionWriteContext.close();
+ // TODO verify context was closed
+ }
+}
\ No newline at end of file