From: Basheeruddin Ahmed Date: Tue, 8 Jul 2014 14:10:55 +0000 (-0700) Subject: NormalizedNode serialization using protocol buffer X-Git-Tag: release/helium~416 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=f1c47fb514878ef2149e5f22d6098ff8c79dec1d NormalizedNode serialization using protocol buffer Utilization of CreateTransactionReply protocol buffer message in Distributed Datastore Subsequent commits will utilize other portocol buffer messages in Distributed Datastore Change-Id: I64c08d1998bab29a92351fc1fd5897d0faaf4081 Signed-off-by: Basheeruddin Ahmed Signed-off-by: Moiz Raja --- diff --git a/opendaylight/md-sal/sal-distributed-datastore/pom.xml b/opendaylight/md-sal/sal-distributed-datastore/pom.xml index 5152363ab2..3dd44bb850 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/pom.xml +++ b/opendaylight/md-sal/sal-distributed-datastore/pom.xml @@ -118,6 +118,12 @@ scala-library + + org.opendaylight.controller + sal-protocolbuffer-encoding + 1.1-SNAPSHOT + + junit diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java index 3425608d23..f61eec8708 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java @@ -23,7 +23,6 @@ import org.opendaylight.controller.cluster.datastore.messages.CommitTransactionR import org.opendaylight.controller.cluster.datastore.messages.CreateTransaction; import org.opendaylight.controller.cluster.datastore.messages.CreateTransactionChain; import org.opendaylight.controller.cluster.datastore.messages.CreateTransactionChainReply; -import org.opendaylight.controller.cluster.datastore.messages.CreateTransactionReply; import org.opendaylight.controller.cluster.datastore.messages.ForwardedCommitTransaction; import org.opendaylight.controller.cluster.datastore.messages.NonPersistent; import org.opendaylight.controller.cluster.datastore.messages.RegisterChangeListener; @@ -37,6 +36,7 @@ import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCoh import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionChain; import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; +import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages.CreateTransactionReply; import java.util.HashMap; import java.util.Map; @@ -117,7 +117,10 @@ public class Shard extends UntypedProcessor { ActorRef transactionActor = getContext().actorOf( ShardTransaction.props(transaction, getSelf()), "shard-" + createTransaction.getTransactionId()); getSender() - .tell(new CreateTransactionReply(transactionActor.path(), createTransaction.getTransactionId()), + .tell(CreateTransactionReply.newBuilder() + .setTransactionActorPath(transactionActor.path().toString()) + .setTransactionId(createTransaction.getTransactionId()) + .build(), getSelf()); } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardTransactionChain.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardTransactionChain.java index 1092e9a793..f76dc40e8e 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardTransactionChain.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardTransactionChain.java @@ -14,7 +14,7 @@ import akka.japi.Creator; import org.opendaylight.controller.cluster.datastore.messages.CloseTransactionChain; import org.opendaylight.controller.cluster.datastore.messages.CloseTransactionChainReply; import org.opendaylight.controller.cluster.datastore.messages.CreateTransaction; -import org.opendaylight.controller.cluster.datastore.messages.CreateTransactionReply; +import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages; import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction; import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionChain; @@ -46,7 +46,10 @@ public class ShardTransactionChain extends AbstractUntypedActor { ActorRef transactionActor = getContext().actorOf(ShardTransaction .props(chain, transaction, getContext().parent()), "shard-" + createTransaction.getTransactionId()); getSender() - .tell(new CreateTransactionReply(transactionActor.path(), createTransaction.getTransactionId()), + .tell(ShardTransactionMessages.CreateTransactionReply.newBuilder() + .setTransactionActorPath(transactionActor.path().toString()) + .setTransactionId(createTransaction.getTransactionId()) + .build(), getSelf()); } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionProxy.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionProxy.java index 74245c4259..e65aab85a4 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionProxy.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionProxy.java @@ -15,7 +15,7 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListenableFutureTask; import org.opendaylight.controller.cluster.datastore.messages.CloseTransaction; import org.opendaylight.controller.cluster.datastore.messages.CreateTransaction; -import org.opendaylight.controller.cluster.datastore.messages.CreateTransactionReply; +import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages.CreateTransactionReply; import org.opendaylight.controller.cluster.datastore.messages.DeleteData; import org.opendaylight.controller.cluster.datastore.messages.MergeData; import org.opendaylight.controller.cluster.datastore.messages.ReadData; @@ -78,7 +78,7 @@ public class TransactionProxy implements DOMStoreReadWriteTransaction { Object response = actorContext.executeShardOperation(Shard.DEFAULT_NAME, new CreateTransaction(identifier), ActorContext.ASK_DURATION); if(response instanceof CreateTransactionReply){ CreateTransactionReply reply = (CreateTransactionReply) response; - remoteTransactionPaths.put(Shard.DEFAULT_NAME, actorContext.actorSelection(reply.getTransactionPath())); + remoteTransactionPaths.put(Shard.DEFAULT_NAME, actorContext.actorSelection(reply.getTransactionActorPath())); } } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CreateTransactionReply.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CreateTransactionReply.java index 46b7194c84..81fd6eeabf 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CreateTransactionReply.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CreateTransactionReply.java @@ -10,6 +10,13 @@ package org.opendaylight.controller.cluster.datastore.messages; import akka.actor.ActorPath; +/** + * This is being deprecated to use sal-protocolbuff-encoding ShardTransactionMessages.CreateTransactionReply + * This classes will be removed once complete integration of distribute datastore with + * sal-protocolbuff-encoding is done. + */ + +@Deprecated public class CreateTransactionReply { private final ActorPath transactionPath; private final String transactionId; diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/resources/application.conf b/opendaylight/md-sal/sal-distributed-datastore/src/main/resources/application.conf index b56c26b578..76914c2c84 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/resources/application.conf +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/resources/application.conf @@ -1,3 +1,15 @@ ODLCluster{ +actor { + serializers { + java = "akka.serialization.JavaSerializer" + proto = "akka.remote.serialization.ProtobufSerializer" + } + + serialization-bindings { + "com.google.protobuf.Message" = proto + + } + } + } \ No newline at end of file diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/BasicIntegrationTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/BasicIntegrationTest.java index dfefc5ed57..6b436ad95e 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/BasicIntegrationTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/BasicIntegrationTest.java @@ -21,7 +21,7 @@ import org.opendaylight.controller.cluster.datastore.messages.CommitTransactionR import org.opendaylight.controller.cluster.datastore.messages.CreateTransaction; import org.opendaylight.controller.cluster.datastore.messages.CreateTransactionChain; import org.opendaylight.controller.cluster.datastore.messages.CreateTransactionChainReply; -import org.opendaylight.controller.cluster.datastore.messages.CreateTransactionReply; +import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages.CreateTransactionReply; import org.opendaylight.controller.cluster.datastore.messages.PreCommitTransaction; import org.opendaylight.controller.cluster.datastore.messages.PreCommitTransactionReply; import org.opendaylight.controller.cluster.datastore.messages.ReadyTransaction; @@ -83,11 +83,9 @@ public class BasicIntegrationTest extends AbstractActorTest { new ExpectMsg("CreateTransactionReply") { protected ActorSelection match(Object in) { if (in instanceof CreateTransactionReply) { - ActorPath transactionPath = - ((CreateTransactionReply) in) - .getTransactionPath(); return getSystem() - .actorSelection(transactionPath); + .actorSelection((((CreateTransactionReply) in) + .getTransactionActorPath())); } else { throw noMatch(); } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataChangeListenerProxyTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataChangeListenerProxyTest.java index a8409a6f85..fa246f01ea 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataChangeListenerProxyTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataChangeListenerProxyTest.java @@ -36,7 +36,7 @@ public class DataChangeListenerProxyTest extends AbstractActorTest { } @Override - public Map> getOriginalData() { + public Map> getOriginalData() { throw new UnsupportedOperationException("getOriginalData"); } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataChangeListenerTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataChangeListenerTest.java index 6f0816be5c..d64859a91c 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataChangeListenerTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataChangeListenerTest.java @@ -35,7 +35,7 @@ public class DataChangeListenerTest extends AbstractActorTest { } @Override - public Map> getOriginalData() { + public Map> getOriginalData() { throw new UnsupportedOperationException("getOriginalData"); } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreTest.java index 5f82b40140..da9fb6896e 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreTest.java @@ -3,7 +3,7 @@ package org.opendaylight.controller.cluster.datastore; import akka.actor.ActorRef; import akka.actor.Props; import junit.framework.Assert; -import org.opendaylight.controller.cluster.datastore.messages.CreateTransactionReply; + import org.opendaylight.controller.cluster.datastore.messages.RegisterChangeListenerReply; import org.opendaylight.controller.cluster.datastore.utils.DoNothingActor; import org.opendaylight.controller.cluster.datastore.utils.MockActorContext; @@ -11,6 +11,7 @@ import org.opendaylight.controller.md.cluster.datastore.model.TestModel; import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker; import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent; import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener; +import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages.CreateTransactionReply; import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadTransaction; import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction; import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionChain; @@ -39,7 +40,10 @@ public class DistributedDataStoreTest extends AbstractActorTest{ // Make CreateTransactionReply as the default response. Will need to be // tuned if a specific test requires some other response mockActorContext.setExecuteShardOperationResponse( - new CreateTransactionReply(doNothingActorRef.path(), "txn-1 ")); + CreateTransactionReply.newBuilder() + .setTransactionActorPath(doNothingActorRef.path().toString()) + .setTransactionId("txn-1 ") + .build()); } @org.junit.After diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java index ed447e004f..2b1d892db0 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java @@ -7,7 +7,7 @@ import org.junit.Test; import org.opendaylight.controller.cluster.datastore.messages.CreateTransaction; import org.opendaylight.controller.cluster.datastore.messages.CreateTransactionChain; import org.opendaylight.controller.cluster.datastore.messages.CreateTransactionChainReply; -import org.opendaylight.controller.cluster.datastore.messages.CreateTransactionReply; +import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages.CreateTransactionReply; import org.opendaylight.controller.cluster.datastore.messages.RegisterChangeListener; import org.opendaylight.controller.cluster.datastore.messages.RegisterChangeListenerReply; import org.opendaylight.controller.cluster.datastore.messages.UpdateSchemaContext; @@ -126,7 +126,7 @@ public class ShardTest extends AbstractActorTest { if (in instanceof CreateTransactionReply) { CreateTransactionReply reply = (CreateTransactionReply) in; - return reply.getTransactionPath() + return reply.getTransactionActorPath() .toString(); } else { throw noMatch(); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTransactionChainTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTransactionChainTest.java index b07cbfd87c..8bdc38ae79 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTransactionChainTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTransactionChainTest.java @@ -9,7 +9,7 @@ import org.junit.Test; import org.opendaylight.controller.cluster.datastore.messages.CloseTransactionChain; import org.opendaylight.controller.cluster.datastore.messages.CloseTransactionChainReply; import org.opendaylight.controller.cluster.datastore.messages.CreateTransaction; -import org.opendaylight.controller.cluster.datastore.messages.CreateTransactionReply; +import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages.CreateTransactionReply; import org.opendaylight.controller.md.cluster.datastore.model.TestModel; import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore; @@ -39,7 +39,7 @@ public class ShardTransactionChainTest extends AbstractActorTest { // do not put code outside this method, will run afterwards protected String match(Object in) { if (in instanceof CreateTransactionReply) { - return ((CreateTransactionReply) in).getTransactionPath().toString(); + return ((CreateTransactionReply) in).getTransactionActorPath().toString(); } else { throw noMatch(); } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TransactionProxyTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TransactionProxyTest.java index a8df49f5ca..d6cb1fb97c 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TransactionProxyTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TransactionProxyTest.java @@ -7,7 +7,6 @@ import com.google.common.util.concurrent.ListenableFuture; import junit.framework.Assert; import org.junit.Test; import org.opendaylight.controller.cluster.datastore.messages.CloseTransaction; -import org.opendaylight.controller.cluster.datastore.messages.CreateTransactionReply; import org.opendaylight.controller.cluster.datastore.messages.DeleteData; import org.opendaylight.controller.cluster.datastore.messages.MergeData; import org.opendaylight.controller.cluster.datastore.messages.ReadDataReply; @@ -18,6 +17,7 @@ import org.opendaylight.controller.cluster.datastore.utils.DoNothingActor; import org.opendaylight.controller.cluster.datastore.utils.MessageCollectorActor; import org.opendaylight.controller.cluster.datastore.utils.MockActorContext; import org.opendaylight.controller.md.cluster.datastore.model.TestModel; +import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages.CreateTransactionReply; import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes; @@ -259,6 +259,9 @@ public class TransactionProxyTest extends AbstractActorTest { } private CreateTransactionReply createTransactionReply(ActorRef actorRef){ - return new CreateTransactionReply(actorRef.path(), "txn-1"); + return CreateTransactionReply.newBuilder() + .setTransactionActorPath(actorRef.path().toString()) + .setTransactionId("txn-1") + .build(); } } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/resources/application.conf b/opendaylight/md-sal/sal-distributed-datastore/src/test/resources/application.conf index 2647850667..a07c252e4c 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/resources/application.conf +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/resources/application.conf @@ -1,11 +1,14 @@ akka { actor { - serializers { - java = "akka.serialization.JavaSerializer" - } + serializers { + java = "akka.serialization.JavaSerializer" + proto = "akka.remote.serialization.ProtobufSerializer" + } serialization-bindings { "org.opendaylight.controller.cluster.datastore.modification.MutableCompositeModification" = java + "com.google.protobuf.Message" = proto + } } } \ No newline at end of file diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/pom.xml b/opendaylight/md-sal/sal-protocolbuffer-encoding/pom.xml index 5254c19fcb..e3fac63a83 100644 --- a/opendaylight/md-sal/sal-protocolbuffer-encoding/pom.xml +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/pom.xml @@ -13,15 +13,78 @@ bundle + + com.google.code.findbugs + jsr305 + 2.0.1 + + + com.google.guava + guava + com.google.protobuf protobuf-java 2.5.0 + + commons-lang + commons-lang + + + org.opendaylight.yangtools + util + + + org.opendaylight.yangtools + yang-binding + + + org.opendaylight.yangtools + yang-common + + + org.opendaylight.yangtools + yang-data-api + + + org.opendaylight.yangtools + yang-data-impl + + + org.opendaylight.yangtools + yang-model-api + + + org.opendaylight.yangtools + yang-model-util + + + + org.opendaylight.yangtools + yang-parser-impl + + + + xmlunit + xmlunit + 1.5 + junit junit test + + + junit + junit + test + + + org.slf4j + slf4j-simple + ${slf4j.version} + test org.opendaylight.yangtools diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/NodeToNormalizedNodeBuilder.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/NodeToNormalizedNodeBuilder.java new file mode 100644 index 0000000000..95b6f4fb5c --- /dev/null +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/NodeToNormalizedNodeBuilder.java @@ -0,0 +1,748 @@ +package org.opendaylight.controller.cluster.datastore.node; + +import com.google.common.base.Preconditions; +import com.google.common.collect.FluentIterable; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node; +import org.opendaylight.controller.cluster.datastore.node.utils.NodeIdentifierFactory; +import org.opendaylight.yangtools.concepts.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.AugmentationIdentifier; +import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier; +import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifierWithPredicates; +import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeWithValue; +import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; +import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; +import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; +import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNodeContainer; +import org.opendaylight.yangtools.yang.data.impl.schema.Builders; +import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes; +import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeAttrBuilder; +import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeContainerBuilder; +import org.opendaylight.yangtools.yang.model.api.AugmentationSchema; +import org.opendaylight.yangtools.yang.model.api.AugmentationTarget; +import org.opendaylight.yangtools.yang.model.api.ChoiceCaseNode; +import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode; +import org.opendaylight.yangtools.yang.model.api.DataNodeContainer; +import org.opendaylight.yangtools.yang.model.api.DataSchemaNode; +import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode; +import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; +import org.opendaylight.yangtools.yang.model.api.ListSchemaNode; +import org.opendaylight.yangtools.yang.model.api.SchemaContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +import static com.google.common.base.Preconditions.checkArgument; + +/** + * NormalizedNodeBuilder is a builder that walks through a tree like structure and constructs a + * NormalizedNode from it. + * + * A large part of this code has been copied over from a similar class in sal-common-impl which was + * originally supposed to convert a CompositeNode to NormalizedNode + * + * @param + */ +public abstract class NodeToNormalizedNodeBuilder + implements Identifiable { + + private final T identifier; + + protected static final Logger logger = LoggerFactory + .getLogger(NodeToNormalizedNodeBuilder.class); + + @Override + public T getIdentifier() { + return identifier; + }; + + protected NodeToNormalizedNodeBuilder(final T identifier) { + super(); + this.identifier = identifier; + + } + + /** + * + * @return Should return true if the node that this operation corresponds to is a mixin + */ + public boolean isMixin() { + return false; + } + + + /** + * + * @return Should return true if the node that this operation corresponds to has a 'key' + * associated with it. This is typically true for a list-item or leaf-list entry in yang + */ + public boolean isKeyedEntry() { + return false; + } + + protected Set getQNameIdentifiers() { + return Collections.singleton(identifier.getNodeType()); + } + + public abstract NodeToNormalizedNodeBuilder getChild( + final PathArgument child); + + public abstract NodeToNormalizedNodeBuilder getChild(QName child); + + public abstract NormalizedNode normalize(QName nodeType, Node node); + + + + private static abstract class SimpleTypeNormalization + extends NodeToNormalizedNodeBuilder { + + protected SimpleTypeNormalization(final T identifier) { + super(identifier); + } + + @Override + public NormalizedNode normalize(final QName nodeType, final Node node) { + checkArgument(node != null); + return normalizeImpl(nodeType, node); + } + + protected abstract NormalizedNode normalizeImpl(QName nodeType, + Node node); + + @Override + public NodeToNormalizedNodeBuilder getChild(final PathArgument child) { + return null; + } + + @Override + public NodeToNormalizedNodeBuilder getChild(final QName child) { + return null; + } + + @Override + public NormalizedNode createDefault(final PathArgument currentArg) { + // TODO Auto-generated method stub + return null; + } + + } + + private static final class LeafNormalization extends + SimpleTypeNormalization { + + protected LeafNormalization(final NodeIdentifier identifier) { + super(identifier); + } + + @Override + protected NormalizedNode normalizeImpl(final QName nodeType, + final Node node) { + return ImmutableNodes.leafNode(nodeType, node.getValue()); + + } + + } + + private static final class LeafListEntryNormalization extends + SimpleTypeNormalization { + + public LeafListEntryNormalization(final LeafListSchemaNode potential) { + super(new NodeWithValue(potential.getQName(), null)); + } + + @Override + protected NormalizedNode normalizeImpl(final QName nodeType, + final Node node) { + final Object data = node.getValue(); + if (data == null) { + Preconditions.checkArgument(false, + "No data available in leaf list entry for " + nodeType); + } + NodeWithValue nodeId = new NodeWithValue(nodeType, data); + return Builders.leafSetEntryBuilder().withNodeIdentifier(nodeId) + .withValue(data).build(); + } + + + @Override + public boolean isKeyedEntry() { + return true; + } + } + + private static abstract class NodeToNormalizationNodeOperation + extends NodeToNormalizedNodeBuilder { + + protected NodeToNormalizationNodeOperation(final T identifier) { + super(identifier); + } + + @SuppressWarnings({"rawtypes", "unchecked"}) + @Override + public final NormalizedNodeContainer normalize( + final QName nodeType, final Node node) { + checkArgument(node != null); + if (!node.getType().equals(AugmentationNode.class.getSimpleName())) { + checkArgument(nodeType != null); + } + + NormalizedNodeContainerBuilder builder = createBuilder(node); + + Set> usedMixins = new HashSet<>(); + + logNode(node); + + if (node.getChildCount() == 0) { + PathArgument childPathArgument = + NodeIdentifierFactory.getArgument(node.getPath()); + NormalizedNode child = null; + if (childPathArgument instanceof NodeWithValue) { + final NodeWithValue nodeWithValue = + new NodeWithValue(childPathArgument.getNodeType(), + node.getValue()); + child = + Builders.leafSetEntryBuilder().withNodeIdentifier(nodeWithValue) + .withValue(node.getValue()).build(); + } else { + child = + ImmutableNodes.leafNode(childPathArgument.getNodeType(), + node.getValue()); + } + builder.addChild(child); + } + + final List children = node.getChildList(); + for (Node nodeChild : children) { + + PathArgument childPathArgument = + NodeIdentifierFactory.getArgument(nodeChild.getPath()); + + QName childNodeType = null; + NodeToNormalizedNodeBuilder childOp = null; + + + if (childPathArgument instanceof AugmentationIdentifier) { + childOp = getChild(childPathArgument); + } else { + childNodeType = childPathArgument.getNodeType(); + childOp = getChild(childNodeType); + } + // We skip unknown nodes if this node is mixin since + // it's nodes and parent nodes are interleaved + if (childOp == null && isMixin()) { + continue; + } else if (childOp == null) { + logger.error( + "childOp is null and this operation is not a mixin : this = {}", + this.toString()); + } + + checkArgument(childOp != null, "Node %s is not allowed inside %s", + childNodeType, getIdentifier()); + if (childOp.isMixin()) { + if (usedMixins.contains(childOp)) { + // We already run / processed that mixin, so to avoid + // duplicate we are + // skiping next nodes. + continue; + } + // builder.addChild(childOp.normalize(nodeType, treeCacheNode)); + final NormalizedNode childNode = + childOp.normalize(childNodeType, nodeChild); + if (childNode != null) + builder.addChild(childNode); + usedMixins.add(childOp); + } else { + final NormalizedNode childNode = + childOp.normalize(childNodeType, nodeChild); + if (childNode != null) + builder.addChild(childNode); + } + } + + + try { + return (NormalizedNodeContainer) builder.build(); + } catch (Exception e) { + return null; + } + + } + + private void logNode(Node node) { + //let us find out the type of the node + logger.debug("We got a {} , with identifier {} with {} children", node.getType(),node.getPath(), + node.getChildList()); + } + + @SuppressWarnings("rawtypes") + protected abstract NormalizedNodeContainerBuilder createBuilder( + final Node node); + + } + + private static abstract class DataContainerNormalizationOperation + extends NodeToNormalizationNodeOperation { + + private final DataNodeContainer schema; + private final Map> byQName; + private final Map> byArg; + + protected DataContainerNormalizationOperation(final T identifier, + final DataNodeContainer schema) { + super(identifier); + this.schema = schema; + this.byArg = new ConcurrentHashMap<>(); + this.byQName = new ConcurrentHashMap<>(); + } + + @Override + public NodeToNormalizedNodeBuilder getChild(final PathArgument child) { + NodeToNormalizedNodeBuilder potential = byArg.get(child); + if (potential != null) { + return potential; + } + potential = fromSchema(schema, child); + return register(potential); + } + + @Override + public NodeToNormalizedNodeBuilder getChild(final QName child) { + if (child == null) { + return null; + } + + NodeToNormalizedNodeBuilder potential = byQName.get(child); + if (potential != null) { + return potential; + } + potential = fromSchemaAndPathArgument(schema, child); + return register(potential); + } + + private NodeToNormalizedNodeBuilder register( + final NodeToNormalizedNodeBuilder potential) { + if (potential != null) { + byArg.put(potential.getIdentifier(), potential); + for (QName qName : potential.getQNameIdentifiers()) { + byQName.put(qName, potential); + } + } + return potential; + } + + } + + private static final class ListItemNormalization extends + DataContainerNormalizationOperation { + + private final List keyDefinition; + private final ListSchemaNode schemaNode; + + protected ListItemNormalization( + final NodeIdentifierWithPredicates identifier, + final ListSchemaNode schema) { + super(identifier, schema); + this.schemaNode = schema; + keyDefinition = schema.getKeyDefinition(); + } + + @Override + protected NormalizedNodeContainerBuilder createBuilder(final Node node) { + return Builders.mapEntryBuilder().withNodeIdentifier( + (NodeIdentifierWithPredicates) NodeIdentifierFactory.getArgument(node + .getPath())); + } + + @Override + public NormalizedNode createDefault(final PathArgument currentArg) { + DataContainerNodeAttrBuilder builder = + Builders.mapEntryBuilder().withNodeIdentifier( + (NodeIdentifierWithPredicates) currentArg); + for (Entry keyValue : ((NodeIdentifierWithPredicates) currentArg) + .getKeyValues().entrySet()) { + if (keyValue.getValue() == null) { + throw new NullPointerException("Null value found for path : " + + currentArg); + } + builder.addChild(Builders.leafBuilder() + // + .withNodeIdentifier(new NodeIdentifier(keyValue.getKey())) + .withValue(keyValue.getValue()).build()); + } + return builder.build(); + } + + + @Override + public boolean isKeyedEntry() { + return true; + } + } + + private static final class ContainerNormalization extends + DataContainerNormalizationOperation { + + protected ContainerNormalization(final ContainerSchemaNode schema) { + super(new NodeIdentifier(schema.getQName()), schema); + } + + @Override + protected NormalizedNodeContainerBuilder createBuilder(final Node node) { + return Builders.containerBuilder().withNodeIdentifier(getIdentifier()); + } + + @Override + public NormalizedNode createDefault(final PathArgument currentArg) { + return Builders.containerBuilder() + .withNodeIdentifier((NodeIdentifier) currentArg).build(); + } + + } + + private static abstract class MixinNormalizationOp + extends NodeToNormalizationNodeOperation { + + protected MixinNormalizationOp(final T identifier) { + super(identifier); + } + + @Override + public final boolean isMixin() { + return true; + } + + } + + private static final class LeafListMixinNormalization extends + MixinNormalizationOp { + + private final NodeToNormalizedNodeBuilder innerOp; + + public LeafListMixinNormalization(final LeafListSchemaNode potential) { + super(new NodeIdentifier(potential.getQName())); + innerOp = new LeafListEntryNormalization(potential); + } + + @Override + protected NormalizedNodeContainerBuilder createBuilder( + final Node node) { + return Builders.leafSetBuilder().withNodeIdentifier(getIdentifier()); + } + + @Override + public NormalizedNode createDefault(final PathArgument currentArg) { + return Builders.leafSetBuilder().withNodeIdentifier(getIdentifier()) + .build(); + } + + @Override + public NodeToNormalizedNodeBuilder getChild(final PathArgument child) { + if (child instanceof NodeWithValue) { + return innerOp; + } + return null; + } + + @Override + public NodeToNormalizedNodeBuilder getChild(final QName child) { + if (getIdentifier().getNodeType().equals(child)) { + return innerOp; + } + return null; + } + + } + + private static final class AugmentationNormalization extends + MixinNormalizationOp { + + private final Map> byQName; + private final Map> byArg; + + public AugmentationNormalization(final AugmentationSchema augmentation, + final DataNodeContainer schema) { + super(augmentationIdentifierFrom(augmentation)); + + ImmutableMap.Builder> byQNameBuilder = + ImmutableMap.builder(); + ImmutableMap.Builder> byArgBuilder = + ImmutableMap.builder(); + + for (DataSchemaNode augNode : augmentation.getChildNodes()) { + DataSchemaNode resolvedNode = + schema.getDataChildByName(augNode.getQName()); + NodeToNormalizedNodeBuilder resolvedOp = + fromDataSchemaNode(resolvedNode); + byArgBuilder.put(resolvedOp.getIdentifier(), resolvedOp); + for (QName resQName : resolvedOp.getQNameIdentifiers()) { + byQNameBuilder.put(resQName, resolvedOp); + } + } + byQName = byQNameBuilder.build(); + byArg = byArgBuilder.build(); + + } + + @Override + public NodeToNormalizedNodeBuilder getChild(final PathArgument child) { + return byArg.get(child); + } + + @Override + public NodeToNormalizedNodeBuilder getChild(final QName child) { + return byQName.get(child); + } + + @Override + protected Set getQNameIdentifiers() { + return getIdentifier().getPossibleChildNames(); + } + + @SuppressWarnings("rawtypes") + @Override + protected NormalizedNodeContainerBuilder createBuilder(final Node node) { + return Builders.augmentationBuilder().withNodeIdentifier(getIdentifier()); + } + + @Override + public NormalizedNode createDefault(final PathArgument currentArg) { + return Builders.augmentationBuilder().withNodeIdentifier(getIdentifier()) + .build(); + } + + } + + private static final class ListMixinNormalization extends + MixinNormalizationOp { + + private final ListItemNormalization innerNode; + + public ListMixinNormalization(final ListSchemaNode list) { + super(new NodeIdentifier(list.getQName())); + this.innerNode = + new ListItemNormalization(new NodeIdentifierWithPredicates( + list.getQName(), Collections.emptyMap()), list); + } + + @SuppressWarnings("rawtypes") + @Override + protected NormalizedNodeContainerBuilder createBuilder( + final Node node) { + return Builders.mapBuilder().withNodeIdentifier(getIdentifier()); + } + + @Override + public NormalizedNode createDefault(final PathArgument currentArg) { + return Builders.mapBuilder().withNodeIdentifier(getIdentifier()).build(); + } + + @Override + public NodeToNormalizedNodeBuilder getChild(final PathArgument child) { + if (child.getNodeType().equals(getIdentifier().getNodeType())) { + return innerNode; + } + return null; + } + + @Override + public NodeToNormalizedNodeBuilder getChild(final QName child) { + if (getIdentifier().getNodeType().equals(child)) { + return innerNode; + } + return null; + } + + } + + private static class ChoiceNodeNormalization extends + MixinNormalizationOp { + + private final ImmutableMap> byQName; + private final ImmutableMap> byArg; + + protected ChoiceNodeNormalization( + final org.opendaylight.yangtools.yang.model.api.ChoiceNode schema) { + super(new NodeIdentifier(schema.getQName())); + ImmutableMap.Builder> byQNameBuilder = + ImmutableMap.builder(); + ImmutableMap.Builder> byArgBuilder = + ImmutableMap.builder(); + + for (ChoiceCaseNode caze : schema.getCases()) { + for (DataSchemaNode cazeChild : caze.getChildNodes()) { + NodeToNormalizedNodeBuilder childOp = + fromDataSchemaNode(cazeChild); + byArgBuilder.put(childOp.getIdentifier(), childOp); + for (QName qname : childOp.getQNameIdentifiers()) { + byQNameBuilder.put(qname, childOp); + } + } + } + byQName = byQNameBuilder.build(); + byArg = byArgBuilder.build(); + } + + @Override + public NodeToNormalizedNodeBuilder getChild(final PathArgument child) { + return byArg.get(child); + } + + @Override + public NodeToNormalizedNodeBuilder getChild(final QName child) { + return byQName.get(child); + } + + @Override + protected NormalizedNodeContainerBuilder createBuilder(final Node node) { + return Builders.choiceBuilder().withNodeIdentifier(getIdentifier()); + } + + @Override + public NormalizedNode createDefault(final PathArgument currentArg) { + return Builders.choiceBuilder().withNodeIdentifier(getIdentifier()) + .build(); + } + } + + public static NodeToNormalizedNodeBuilder fromSchemaAndPathArgument( + final DataNodeContainer schema, final QName child) { + DataSchemaNode potential = schema.getDataChildByName(child); + if (potential == null) { + Iterable choices = + FluentIterable.from(schema.getChildNodes()).filter( + org.opendaylight.yangtools.yang.model.api.ChoiceNode.class); + potential = findChoice(choices, child); + } + if (potential == null) { + if (logger.isTraceEnabled()) { + logger.trace("BAD CHILD = {}", child.toString()); + } + } + + checkArgument(potential != null, + "Supplied QName %s is not valid according to schema %s", child, schema); + if ((schema instanceof DataSchemaNode) + && !((DataSchemaNode) schema).isAugmenting() + && potential.isAugmenting()) { + return fromAugmentation(schema, (AugmentationTarget) schema, potential); + } + return fromDataSchemaNode(potential); + } + + /** + * Given a bunch of choice nodes and a the name of child find a choice node for that child which + * has a non-null value + * + * @param choices + * @param child + * @return + */ + private static org.opendaylight.yangtools.yang.model.api.ChoiceNode findChoice( + final Iterable choices, + final QName child) { + org.opendaylight.yangtools.yang.model.api.ChoiceNode foundChoice = null; + choiceLoop: for (org.opendaylight.yangtools.yang.model.api.ChoiceNode choice : choices) { + for (ChoiceCaseNode caze : choice.getCases()) { + if (caze.getDataChildByName(child) != null) { + foundChoice = choice; + break choiceLoop; + } + } + } + return foundChoice; + } + + + /** + * Create an AugmentationIdentifier based on the AugmentationSchema + * + * @param augmentation + * @return + */ + public static AugmentationIdentifier augmentationIdentifierFrom( + final AugmentationSchema augmentation) { + ImmutableSet.Builder potentialChildren = ImmutableSet.builder(); + for (DataSchemaNode child : augmentation.getChildNodes()) { + potentialChildren.add(child.getQName()); + } + return new AugmentationIdentifier(null, potentialChildren.build()); + } + + /** + * Create an AugmentationNormalization based on the schema of the DataContainer, the + * AugmentationTarget and the potential schema node + * + * @param schema + * @param augments + * @param potential + * @return + */ + private static AugmentationNormalization fromAugmentation( + final DataNodeContainer schema, final AugmentationTarget augments, + final DataSchemaNode potential) { + AugmentationSchema augmentation = null; + for (AugmentationSchema aug : augments.getAvailableAugmentations()) { + DataSchemaNode child = aug.getDataChildByName(potential.getQName()); + if (child != null) { + augmentation = aug; + break; + } + + } + if (augmentation != null) { + return new AugmentationNormalization(augmentation, schema); + } else { + return null; + } + } + + /** + * + * @param schema + * @param child + * @return + */ + private static NodeToNormalizedNodeBuilder fromSchema( + final DataNodeContainer schema, final PathArgument child) { + if (child instanceof AugmentationIdentifier) { + return fromSchemaAndPathArgument(schema, ((AugmentationIdentifier) child) + .getPossibleChildNames().iterator().next()); + } + return fromSchemaAndPathArgument(schema, child.getNodeType()); + } + + public static NodeToNormalizedNodeBuilder fromDataSchemaNode( + final DataSchemaNode potential) { + if (potential instanceof ContainerSchemaNode) { + return new ContainerNormalization((ContainerSchemaNode) potential); + } else if (potential instanceof ListSchemaNode) { + return new ListMixinNormalization((ListSchemaNode) potential); + } else if (potential instanceof LeafSchemaNode) { + return new LeafNormalization(new NodeIdentifier(potential.getQName())); + } else if (potential instanceof org.opendaylight.yangtools.yang.model.api.ChoiceNode) { + return new ChoiceNodeNormalization( + (org.opendaylight.yangtools.yang.model.api.ChoiceNode) potential); + } else if (potential instanceof LeafListSchemaNode) { + return new LeafListMixinNormalization((LeafListSchemaNode) potential); + } + return null; + } + + public static NodeToNormalizedNodeBuilder from(final SchemaContext ctx) { + return new ContainerNormalization(ctx); + } + + public abstract NormalizedNode createDefault(PathArgument currentArg); + +} diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/NormalizedNodeToNodeCodec.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/NormalizedNodeToNodeCodec.java new file mode 100644 index 0000000000..23d412708e --- /dev/null +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/NormalizedNodeToNodeCodec.java @@ -0,0 +1,64 @@ +package org.opendaylight.controller.cluster.datastore.node; + +import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages; +import org.opendaylight.controller.cluster.datastore.node.utils.PathUtils; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; +import org.opendaylight.yangtools.yang.model.api.SchemaContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class NormalizedNodeToNodeCodec { + private final SchemaContext ctx; + private static final Logger logger = LoggerFactory.getLogger(NormalizedNodeToNodeCodec.class); + + public NormalizedNodeToNodeCodec(final SchemaContext ctx){ + this.ctx = ctx; + + } + + public NormalizedNodeMessages.Container encode(InstanceIdentifier id, NormalizedNode node){ + String parentPath = ""; + + if(id != null){ + parentPath = PathUtils.getParentPath(id.toString()); + } + + + NormalizedNodeToProtocolBufferNode encoder = new NormalizedNodeToProtocolBufferNode(); + encoder.encode(parentPath, node); + + return encoder.getContainer(); + + + } + + public NormalizedNode decode(InstanceIdentifier id, NormalizedNodeMessages.Node node){ + NodeToNormalizedNodeBuilder currentOp = NodeToNormalizedNodeBuilder.from(ctx); + + for(InstanceIdentifier.PathArgument pathArgument : id.getPath()){ + currentOp = currentOp.getChild(pathArgument); + } + + QName nodeType = null; + + if(id.getPath().size() < 1){ + nodeType = null; + } else { + final InstanceIdentifier.PathArgument pathArgument = id.getPath().get(id.getPath().size() - 1); + if(pathArgument instanceof InstanceIdentifier.AugmentationIdentifier){ + nodeType = null; + } else { + nodeType = pathArgument.getNodeType(); + } + } + try { + return currentOp.normalize(nodeType , node); + } catch(RuntimeException e){ + throw e; + } + } + + +} diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/NormalizedNodeToProtocolBufferNode.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/NormalizedNodeToProtocolBufferNode.java new file mode 100644 index 0000000000..6b2f1bd187 --- /dev/null +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/NormalizedNodeToProtocolBufferNode.java @@ -0,0 +1,194 @@ +package org.opendaylight.controller.cluster.datastore.node; +import com.google.common.base.Preconditions; +import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages; +import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; +import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode; +import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; +import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; +import org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode; +import org.opendaylight.yangtools.yang.data.api.schema.LeafNode; +import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode; +import org.opendaylight.yangtools.yang.data.api.schema.LeafSetNode; +import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; +import org.opendaylight.yangtools.yang.data.api.schema.MapNode; +import org.opendaylight.yangtools.yang.data.api.schema.MixinNode; +import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; +import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNodeContainer; +import org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListEntryNode; + +import java.util.Map; + +/** + * NormalizedNodeToProtocolBufferNode walks the NormalizedNode tree converting it to the + * NormalizedMessage.Node + * + * {@link org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode } is a tree like structure that provides a generic structure for a yang data + * model + * + * + */ +public class NormalizedNodeToProtocolBufferNode { + + + private final Node.Builder builderRoot; + private NormalizedNodeMessages.Container container; + + public NormalizedNodeToProtocolBufferNode() { + + builderRoot = Node.newBuilder(); + } + + public void encode(String parentPath, NormalizedNode normalizedNode) { + if (parentPath == null) { + parentPath = ""; + } + + Preconditions.checkArgument(normalizedNode!=null); + + navigateNormalizedNode(0, parentPath,normalizedNode, builderRoot); + // here we need to put back the Node Tree in Container + NormalizedNodeMessages.Container.Builder containerBuilder = + NormalizedNodeMessages.Container.newBuilder(); + containerBuilder.setParentPath(parentPath).setNormalizedNode( + builderRoot.build()); + container = containerBuilder.build(); + + } + + + private void navigateDataContainerNode(int level,final String parentPath, + final DataContainerNode dataContainerNode, Node.Builder builderParent) { + + String newParentPath = parentPath + "/" + dataContainerNode.getIdentifier().toString(); + String type = getDataContainerType(dataContainerNode).getSimpleName(); + builderParent.setPath(dataContainerNode.getIdentifier().toString()) + .setType(type); + + final Iterable> value = + dataContainerNode.getValue(); + for (NormalizedNode node : value) { + Node.Builder builderChild = Node.newBuilder(); + if (node instanceof MixinNode && node instanceof NormalizedNodeContainer) { + + navigateNormalizedNodeContainerMixin(level, newParentPath, + (NormalizedNodeContainer) node, builderChild); + } else { + navigateNormalizedNode(level, newParentPath,node, builderChild); + } + builderParent.addChild(builderChild); + } + + } + + private Class getDataContainerType( + NormalizedNodeContainer dataContainerNode) { + if (dataContainerNode instanceof ChoiceNode) { + return ChoiceNode.class; + } else if (dataContainerNode instanceof AugmentationNode) { + return AugmentationNode.class; + } else if (dataContainerNode instanceof ContainerNode) { + return ContainerNode.class; + } else if (dataContainerNode instanceof MapEntryNode) { + return MapEntryNode.class; + } else if (dataContainerNode instanceof UnkeyedListEntryNode) { + return UnkeyedListEntryNode.class; + } else if (dataContainerNode instanceof MapNode) { + return MapNode.class; + } else if (dataContainerNode instanceof LeafSetNode){ + return LeafSetNode.class; + } + throw new IllegalArgumentException( + "could not find the data container node type " + + dataContainerNode.toString()); + } + + private void navigateNormalizedNodeContainerMixin(int level, final String parentPath, + NormalizedNodeContainer node, Node.Builder builderParent) { + String newParentPath = parentPath + "/" + node.getIdentifier().toString(); + + builderParent.setPath(node.getIdentifier().toString()).setType( + this.getDataContainerType(node).getSimpleName()); + final Iterable> value = node.getValue(); + for (NormalizedNode normalizedNode : value) { + // child node builder + Node.Builder builderChild = Node.newBuilder(); + if (normalizedNode instanceof MixinNode + && normalizedNode instanceof NormalizedNodeContainer) { + navigateNormalizedNodeContainerMixin(level + 1,newParentPath, + (NormalizedNodeContainer) normalizedNode, builderChild); + } else { + navigateNormalizedNode(level,newParentPath, normalizedNode, builderChild); + } + builderParent.addChild(builderChild); + + } + + + + } + + + private void navigateNormalizedNode(int level, + String parentPath,NormalizedNode normalizedNode, Node.Builder builderParent) { + + if (normalizedNode instanceof DataContainerNode) { + + final DataContainerNode dataContainerNode = + (DataContainerNode) normalizedNode; + + navigateDataContainerNode(level + 1, parentPath,dataContainerNode, builderParent); + } else { + + if (normalizedNode instanceof LeafNode) { + buildLeafNode(parentPath,normalizedNode, builderParent); + } else if (normalizedNode instanceof LeafSetEntryNode) { + buildLeafSetEntryNode(parentPath,normalizedNode,builderParent); + } + + } + + } + + private void buildLeafSetEntryNode(String parentPath,NormalizedNode normalizedNode, + Node.Builder builderParent) { + String path = parentPath + "/" + normalizedNode.getIdentifier().toString(); + LeafSetEntryNode leafSetEntryNode = (LeafSetEntryNode) normalizedNode; + Map attributes = leafSetEntryNode.getAttributes(); + if (!attributes.isEmpty()) { + NormalizedNodeMessages.Attribute.Builder builder = null; + for (Map.Entry attribute : attributes.entrySet()) { + builder = NormalizedNodeMessages.Attribute.newBuilder(); + builder.setName(attribute.getKey().toString()).setValue( + normalizedNode.getValue().toString()); + builderParent.addAttributes(builder.build()); + } + } + builderParent.setPath(normalizedNode.getIdentifier().toString()).setType( + LeafSetEntryNode.class.getSimpleName()).setValue(normalizedNode.getValue().toString()); + } + + private void buildLeafNode(String parentPath,NormalizedNode normalizedNode, + Node.Builder builderParent) { + String path = parentPath + "/" + normalizedNode.getIdentifier().toString(); + LeafNode leafNode = (LeafNode) normalizedNode; + Map attributes = leafNode.getAttributes(); + if (!attributes.isEmpty()) { + NormalizedNodeMessages.Attribute.Builder builder = null; + for (Map.Entry attribute : attributes.entrySet()) { + builder = NormalizedNodeMessages.Attribute.newBuilder(); + builder.setName(attribute.getKey().toString()).setValue( + normalizedNode.getValue().toString()); + builderParent.addAttributes(builder.build()); + } + } + builderParent.setPath(normalizedNode.getIdentifier().toString()).setType( + LeafNode.class.getSimpleName()).setValue(normalizedNode.getValue().toString()); + } + + public NormalizedNodeMessages.Container getContainer() { + return container; + } +} diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/AugmentationIdentifierGenerator.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/AugmentationIdentifierGenerator.java new file mode 100644 index 0000000000..0f9897efed --- /dev/null +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/AugmentationIdentifierGenerator.java @@ -0,0 +1,42 @@ +package org.opendaylight.controller.cluster.datastore.node.utils; + +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; + +import java.util.HashSet; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class AugmentationIdentifierGenerator { + private final String id; + private static final Pattern pattern = Pattern.compile("AugmentationIdentifier\\Q{\\EchildNames=\\Q[\\E(.*)\\Q]}\\E"); + private final Matcher matcher; + private final boolean doesMatch; + + public AugmentationIdentifierGenerator(String id){ + this.id = id; + matcher = pattern.matcher(this.id); + doesMatch = matcher.matches(); + } + + public boolean matches(){ + return doesMatch; + } + + public InstanceIdentifier.AugmentationIdentifier getPathArgument(){ + Set childNames = new HashSet(); + final String childQNames = matcher.group(1); + + final String[] splitChildQNames = childQNames.split(","); + + for(String name : splitChildQNames){ + childNames.add( + org.opendaylight.controller.cluster.datastore.node.utils.QNameFactory + .create(name.trim())); + } + + return new InstanceIdentifier.AugmentationIdentifier(null, childNames); + } + +} diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NodeIdentifierFactory.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NodeIdentifierFactory.java new file mode 100644 index 0000000000..3250fadcf5 --- /dev/null +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NodeIdentifierFactory.java @@ -0,0 +1,44 @@ +package org.opendaylight.controller.cluster.datastore.node.utils; + +import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; + +import java.util.HashMap; +import java.util.Map; + +public class NodeIdentifierFactory { + private static final Map cache = new HashMap<>(); + public static InstanceIdentifier.PathArgument getArgument(String id){ + InstanceIdentifier.PathArgument value = cache.get(id); + if(value == null){ + synchronized (cache){ + value = cache.get(id); + if(value == null) { + value = createPathArgument(id); + cache.put(id, value); + } + } + } + return value; + } + + private static InstanceIdentifier.PathArgument createPathArgument(String id){ + final NodeIdentifierWithPredicatesGenerator + nodeIdentifierWithPredicatesGenerator = new NodeIdentifierWithPredicatesGenerator(id); + if(nodeIdentifierWithPredicatesGenerator.matches()){ + return nodeIdentifierWithPredicatesGenerator.getPathArgument(); + } + + final NodeIdentifierWithValueGenerator + nodeWithValueGenerator = new NodeIdentifierWithValueGenerator(id); + if(nodeWithValueGenerator.matches()){ + return nodeWithValueGenerator.getPathArgument(); + } + + final AugmentationIdentifierGenerator augmentationIdentifierGenerator = new AugmentationIdentifierGenerator(id); + if(augmentationIdentifierGenerator.matches()){ + return augmentationIdentifierGenerator.getPathArgument(); + } + + return new NodeIdentifierGenerator(id).getArgument(); + } +} diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NodeIdentifierGenerator.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NodeIdentifierGenerator.java new file mode 100644 index 0000000000..682d9438e4 --- /dev/null +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NodeIdentifierGenerator.java @@ -0,0 +1,18 @@ +package org.opendaylight.controller.cluster.datastore.node.utils; + +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; + +public class NodeIdentifierGenerator { + private final String id; + private final QName qName; + + public NodeIdentifierGenerator(String id){ + this.id = id; + this.qName = QNameFactory.create(id); + } + + public InstanceIdentifier.PathArgument getArgument(){ + return new InstanceIdentifier.NodeIdentifier(qName); + } +} diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NodeIdentifierWithPredicatesGenerator.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NodeIdentifierWithPredicatesGenerator.java new file mode 100644 index 0000000000..86430a57b3 --- /dev/null +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NodeIdentifierWithPredicatesGenerator.java @@ -0,0 +1,69 @@ +package org.opendaylight.controller.cluster.datastore.node.utils; + +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.impl.codec.TypeDefinitionAwareCodec; +import org.opendaylight.yangtools.yang.model.api.DataSchemaNode; +import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; +import org.opendaylight.yangtools.yang.model.api.ListSchemaNode; + +import java.util.HashMap; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class NodeIdentifierWithPredicatesGenerator{ + private final String id; + private static final Pattern pattern = Pattern.compile("(.*)\\Q[{\\E(.*)\\Q}]\\E"); + private final Matcher matcher; + private final boolean doesMatch; + private final ListSchemaNode listSchemaNode; + + public NodeIdentifierWithPredicatesGenerator(String id){ + this(id, null); + } + + public NodeIdentifierWithPredicatesGenerator(String id, ListSchemaNode schemaNode){ + this.id = id; + matcher = pattern.matcher(this.id); + doesMatch = matcher.matches(); + this.listSchemaNode = schemaNode; + } + + + public boolean matches(){ + return doesMatch; + } + + public InstanceIdentifier.NodeIdentifierWithPredicates getPathArgument(){ + final String group = matcher.group(2); + final String[] keyValues = group.split(","); + Map nameValues = new HashMap<>(); + + for(String keyValue : keyValues){ + int eqIndex = keyValue.lastIndexOf('='); + try { + final QName key = QNameFactory + .create(keyValue.substring(0, eqIndex)); + nameValues.put(key, getValue(key, keyValue.substring(eqIndex + 1))); + } catch(IllegalArgumentException e){ + System.out.println("Error processing identifier : " + id); + throw e; + } + } + + return new InstanceIdentifier.NodeIdentifierWithPredicates(QNameFactory.create(matcher.group(1)), nameValues); + } + + + private Object getValue(QName key, String value){ + if(listSchemaNode != null){ + for(DataSchemaNode node : listSchemaNode.getChildNodes()){ + if(node instanceof LeafSchemaNode && node.getQName().equals(key)){ + return TypeDefinitionAwareCodec.from(LeafSchemaNode.class.cast(node).getType()).deserialize(value); + } + } + } + return value; + } +} diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NodeIdentifierWithValueGenerator.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NodeIdentifierWithValueGenerator.java new file mode 100644 index 0000000000..95c777c964 --- /dev/null +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NodeIdentifierWithValueGenerator.java @@ -0,0 +1,31 @@ +package org.opendaylight.controller.cluster.datastore.node.utils; + +import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class NodeIdentifierWithValueGenerator{ + private final String id; + private static final Pattern pattern = Pattern.compile("(.*)\\Q[\\E(.*)\\Q]\\E"); + private final Matcher matcher; + private final boolean doesMatch; + + public NodeIdentifierWithValueGenerator(String id){ + this.id = id; + matcher = pattern.matcher(this.id); + doesMatch = matcher.matches(); + } + + public boolean matches(){ + return doesMatch; + } + + public InstanceIdentifier.PathArgument getPathArgument(){ + final String name = matcher.group(1); + final String value = matcher.group(2); + + return new InstanceIdentifier.NodeWithValue( + QNameFactory.create(name), value); + } + } diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NormalizedNodeGetter.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NormalizedNodeGetter.java new file mode 100644 index 0000000000..e82a23d37f --- /dev/null +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NormalizedNodeGetter.java @@ -0,0 +1,28 @@ +package org.opendaylight.controller.cluster.datastore.node.utils; + +import com.google.common.base.Preconditions; +import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; + +public class NormalizedNodeGetter implements + NormalizedNodeVisitor { + private final String path; + NormalizedNode output; + + public NormalizedNodeGetter(String path){ + Preconditions.checkNotNull(path); + this.path = path; + } + + @Override + public void visitNode(int level, String parentPath, NormalizedNode normalizedNode) { + String nodePath = parentPath + "/"+ normalizedNode.getIdentifier().toString(); + + if(nodePath.toString().equals(path)){ + output = normalizedNode; + } + } + + public NormalizedNode getOutput(){ + return output; + } +} diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NormalizedNodeNavigator.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NormalizedNodeNavigator.java new file mode 100644 index 0000000000..4c2fba520d --- /dev/null +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NormalizedNodeNavigator.java @@ -0,0 +1,81 @@ +package org.opendaylight.controller.cluster.datastore.node.utils; + +import com.google.common.base.Preconditions; +import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; +import org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode; +import org.opendaylight.yangtools.yang.data.api.schema.MixinNode; +import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; +import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNodeContainer; + +/** + * NormalizedNodeNavigator walks a {@link NormalizedNodeVisitor} through the NormalizedNode + * + * {@link NormalizedNode } is a tree like structure that provides a generic structure for a yang data model + * + * For examples of visitors + * @see NormalizedNodePrinter + * + * + */ +public class NormalizedNodeNavigator { + + private final org.opendaylight.controller.cluster.datastore.node.utils.NormalizedNodeVisitor + visitor; + + public NormalizedNodeNavigator( + org.opendaylight.controller.cluster.datastore.node.utils.NormalizedNodeVisitor visitor){ + Preconditions.checkNotNull(visitor, "visitor should not be null"); + this.visitor = visitor; + } + public void navigate(String parentPath, NormalizedNode normalizedNode){ + if(parentPath == null){ + parentPath = ""; + } + navigateNormalizedNode(0, parentPath, normalizedNode); + } + + private void navigateDataContainerNode(int level, final String parentPath, final DataContainerNode dataContainerNode){ + visitor.visitNode(level, parentPath ,dataContainerNode); + + String newParentPath = parentPath + "/" + dataContainerNode.getIdentifier().toString(); + + final Iterable> value = dataContainerNode.getValue(); + for(NormalizedNode node : value){ + if(node instanceof MixinNode && node instanceof NormalizedNodeContainer){ + navigateNormalizedNodeContainerMixin(level, newParentPath, (NormalizedNodeContainer) node); + } else { + navigateNormalizedNode(level, newParentPath, node); + } + } + + } + + private void navigateNormalizedNodeContainerMixin(int level, final String parentPath, NormalizedNodeContainer node) { + visitor.visitNode(level, parentPath, node); + + String newParentPath = parentPath + "/" + node.getIdentifier().toString(); + + final Iterable> value = node.getValue(); + for(NormalizedNode normalizedNode : value){ + if(normalizedNode instanceof MixinNode && normalizedNode instanceof NormalizedNodeContainer){ + navigateNormalizedNodeContainerMixin(level + 1, newParentPath, (NormalizedNodeContainer) normalizedNode); + } else { + navigateNormalizedNode(level, newParentPath, normalizedNode); + } + } + + } + + + private void navigateNormalizedNode(int level, String parentPath, NormalizedNode normalizedNode){ + if(normalizedNode instanceof DataContainerNode){ + + final DataContainerNode dataContainerNode = (DataContainerNode) normalizedNode; + + navigateDataContainerNode(level + 1, parentPath, dataContainerNode); + } else { + visitor.visitNode(level+1, parentPath, normalizedNode); + } + } +} diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NormalizedNodePrinter.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NormalizedNodePrinter.java new file mode 100644 index 0000000000..7735a12a8b --- /dev/null +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NormalizedNodePrinter.java @@ -0,0 +1,26 @@ +package org.opendaylight.controller.cluster.datastore.node.utils; + +import org.opendaylight.yangtools.yang.data.api.schema.LeafNode; +import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode; +import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; + +public class NormalizedNodePrinter implements NormalizedNodeVisitor { + + private String spaces(int n){ + StringBuilder builder = new StringBuilder(); + for(int i=0;i 2){ + for(int i=0;i 0){ + parentPath += "/" + parentPaths[i]; + } + } + } + } + return parentPath; + } +} diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/QNameFactory.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/QNameFactory.java new file mode 100644 index 0000000000..8dba0563bd --- /dev/null +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/QNameFactory.java @@ -0,0 +1,24 @@ +package org.opendaylight.controller.cluster.datastore.node.utils; + +import org.opendaylight.yangtools.yang.common.QName; + +import java.util.HashMap; +import java.util.Map; + +public class QNameFactory { + private static final Map cache = new HashMap<>(); + + public static QName create(String name){ + QName value = cache.get(name); + if(value == null){ + synchronized (cache){ + value = cache.get(name); + if(value == null) { + value = QName.create(name); + cache.put(name, value); + } + } + } + return value; + } +} diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/util/EncoderDecoderUtil.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/util/EncoderDecoderUtil.java index 8e0e85cabb..d9a067b573 100644 --- a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/util/EncoderDecoderUtil.java +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/util/EncoderDecoderUtil.java @@ -4,16 +4,26 @@ import com.google.common.base.Preconditions; import com.google.common.collect.Lists; import org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage; import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; +import org.opendaylight.yangtools.yang.data.api.schema.LeafNode; +import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode; +import org.opendaylight.yangtools.yang.data.api.schema.LeafSetNode; +import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; +import org.opendaylight.yangtools.yang.data.api.schema.MapNode; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlDocumentUtils; import org.opendaylight.yangtools.yang.data.impl.schema.transform.dom.DomUtils; import org.opendaylight.yangtools.yang.data.impl.schema.transform.dom.parser.DomToNormalizedNodeParserFactory; import org.opendaylight.yangtools.yang.data.impl.schema.transform.dom.serializer.DomFromNormalizedNodeSerializerFactory; +import org.opendaylight.yangtools.yang.model.api.AugmentationSchema; import org.opendaylight.yangtools.yang.model.api.ChoiceNode; import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode; import org.opendaylight.yangtools.yang.model.api.DataNodeContainer; import org.opendaylight.yangtools.yang.model.api.DataSchemaNode; +import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode; +import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode; +import org.opendaylight.yangtools.yang.model.api.ListSchemaNode; import org.opendaylight.yangtools.yang.model.api.Module; import org.opendaylight.yangtools.yang.model.api.SchemaContext; import org.w3c.dom.Document; @@ -29,7 +39,9 @@ import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import java.io.ByteArrayInputStream; import java.io.StringWriter; +import java.util.Collection; import java.util.Collections; +import java.util.Iterator; import java.util.List; /* @@ -47,142 +59,271 @@ import java.util.List; * @author: syedbahm */ public class EncoderDecoderUtil { - static DocumentBuilderFactory factory; - static { - factory = DocumentBuilderFactory.newInstance(); - factory.setNamespaceAware(true); - factory.setCoalescing(true); - factory.setIgnoringElementContentWhitespace(true); - factory.setIgnoringComments(true); - } + static DocumentBuilderFactory factory; - private static DataSchemaNode findChildNode(Iterable children, - String name) { - List containers = Lists.newArrayList(); - - for (DataSchemaNode dataSchemaNode : children) { - if (dataSchemaNode.getQName().getLocalName().equals(name)) - return dataSchemaNode; - if (dataSchemaNode instanceof DataNodeContainer) { - containers.add((DataNodeContainer) dataSchemaNode); - } else if (dataSchemaNode instanceof ChoiceNode) { - containers.addAll(((ChoiceNode) dataSchemaNode).getCases()); - } + private static DomFromNormalizedNodeSerializerFactory serializerFactory = + DomFromNormalizedNodeSerializerFactory + .getInstance(XmlDocumentUtils.getDocument(), + DomUtils.defaultValueCodecProvider()); + + private static DomToNormalizedNodeParserFactory parserFactory = + DomToNormalizedNodeParserFactory + .getInstance(DomUtils.defaultValueCodecProvider()); + + static { + factory = DocumentBuilderFactory.newInstance(); + factory.setNamespaceAware(true); + factory.setCoalescing(true); + factory.setIgnoringElementContentWhitespace(true); + factory.setIgnoringComments(true); } - for (DataNodeContainer container : containers) { - DataSchemaNode retVal = findChildNode(container.getChildNodes(), name); - if (retVal != null) { - return retVal; - } + private static DataSchemaNode findChildNode(Collection children, + String name) { + List containers = Lists.newArrayList(); + + for (DataSchemaNode dataSchemaNode : children) { + if (dataSchemaNode.getQName().getLocalName().equals(name)) + return dataSchemaNode; + if (dataSchemaNode instanceof DataNodeContainer) { + containers.add((DataNodeContainer) dataSchemaNode); + } else if (dataSchemaNode instanceof ChoiceNode) { + containers.addAll(((ChoiceNode) dataSchemaNode).getCases()); + } + } + + for (DataNodeContainer container : containers) { + DataSchemaNode retVal = + findChildNode(container.getChildNodes(), name); + if (retVal != null) { + return retVal; + } + } + + return null; } - return null; - } + private static DataSchemaNode getSchemaNode(SchemaContext context, + QName qname) { - private static DataSchemaNode getSchemaNode(SchemaContext context, QName qname) { + for (Module module : context + .findModuleByNamespace(qname.getNamespace())) { + // we will take the first child as the start of the + if (module.getChildNodes() != null || !module.getChildNodes() + .isEmpty()) { - for (Module module : context.findModuleByNamespace(qname.getNamespace())) { - // we will take the first child as the start of the - if (module.getChildNodes() != null || !module.getChildNodes().isEmpty()) { + DataSchemaNode found = + findChildNode(module.getChildNodes(), qname.getLocalName()); + return found; + } + } + return null; + } - DataSchemaNode found = - findChildNode(module.getChildNodes(), qname.getLocalName()); - return found; - } + private static String toString(Element xml) { + try { + Transformer transformer = + TransformerFactory.newInstance().newTransformer(); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + + StreamResult result = new StreamResult(new StringWriter()); + DOMSource source = new DOMSource(xml); + transformer.transform(source, result); + + return result.getWriter().toString(); + } catch (IllegalArgumentException | TransformerFactoryConfigurationError + | TransformerException e) { + throw new RuntimeException("Unable to serialize xml element " + xml, + e); + } } - return null; - } - private static String toString(Element xml) { + private static String toString(Iterable xmlIterable) { try { Transformer transformer = TransformerFactory.newInstance().newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); StreamResult result = new StreamResult(new StringWriter()); - DOMSource source = new DOMSource(xml); - transformer.transform(source, result); + Iterator iterator = xmlIterable.iterator(); + DOMSource source; + if(iterator.hasNext()) { + source = new DOMSource((org.w3c.dom.Node) iterator.next()); + transformer.transform(source, result); + transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); + } + while(iterator.hasNext()) { + source = new DOMSource((org.w3c.dom.Node) iterator.next()); + transformer.transform(source, result); + } + System.out.println(result.getWriter().toString()); return result.getWriter().toString(); } catch (IllegalArgumentException | TransformerFactoryConfigurationError | TransformerException e) { - throw new RuntimeException("Unable to serialize xml element " + xml, e); + throw new RuntimeException("Unable to serialize xml element(s) " + xmlIterable.toString(), + e); } } - /** - * Helps in generation of NormalizedNodeXml message for the supplied NormalizedNode - * - * @param sc --SchemaContext - * @param normalizedNode -- Normalized Node to be encoded - * @return SimpleNormalizedNodeMessage.NormalizedNodeXml - */ - public static SimpleNormalizedNodeMessage.NormalizedNodeXml encode( - SchemaContext sc, NormalizedNode normalizedNode) { - Preconditions.checkArgument(sc != null, "Schema context found null"); - Preconditions.checkArgument(normalizedNode != null, - "normalized node found null"); - ContainerSchemaNode containerNode = - (ContainerSchemaNode) getSchemaNode(sc, normalizedNode.getIdentifier() - .getNodeType()); - Preconditions.checkState(containerNode != null, - "Couldn't find schema node for " + normalizedNode.getIdentifier()); - Iterable els = - DomFromNormalizedNodeSerializerFactory - .getInstance(XmlDocumentUtils.getDocument(), - DomUtils.defaultValueCodecProvider()) - .getContainerNodeSerializer() - .serialize(containerNode, (ContainerNode) normalizedNode); - String xmlString = toString(els.iterator().next()); - SimpleNormalizedNodeMessage.NormalizedNodeXml.Builder builder = - SimpleNormalizedNodeMessage.NormalizedNodeXml.newBuilder(); - builder.setXmlString(xmlString); - builder.setNodeIdentifier(((ContainerNode) normalizedNode).getIdentifier() - .getNodeType().toString()); - return builder.build(); + private static Iterable serialize(DataSchemaNode schemaNode, NormalizedNode normalizedNode){ + if(schemaNode instanceof ContainerSchemaNode){ //1 + return serializerFactory + .getContainerNodeSerializer() + .serialize((ContainerSchemaNode) schemaNode, + (ContainerNode) normalizedNode); + } else if(schemaNode instanceof ChoiceNode){ //2 + return serializerFactory + .getChoiceNodeSerializer() + .serialize((ChoiceNode) schemaNode, + (org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode) normalizedNode); + } else if(schemaNode instanceof LeafSchemaNode){ //3 + return serializerFactory + .getLeafNodeSerializer() + .serialize((LeafSchemaNode) schemaNode, (LeafNode) normalizedNode); + } else if(schemaNode instanceof ListSchemaNode){ //4 + return serializerFactory + .getMapNodeSerializer() + .serialize((ListSchemaNode) schemaNode, (MapNode) normalizedNode); + } else if(schemaNode instanceof LeafListSchemaNode){ //5 + return serializerFactory + .getLeafSetNodeSerializer() + .serialize((LeafListSchemaNode) schemaNode, (LeafSetNode) normalizedNode); + } else if(schemaNode instanceof AugmentationSchema){//6 + return serializerFactory + .getAugmentationNodeSerializer() + .serialize((AugmentationSchema) schemaNode, (AugmentationNode) normalizedNode); + } else if(schemaNode instanceof ListSchemaNode && normalizedNode instanceof LeafSetEntryNode){ //7 + return serializerFactory + .getLeafSetEntryNodeSerializer() + .serialize((LeafListSchemaNode) schemaNode, (LeafSetEntryNode) normalizedNode); + } else if(schemaNode instanceof ListSchemaNode){ //8 + return serializerFactory + .getMapEntryNodeSerializer() + .serialize((ListSchemaNode) schemaNode, (MapEntryNode) normalizedNode); + } - } - /** - * Utilizes the SimpleNormalizedNodeMessage.NormalizedNodeXml to convert into NormalizedNode - * - * @param sc -- schema context - * @param normalizedNodeXml -- containing the normalized Node XML - * @return NormalizedNode return - * @throws Exception - */ - - public static NormalizedNode decode(SchemaContext sc, - SimpleNormalizedNodeMessage.NormalizedNodeXml normalizedNodeXml) - throws Exception { - Preconditions.checkArgument(sc != null, "schema context seems to be null"); - Preconditions.checkArgument(normalizedNodeXml != null, - "SimpleNormalizedNodeMessage.NormalizedNodeXml found to be null"); - QName qname = QName.create(normalizedNodeXml.getNodeIdentifier()); - - // here we will try to get back the NormalizedNode - ContainerSchemaNode containerSchemaNode = - (ContainerSchemaNode) getSchemaNode(sc, qname); - - // now we need to read the XML - - Document doc = - factory.newDocumentBuilder().parse( - new ByteArrayInputStream(normalizedNodeXml.getXmlString().getBytes( - "utf-8"))); - doc.getDocumentElement().normalize(); - - ContainerNode result = - DomToNormalizedNodeParserFactory - .getInstance(DomUtils.defaultValueCodecProvider()) - .getContainerNodeParser() - .parse(Collections.singletonList(doc.getDocumentElement()), - containerSchemaNode); - return (NormalizedNode) result; + throw new UnsupportedOperationException(schemaNode.getClass().toString()); + } - } + private static NormalizedNode parse(Document doc, DataSchemaNode schemaNode){ + if(schemaNode instanceof ContainerSchemaNode){ + return parserFactory + .getContainerNodeParser() + .parse(Collections.singletonList(doc.getDocumentElement()), + (ContainerSchemaNode) schemaNode); + + } else if(schemaNode instanceof ChoiceNode){ + return parserFactory + .getChoiceNodeParser() + .parse(Collections.singletonList(doc.getDocumentElement()), + (ChoiceNode) schemaNode); + } else if(schemaNode instanceof LeafNode){ + return parserFactory + .getLeafNodeParser() + .parse(Collections.singletonList(doc.getDocumentElement()), + (LeafSchemaNode) schemaNode); + } else if(schemaNode instanceof ListSchemaNode){ + return parserFactory + .getMapNodeParser() + .parse(Collections.singletonList(doc.getDocumentElement()), + (ListSchemaNode) schemaNode); + } else if(schemaNode instanceof LeafListSchemaNode){ + return parserFactory + .getLeafSetNodeParser() + .parse(Collections.singletonList(doc.getDocumentElement()), + (LeafListSchemaNode) schemaNode); + } else if(schemaNode instanceof AugmentationSchema){ + return parserFactory + .getAugmentationNodeParser() + .parse(Collections.singletonList(doc.getDocumentElement()), + (AugmentationSchema) schemaNode); + } else if(schemaNode instanceof ListSchemaNode){ + return parserFactory + .getMapEntryNodeParser() + .parse(Collections.singletonList(doc.getDocumentElement()), + (ListSchemaNode) schemaNode); + + } + + throw new UnsupportedOperationException(schemaNode.getClass().toString()); + } + + + /** + * Helps in generation of NormalizedNodeXml message for the supplied NormalizedNode + * + * @param sc --SchemaContext + * @param normalizedNode -- Normalized Node to be encoded + * @return SimpleNormalizedNodeMessage.NormalizedNodeXml + */ + public static SimpleNormalizedNodeMessage.NormalizedNodeXml encode( + SchemaContext sc, NormalizedNode normalizedNode) { + + Preconditions.checkArgument(sc != null, "Schema context found null"); + + Preconditions.checkArgument(normalizedNode != null, + "normalized node found null"); + + DataSchemaNode schemaNode = getSchemaNode(sc, + normalizedNode.getIdentifier() + .getNodeType() + ); + + Preconditions.checkState(schemaNode != null, + "Couldn't find schema node for " + normalizedNode.getIdentifier()); + + Iterable els = serialize(schemaNode, normalizedNode); + + String xmlString = toString(els.iterator().next()); + SimpleNormalizedNodeMessage.NormalizedNodeXml.Builder builder = + SimpleNormalizedNodeMessage.NormalizedNodeXml.newBuilder(); + builder.setXmlString(xmlString); + builder + .setNodeIdentifier(normalizedNode.getIdentifier() + .getNodeType().toString()); + return builder.build(); + + } + + /** + * Utilizes the SimpleNormalizedNodeMessage.NormalizedNodeXml to convert into NormalizedNode + * + * @param sc -- schema context + * @param normalizedNodeXml -- containing the normalized Node XML + * @return NormalizedNode return + * @throws Exception + */ + + public static NormalizedNode decode(SchemaContext sc, + SimpleNormalizedNodeMessage.NormalizedNodeXml normalizedNodeXml) + throws Exception { + + Preconditions + .checkArgument(sc != null, "schema context seems to be null"); + + Preconditions.checkArgument(normalizedNodeXml != null, + "SimpleNormalizedNodeMessage.NormalizedNodeXml found to be null"); + QName qname = QName.create(normalizedNodeXml.getNodeIdentifier()); + + // here we will try to get back the NormalizedNode + DataSchemaNode schemaNode = getSchemaNode(sc, qname); + + // now we need to read the XML + Document doc = + factory.newDocumentBuilder().parse( + new ByteArrayInputStream( + normalizedNodeXml.getXmlString().getBytes( + "utf-8")) + ); + + doc.getDocumentElement().normalize(); + + + return parse(doc, schemaNode); + } diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/cohort3pc/ThreePhaseCommitCohortMessages.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/cohort3pc/ThreePhaseCommitCohortMessages.java new file mode 100644 index 0000000000..22a93c0e10 --- /dev/null +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/cohort3pc/ThreePhaseCommitCohortMessages.java @@ -0,0 +1,2700 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: Cohort.proto + +package org.opendaylight.controller.protobuff.messages.cohort3pc; + +public final class ThreePhaseCommitCohortMessages { + private ThreePhaseCommitCohortMessages() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + } + public interface CanCommitTransactionOrBuilder + extends com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code org.opendaylight.controller.mdsal.CanCommitTransaction} + */ + public static final class CanCommitTransaction extends + com.google.protobuf.GeneratedMessage + implements CanCommitTransactionOrBuilder { + // Use CanCommitTransaction.newBuilder() to construct. + private CanCommitTransaction(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private CanCommitTransaction(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final CanCommitTransaction defaultInstance; + public static CanCommitTransaction getDefaultInstance() { + return defaultInstance; + } + + public CanCommitTransaction getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CanCommitTransaction( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CanCommitTransaction_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CanCommitTransaction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction.class, org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public CanCommitTransaction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CanCommitTransaction(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private void initFields() { + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.opendaylight.controller.mdsal.CanCommitTransaction} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CanCommitTransaction_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CanCommitTransaction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction.class, org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction.Builder.class); + } + + // Construct using org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CanCommitTransaction_descriptor; + } + + public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction getDefaultInstanceForType() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction.getDefaultInstance(); + } + + public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction build() { + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction buildPartial() { + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction result = new org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction(this); + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction) { + return mergeFrom((org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction other) { + if (other == org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + // @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.CanCommitTransaction) + } + + static { + defaultInstance = new CanCommitTransaction(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.opendaylight.controller.mdsal.CanCommitTransaction) + } + + public interface CanCommitTransactionReplyOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required bool canCommit = 1; + /** + * required bool canCommit = 1; + */ + boolean hasCanCommit(); + /** + * required bool canCommit = 1; + */ + boolean getCanCommit(); + } + /** + * Protobuf type {@code org.opendaylight.controller.mdsal.CanCommitTransactionReply} + */ + public static final class CanCommitTransactionReply extends + com.google.protobuf.GeneratedMessage + implements CanCommitTransactionReplyOrBuilder { + // Use CanCommitTransactionReply.newBuilder() to construct. + private CanCommitTransactionReply(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private CanCommitTransactionReply(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final CanCommitTransactionReply defaultInstance; + public static CanCommitTransactionReply getDefaultInstance() { + return defaultInstance; + } + + public CanCommitTransactionReply getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CanCommitTransactionReply( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + canCommit_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CanCommitTransactionReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CanCommitTransactionReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply.class, org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public CanCommitTransactionReply parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CanCommitTransactionReply(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // required bool canCommit = 1; + public static final int CANCOMMIT_FIELD_NUMBER = 1; + private boolean canCommit_; + /** + * required bool canCommit = 1; + */ + public boolean hasCanCommit() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bool canCommit = 1; + */ + public boolean getCanCommit() { + return canCommit_; + } + + private void initFields() { + canCommit_ = false; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasCanCommit()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBool(1, canCommit_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, canCommit_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.opendaylight.controller.mdsal.CanCommitTransactionReply} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReplyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CanCommitTransactionReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CanCommitTransactionReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply.class, org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply.Builder.class); + } + + // Construct using org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + canCommit_ = false; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CanCommitTransactionReply_descriptor; + } + + public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply getDefaultInstanceForType() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply.getDefaultInstance(); + } + + public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply build() { + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply buildPartial() { + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply result = new org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.canCommit_ = canCommit_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply) { + return mergeFrom((org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply other) { + if (other == org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply.getDefaultInstance()) return this; + if (other.hasCanCommit()) { + setCanCommit(other.getCanCommit()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasCanCommit()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // required bool canCommit = 1; + private boolean canCommit_ ; + /** + * required bool canCommit = 1; + */ + public boolean hasCanCommit() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bool canCommit = 1; + */ + public boolean getCanCommit() { + return canCommit_; + } + /** + * required bool canCommit = 1; + */ + public Builder setCanCommit(boolean value) { + bitField0_ |= 0x00000001; + canCommit_ = value; + onChanged(); + return this; + } + /** + * required bool canCommit = 1; + */ + public Builder clearCanCommit() { + bitField0_ = (bitField0_ & ~0x00000001); + canCommit_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.CanCommitTransactionReply) + } + + static { + defaultInstance = new CanCommitTransactionReply(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.opendaylight.controller.mdsal.CanCommitTransactionReply) + } + + public interface AbortTransactionOrBuilder + extends com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code org.opendaylight.controller.mdsal.AbortTransaction} + */ + public static final class AbortTransaction extends + com.google.protobuf.GeneratedMessage + implements AbortTransactionOrBuilder { + // Use AbortTransaction.newBuilder() to construct. + private AbortTransaction(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private AbortTransaction(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final AbortTransaction defaultInstance; + public static AbortTransaction getDefaultInstance() { + return defaultInstance; + } + + public AbortTransaction getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AbortTransaction( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_AbortTransaction_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_AbortTransaction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction.class, org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public AbortTransaction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AbortTransaction(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private void initFields() { + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.opendaylight.controller.mdsal.AbortTransaction} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_AbortTransaction_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_AbortTransaction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction.class, org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction.Builder.class); + } + + // Construct using org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_AbortTransaction_descriptor; + } + + public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction getDefaultInstanceForType() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction.getDefaultInstance(); + } + + public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction build() { + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction buildPartial() { + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction result = new org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction(this); + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction) { + return mergeFrom((org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction other) { + if (other == org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + // @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.AbortTransaction) + } + + static { + defaultInstance = new AbortTransaction(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.opendaylight.controller.mdsal.AbortTransaction) + } + + public interface AbortTransactionReplyOrBuilder + extends com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code org.opendaylight.controller.mdsal.AbortTransactionReply} + */ + public static final class AbortTransactionReply extends + com.google.protobuf.GeneratedMessage + implements AbortTransactionReplyOrBuilder { + // Use AbortTransactionReply.newBuilder() to construct. + private AbortTransactionReply(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private AbortTransactionReply(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final AbortTransactionReply defaultInstance; + public static AbortTransactionReply getDefaultInstance() { + return defaultInstance; + } + + public AbortTransactionReply getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AbortTransactionReply( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_AbortTransactionReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_AbortTransactionReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply.class, org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public AbortTransactionReply parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AbortTransactionReply(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private void initFields() { + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.opendaylight.controller.mdsal.AbortTransactionReply} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReplyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_AbortTransactionReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_AbortTransactionReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply.class, org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply.Builder.class); + } + + // Construct using org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_AbortTransactionReply_descriptor; + } + + public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply getDefaultInstanceForType() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply.getDefaultInstance(); + } + + public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply build() { + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply buildPartial() { + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply result = new org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply(this); + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply) { + return mergeFrom((org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply other) { + if (other == org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + // @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.AbortTransactionReply) + } + + static { + defaultInstance = new AbortTransactionReply(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.opendaylight.controller.mdsal.AbortTransactionReply) + } + + public interface CommitTransactionOrBuilder + extends com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code org.opendaylight.controller.mdsal.CommitTransaction} + */ + public static final class CommitTransaction extends + com.google.protobuf.GeneratedMessage + implements CommitTransactionOrBuilder { + // Use CommitTransaction.newBuilder() to construct. + private CommitTransaction(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private CommitTransaction(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final CommitTransaction defaultInstance; + public static CommitTransaction getDefaultInstance() { + return defaultInstance; + } + + public CommitTransaction getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CommitTransaction( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CommitTransaction_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CommitTransaction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction.class, org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public CommitTransaction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CommitTransaction(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private void initFields() { + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.opendaylight.controller.mdsal.CommitTransaction} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CommitTransaction_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CommitTransaction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction.class, org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction.Builder.class); + } + + // Construct using org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CommitTransaction_descriptor; + } + + public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction getDefaultInstanceForType() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction.getDefaultInstance(); + } + + public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction build() { + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction buildPartial() { + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction result = new org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction(this); + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction) { + return mergeFrom((org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction other) { + if (other == org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + // @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.CommitTransaction) + } + + static { + defaultInstance = new CommitTransaction(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.opendaylight.controller.mdsal.CommitTransaction) + } + + public interface CommitTransactionReplyOrBuilder + extends com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code org.opendaylight.controller.mdsal.CommitTransactionReply} + */ + public static final class CommitTransactionReply extends + com.google.protobuf.GeneratedMessage + implements CommitTransactionReplyOrBuilder { + // Use CommitTransactionReply.newBuilder() to construct. + private CommitTransactionReply(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private CommitTransactionReply(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final CommitTransactionReply defaultInstance; + public static CommitTransactionReply getDefaultInstance() { + return defaultInstance; + } + + public CommitTransactionReply getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CommitTransactionReply( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CommitTransactionReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CommitTransactionReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply.class, org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public CommitTransactionReply parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CommitTransactionReply(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private void initFields() { + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.opendaylight.controller.mdsal.CommitTransactionReply} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReplyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CommitTransactionReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CommitTransactionReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply.class, org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply.Builder.class); + } + + // Construct using org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CommitTransactionReply_descriptor; + } + + public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply getDefaultInstanceForType() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply.getDefaultInstance(); + } + + public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply build() { + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply buildPartial() { + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply result = new org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply(this); + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply) { + return mergeFrom((org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply other) { + if (other == org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + // @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.CommitTransactionReply) + } + + static { + defaultInstance = new CommitTransactionReply(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.opendaylight.controller.mdsal.CommitTransactionReply) + } + + public interface PreCommitTransactionOrBuilder + extends com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code org.opendaylight.controller.mdsal.PreCommitTransaction} + */ + public static final class PreCommitTransaction extends + com.google.protobuf.GeneratedMessage + implements PreCommitTransactionOrBuilder { + // Use PreCommitTransaction.newBuilder() to construct. + private PreCommitTransaction(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private PreCommitTransaction(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final PreCommitTransaction defaultInstance; + public static PreCommitTransaction getDefaultInstance() { + return defaultInstance; + } + + public PreCommitTransaction getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PreCommitTransaction( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_PreCommitTransaction_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_PreCommitTransaction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction.class, org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public PreCommitTransaction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PreCommitTransaction(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private void initFields() { + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.opendaylight.controller.mdsal.PreCommitTransaction} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_PreCommitTransaction_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_PreCommitTransaction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction.class, org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction.Builder.class); + } + + // Construct using org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_PreCommitTransaction_descriptor; + } + + public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction getDefaultInstanceForType() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction.getDefaultInstance(); + } + + public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction build() { + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction buildPartial() { + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction result = new org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction(this); + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction) { + return mergeFrom((org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction other) { + if (other == org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + // @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.PreCommitTransaction) + } + + static { + defaultInstance = new PreCommitTransaction(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.opendaylight.controller.mdsal.PreCommitTransaction) + } + + public interface PreCommitTransactionReplyOrBuilder + extends com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code org.opendaylight.controller.mdsal.PreCommitTransactionReply} + */ + public static final class PreCommitTransactionReply extends + com.google.protobuf.GeneratedMessage + implements PreCommitTransactionReplyOrBuilder { + // Use PreCommitTransactionReply.newBuilder() to construct. + private PreCommitTransactionReply(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private PreCommitTransactionReply(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final PreCommitTransactionReply defaultInstance; + public static PreCommitTransactionReply getDefaultInstance() { + return defaultInstance; + } + + public PreCommitTransactionReply getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PreCommitTransactionReply( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_PreCommitTransactionReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_PreCommitTransactionReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply.class, org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public PreCommitTransactionReply parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PreCommitTransactionReply(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private void initFields() { + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.opendaylight.controller.mdsal.PreCommitTransactionReply} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReplyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_PreCommitTransactionReply_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_PreCommitTransactionReply_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply.class, org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply.Builder.class); + } + + // Construct using org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_PreCommitTransactionReply_descriptor; + } + + public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply getDefaultInstanceForType() { + return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply.getDefaultInstance(); + } + + public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply build() { + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply buildPartial() { + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply result = new org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply(this); + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply) { + return mergeFrom((org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply other) { + if (other == org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + // @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.PreCommitTransactionReply) + } + + static { + defaultInstance = new PreCommitTransactionReply(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.opendaylight.controller.mdsal.PreCommitTransactionReply) + } + + private static com.google.protobuf.Descriptors.Descriptor + internal_static_org_opendaylight_controller_mdsal_CanCommitTransaction_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_org_opendaylight_controller_mdsal_CanCommitTransaction_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_org_opendaylight_controller_mdsal_CanCommitTransactionReply_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_org_opendaylight_controller_mdsal_CanCommitTransactionReply_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_org_opendaylight_controller_mdsal_AbortTransaction_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_org_opendaylight_controller_mdsal_AbortTransaction_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_org_opendaylight_controller_mdsal_AbortTransactionReply_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_org_opendaylight_controller_mdsal_AbortTransactionReply_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_org_opendaylight_controller_mdsal_CommitTransaction_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_org_opendaylight_controller_mdsal_CommitTransaction_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_org_opendaylight_controller_mdsal_CommitTransactionReply_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_org_opendaylight_controller_mdsal_CommitTransactionReply_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_org_opendaylight_controller_mdsal_PreCommitTransaction_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_org_opendaylight_controller_mdsal_PreCommitTransaction_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_org_opendaylight_controller_mdsal_PreCommitTransactionReply_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_org_opendaylight_controller_mdsal_PreCommitTransactionReply_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\014Cohort.proto\022!org.opendaylight.control" + + "ler.mdsal\"\026\n\024CanCommitTransaction\".\n\031Can" + + "CommitTransactionReply\022\021\n\tcanCommit\030\001 \002(" + + "\010\"\022\n\020AbortTransaction\"\027\n\025AbortTransactio" + + "nReply\"\023\n\021CommitTransaction\"\030\n\026CommitTra" + + "nsactionReply\"\026\n\024PreCommitTransaction\"\033\n" + + "\031PreCommitTransactionReplyBZ\n8org.openda" + + "ylight.controller.protobuff.messages.coh" + + "ort3pcB\036ThreePhaseCommitCohortMessages" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + internal_static_org_opendaylight_controller_mdsal_CanCommitTransaction_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_org_opendaylight_controller_mdsal_CanCommitTransaction_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_org_opendaylight_controller_mdsal_CanCommitTransaction_descriptor, + new java.lang.String[] { }); + internal_static_org_opendaylight_controller_mdsal_CanCommitTransactionReply_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_org_opendaylight_controller_mdsal_CanCommitTransactionReply_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_org_opendaylight_controller_mdsal_CanCommitTransactionReply_descriptor, + new java.lang.String[] { "CanCommit", }); + internal_static_org_opendaylight_controller_mdsal_AbortTransaction_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_org_opendaylight_controller_mdsal_AbortTransaction_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_org_opendaylight_controller_mdsal_AbortTransaction_descriptor, + new java.lang.String[] { }); + internal_static_org_opendaylight_controller_mdsal_AbortTransactionReply_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_org_opendaylight_controller_mdsal_AbortTransactionReply_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_org_opendaylight_controller_mdsal_AbortTransactionReply_descriptor, + new java.lang.String[] { }); + internal_static_org_opendaylight_controller_mdsal_CommitTransaction_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_org_opendaylight_controller_mdsal_CommitTransaction_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_org_opendaylight_controller_mdsal_CommitTransaction_descriptor, + new java.lang.String[] { }); + internal_static_org_opendaylight_controller_mdsal_CommitTransactionReply_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_org_opendaylight_controller_mdsal_CommitTransactionReply_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_org_opendaylight_controller_mdsal_CommitTransactionReply_descriptor, + new java.lang.String[] { }); + internal_static_org_opendaylight_controller_mdsal_PreCommitTransaction_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_org_opendaylight_controller_mdsal_PreCommitTransaction_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_org_opendaylight_controller_mdsal_PreCommitTransaction_descriptor, + new java.lang.String[] { }); + internal_static_org_opendaylight_controller_mdsal_PreCommitTransactionReply_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_org_opendaylight_controller_mdsal_PreCommitTransactionReply_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_org_opendaylight_controller_mdsal_PreCommitTransactionReply_descriptor, + new java.lang.String[] { }); + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/common/NormalizedNodeMessages.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/common/NormalizedNodeMessages.java new file mode 100644 index 0000000000..3a19ab2dd3 --- /dev/null +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/common/NormalizedNodeMessages.java @@ -0,0 +1,2942 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: Common.proto + +package org.opendaylight.controller.protobuff.messages.common; + +public final class NormalizedNodeMessages { + private NormalizedNodeMessages() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + } + public interface AttributeOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required string name = 1; + /** + * required string name = 1; + */ + boolean hasName(); + /** + * required string name = 1; + */ + java.lang.String getName(); + /** + * required string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + // optional string value = 2; + /** + * optional string value = 2; + */ + boolean hasValue(); + /** + * optional string value = 2; + */ + java.lang.String getValue(); + /** + * optional string value = 2; + */ + com.google.protobuf.ByteString + getValueBytes(); + } + /** + * Protobuf type {@code org.opendaylight.controller.mdsal.Attribute} + */ + public static final class Attribute extends + com.google.protobuf.GeneratedMessage + implements AttributeOrBuilder { + // Use Attribute.newBuilder() to construct. + private Attribute(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private Attribute(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final Attribute defaultInstance; + public static Attribute getDefaultInstance() { + return defaultInstance; + } + + public Attribute getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Attribute( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + name_ = input.readBytes(); + break; + } + case 18: { + bitField0_ |= 0x00000002; + value_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_Attribute_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_Attribute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.class, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Attribute parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Attribute(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // required string name = 1; + public static final int NAME_FIELD_NUMBER = 1; + private java.lang.Object name_; + /** + * required string name = 1; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } + } + /** + * required string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + // optional string value = 2; + public static final int VALUE_FIELD_NUMBER = 2; + private java.lang.Object value_; + /** + * optional string value = 2; + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string value = 2; + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + value_ = s; + } + return s; + } + } + /** + * optional string value = 2; + */ + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private void initFields() { + name_ = ""; + value_ = ""; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasName()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, getNameBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getValueBytes()); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, getNameBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, getValueBytes()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.opendaylight.controller.mdsal.Attribute} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_Attribute_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_Attribute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.class, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder.class); + } + + // Construct using org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + name_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + value_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_Attribute_descriptor; + } + + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute getDefaultInstanceForType() { + return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.getDefaultInstance(); + } + + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute build() { + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute buildPartial() { + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute result = new org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.name_ = name_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.value_ = value_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute) { + return mergeFrom((org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute other) { + if (other == org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.getDefaultInstance()) return this; + if (other.hasName()) { + bitField0_ |= 0x00000001; + name_ = other.name_; + onChanged(); + } + if (other.hasValue()) { + bitField0_ |= 0x00000002; + value_ = other.value_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasName()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // required string name = 1; + private java.lang.Object name_ = ""; + /** + * required string name = 1; + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + name_ = value; + onChanged(); + return this; + } + /** + * required string name = 1; + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000001); + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * required string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + name_ = value; + onChanged(); + return this; + } + + // optional string value = 2; + private java.lang.Object value_ = ""; + /** + * optional string value = 2; + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string value = 2; + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string value = 2; + */ + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string value = 2; + */ + public Builder setValue( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + value_ = value; + onChanged(); + return this; + } + /** + * optional string value = 2; + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000002); + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + /** + * optional string value = 2; + */ + public Builder setValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + value_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.Attribute) + } + + static { + defaultInstance = new Attribute(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.opendaylight.controller.mdsal.Attribute) + } + + public interface NodeOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required string path = 1; + /** + * required string path = 1; + */ + boolean hasPath(); + /** + * required string path = 1; + */ + java.lang.String getPath(); + /** + * required string path = 1; + */ + com.google.protobuf.ByteString + getPathBytes(); + + // optional string type = 2; + /** + * optional string type = 2; + */ + boolean hasType(); + /** + * optional string type = 2; + */ + java.lang.String getType(); + /** + * optional string type = 2; + */ + com.google.protobuf.ByteString + getTypeBytes(); + + // repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + java.util.List + getAttributesList(); + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute getAttributes(int index); + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + int getAttributesCount(); + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + java.util.List + getAttributesOrBuilderList(); + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder getAttributesOrBuilder( + int index); + + // repeated .org.opendaylight.controller.mdsal.Node child = 4; + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + java.util.List + getChildList(); + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getChild(int index); + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + int getChildCount(); + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + java.util.List + getChildOrBuilderList(); + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getChildOrBuilder( + int index); + + // optional string value = 5; + /** + * optional string value = 5; + */ + boolean hasValue(); + /** + * optional string value = 5; + */ + java.lang.String getValue(); + /** + * optional string value = 5; + */ + com.google.protobuf.ByteString + getValueBytes(); + } + /** + * Protobuf type {@code org.opendaylight.controller.mdsal.Node} + */ + public static final class Node extends + com.google.protobuf.GeneratedMessage + implements NodeOrBuilder { + // Use Node.newBuilder() to construct. + private Node(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private Node(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final Node defaultInstance; + public static Node getDefaultInstance() { + return defaultInstance; + } + + public Node getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Node( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + path_ = input.readBytes(); + break; + } + case 18: { + bitField0_ |= 0x00000002; + type_ = input.readBytes(); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + attributes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + attributes_.add(input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.PARSER, extensionRegistry)); + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + child_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + child_.add(input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.PARSER, extensionRegistry)); + break; + } + case 42: { + bitField0_ |= 0x00000004; + value_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + attributes_ = java.util.Collections.unmodifiableList(attributes_); + } + if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + child_ = java.util.Collections.unmodifiableList(child_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_Node_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_Node_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.class, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Node parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Node(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // required string path = 1; + public static final int PATH_FIELD_NUMBER = 1; + private java.lang.Object path_; + /** + * required string path = 1; + */ + public boolean hasPath() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string path = 1; + */ + public java.lang.String getPath() { + java.lang.Object ref = path_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + path_ = s; + } + return s; + } + } + /** + * required string path = 1; + */ + public com.google.protobuf.ByteString + getPathBytes() { + java.lang.Object ref = path_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + path_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + // optional string type = 2; + public static final int TYPE_FIELD_NUMBER = 2; + private java.lang.Object type_; + /** + * optional string type = 2; + */ + public boolean hasType() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string type = 2; + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + type_ = s; + } + return s; + } + } + /** + * optional string type = 2; + */ + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + // repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + public static final int ATTRIBUTES_FIELD_NUMBER = 3; + private java.util.List attributes_; + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + public java.util.List getAttributesList() { + return attributes_; + } + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + public java.util.List + getAttributesOrBuilderList() { + return attributes_; + } + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + public int getAttributesCount() { + return attributes_.size(); + } + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute getAttributes(int index) { + return attributes_.get(index); + } + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder getAttributesOrBuilder( + int index) { + return attributes_.get(index); + } + + // repeated .org.opendaylight.controller.mdsal.Node child = 4; + public static final int CHILD_FIELD_NUMBER = 4; + private java.util.List child_; + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + public java.util.List getChildList() { + return child_; + } + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + public java.util.List + getChildOrBuilderList() { + return child_; + } + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + public int getChildCount() { + return child_.size(); + } + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getChild(int index) { + return child_.get(index); + } + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getChildOrBuilder( + int index) { + return child_.get(index); + } + + // optional string value = 5; + public static final int VALUE_FIELD_NUMBER = 5; + private java.lang.Object value_; + /** + * optional string value = 5; + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional string value = 5; + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + value_ = s; + } + return s; + } + } + /** + * optional string value = 5; + */ + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private void initFields() { + path_ = ""; + type_ = ""; + attributes_ = java.util.Collections.emptyList(); + child_ = java.util.Collections.emptyList(); + value_ = ""; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasPath()) { + memoizedIsInitialized = 0; + return false; + } + for (int i = 0; i < getAttributesCount(); i++) { + if (!getAttributes(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getChildCount(); i++) { + if (!getChild(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, getPathBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getTypeBytes()); + } + for (int i = 0; i < attributes_.size(); i++) { + output.writeMessage(3, attributes_.get(i)); + } + for (int i = 0; i < child_.size(); i++) { + output.writeMessage(4, child_.get(i)); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(5, getValueBytes()); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, getPathBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, getTypeBytes()); + } + for (int i = 0; i < attributes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, attributes_.get(i)); + } + for (int i = 0; i < child_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, child_.get(i)); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(5, getValueBytes()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.opendaylight.controller.mdsal.Node} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_Node_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_Node_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.class, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder.class); + } + + // Construct using org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getAttributesFieldBuilder(); + getChildFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + path_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + type_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + if (attributesBuilder_ == null) { + attributes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + attributesBuilder_.clear(); + } + if (childBuilder_ == null) { + child_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + childBuilder_.clear(); + } + value_ = ""; + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_Node_descriptor; + } + + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getDefaultInstanceForType() { + return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance(); + } + + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node build() { + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node buildPartial() { + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node result = new org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.path_ = path_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.type_ = type_; + if (attributesBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + attributes_ = java.util.Collections.unmodifiableList(attributes_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.attributes_ = attributes_; + } else { + result.attributes_ = attributesBuilder_.build(); + } + if (childBuilder_ == null) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { + child_ = java.util.Collections.unmodifiableList(child_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.child_ = child_; + } else { + result.child_ = childBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000004; + } + result.value_ = value_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node) { + return mergeFrom((org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node other) { + if (other == org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance()) return this; + if (other.hasPath()) { + bitField0_ |= 0x00000001; + path_ = other.path_; + onChanged(); + } + if (other.hasType()) { + bitField0_ |= 0x00000002; + type_ = other.type_; + onChanged(); + } + if (attributesBuilder_ == null) { + if (!other.attributes_.isEmpty()) { + if (attributes_.isEmpty()) { + attributes_ = other.attributes_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureAttributesIsMutable(); + attributes_.addAll(other.attributes_); + } + onChanged(); + } + } else { + if (!other.attributes_.isEmpty()) { + if (attributesBuilder_.isEmpty()) { + attributesBuilder_.dispose(); + attributesBuilder_ = null; + attributes_ = other.attributes_; + bitField0_ = (bitField0_ & ~0x00000004); + attributesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getAttributesFieldBuilder() : null; + } else { + attributesBuilder_.addAllMessages(other.attributes_); + } + } + } + if (childBuilder_ == null) { + if (!other.child_.isEmpty()) { + if (child_.isEmpty()) { + child_ = other.child_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureChildIsMutable(); + child_.addAll(other.child_); + } + onChanged(); + } + } else { + if (!other.child_.isEmpty()) { + if (childBuilder_.isEmpty()) { + childBuilder_.dispose(); + childBuilder_ = null; + child_ = other.child_; + bitField0_ = (bitField0_ & ~0x00000008); + childBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getChildFieldBuilder() : null; + } else { + childBuilder_.addAllMessages(other.child_); + } + } + } + if (other.hasValue()) { + bitField0_ |= 0x00000010; + value_ = other.value_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasPath()) { + + return false; + } + for (int i = 0; i < getAttributesCount(); i++) { + if (!getAttributes(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getChildCount(); i++) { + if (!getChild(i).isInitialized()) { + + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // required string path = 1; + private java.lang.Object path_ = ""; + /** + * required string path = 1; + */ + public boolean hasPath() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string path = 1; + */ + public java.lang.String getPath() { + java.lang.Object ref = path_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + path_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string path = 1; + */ + public com.google.protobuf.ByteString + getPathBytes() { + java.lang.Object ref = path_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + path_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string path = 1; + */ + public Builder setPath( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + path_ = value; + onChanged(); + return this; + } + /** + * required string path = 1; + */ + public Builder clearPath() { + bitField0_ = (bitField0_ & ~0x00000001); + path_ = getDefaultInstance().getPath(); + onChanged(); + return this; + } + /** + * required string path = 1; + */ + public Builder setPathBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + path_ = value; + onChanged(); + return this; + } + + // optional string type = 2; + private java.lang.Object type_ = ""; + /** + * optional string type = 2; + */ + public boolean hasType() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string type = 2; + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string type = 2; + */ + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string type = 2; + */ + public Builder setType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + type_ = value; + onChanged(); + return this; + } + /** + * optional string type = 2; + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000002); + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * optional string type = 2; + */ + public Builder setTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + type_ = value; + onChanged(); + return this; + } + + // repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + private java.util.List attributes_ = + java.util.Collections.emptyList(); + private void ensureAttributesIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + attributes_ = new java.util.ArrayList(attributes_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder> attributesBuilder_; + + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + public java.util.List getAttributesList() { + if (attributesBuilder_ == null) { + return java.util.Collections.unmodifiableList(attributes_); + } else { + return attributesBuilder_.getMessageList(); + } + } + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + public int getAttributesCount() { + if (attributesBuilder_ == null) { + return attributes_.size(); + } else { + return attributesBuilder_.getCount(); + } + } + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute getAttributes(int index) { + if (attributesBuilder_ == null) { + return attributes_.get(index); + } else { + return attributesBuilder_.getMessage(index); + } + } + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + public Builder setAttributes( + int index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute value) { + if (attributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttributesIsMutable(); + attributes_.set(index, value); + onChanged(); + } else { + attributesBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + public Builder setAttributes( + int index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder builderForValue) { + if (attributesBuilder_ == null) { + ensureAttributesIsMutable(); + attributes_.set(index, builderForValue.build()); + onChanged(); + } else { + attributesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + public Builder addAttributes(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute value) { + if (attributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttributesIsMutable(); + attributes_.add(value); + onChanged(); + } else { + attributesBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + public Builder addAttributes( + int index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute value) { + if (attributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttributesIsMutable(); + attributes_.add(index, value); + onChanged(); + } else { + attributesBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + public Builder addAttributes( + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder builderForValue) { + if (attributesBuilder_ == null) { + ensureAttributesIsMutable(); + attributes_.add(builderForValue.build()); + onChanged(); + } else { + attributesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + public Builder addAttributes( + int index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder builderForValue) { + if (attributesBuilder_ == null) { + ensureAttributesIsMutable(); + attributes_.add(index, builderForValue.build()); + onChanged(); + } else { + attributesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + public Builder addAllAttributes( + java.lang.Iterable values) { + if (attributesBuilder_ == null) { + ensureAttributesIsMutable(); + super.addAll(values, attributes_); + onChanged(); + } else { + attributesBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + public Builder clearAttributes() { + if (attributesBuilder_ == null) { + attributes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + attributesBuilder_.clear(); + } + return this; + } + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + public Builder removeAttributes(int index) { + if (attributesBuilder_ == null) { + ensureAttributesIsMutable(); + attributes_.remove(index); + onChanged(); + } else { + attributesBuilder_.remove(index); + } + return this; + } + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder getAttributesBuilder( + int index) { + return getAttributesFieldBuilder().getBuilder(index); + } + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder getAttributesOrBuilder( + int index) { + if (attributesBuilder_ == null) { + return attributes_.get(index); } else { + return attributesBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + public java.util.List + getAttributesOrBuilderList() { + if (attributesBuilder_ != null) { + return attributesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(attributes_); + } + } + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder addAttributesBuilder() { + return getAttributesFieldBuilder().addBuilder( + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.getDefaultInstance()); + } + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder addAttributesBuilder( + int index) { + return getAttributesFieldBuilder().addBuilder( + index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.getDefaultInstance()); + } + /** + * repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3; + */ + public java.util.List + getAttributesBuilderList() { + return getAttributesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder> + getAttributesFieldBuilder() { + if (attributesBuilder_ == null) { + attributesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder>( + attributes_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + attributes_ = null; + } + return attributesBuilder_; + } + + // repeated .org.opendaylight.controller.mdsal.Node child = 4; + private java.util.List child_ = + java.util.Collections.emptyList(); + private void ensureChildIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + child_ = new java.util.ArrayList(child_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder> childBuilder_; + + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + public java.util.List getChildList() { + if (childBuilder_ == null) { + return java.util.Collections.unmodifiableList(child_); + } else { + return childBuilder_.getMessageList(); + } + } + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + public int getChildCount() { + if (childBuilder_ == null) { + return child_.size(); + } else { + return childBuilder_.getCount(); + } + } + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getChild(int index) { + if (childBuilder_ == null) { + return child_.get(index); + } else { + return childBuilder_.getMessage(index); + } + } + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + public Builder setChild( + int index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node value) { + if (childBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChildIsMutable(); + child_.set(index, value); + onChanged(); + } else { + childBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + public Builder setChild( + int index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder builderForValue) { + if (childBuilder_ == null) { + ensureChildIsMutable(); + child_.set(index, builderForValue.build()); + onChanged(); + } else { + childBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + public Builder addChild(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node value) { + if (childBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChildIsMutable(); + child_.add(value); + onChanged(); + } else { + childBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + public Builder addChild( + int index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node value) { + if (childBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChildIsMutable(); + child_.add(index, value); + onChanged(); + } else { + childBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + public Builder addChild( + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder builderForValue) { + if (childBuilder_ == null) { + ensureChildIsMutable(); + child_.add(builderForValue.build()); + onChanged(); + } else { + childBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + public Builder addChild( + int index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder builderForValue) { + if (childBuilder_ == null) { + ensureChildIsMutable(); + child_.add(index, builderForValue.build()); + onChanged(); + } else { + childBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + public Builder addAllChild( + java.lang.Iterable values) { + if (childBuilder_ == null) { + ensureChildIsMutable(); + super.addAll(values, child_); + onChanged(); + } else { + childBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + public Builder clearChild() { + if (childBuilder_ == null) { + child_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + childBuilder_.clear(); + } + return this; + } + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + public Builder removeChild(int index) { + if (childBuilder_ == null) { + ensureChildIsMutable(); + child_.remove(index); + onChanged(); + } else { + childBuilder_.remove(index); + } + return this; + } + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder getChildBuilder( + int index) { + return getChildFieldBuilder().getBuilder(index); + } + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getChildOrBuilder( + int index) { + if (childBuilder_ == null) { + return child_.get(index); } else { + return childBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + public java.util.List + getChildOrBuilderList() { + if (childBuilder_ != null) { + return childBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(child_); + } + } + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder addChildBuilder() { + return getChildFieldBuilder().addBuilder( + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance()); + } + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder addChildBuilder( + int index) { + return getChildFieldBuilder().addBuilder( + index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance()); + } + /** + * repeated .org.opendaylight.controller.mdsal.Node child = 4; + */ + public java.util.List + getChildBuilderList() { + return getChildFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder> + getChildFieldBuilder() { + if (childBuilder_ == null) { + childBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder>( + child_, + ((bitField0_ & 0x00000008) == 0x00000008), + getParentForChildren(), + isClean()); + child_ = null; + } + return childBuilder_; + } + + // optional string value = 5; + private java.lang.Object value_ = ""; + /** + * optional string value = 5; + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional string value = 5; + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string value = 5; + */ + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string value = 5; + */ + public Builder setValue( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + value_ = value; + onChanged(); + return this; + } + /** + * optional string value = 5; + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000010); + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + /** + * optional string value = 5; + */ + public Builder setValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + value_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.Node) + } + + static { + defaultInstance = new Node(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.opendaylight.controller.mdsal.Node) + } + + public interface ContainerOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required string parentPath = 1; + /** + * required string parentPath = 1; + */ + boolean hasParentPath(); + /** + * required string parentPath = 1; + */ + java.lang.String getParentPath(); + /** + * required string parentPath = 1; + */ + com.google.protobuf.ByteString + getParentPathBytes(); + + // required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; + /** + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; + */ + boolean hasNormalizedNode(); + /** + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; + */ + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getNormalizedNode(); + /** + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; + */ + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getNormalizedNodeOrBuilder(); + } + /** + * Protobuf type {@code org.opendaylight.controller.mdsal.Container} + */ + public static final class Container extends + com.google.protobuf.GeneratedMessage + implements ContainerOrBuilder { + // Use Container.newBuilder() to construct. + private Container(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private Container(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final Container defaultInstance; + public static Container getDefaultInstance() { + return defaultInstance; + } + + public Container getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Container( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + parentPath_ = input.readBytes(); + break; + } + case 18: { + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = normalizedNode_.toBuilder(); + } + normalizedNode_ = input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(normalizedNode_); + normalizedNode_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_Container_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_Container_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container.class, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Container parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Container(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // required string parentPath = 1; + public static final int PARENTPATH_FIELD_NUMBER = 1; + private java.lang.Object parentPath_; + /** + * required string parentPath = 1; + */ + public boolean hasParentPath() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string parentPath = 1; + */ + public java.lang.String getParentPath() { + java.lang.Object ref = parentPath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + parentPath_ = s; + } + return s; + } + } + /** + * required string parentPath = 1; + */ + public com.google.protobuf.ByteString + getParentPathBytes() { + java.lang.Object ref = parentPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parentPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + // required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; + public static final int NORMALIZEDNODE_FIELD_NUMBER = 2; + private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node normalizedNode_; + /** + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; + */ + public boolean hasNormalizedNode() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; + */ + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getNormalizedNode() { + return normalizedNode_; + } + /** + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; + */ + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getNormalizedNodeOrBuilder() { + return normalizedNode_; + } + + private void initFields() { + parentPath_ = ""; + normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasParentPath()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasNormalizedNode()) { + memoizedIsInitialized = 0; + return false; + } + if (!getNormalizedNode().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, getParentPathBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(2, normalizedNode_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, getParentPathBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, normalizedNode_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.opendaylight.controller.mdsal.Container} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.ContainerOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_Container_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_Container_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container.class, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container.Builder.class); + } + + // Construct using org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getNormalizedNodeFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + parentPath_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + if (normalizedNodeBuilder_ == null) { + normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance(); + } else { + normalizedNodeBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_Container_descriptor; + } + + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container getDefaultInstanceForType() { + return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container.getDefaultInstance(); + } + + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container build() { + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container buildPartial() { + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container result = new org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.parentPath_ = parentPath_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + if (normalizedNodeBuilder_ == null) { + result.normalizedNode_ = normalizedNode_; + } else { + result.normalizedNode_ = normalizedNodeBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container) { + return mergeFrom((org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container other) { + if (other == org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container.getDefaultInstance()) return this; + if (other.hasParentPath()) { + bitField0_ |= 0x00000001; + parentPath_ = other.parentPath_; + onChanged(); + } + if (other.hasNormalizedNode()) { + mergeNormalizedNode(other.getNormalizedNode()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasParentPath()) { + + return false; + } + if (!hasNormalizedNode()) { + + return false; + } + if (!getNormalizedNode().isInitialized()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // required string parentPath = 1; + private java.lang.Object parentPath_ = ""; + /** + * required string parentPath = 1; + */ + public boolean hasParentPath() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string parentPath = 1; + */ + public java.lang.String getParentPath() { + java.lang.Object ref = parentPath_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + parentPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string parentPath = 1; + */ + public com.google.protobuf.ByteString + getParentPathBytes() { + java.lang.Object ref = parentPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parentPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string parentPath = 1; + */ + public Builder setParentPath( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + parentPath_ = value; + onChanged(); + return this; + } + /** + * required string parentPath = 1; + */ + public Builder clearParentPath() { + bitField0_ = (bitField0_ & ~0x00000001); + parentPath_ = getDefaultInstance().getParentPath(); + onChanged(); + return this; + } + /** + * required string parentPath = 1; + */ + public Builder setParentPathBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + parentPath_ = value; + onChanged(); + return this; + } + + // required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; + private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder< + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder> normalizedNodeBuilder_; + /** + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; + */ + public boolean hasNormalizedNode() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; + */ + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getNormalizedNode() { + if (normalizedNodeBuilder_ == null) { + return normalizedNode_; + } else { + return normalizedNodeBuilder_.getMessage(); + } + } + /** + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; + */ + public Builder setNormalizedNode(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node value) { + if (normalizedNodeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + normalizedNode_ = value; + onChanged(); + } else { + normalizedNodeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; + */ + public Builder setNormalizedNode( + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder builderForValue) { + if (normalizedNodeBuilder_ == null) { + normalizedNode_ = builderForValue.build(); + onChanged(); + } else { + normalizedNodeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; + */ + public Builder mergeNormalizedNode(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node value) { + if (normalizedNodeBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002) && + normalizedNode_ != org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance()) { + normalizedNode_ = + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.newBuilder(normalizedNode_).mergeFrom(value).buildPartial(); + } else { + normalizedNode_ = value; + } + onChanged(); + } else { + normalizedNodeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; + */ + public Builder clearNormalizedNode() { + if (normalizedNodeBuilder_ == null) { + normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance(); + onChanged(); + } else { + normalizedNodeBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + /** + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; + */ + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder getNormalizedNodeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getNormalizedNodeFieldBuilder().getBuilder(); + } + /** + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; + */ + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getNormalizedNodeOrBuilder() { + if (normalizedNodeBuilder_ != null) { + return normalizedNodeBuilder_.getMessageOrBuilder(); + } else { + return normalizedNode_; + } + } + /** + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder> + getNormalizedNodeFieldBuilder() { + if (normalizedNodeBuilder_ == null) { + normalizedNodeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder>( + normalizedNode_, + getParentForChildren(), + isClean()); + normalizedNode_ = null; + } + return normalizedNodeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.Container) + } + + static { + defaultInstance = new Container(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.opendaylight.controller.mdsal.Container) + } + + private static com.google.protobuf.Descriptors.Descriptor + internal_static_org_opendaylight_controller_mdsal_Attribute_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_org_opendaylight_controller_mdsal_Attribute_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_org_opendaylight_controller_mdsal_Node_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_org_opendaylight_controller_mdsal_Node_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_org_opendaylight_controller_mdsal_Container_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_org_opendaylight_controller_mdsal_Container_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\014Common.proto\022!org.opendaylight.control" + + "ler.mdsal\"(\n\tAttribute\022\014\n\004name\030\001 \002(\t\022\r\n\005" + + "value\030\002 \001(\t\"\253\001\n\004Node\022\014\n\004path\030\001 \002(\t\022\014\n\004ty" + + "pe\030\002 \001(\t\022@\n\nattributes\030\003 \003(\0132,.org.opend" + + "aylight.controller.mdsal.Attribute\0226\n\005ch" + + "ild\030\004 \003(\0132\'.org.opendaylight.controller." + + "mdsal.Node\022\r\n\005value\030\005 \001(\t\"`\n\tContainer\022\022" + + "\n\nparentPath\030\001 \002(\t\022?\n\016normalizedNode\030\002 \002" + + "(\0132\'.org.opendaylight.controller.mdsal.N" + + "odeBO\n5org.opendaylight.controller.proto", + "buff.messages.commonB\026NormalizedNodeMess" + + "ages" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + internal_static_org_opendaylight_controller_mdsal_Attribute_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_org_opendaylight_controller_mdsal_Attribute_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_org_opendaylight_controller_mdsal_Attribute_descriptor, + new java.lang.String[] { "Name", "Value", }); + internal_static_org_opendaylight_controller_mdsal_Node_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_org_opendaylight_controller_mdsal_Node_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_org_opendaylight_controller_mdsal_Node_descriptor, + new java.lang.String[] { "Path", "Type", "Attributes", "Child", "Value", }); + internal_static_org_opendaylight_controller_mdsal_Container_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_org_opendaylight_controller_mdsal_Container_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_org_opendaylight_controller_mdsal_Container_descriptor, + new java.lang.String[] { "ParentPath", "NormalizedNode", }); + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/datachange/notification/DataChangeListenerMessages.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/datachange/notification/DataChangeListenerMessages.java index 391107e2b7..5a9c14e8e9 100644 --- a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/datachange/notification/DataChangeListenerMessages.java +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/datachange/notification/DataChangeListenerMessages.java @@ -31,19 +31,19 @@ public final class DataChangeListenerMessages { com.google.protobuf.ByteString getInstanceIdentifierPathArgumentsBytes(int index); - // required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNodeXml = 2; + // required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNodeXml = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ - boolean hasNormalizedNodeXml(); + boolean hasNormalizedNode(); /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNodeXml = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ - org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml getNormalizedNodeXml(); + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getNormalizedNode(); /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNodeXml = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ - org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXmlOrBuilder getNormalizedNodeXmlOrBuilder(); + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getNormalizedNodeOrBuilder(); } /** * Protobuf type {@code org.opendaylight.controller.mdsal.DataChanged} @@ -105,14 +105,14 @@ public final class DataChangeListenerMessages { break; } case 18: { - org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.Builder subBuilder = null; + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder subBuilder = null; if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = normalizedNodeXml_.toBuilder(); + subBuilder = normalizedNode_.toBuilder(); } - normalizedNodeXml_ = input.readMessage(org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.PARSER, extensionRegistry); + normalizedNode_ = input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.PARSER, extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(normalizedNodeXml_); - normalizedNodeXml_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(normalizedNode_); + normalizedNode_ = subBuilder.buildPartial(); } bitField0_ |= 0x00000001; break; @@ -190,42 +190,42 @@ public final class DataChangeListenerMessages { return instanceIdentifierPathArguments_.getByteString(index); } - // required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNodeXml = 2; - public static final int NORMALIZEDNODEXML_FIELD_NUMBER = 2; - private org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml normalizedNodeXml_; + // required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; + public static final int NORMALIZEDNODE_FIELD_NUMBER = 2; + private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node normalizedNode_; /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNodeXml = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ - public boolean hasNormalizedNodeXml() { + public boolean hasNormalizedNode() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNodeXml = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ - public org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml getNormalizedNodeXml() { - return normalizedNodeXml_; + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getNormalizedNode() { + return normalizedNode_; } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNodeXml = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ - public org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXmlOrBuilder getNormalizedNodeXmlOrBuilder() { - return normalizedNodeXml_; + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getNormalizedNodeOrBuilder() { + return normalizedNode_; } private void initFields() { instanceIdentifierPathArguments_ = com.google.protobuf.LazyStringArrayList.EMPTY; - normalizedNodeXml_ = org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.getDefaultInstance(); + normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - if (!hasNormalizedNodeXml()) { + if (!hasNormalizedNode()) { memoizedIsInitialized = 0; return false; } - if (!getNormalizedNodeXml().isInitialized()) { + if (!getNormalizedNode().isInitialized()) { memoizedIsInitialized = 0; return false; } @@ -240,7 +240,7 @@ public final class DataChangeListenerMessages { output.writeBytes(1, instanceIdentifierPathArguments_.getByteString(i)); } if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(2, normalizedNodeXml_); + output.writeMessage(2, normalizedNode_); } getUnknownFields().writeTo(output); } @@ -262,7 +262,7 @@ public final class DataChangeListenerMessages { } if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, normalizedNodeXml_); + .computeMessageSize(2, normalizedNode_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; @@ -372,7 +372,7 @@ public final class DataChangeListenerMessages { } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getNormalizedNodeXmlFieldBuilder(); + getNormalizedNodeFieldBuilder(); } } private static Builder create() { @@ -383,10 +383,10 @@ public final class DataChangeListenerMessages { super.clear(); instanceIdentifierPathArguments_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000001); - if (normalizedNodeXmlBuilder_ == null) { - normalizedNodeXml_ = org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.getDefaultInstance(); + if (normalizedNodeBuilder_ == null) { + normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance(); } else { - normalizedNodeXmlBuilder_.clear(); + normalizedNodeBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000002); return this; @@ -426,10 +426,10 @@ public final class DataChangeListenerMessages { if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000001; } - if (normalizedNodeXmlBuilder_ == null) { - result.normalizedNodeXml_ = normalizedNodeXml_; + if (normalizedNodeBuilder_ == null) { + result.normalizedNode_ = normalizedNode_; } else { - result.normalizedNodeXml_ = normalizedNodeXmlBuilder_.build(); + result.normalizedNode_ = normalizedNodeBuilder_.build(); } result.bitField0_ = to_bitField0_; onBuilt(); @@ -457,19 +457,19 @@ public final class DataChangeListenerMessages { } onChanged(); } - if (other.hasNormalizedNodeXml()) { - mergeNormalizedNodeXml(other.getNormalizedNodeXml()); + if (other.hasNormalizedNode()) { + mergeNormalizedNode(other.getNormalizedNode()); } this.mergeUnknownFields(other.getUnknownFields()); return this; } public final boolean isInitialized() { - if (!hasNormalizedNodeXml()) { + if (!hasNormalizedNode()) { return false; } - if (!getNormalizedNodeXml().isInitialized()) { + if (!getNormalizedNode().isInitialized()) { return false; } @@ -588,121 +588,121 @@ public final class DataChangeListenerMessages { return this; } - // required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNodeXml = 2; - private org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml normalizedNodeXml_ = org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.getDefaultInstance(); + // required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; + private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< - org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml, org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.Builder, org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXmlOrBuilder> normalizedNodeXmlBuilder_; + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder> normalizedNodeBuilder_; /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNodeXml = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ - public boolean hasNormalizedNodeXml() { + public boolean hasNormalizedNode() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNodeXml = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ - public org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml getNormalizedNodeXml() { - if (normalizedNodeXmlBuilder_ == null) { - return normalizedNodeXml_; + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getNormalizedNode() { + if (normalizedNodeBuilder_ == null) { + return normalizedNode_; } else { - return normalizedNodeXmlBuilder_.getMessage(); + return normalizedNodeBuilder_.getMessage(); } } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNodeXml = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ - public Builder setNormalizedNodeXml(org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml value) { - if (normalizedNodeXmlBuilder_ == null) { + public Builder setNormalizedNode(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node value) { + if (normalizedNodeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - normalizedNodeXml_ = value; + normalizedNode_ = value; onChanged(); } else { - normalizedNodeXmlBuilder_.setMessage(value); + normalizedNodeBuilder_.setMessage(value); } bitField0_ |= 0x00000002; return this; } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNodeXml = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ - public Builder setNormalizedNodeXml( - org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.Builder builderForValue) { - if (normalizedNodeXmlBuilder_ == null) { - normalizedNodeXml_ = builderForValue.build(); + public Builder setNormalizedNode( + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder builderForValue) { + if (normalizedNodeBuilder_ == null) { + normalizedNode_ = builderForValue.build(); onChanged(); } else { - normalizedNodeXmlBuilder_.setMessage(builderForValue.build()); + normalizedNodeBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000002; return this; } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNodeXml = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ - public Builder mergeNormalizedNodeXml(org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml value) { - if (normalizedNodeXmlBuilder_ == null) { + public Builder mergeNormalizedNode(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node value) { + if (normalizedNodeBuilder_ == null) { if (((bitField0_ & 0x00000002) == 0x00000002) && - normalizedNodeXml_ != org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.getDefaultInstance()) { - normalizedNodeXml_ = - org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.newBuilder(normalizedNodeXml_).mergeFrom(value).buildPartial(); + normalizedNode_ != org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance()) { + normalizedNode_ = + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.newBuilder(normalizedNode_).mergeFrom(value).buildPartial(); } else { - normalizedNodeXml_ = value; + normalizedNode_ = value; } onChanged(); } else { - normalizedNodeXmlBuilder_.mergeFrom(value); + normalizedNodeBuilder_.mergeFrom(value); } bitField0_ |= 0x00000002; return this; } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNodeXml = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ - public Builder clearNormalizedNodeXml() { - if (normalizedNodeXmlBuilder_ == null) { - normalizedNodeXml_ = org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.getDefaultInstance(); + public Builder clearNormalizedNode() { + if (normalizedNodeBuilder_ == null) { + normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance(); onChanged(); } else { - normalizedNodeXmlBuilder_.clear(); + normalizedNodeBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000002); return this; } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNodeXml = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ - public org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.Builder getNormalizedNodeXmlBuilder() { + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder getNormalizedNodeBuilder() { bitField0_ |= 0x00000002; onChanged(); - return getNormalizedNodeXmlFieldBuilder().getBuilder(); + return getNormalizedNodeFieldBuilder().getBuilder(); } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNodeXml = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ - public org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXmlOrBuilder getNormalizedNodeXmlOrBuilder() { - if (normalizedNodeXmlBuilder_ != null) { - return normalizedNodeXmlBuilder_.getMessageOrBuilder(); + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getNormalizedNodeOrBuilder() { + if (normalizedNodeBuilder_ != null) { + return normalizedNodeBuilder_.getMessageOrBuilder(); } else { - return normalizedNodeXml_; + return normalizedNode_; } } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNodeXml = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ private com.google.protobuf.SingleFieldBuilder< - org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml, org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.Builder, org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXmlOrBuilder> - getNormalizedNodeXmlFieldBuilder() { - if (normalizedNodeXmlBuilder_ == null) { - normalizedNodeXmlBuilder_ = new com.google.protobuf.SingleFieldBuilder< - org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml, org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.Builder, org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXmlOrBuilder>( - normalizedNodeXml_, + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder> + getNormalizedNodeFieldBuilder() { + if (normalizedNodeBuilder_ == null) { + normalizedNodeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder>( + normalizedNode_, getParentForChildren(), isClean()); - normalizedNodeXml_ = null; + normalizedNode_ = null; } - return normalizedNodeXmlBuilder_; + return normalizedNodeBuilder_; } // @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.DataChanged) @@ -1045,14 +1045,13 @@ public final class DataChangeListenerMessages { static { java.lang.String[] descriptorData = { "\n\030DataChangeListener.proto\022!org.opendayl" + - "ight.controller.mdsal\032\032SimpleNormalizedN" + - "ode.proto\"\207\001\n\013DataChanged\022\'\n\037instanceIde" + - "ntifierPathArguments\030\001 \003(\t\022O\n\021normalized" + - "NodeXml\030\002 \002(\01324.org.opendaylight.control" + - "ler.mdsal.NormalizedNodeXml\"\022\n\020DataChang" + - "edReplyBd\nForg.opendaylight.controller.p" + - "rotobuff.messages.datachange.notificatio" + - "nB\032DataChangeListenerMessages" + "ight.controller.mdsal\032\014Common.proto\"w\n\013D" + + "ataChanged\022\'\n\037instanceIdentifierPathArgu" + + "ments\030\001 \003(\t\022?\n\016normalizedNode\030\002 \002(\0132\'.or" + + "g.opendaylight.controller.mdsal.Node\"\022\n\020" + + "DataChangedReplyBd\nForg.opendaylight.con" + + "troller.protobuff.messages.datachange.no" + + "tificationB\032DataChangeListenerMessages" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -1064,7 +1063,7 @@ public final class DataChangeListenerMessages { internal_static_org_opendaylight_controller_mdsal_DataChanged_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_org_opendaylight_controller_mdsal_DataChanged_descriptor, - new java.lang.String[] { "InstanceIdentifierPathArguments", "NormalizedNodeXml", }); + new java.lang.String[] { "InstanceIdentifierPathArguments", "NormalizedNode", }); internal_static_org_opendaylight_controller_mdsal_DataChangedReply_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_org_opendaylight_controller_mdsal_DataChangedReply_fieldAccessorTable = new @@ -1077,7 +1076,7 @@ public final class DataChangeListenerMessages { com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { - org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.getDescriptor(), + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.getDescriptor(), }, assigner); } diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/registration/ListenerRegistrationMessages.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/registration/ListenerRegistrationMessages.java index a1906b8ba5..8159452b68 100644 --- a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/registration/ListenerRegistrationMessages.java +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/registration/ListenerRegistrationMessages.java @@ -8,28 +8,28 @@ public final class ListenerRegistrationMessages { public static void registerAllExtensions( com.google.protobuf.ExtensionRegistry registry) { } - public interface CloseOrBuilder + public interface CloseDataChangeListenerRegistrationOrBuilder extends com.google.protobuf.MessageOrBuilder { } /** - * Protobuf type {@code org.opendaylight.controller.mdsal.Close} + * Protobuf type {@code org.opendaylight.controller.mdsal.CloseDataChangeListenerRegistration} */ - public static final class Close extends + public static final class CloseDataChangeListenerRegistration extends com.google.protobuf.GeneratedMessage - implements CloseOrBuilder { - // Use Close.newBuilder() to construct. - private Close(com.google.protobuf.GeneratedMessage.Builder builder) { + implements CloseDataChangeListenerRegistrationOrBuilder { + // Use CloseDataChangeListenerRegistration.newBuilder() to construct. + private CloseDataChangeListenerRegistration(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } - private Close(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private CloseDataChangeListenerRegistration(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - private static final Close defaultInstance; - public static Close getDefaultInstance() { + private static final CloseDataChangeListenerRegistration defaultInstance; + public static CloseDataChangeListenerRegistration getDefaultInstance() { return defaultInstance; } - public Close getDefaultInstanceForType() { + public CloseDataChangeListenerRegistration getDefaultInstanceForType() { return defaultInstance; } @@ -39,7 +39,7 @@ public final class ListenerRegistrationMessages { getUnknownFields() { return this.unknownFields; } - private Close( + private CloseDataChangeListenerRegistration( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -75,28 +75,28 @@ public final class ListenerRegistrationMessages { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.internal_static_org_opendaylight_controller_mdsal_Close_descriptor; + return org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.internal_static_org_opendaylight_controller_mdsal_CloseDataChangeListenerRegistration_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.internal_static_org_opendaylight_controller_mdsal_Close_fieldAccessorTable + return org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.internal_static_org_opendaylight_controller_mdsal_CloseDataChangeListenerRegistration_fieldAccessorTable .ensureFieldAccessorsInitialized( - org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close.class, org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close.Builder.class); + org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration.class, org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration.Builder.class); } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public Close parsePartialFrom( + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public CloseDataChangeListenerRegistration parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Close(input, extensionRegistry); + return new CloseDataChangeListenerRegistration(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @@ -135,53 +135,53 @@ public final class ListenerRegistrationMessages { return super.writeReplace(); } - public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close parseFrom( + public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close parseFrom( + public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close parseFrom(byte[] data) + public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close parseFrom( + public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close parseFrom(java.io.InputStream input) + public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close parseFrom( + public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close parseDelimitedFrom(java.io.InputStream input) + public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close parseDelimitedFrom( + public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close parseFrom( + public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close parseFrom( + public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -190,7 +190,7 @@ public final class ListenerRegistrationMessages { public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close prototype) { + public static Builder newBuilder(org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -202,24 +202,24 @@ public final class ListenerRegistrationMessages { return builder; } /** - * Protobuf type {@code org.opendaylight.controller.mdsal.Close} + * Protobuf type {@code org.opendaylight.controller.mdsal.CloseDataChangeListenerRegistration} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder - implements org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseOrBuilder { + implements org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.internal_static_org_opendaylight_controller_mdsal_Close_descriptor; + return org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.internal_static_org_opendaylight_controller_mdsal_CloseDataChangeListenerRegistration_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.internal_static_org_opendaylight_controller_mdsal_Close_fieldAccessorTable + return org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.internal_static_org_opendaylight_controller_mdsal_CloseDataChangeListenerRegistration_fieldAccessorTable .ensureFieldAccessorsInitialized( - org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close.class, org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close.Builder.class); + org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration.class, org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration.Builder.class); } - // Construct using org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close.newBuilder() + // Construct using org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -248,38 +248,38 @@ public final class ListenerRegistrationMessages { public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.internal_static_org_opendaylight_controller_mdsal_Close_descriptor; + return org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.internal_static_org_opendaylight_controller_mdsal_CloseDataChangeListenerRegistration_descriptor; } - public org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close getDefaultInstanceForType() { - return org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close.getDefaultInstance(); + public org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration getDefaultInstanceForType() { + return org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration.getDefaultInstance(); } - public org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close build() { - org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close result = buildPartial(); + public org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration build() { + org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close buildPartial() { - org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close result = new org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close(this); + public org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration buildPartial() { + org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration result = new org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration(this); onBuilt(); return result; } public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close) { - return mergeFrom((org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close)other); + if (other instanceof org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration) { + return mergeFrom((org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close other) { - if (other == org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close.getDefaultInstance()) return this; + public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration other) { + if (other == org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration.getDefaultInstance()) return this; this.mergeUnknownFields(other.getUnknownFields()); return this; } @@ -292,11 +292,11 @@ public final class ListenerRegistrationMessages { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close parsedMessage = null; + org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.Close) e.getUnfinishedMessage(); + parsedMessage = (org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistration) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -306,39 +306,39 @@ public final class ListenerRegistrationMessages { return this; } - // @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.Close) + // @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.CloseDataChangeListenerRegistration) } static { - defaultInstance = new Close(true); + defaultInstance = new CloseDataChangeListenerRegistration(true); defaultInstance.initFields(); } - // @@protoc_insertion_point(class_scope:org.opendaylight.controller.mdsal.Close) + // @@protoc_insertion_point(class_scope:org.opendaylight.controller.mdsal.CloseDataChangeListenerRegistration) } - public interface CloseReplyOrBuilder + public interface CloseDataChangeListenerRegistrationReplyOrBuilder extends com.google.protobuf.MessageOrBuilder { } /** - * Protobuf type {@code org.opendaylight.controller.mdsal.CloseReply} + * Protobuf type {@code org.opendaylight.controller.mdsal.CloseDataChangeListenerRegistrationReply} */ - public static final class CloseReply extends + public static final class CloseDataChangeListenerRegistrationReply extends com.google.protobuf.GeneratedMessage - implements CloseReplyOrBuilder { - // Use CloseReply.newBuilder() to construct. - private CloseReply(com.google.protobuf.GeneratedMessage.Builder builder) { + implements CloseDataChangeListenerRegistrationReplyOrBuilder { + // Use CloseDataChangeListenerRegistrationReply.newBuilder() to construct. + private CloseDataChangeListenerRegistrationReply(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } - private CloseReply(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private CloseDataChangeListenerRegistrationReply(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - private static final CloseReply defaultInstance; - public static CloseReply getDefaultInstance() { + private static final CloseDataChangeListenerRegistrationReply defaultInstance; + public static CloseDataChangeListenerRegistrationReply getDefaultInstance() { return defaultInstance; } - public CloseReply getDefaultInstanceForType() { + public CloseDataChangeListenerRegistrationReply getDefaultInstanceForType() { return defaultInstance; } @@ -348,7 +348,7 @@ public final class ListenerRegistrationMessages { getUnknownFields() { return this.unknownFields; } - private CloseReply( + private CloseDataChangeListenerRegistrationReply( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -384,28 +384,28 @@ public final class ListenerRegistrationMessages { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.internal_static_org_opendaylight_controller_mdsal_CloseReply_descriptor; + return org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.internal_static_org_opendaylight_controller_mdsal_CloseDataChangeListenerRegistrationReply_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.internal_static_org_opendaylight_controller_mdsal_CloseReply_fieldAccessorTable + return org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.internal_static_org_opendaylight_controller_mdsal_CloseDataChangeListenerRegistrationReply_fieldAccessorTable .ensureFieldAccessorsInitialized( - org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply.class, org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply.Builder.class); + org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply.class, org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply.Builder.class); } - public static com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public CloseReply parsePartialFrom( + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public CloseDataChangeListenerRegistrationReply parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new CloseReply(input, extensionRegistry); + return new CloseDataChangeListenerRegistrationReply(input, extensionRegistry); } }; @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @@ -444,53 +444,53 @@ public final class ListenerRegistrationMessages { return super.writeReplace(); } - public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply parseFrom( + public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply parseFrom( + public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply parseFrom(byte[] data) + public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply parseFrom( + public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply parseFrom(java.io.InputStream input) + public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply parseFrom( + public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply parseDelimitedFrom(java.io.InputStream input) + public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply parseDelimitedFrom( + public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply parseFrom( + public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply parseFrom( + public static org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -499,7 +499,7 @@ public final class ListenerRegistrationMessages { public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply prototype) { + public static Builder newBuilder(org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } @@ -511,24 +511,24 @@ public final class ListenerRegistrationMessages { return builder; } /** - * Protobuf type {@code org.opendaylight.controller.mdsal.CloseReply} + * Protobuf type {@code org.opendaylight.controller.mdsal.CloseDataChangeListenerRegistrationReply} */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder - implements org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReplyOrBuilder { + implements org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReplyOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.internal_static_org_opendaylight_controller_mdsal_CloseReply_descriptor; + return org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.internal_static_org_opendaylight_controller_mdsal_CloseDataChangeListenerRegistrationReply_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.internal_static_org_opendaylight_controller_mdsal_CloseReply_fieldAccessorTable + return org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.internal_static_org_opendaylight_controller_mdsal_CloseDataChangeListenerRegistrationReply_fieldAccessorTable .ensureFieldAccessorsInitialized( - org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply.class, org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply.Builder.class); + org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply.class, org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply.Builder.class); } - // Construct using org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply.newBuilder() + // Construct using org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -557,38 +557,38 @@ public final class ListenerRegistrationMessages { public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.internal_static_org_opendaylight_controller_mdsal_CloseReply_descriptor; + return org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.internal_static_org_opendaylight_controller_mdsal_CloseDataChangeListenerRegistrationReply_descriptor; } - public org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply getDefaultInstanceForType() { - return org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply.getDefaultInstance(); + public org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply getDefaultInstanceForType() { + return org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply.getDefaultInstance(); } - public org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply build() { - org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply result = buildPartial(); + public org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply build() { + org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply buildPartial() { - org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply result = new org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply(this); + public org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply buildPartial() { + org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply result = new org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply(this); onBuilt(); return result; } public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply) { - return mergeFrom((org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply)other); + if (other instanceof org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply) { + return mergeFrom((org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply other) { - if (other == org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply.getDefaultInstance()) return this; + public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply other) { + if (other == org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply.getDefaultInstance()) return this; this.mergeUnknownFields(other.getUnknownFields()); return this; } @@ -601,11 +601,11 @@ public final class ListenerRegistrationMessages { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply parsedMessage = null; + org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseReply) e.getUnfinishedMessage(); + parsedMessage = (org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -615,27 +615,27 @@ public final class ListenerRegistrationMessages { return this; } - // @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.CloseReply) + // @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.CloseDataChangeListenerRegistrationReply) } static { - defaultInstance = new CloseReply(true); + defaultInstance = new CloseDataChangeListenerRegistrationReply(true); defaultInstance.initFields(); } - // @@protoc_insertion_point(class_scope:org.opendaylight.controller.mdsal.CloseReply) + // @@protoc_insertion_point(class_scope:org.opendaylight.controller.mdsal.CloseDataChangeListenerRegistrationReply) } private static com.google.protobuf.Descriptors.Descriptor - internal_static_org_opendaylight_controller_mdsal_Close_descriptor; + internal_static_org_opendaylight_controller_mdsal_CloseDataChangeListenerRegistration_descriptor; private static com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_org_opendaylight_controller_mdsal_Close_fieldAccessorTable; + internal_static_org_opendaylight_controller_mdsal_CloseDataChangeListenerRegistration_fieldAccessorTable; private static com.google.protobuf.Descriptors.Descriptor - internal_static_org_opendaylight_controller_mdsal_CloseReply_descriptor; + internal_static_org_opendaylight_controller_mdsal_CloseDataChangeListenerRegistrationReply_descriptor; private static com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_org_opendaylight_controller_mdsal_CloseReply_fieldAccessorTable; + internal_static_org_opendaylight_controller_mdsal_CloseDataChangeListenerRegistrationReply_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -646,27 +646,28 @@ public final class ListenerRegistrationMessages { static { java.lang.String[] descriptorData = { "\n\032ListenerRegistration.proto\022!org.openda" + - "ylight.controller.mdsal\"\007\n\005Close\"\014\n\nClos" + - "eReplyB[\n;org.opendaylight.controller.pr" + - "otobuff.messages.registrationB\034ListenerR" + - "egistrationMessages" + "ylight.controller.mdsal\"%\n#CloseDataChan" + + "geListenerRegistration\"*\n(CloseDataChang" + + "eListenerRegistrationReplyB[\n;org.openda" + + "ylight.controller.protobuff.messages.reg" + + "istrationB\034ListenerRegistrationMessages" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { public com.google.protobuf.ExtensionRegistry assignDescriptors( com.google.protobuf.Descriptors.FileDescriptor root) { descriptor = root; - internal_static_org_opendaylight_controller_mdsal_Close_descriptor = + internal_static_org_opendaylight_controller_mdsal_CloseDataChangeListenerRegistration_descriptor = getDescriptor().getMessageTypes().get(0); - internal_static_org_opendaylight_controller_mdsal_Close_fieldAccessorTable = new + internal_static_org_opendaylight_controller_mdsal_CloseDataChangeListenerRegistration_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_org_opendaylight_controller_mdsal_Close_descriptor, + internal_static_org_opendaylight_controller_mdsal_CloseDataChangeListenerRegistration_descriptor, new java.lang.String[] { }); - internal_static_org_opendaylight_controller_mdsal_CloseReply_descriptor = + internal_static_org_opendaylight_controller_mdsal_CloseDataChangeListenerRegistrationReply_descriptor = getDescriptor().getMessageTypes().get(1); - internal_static_org_opendaylight_controller_mdsal_CloseReply_fieldAccessorTable = new + internal_static_org_opendaylight_controller_mdsal_CloseDataChangeListenerRegistrationReply_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_org_opendaylight_controller_mdsal_CloseReply_descriptor, + internal_static_org_opendaylight_controller_mdsal_CloseDataChangeListenerRegistrationReply_descriptor, new java.lang.String[] { }); return null; } diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/transaction/ShardTransactionMessages.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/transaction/ShardTransactionMessages.java index cabcf859da..e015958efd 100644 --- a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/transaction/ShardTransactionMessages.java +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/transaction/ShardTransactionMessages.java @@ -938,20 +938,35 @@ public final class ShardTransactionMessages { public interface CreateTransactionReplyOrBuilder extends com.google.protobuf.MessageOrBuilder { - // required string transactionPath = 1; + // required string transactionActorPath = 1; /** - * required string transactionPath = 1; + * required string transactionActorPath = 1; */ - boolean hasTransactionPath(); + boolean hasTransactionActorPath(); /** - * required string transactionPath = 1; + * required string transactionActorPath = 1; */ - java.lang.String getTransactionPath(); + java.lang.String getTransactionActorPath(); /** - * required string transactionPath = 1; + * required string transactionActorPath = 1; */ com.google.protobuf.ByteString - getTransactionPathBytes(); + getTransactionActorPathBytes(); + + // required string transactionId = 2; + /** + * required string transactionId = 2; + */ + boolean hasTransactionId(); + /** + * required string transactionId = 2; + */ + java.lang.String getTransactionId(); + /** + * required string transactionId = 2; + */ + com.google.protobuf.ByteString + getTransactionIdBytes(); } /** * Protobuf type {@code org.opendaylight.controller.mdsal.CreateTransactionReply} @@ -1006,7 +1021,12 @@ public final class ShardTransactionMessages { } case 10: { bitField0_ |= 0x00000001; - transactionPath_ = input.readBytes(); + transactionActorPath_ = input.readBytes(); + break; + } + case 18: { + bitField0_ |= 0x00000002; + transactionId_ = input.readBytes(); break; } } @@ -1049,20 +1069,20 @@ public final class ShardTransactionMessages { } private int bitField0_; - // required string transactionPath = 1; - public static final int TRANSACTIONPATH_FIELD_NUMBER = 1; - private java.lang.Object transactionPath_; + // required string transactionActorPath = 1; + public static final int TRANSACTIONACTORPATH_FIELD_NUMBER = 1; + private java.lang.Object transactionActorPath_; /** - * required string transactionPath = 1; + * required string transactionActorPath = 1; */ - public boolean hasTransactionPath() { + public boolean hasTransactionActorPath() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * required string transactionPath = 1; + * required string transactionActorPath = 1; */ - public java.lang.String getTransactionPath() { - java.lang.Object ref = transactionPath_; + public java.lang.String getTransactionActorPath() { + java.lang.Object ref = transactionActorPath_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { @@ -1070,22 +1090,65 @@ public final class ShardTransactionMessages { (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { - transactionPath_ = s; + transactionActorPath_ = s; } return s; } } /** - * required string transactionPath = 1; + * required string transactionActorPath = 1; */ public com.google.protobuf.ByteString - getTransactionPathBytes() { - java.lang.Object ref = transactionPath_; + getTransactionActorPathBytes() { + java.lang.Object ref = transactionActorPath_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); - transactionPath_ = b; + transactionActorPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + // required string transactionId = 2; + public static final int TRANSACTIONID_FIELD_NUMBER = 2; + private java.lang.Object transactionId_; + /** + * required string transactionId = 2; + */ + public boolean hasTransactionId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required string transactionId = 2; + */ + public java.lang.String getTransactionId() { + java.lang.Object ref = transactionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + transactionId_ = s; + } + return s; + } + } + /** + * required string transactionId = 2; + */ + public com.google.protobuf.ByteString + getTransactionIdBytes() { + java.lang.Object ref = transactionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + transactionId_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; @@ -1093,14 +1156,19 @@ public final class ShardTransactionMessages { } private void initFields() { - transactionPath_ = ""; + transactionActorPath_ = ""; + transactionId_ = ""; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - if (!hasTransactionPath()) { + if (!hasTransactionActorPath()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasTransactionId()) { memoizedIsInitialized = 0; return false; } @@ -1112,7 +1180,10 @@ public final class ShardTransactionMessages { throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getTransactionPathBytes()); + output.writeBytes(1, getTransactionActorPathBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getTransactionIdBytes()); } getUnknownFields().writeTo(output); } @@ -1125,7 +1196,11 @@ public final class ShardTransactionMessages { size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, getTransactionPathBytes()); + .computeBytesSize(1, getTransactionActorPathBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, getTransactionIdBytes()); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; @@ -1243,8 +1318,10 @@ public final class ShardTransactionMessages { public Builder clear() { super.clear(); - transactionPath_ = ""; + transactionActorPath_ = ""; bitField0_ = (bitField0_ & ~0x00000001); + transactionId_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); return this; } @@ -1276,7 +1353,11 @@ public final class ShardTransactionMessages { if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } - result.transactionPath_ = transactionPath_; + result.transactionActorPath_ = transactionActorPath_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.transactionId_ = transactionId_; result.bitField0_ = to_bitField0_; onBuilt(); return result; @@ -1293,9 +1374,14 @@ public final class ShardTransactionMessages { public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages.CreateTransactionReply other) { if (other == org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages.CreateTransactionReply.getDefaultInstance()) return this; - if (other.hasTransactionPath()) { + if (other.hasTransactionActorPath()) { bitField0_ |= 0x00000001; - transactionPath_ = other.transactionPath_; + transactionActorPath_ = other.transactionActorPath_; + onChanged(); + } + if (other.hasTransactionId()) { + bitField0_ |= 0x00000002; + transactionId_ = other.transactionId_; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -1303,7 +1389,11 @@ public final class ShardTransactionMessages { } public final boolean isInitialized() { - if (!hasTransactionPath()) { + if (!hasTransactionActorPath()) { + + return false; + } + if (!hasTransactionId()) { return false; } @@ -1329,76 +1419,150 @@ public final class ShardTransactionMessages { } private int bitField0_; - // required string transactionPath = 1; - private java.lang.Object transactionPath_ = ""; + // required string transactionActorPath = 1; + private java.lang.Object transactionActorPath_ = ""; /** - * required string transactionPath = 1; + * required string transactionActorPath = 1; */ - public boolean hasTransactionPath() { + public boolean hasTransactionActorPath() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * required string transactionPath = 1; + * required string transactionActorPath = 1; */ - public java.lang.String getTransactionPath() { - java.lang.Object ref = transactionPath_; + public java.lang.String getTransactionActorPath() { + java.lang.Object ref = transactionActorPath_; if (!(ref instanceof java.lang.String)) { java.lang.String s = ((com.google.protobuf.ByteString) ref) .toStringUtf8(); - transactionPath_ = s; + transactionActorPath_ = s; return s; } else { return (java.lang.String) ref; } } /** - * required string transactionPath = 1; + * required string transactionActorPath = 1; */ public com.google.protobuf.ByteString - getTransactionPathBytes() { - java.lang.Object ref = transactionPath_; + getTransactionActorPathBytes() { + java.lang.Object ref = transactionActorPath_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); - transactionPath_ = b; + transactionActorPath_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** - * required string transactionPath = 1; + * required string transactionActorPath = 1; */ - public Builder setTransactionPath( + public Builder setTransactionActorPath( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000001; - transactionPath_ = value; + transactionActorPath_ = value; onChanged(); return this; } /** - * required string transactionPath = 1; + * required string transactionActorPath = 1; */ - public Builder clearTransactionPath() { + public Builder clearTransactionActorPath() { bitField0_ = (bitField0_ & ~0x00000001); - transactionPath_ = getDefaultInstance().getTransactionPath(); + transactionActorPath_ = getDefaultInstance().getTransactionActorPath(); onChanged(); return this; } /** - * required string transactionPath = 1; + * required string transactionActorPath = 1; */ - public Builder setTransactionPathBytes( + public Builder setTransactionActorPathBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000001; - transactionPath_ = value; + transactionActorPath_ = value; + onChanged(); + return this; + } + + // required string transactionId = 2; + private java.lang.Object transactionId_ = ""; + /** + * required string transactionId = 2; + */ + public boolean hasTransactionId() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required string transactionId = 2; + */ + public java.lang.String getTransactionId() { + java.lang.Object ref = transactionId_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + transactionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * required string transactionId = 2; + */ + public com.google.protobuf.ByteString + getTransactionIdBytes() { + java.lang.Object ref = transactionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + transactionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string transactionId = 2; + */ + public Builder setTransactionId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + transactionId_ = value; + onChanged(); + return this; + } + /** + * required string transactionId = 2; + */ + public Builder clearTransactionId() { + bitField0_ = (bitField0_ & ~0x00000002); + transactionId_ = getDefaultInstance().getTransactionId(); + onChanged(); + return this; + } + /** + * required string transactionId = 2; + */ + public Builder setTransactionIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + transactionId_ = value; onChanged(); return this; } @@ -3490,19 +3654,19 @@ public final class ShardTransactionMessages { public interface ReadDataReplyOrBuilder extends com.google.protobuf.MessageOrBuilder { - // required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 1; + // required .org.opendaylight.controller.mdsal.Node normalizedNode = 1; /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 1; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 1; */ boolean hasNormalizedNode(); /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 1; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 1; */ - org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml getNormalizedNode(); + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getNormalizedNode(); /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 1; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 1; */ - org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXmlOrBuilder getNormalizedNodeOrBuilder(); + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getNormalizedNodeOrBuilder(); } /** * Protobuf type {@code org.opendaylight.controller.mdsal.ReadDataReply} @@ -3556,11 +3720,11 @@ public final class ShardTransactionMessages { break; } case 10: { - org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.Builder subBuilder = null; + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder subBuilder = null; if (((bitField0_ & 0x00000001) == 0x00000001)) { subBuilder = normalizedNode_.toBuilder(); } - normalizedNode_ = input.readMessage(org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.PARSER, extensionRegistry); + normalizedNode_ = input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(normalizedNode_); normalizedNode_ = subBuilder.buildPartial(); @@ -3608,30 +3772,30 @@ public final class ShardTransactionMessages { } private int bitField0_; - // required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 1; + // required .org.opendaylight.controller.mdsal.Node normalizedNode = 1; public static final int NORMALIZEDNODE_FIELD_NUMBER = 1; - private org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml normalizedNode_; + private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node normalizedNode_; /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 1; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 1; */ public boolean hasNormalizedNode() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 1; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 1; */ - public org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml getNormalizedNode() { + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getNormalizedNode() { return normalizedNode_; } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 1; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 1; */ - public org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXmlOrBuilder getNormalizedNodeOrBuilder() { + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getNormalizedNodeOrBuilder() { return normalizedNode_; } private void initFields() { - normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.getDefaultInstance(); + normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -3787,7 +3951,7 @@ public final class ShardTransactionMessages { public Builder clear() { super.clear(); if (normalizedNodeBuilder_ == null) { - normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.getDefaultInstance(); + normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance(); } else { normalizedNodeBuilder_.clear(); } @@ -3882,20 +4046,20 @@ public final class ShardTransactionMessages { } private int bitField0_; - // required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 1; - private org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.getDefaultInstance(); + // required .org.opendaylight.controller.mdsal.Node normalizedNode = 1; + private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< - org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml, org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.Builder, org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXmlOrBuilder> normalizedNodeBuilder_; + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder> normalizedNodeBuilder_; /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 1; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 1; */ public boolean hasNormalizedNode() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 1; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 1; */ - public org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml getNormalizedNode() { + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getNormalizedNode() { if (normalizedNodeBuilder_ == null) { return normalizedNode_; } else { @@ -3903,9 +4067,9 @@ public final class ShardTransactionMessages { } } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 1; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 1; */ - public Builder setNormalizedNode(org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml value) { + public Builder setNormalizedNode(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node value) { if (normalizedNodeBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3919,10 +4083,10 @@ public final class ShardTransactionMessages { return this; } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 1; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 1; */ public Builder setNormalizedNode( - org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.Builder builderForValue) { + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder builderForValue) { if (normalizedNodeBuilder_ == null) { normalizedNode_ = builderForValue.build(); onChanged(); @@ -3933,14 +4097,14 @@ public final class ShardTransactionMessages { return this; } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 1; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 1; */ - public Builder mergeNormalizedNode(org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml value) { + public Builder mergeNormalizedNode(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node value) { if (normalizedNodeBuilder_ == null) { if (((bitField0_ & 0x00000001) == 0x00000001) && - normalizedNode_ != org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.getDefaultInstance()) { + normalizedNode_ != org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance()) { normalizedNode_ = - org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.newBuilder(normalizedNode_).mergeFrom(value).buildPartial(); + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.newBuilder(normalizedNode_).mergeFrom(value).buildPartial(); } else { normalizedNode_ = value; } @@ -3952,11 +4116,11 @@ public final class ShardTransactionMessages { return this; } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 1; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 1; */ public Builder clearNormalizedNode() { if (normalizedNodeBuilder_ == null) { - normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.getDefaultInstance(); + normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance(); onChanged(); } else { normalizedNodeBuilder_.clear(); @@ -3965,17 +4129,17 @@ public final class ShardTransactionMessages { return this; } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 1; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 1; */ - public org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.Builder getNormalizedNodeBuilder() { + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder getNormalizedNodeBuilder() { bitField0_ |= 0x00000001; onChanged(); return getNormalizedNodeFieldBuilder().getBuilder(); } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 1; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 1; */ - public org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXmlOrBuilder getNormalizedNodeOrBuilder() { + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getNormalizedNodeOrBuilder() { if (normalizedNodeBuilder_ != null) { return normalizedNodeBuilder_.getMessageOrBuilder(); } else { @@ -3983,14 +4147,14 @@ public final class ShardTransactionMessages { } } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 1; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 1; */ private com.google.protobuf.SingleFieldBuilder< - org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml, org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.Builder, org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXmlOrBuilder> + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder> getNormalizedNodeFieldBuilder() { if (normalizedNodeBuilder_ == null) { normalizedNodeBuilder_ = new com.google.protobuf.SingleFieldBuilder< - org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml, org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.Builder, org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXmlOrBuilder>( + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder>( normalizedNode_, getParentForChildren(), isClean()); @@ -4033,19 +4197,19 @@ public final class ShardTransactionMessages { com.google.protobuf.ByteString getInstanceIdentifierPathArgumentsBytes(int index); - // required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 2; + // required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ boolean hasNormalizedNode(); /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ - org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml getNormalizedNode(); + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getNormalizedNode(); /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ - org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXmlOrBuilder getNormalizedNodeOrBuilder(); + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getNormalizedNodeOrBuilder(); } /** * Protobuf type {@code org.opendaylight.controller.mdsal.WriteData} @@ -4107,11 +4271,11 @@ public final class ShardTransactionMessages { break; } case 18: { - org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.Builder subBuilder = null; + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder subBuilder = null; if (((bitField0_ & 0x00000001) == 0x00000001)) { subBuilder = normalizedNode_.toBuilder(); } - normalizedNode_ = input.readMessage(org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.PARSER, extensionRegistry); + normalizedNode_ = input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.PARSER, extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(normalizedNode_); normalizedNode_ = subBuilder.buildPartial(); @@ -4192,31 +4356,31 @@ public final class ShardTransactionMessages { return instanceIdentifierPathArguments_.getByteString(index); } - // required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 2; + // required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; public static final int NORMALIZEDNODE_FIELD_NUMBER = 2; - private org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml normalizedNode_; + private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node normalizedNode_; /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ public boolean hasNormalizedNode() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ - public org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml getNormalizedNode() { + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getNormalizedNode() { return normalizedNode_; } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ - public org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXmlOrBuilder getNormalizedNodeOrBuilder() { + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getNormalizedNodeOrBuilder() { return normalizedNode_; } private void initFields() { instanceIdentifierPathArguments_ = com.google.protobuf.LazyStringArrayList.EMPTY; - normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.getDefaultInstance(); + normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -4386,7 +4550,7 @@ public final class ShardTransactionMessages { instanceIdentifierPathArguments_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000001); if (normalizedNodeBuilder_ == null) { - normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.getDefaultInstance(); + normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance(); } else { normalizedNodeBuilder_.clear(); } @@ -4590,20 +4754,20 @@ public final class ShardTransactionMessages { return this; } - // required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 2; - private org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.getDefaultInstance(); + // required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; + private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< - org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml, org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.Builder, org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXmlOrBuilder> normalizedNodeBuilder_; + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder> normalizedNodeBuilder_; /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ public boolean hasNormalizedNode() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ - public org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml getNormalizedNode() { + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getNormalizedNode() { if (normalizedNodeBuilder_ == null) { return normalizedNode_; } else { @@ -4611,9 +4775,9 @@ public final class ShardTransactionMessages { } } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ - public Builder setNormalizedNode(org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml value) { + public Builder setNormalizedNode(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node value) { if (normalizedNodeBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -4627,10 +4791,10 @@ public final class ShardTransactionMessages { return this; } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ public Builder setNormalizedNode( - org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.Builder builderForValue) { + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder builderForValue) { if (normalizedNodeBuilder_ == null) { normalizedNode_ = builderForValue.build(); onChanged(); @@ -4641,14 +4805,14 @@ public final class ShardTransactionMessages { return this; } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ - public Builder mergeNormalizedNode(org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml value) { + public Builder mergeNormalizedNode(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node value) { if (normalizedNodeBuilder_ == null) { if (((bitField0_ & 0x00000002) == 0x00000002) && - normalizedNode_ != org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.getDefaultInstance()) { + normalizedNode_ != org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance()) { normalizedNode_ = - org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.newBuilder(normalizedNode_).mergeFrom(value).buildPartial(); + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.newBuilder(normalizedNode_).mergeFrom(value).buildPartial(); } else { normalizedNode_ = value; } @@ -4660,11 +4824,11 @@ public final class ShardTransactionMessages { return this; } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ public Builder clearNormalizedNode() { if (normalizedNodeBuilder_ == null) { - normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.getDefaultInstance(); + normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance(); onChanged(); } else { normalizedNodeBuilder_.clear(); @@ -4673,17 +4837,17 @@ public final class ShardTransactionMessages { return this; } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ - public org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.Builder getNormalizedNodeBuilder() { + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder getNormalizedNodeBuilder() { bitField0_ |= 0x00000002; onChanged(); return getNormalizedNodeFieldBuilder().getBuilder(); } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ - public org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXmlOrBuilder getNormalizedNodeOrBuilder() { + public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getNormalizedNodeOrBuilder() { if (normalizedNodeBuilder_ != null) { return normalizedNodeBuilder_.getMessageOrBuilder(); } else { @@ -4691,14 +4855,14 @@ public final class ShardTransactionMessages { } } /** - * required .org.opendaylight.controller.mdsal.NormalizedNodeXml normalizedNode = 2; + * required .org.opendaylight.controller.mdsal.Node normalizedNode = 2; */ private com.google.protobuf.SingleFieldBuilder< - org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml, org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.Builder, org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXmlOrBuilder> + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder> getNormalizedNodeFieldBuilder() { if (normalizedNodeBuilder_ == null) { normalizedNodeBuilder_ = new com.google.protobuf.SingleFieldBuilder< - org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml, org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXml.Builder, org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.NormalizedNodeXmlOrBuilder>( + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder>( normalizedNode_, getParentForChildren(), isClean()); @@ -5097,24 +5261,23 @@ public final class ShardTransactionMessages { static { java.lang.String[] descriptorData = { "\n\026ShardTransaction.proto\022!org.opendaylig" + - "ht.controller.mdsal\032\032SimpleNormalizedNod" + - "e.proto\"\022\n\020CloseTransaction\"\027\n\025CloseTran" + - "sactionReply\"\023\n\021CreateTransaction\"1\n\026Cre" + - "ateTransactionReply\022\027\n\017transactionPath\030\001" + - " \002(\t\"\022\n\020ReadyTransaction\"*\n\025ReadyTransac" + - "tionReply\022\021\n\tactorPath\030\001 \002(\t\"5\n\nDeleteDa" + - "ta\022\'\n\037instanceIdentifierPathArguments\030\001 " + - "\003(\t\"\021\n\017DeleteDataReply\"3\n\010ReadData\022\'\n\037in" + - "stanceIdentifierPathArguments\030\001 \002(\t\"]\n\rR", - "eadDataReply\022L\n\016normalizedNode\030\001 \002(\01324.o" + - "rg.opendaylight.controller.mdsal.Normali" + - "zedNodeXml\"\202\001\n\tWriteData\022\'\n\037instanceIden" + - "tifierPathArguments\030\001 \003(\t\022L\n\016normalizedN" + - "ode\030\002 \002(\01324.org.opendaylight.controller." + - "mdsal.NormalizedNodeXml\"\020\n\016WriteDataRepl" + - "yBV\n:org.opendaylight.controller.protobu" + - "ff.messages.transactionB\030ShardTransactio" + - "nMessages" + "ht.controller.mdsal\032\014Common.proto\"\022\n\020Clo" + + "seTransaction\"\027\n\025CloseTransactionReply\"\023" + + "\n\021CreateTransaction\"M\n\026CreateTransaction" + + "Reply\022\034\n\024transactionActorPath\030\001 \002(\t\022\025\n\rt" + + "ransactionId\030\002 \002(\t\"\022\n\020ReadyTransaction\"*" + + "\n\025ReadyTransactionReply\022\021\n\tactorPath\030\001 \002" + + "(\t\"5\n\nDeleteData\022\'\n\037instanceIdentifierPa" + + "thArguments\030\001 \003(\t\"\021\n\017DeleteDataReply\"3\n\010" + + "ReadData\022\'\n\037instanceIdentifierPathArgume", + "nts\030\001 \002(\t\"P\n\rReadDataReply\022?\n\016normalized" + + "Node\030\001 \002(\0132\'.org.opendaylight.controller" + + ".mdsal.Node\"u\n\tWriteData\022\'\n\037instanceIden" + + "tifierPathArguments\030\001 \003(\t\022?\n\016normalizedN" + + "ode\030\002 \002(\0132\'.org.opendaylight.controller." + + "mdsal.Node\"\020\n\016WriteDataReplyBV\n:org.open" + + "daylight.controller.protobuff.messages.t" + + "ransactionB\030ShardTransactionMessages" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -5144,7 +5307,7 @@ public final class ShardTransactionMessages { internal_static_org_opendaylight_controller_mdsal_CreateTransactionReply_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_org_opendaylight_controller_mdsal_CreateTransactionReply_descriptor, - new java.lang.String[] { "TransactionPath", }); + new java.lang.String[] { "TransactionActorPath", "TransactionId", }); internal_static_org_opendaylight_controller_mdsal_ReadyTransaction_descriptor = getDescriptor().getMessageTypes().get(4); internal_static_org_opendaylight_controller_mdsal_ReadyTransaction_fieldAccessorTable = new @@ -5199,7 +5362,7 @@ public final class ShardTransactionMessages { com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { - org.opendaylight.controller.protobuff.messages.common.SimpleNormalizedNodeMessage.getDescriptor(), + org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.getDescriptor(), }, assigner); } diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/resources/Cohort.proto b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/resources/Cohort.proto new file mode 100644 index 0000000000..dab64131e6 --- /dev/null +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/resources/Cohort.proto @@ -0,0 +1,37 @@ +package org.opendaylight.controller.mdsal; + +option java_package = "org.opendaylight.controller.protobuff.messages.cohort3pc"; +option java_outer_classname = "ThreePhaseCommitCohortMessages"; + + +message CanCommitTransaction{ + +} + +message CanCommitTransactionReply{ + required bool canCommit = 1; + +} + +message AbortTransaction{ + +} + +message AbortTransactionReply { + +} + +message CommitTransaction{ + +} + +message CommitTransactionReply{ + +} + +message PreCommitTransaction{ + +} +message PreCommitTransactionReply{ + +} \ No newline at end of file diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/resources/Common.proto b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/resources/Common.proto new file mode 100644 index 0000000000..657e5060c3 --- /dev/null +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/resources/Common.proto @@ -0,0 +1,23 @@ +package org.opendaylight.controller.mdsal; + +option java_package = "org.opendaylight.controller.protobuff.messages.common"; +option java_outer_classname = "NormalizedNodeMessages"; + + +message Attribute{ + required string name =1; + optional string value=2; +} + +message Node{ + required string path = 1; + optional string type = 2; + repeated Attribute attributes = 3; + repeated Node child=4; + optional string value = 5; +} + +message Container{ + required string parentPath =1 ; + required Node normalizedNode=2; +} \ No newline at end of file diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/resources/DataChangeListener.proto b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/resources/DataChangeListener.proto index f50c36f684..3c1c881796 100644 --- a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/resources/DataChangeListener.proto +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/resources/DataChangeListener.proto @@ -1,13 +1,13 @@ package org.opendaylight.controller.mdsal; -import "SimpleNormalizedNode.proto"; +import "Common.proto"; option java_package = "org.opendaylight.controller.protobuff.messages.datachange.notification"; option java_outer_classname = "DataChangeListenerMessages"; message DataChanged{ repeated string instanceIdentifierPathArguments =1 ; - required NormalizedNodeXml normalizedNodeXml = 2; + required Node normalizedNode = 2; } message DataChangedReply{ diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/resources/ListenerRegistration.proto b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/resources/ListenerRegistration.proto index 27f3c232e7..3efe05d31e 100644 --- a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/resources/ListenerRegistration.proto +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/resources/ListenerRegistration.proto @@ -3,11 +3,11 @@ package org.opendaylight.controller.mdsal; option java_package = "org.opendaylight.controller.protobuff.messages.registration"; option java_outer_classname = "ListenerRegistrationMessages"; -message Close { +message CloseDataChangeListenerRegistration { } -message CloseReply{ +message CloseDataChangeListenerRegistrationReply{ } diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/resources/ShardTransaction.proto b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/resources/ShardTransaction.proto index 120913eb66..6d58148853 100644 --- a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/resources/ShardTransaction.proto +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/resources/ShardTransaction.proto @@ -1,5 +1,7 @@ package org.opendaylight.controller.mdsal; -import "SimpleNormalizedNode.proto"; + +import "Common.proto"; + option java_package = "org.opendaylight.controller.protobuff.messages.transaction"; option java_outer_classname = "ShardTransactionMessages"; @@ -15,7 +17,8 @@ message CreateTransaction{ } message CreateTransactionReply{ -required string transactionPath = 1; +required string transactionActorPath = 1; +required string transactionId = 2; } @@ -39,12 +42,12 @@ required string instanceIdentifierPathArguments=1; } message ReadDataReply{ - required NormalizedNodeXml normalizedNode=1; + required Node normalizedNode=1; } message WriteData { repeated string instanceIdentifierPathArguments = 1; -required NormalizedNodeXml normalizedNode =2; +required Node normalizedNode =2; } diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/cluster/datastore/node/NormalizedNodeToNodeCodecTest.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/cluster/datastore/node/NormalizedNodeToNodeCodecTest.java new file mode 100644 index 0000000000..9aea7a6571 --- /dev/null +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/cluster/datastore/node/NormalizedNodeToNodeCodecTest.java @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ + +package org.opendaylight.controller.cluster.datastore.node; + +import junit.framework.Assert; +import org.junit.Before; +import org.junit.Test; +import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container; +import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node; +import org.opendaylight.controller.cluster.datastore.node.utils.NodeIdentifierFactory; +import org.opendaylight.controller.cluster.datastore.node.utils.NormalizedNodeGetter; +import org.opendaylight.controller.cluster.datastore.node.utils.NormalizedNodeNavigator; +import org.opendaylight.controller.cluster.datastore.util.TestModel; +import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; +import org.opendaylight.yangtools.yang.model.api.SchemaContext; + +import java.util.ArrayList; +import java.util.List; + +import static junit.framework.Assert.assertEquals; +import static junit.framework.Assert.assertNotNull; + +public class NormalizedNodeToNodeCodecTest { + + + + private SchemaContext schemaContext; + + @Before + public void setUp(){ + schemaContext = TestModel.createTestContext(); + assertNotNull("Schema context must not be null.", schemaContext); + } + + private InstanceIdentifier instanceIdentifierFromString(String s){ + + String[] ids = s.split("/"); + + List pathArguments = new ArrayList<>(); + for(String nodeId : ids){ + if(!"".equals(nodeId)) { + pathArguments.add(NodeIdentifierFactory.getArgument(nodeId)); + } + } + final InstanceIdentifier instanceIdentifier = InstanceIdentifier.create(pathArguments); + return instanceIdentifier; + } + + + @Test + public void testNormalizeNodeAttributesToProtoBuffNode(){ + final NormalizedNode documentOne = TestModel.createTestContainer(); + String id = "/(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)test/(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)outer-list/(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)outer-list[{(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)id=2}]/(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)id"; + + NormalizedNodeGetter normalizedNodeGetter = new NormalizedNodeGetter(id); + new NormalizedNodeNavigator(normalizedNodeGetter).navigate( + InstanceIdentifier.builder().build().toString(), documentOne); + + // Validate the value of id can be retrieved from the normalized node + NormalizedNode output = normalizedNodeGetter.getOutput(); + assertNotNull(output); + + + NormalizedNodeToNodeCodec codec = new NormalizedNodeToNodeCodec(schemaContext); + Container container = codec.encode(instanceIdentifierFromString(id),output); + + assertNotNull(container); + assertEquals(id, container.getParentPath()+"/"+container.getNormalizedNode().getPath()) ; + + // Decode the normalized node from the ProtocolBuffer form + //first get the node representation of normalized node + final Node node = container.getNormalizedNode(); + + NormalizedNode normalizedNode = codec.decode(instanceIdentifierFromString(id),node); + + assertEquals(normalizedNode.getValue().toString(),output.getValue().toString()); + } + + @Test + public void testThatANormalizedNodeToProtoBuffNodeEncodeDecode() throws Exception { + final NormalizedNode documentOne = TestModel.createTestContainer(); + + + final NormalizedNodeToNodeCodec normalizedNodeToNodeCodec = new NormalizedNodeToNodeCodec(schemaContext); + + Container container = normalizedNodeToNodeCodec.encode(InstanceIdentifier.builder().build(), documentOne); + + + final NormalizedNode decode = normalizedNodeToNodeCodec.decode(instanceIdentifierFromString("/(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)test"),container.getNormalizedNode()); + assertNotNull(decode != null); + + //let us ensure that the return decode normalized node encode returns same container + Container containerResult = normalizedNodeToNodeCodec.encode(InstanceIdentifier.builder().build(), decode); + + assertEquals(container.getParentPath(),containerResult.getParentPath()); + assertEquals(container.getNormalizedNode().getChildCount(),container.getNormalizedNode().getChildCount()); + + Assert.assertEquals(containerResult.getNormalizedNode().getChildCount(),container.getNormalizedNode().getChildCount()); + + //check first level children are proper + ListchildrenResult = containerResult.getNormalizedNode().getChildList(); + ListchildrenOriginal = container.getNormalizedNode().getChildList(); + boolean bFound; + for(Node resultChild: childrenResult){ + bFound = false; + for(Node originalChild:childrenOriginal){ + if(originalChild.getPath().equals(resultChild.getPath()) + && resultChild.getType().equals(resultChild.getType())){ + bFound=true; + break; + } + } + Assert.assertTrue(bFound); + } + + + } + +} diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/cluster/datastore/node/NormalizedNodeToProtocolBufferNodeTest.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/cluster/datastore/node/NormalizedNodeToProtocolBufferNodeTest.java new file mode 100644 index 0000000000..69d0ac7fcc --- /dev/null +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/cluster/datastore/node/NormalizedNodeToProtocolBufferNodeTest.java @@ -0,0 +1,65 @@ +package org.opendaylight.controller.cluster.datastore.node; + + +import com.google.common.collect.Lists; +import org.junit.Assert; +import org.junit.Test; +import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages; +import org.opendaylight.controller.cluster.datastore.util.NormalizedNodeXmlConverterTest; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; + +import java.util.Iterator; + +/** + * @author: syedbahm + * Date: 7/2/14 + */ +public class NormalizedNodeToProtocolBufferNodeTest { + + private String instanceIdentifierToString(InstanceIdentifier id){ + Iterable iterable = id.getPathArguments(); + Iterator iterator = iterable.iterator(); + String path=""; + while (iterator.hasNext()) { + path += "/"+iterator.next().toString(); + + } + return path; + } + @Test + public void testNormalizedNodeToNodeSerialization (){ + NormalizedNode nn = NormalizedNodeXmlConverterTest.augmentChoiceExpectedNode(); + InstanceIdentifier id = InstanceIdentifier.create( + Lists.newArrayList(NormalizedNodeXmlConverterTest.getNodeIdentifier("container"))); + + NormalizedNodeToProtocolBufferNode nnn = new NormalizedNodeToProtocolBufferNode(); + nnn.encode(instanceIdentifierToString(id), nn); + NormalizedNodeMessages.Node node = nnn.getContainer().getNormalizedNode(); + Assert.assertTrue(node.getChildCount()>0); + } + + @Test + public void testNormalizedNodeToNodeSerializationChoiceNode() { + QName CH2_QNAME = QName.create("urn:opendaylight:params:xml:ns:yang:controller:test", "2014-03-13", "ch2"); + NormalizedNode + choice = NormalizedNodeXmlConverterTest.augmentChoiceExpectedNode() + .getChild(new InstanceIdentifier.NodeIdentifier(CH2_QNAME)) + .get(); + + InstanceIdentifier id = InstanceIdentifier.create( + Lists.newArrayList(NormalizedNodeXmlConverterTest.getNodeIdentifier("ch2"))); + + NormalizedNodeToProtocolBufferNode nnn = new NormalizedNodeToProtocolBufferNode(); + nnn.encode(instanceIdentifierToString(id), choice); + + NormalizedNodeMessages.Node node = nnn.getContainer().getNormalizedNode(); + + Assert.assertTrue(node.getChildCount()==2); + + + + } + +} diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/cluster/datastore/util/NormalizedNodeXmlConverterTest.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/cluster/datastore/util/NormalizedNodeXmlConverterTest.java index 8d609823a7..d53e91a262 100644 --- a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/cluster/datastore/util/NormalizedNodeXmlConverterTest.java +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/cluster/datastore/util/NormalizedNodeXmlConverterTest.java @@ -7,31 +7,10 @@ */ package org.opendaylight.controller.cluster.datastore.util; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.StringWriter; -import java.net.URI; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.TransformerFactoryConfigurationError; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; import org.custommonkey.xmlunit.Diff; import org.custommonkey.xmlunit.XMLUnit; import org.junit.Test; @@ -65,10 +44,30 @@ import org.w3c.dom.Document; import org.w3c.dom.Element; import org.xml.sax.SAXException; -import com.google.common.base.Preconditions; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; -import com.google.common.collect.Sets; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.TransformerFactoryConfigurationError; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringWriter; +import java.net.URI; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Set; /** @@ -81,423 +80,403 @@ import com.google.common.collect.Sets; public class NormalizedNodeXmlConverterTest { - private static final Logger logger = LoggerFactory - .getLogger(NormalizedNodeXmlConverterTest.class); - public static final String NAMESPACE = - "urn:opendaylight:params:xml:ns:yang:controller:test"; - private static Date revision; - private ContainerNode expectedNode; - private ContainerSchemaNode containerNode; - private String xmlPath; - - static { - try { - revision = new SimpleDateFormat("yyyy-MM-dd").parse("2014-03-13"); - } catch (ParseException e) { - throw new RuntimeException(e); - } - } - - public static DataSchemaNode getSchemaNode(final SchemaContext context, - final String moduleName, final String childNodeName) { - for (Module module : context.getModules()) { - if (module.getName().equals(moduleName)) { - DataSchemaNode found = - findChildNode(module.getChildNodes(), childNodeName); - Preconditions.checkState(found != null, "Unable to find %s", - childNodeName); - return found; - } + private static final Logger logger = LoggerFactory + .getLogger(NormalizedNodeXmlConverterTest.class); + public static final String NAMESPACE = + "urn:opendaylight:params:xml:ns:yang:controller:test"; + private static Date revision; + private ContainerNode expectedNode; + private ContainerSchemaNode containerNode; + private String xmlPath; + + static { + try { + revision = new SimpleDateFormat("yyyy-MM-dd").parse("2014-03-13"); + } catch (ParseException e) { + throw new RuntimeException(e); + } } - throw new IllegalStateException("Unable to find child node " - + childNodeName); - } - static DataSchemaNode findChildNode(final Iterable children, final String name) { - List containers = Lists.newArrayList(); + public static DataSchemaNode getSchemaNode(final SchemaContext context, + final String moduleName, final String childNodeName) { + for (Module module : context.getModules()) { + if (module.getName().equals(moduleName)) { + DataSchemaNode found = + findChildNode(module.getChildNodes(), childNodeName); + Preconditions.checkState(found != null, "Unable to find %s", + childNodeName); + return found; + } + } + throw new IllegalStateException("Unable to find child node " + + childNodeName); + } - for (DataSchemaNode dataSchemaNode : children) { - if (dataSchemaNode.getQName().getLocalName().equals(name)) { - return dataSchemaNode; + static DataSchemaNode findChildNode(final Collection children, final String name) { + List containers = Lists.newArrayList(); + + for (DataSchemaNode dataSchemaNode : children) { + if (dataSchemaNode.getQName().getLocalName().equals(name)) { + return dataSchemaNode; + } + if (dataSchemaNode instanceof DataNodeContainer) { + containers.add((DataNodeContainer) dataSchemaNode); + } else if (dataSchemaNode instanceof ChoiceNode) { + containers.addAll(((ChoiceNode) dataSchemaNode).getCases()); + } + } + + for (DataNodeContainer container : containers) { + DataSchemaNode retVal = findChildNode(container.getChildNodes(), name); + if (retVal != null) { + return retVal; + } + } + + return null; } - if (dataSchemaNode instanceof DataNodeContainer) { - containers.add((DataNodeContainer) dataSchemaNode); - } else if (dataSchemaNode instanceof ChoiceNode) { - containers.addAll(((ChoiceNode) dataSchemaNode).getCases()); - } + + public static InstanceIdentifier.NodeIdentifier getNodeIdentifier( + final String localName) { + return new InstanceIdentifier.NodeIdentifier(QName.create( + URI.create(NAMESPACE), revision, localName)); } - for (DataNodeContainer container : containers) { - DataSchemaNode retVal = findChildNode(container.getChildNodes(), name); - if (retVal != null) { - return retVal; - } + public static InstanceIdentifier.AugmentationIdentifier getAugmentIdentifier( + final String... childNames) { + Set qn = Sets.newHashSet(); + + for (String childName : childNames) { + qn.add(getNodeIdentifier(childName).getNodeType()); + } + + return new InstanceIdentifier.AugmentationIdentifier(qn); } - return null; - } - private static InstanceIdentifier.NodeIdentifier getNodeIdentifier( - final String localName) { - return new InstanceIdentifier.NodeIdentifier(QName.create( - URI.create(NAMESPACE), revision, localName)); - } + public static ContainerNode augmentChoiceExpectedNode() { + + DataContainerNodeBuilder b = + Builders.containerBuilder(); + b.withNodeIdentifier(getNodeIdentifier("container")); + + b.withChild(Builders + .choiceBuilder() + .withNodeIdentifier(getNodeIdentifier("ch2")) + .withChild( + Builders.leafBuilder() + .withNodeIdentifier(getNodeIdentifier("c2Leaf")).withValue("2") + .build()) + .withChild( + Builders + .choiceBuilder() + .withNodeIdentifier(getNodeIdentifier("c2DeepChoice")) + .withChild( + Builders + .leafBuilder() + .withNodeIdentifier( + getNodeIdentifier("c2DeepChoiceCase1Leaf2")) + .withValue("2").build()).build()).build()); + + b.withChild(Builders + .choiceBuilder() + .withNodeIdentifier(getNodeIdentifier("ch3")) + .withChild( + Builders.leafBuilder() + .withNodeIdentifier(getNodeIdentifier("c3Leaf")).withValue("3") + .build()).build()); + + b.withChild(Builders + .augmentationBuilder() + .withNodeIdentifier(getAugmentIdentifier("augLeaf")) + .withChild( + Builders.leafBuilder() + .withNodeIdentifier(getNodeIdentifier("augLeaf")) + .withValue("augment").build()).build()); + + b.withChild(Builders + .augmentationBuilder() + .withNodeIdentifier(getAugmentIdentifier("ch")) + .withChild( + Builders + .choiceBuilder() + .withNodeIdentifier(getNodeIdentifier("ch")) + .withChild( + Builders.leafBuilder() + .withNodeIdentifier(getNodeIdentifier("c1Leaf")) + .withValue("1").build()) + .withChild( + Builders + .augmentationBuilder() + .withNodeIdentifier( + getAugmentIdentifier("c1Leaf_AnotherAugment", + "deepChoice")) + .withChild( + Builders + .leafBuilder() + .withNodeIdentifier( + getNodeIdentifier("c1Leaf_AnotherAugment")) + .withValue("1").build()) + .withChild( + Builders + .choiceBuilder() + .withNodeIdentifier( + getNodeIdentifier("deepChoice")) + .withChild( + Builders + .leafBuilder() + .withNodeIdentifier( + getNodeIdentifier("deepLeafc1")) + .withValue("1").build()).build()) + .build()).build()).build()); + + return b.build(); + } - public static InstanceIdentifier.AugmentationIdentifier getAugmentIdentifier( - final String... childNames) { - Set qn = Sets.newHashSet(); - for (String childName : childNames) { - qn.add(getNodeIdentifier(childName).getNodeType()); + + public void init(final String yangPath, final String xmlPath, final ContainerNode expectedNode) + throws Exception { + SchemaContext schema = parseTestSchema(yangPath); + this.xmlPath = xmlPath; + this.containerNode = + (ContainerSchemaNode) getSchemaNode(schema, "test", "container"); + this.expectedNode = expectedNode; } - return new InstanceIdentifier.AugmentationIdentifier(qn); - } - - - private static ContainerNode augmentChoiceExpectedNode() { - - DataContainerNodeBuilder b = - Builders.containerBuilder(); - b.withNodeIdentifier(getNodeIdentifier("container")); - - b.withChild(Builders - .choiceBuilder() - .withNodeIdentifier(getNodeIdentifier("ch2")) - .withChild( - Builders.leafBuilder() - .withNodeIdentifier(getNodeIdentifier("c2Leaf")).withValue("2") - .build()) - .withChild( - Builders - .choiceBuilder() - .withNodeIdentifier(getNodeIdentifier("c2DeepChoice")) - .withChild( - Builders - .leafBuilder() - .withNodeIdentifier( - getNodeIdentifier("c2DeepChoiceCase1Leaf2")) - .withValue("2").build()).build()).build()); - - b.withChild(Builders - .choiceBuilder() - .withNodeIdentifier(getNodeIdentifier("ch3")) - .withChild( - Builders.leafBuilder() - .withNodeIdentifier(getNodeIdentifier("c3Leaf")).withValue("3") - .build()).build()); - - b.withChild(Builders - .augmentationBuilder() - .withNodeIdentifier(getAugmentIdentifier("augLeaf")) - .withChild( - Builders.leafBuilder() - .withNodeIdentifier(getNodeIdentifier("augLeaf")) - .withValue("augment").build()).build()); - - b.withChild(Builders - .augmentationBuilder() - .withNodeIdentifier(getAugmentIdentifier("ch")) - .withChild( - Builders - .choiceBuilder() - .withNodeIdentifier(getNodeIdentifier("ch")) - .withChild( - Builders.leafBuilder() - .withNodeIdentifier(getNodeIdentifier("c1Leaf")) - .withValue("1").build()) - .withChild( - Builders - .augmentationBuilder() - .withNodeIdentifier( - getAugmentIdentifier("c1Leaf_AnotherAugment", - "deepChoice")) - .withChild( - Builders - .leafBuilder() - .withNodeIdentifier( - getNodeIdentifier("c1Leaf_AnotherAugment")) - .withValue("1").build()) - .withChild( - Builders - .choiceBuilder() - .withNodeIdentifier( - getNodeIdentifier("deepChoice")) - .withChild( - Builders - .leafBuilder() - .withNodeIdentifier( - getNodeIdentifier("deepLeafc1")) - .withValue("1").build()).build()) - .build()).build()).build()); - - return b.build(); - } - - - - public void init(final String yangPath, final String xmlPath, final ContainerNode expectedNode) - throws Exception { - SchemaContext schema = parseTestSchema(yangPath); - this.xmlPath = xmlPath; - this.containerNode = - (ContainerSchemaNode) getSchemaNode(schema, "test", "container"); - this.expectedNode = expectedNode; - } - - SchemaContext parseTestSchema(final String yangPath) throws Exception { - - YangParserImpl yangParserImpl = new YangParserImpl(); - InputStream stream = - NormalizedNodeXmlConverterTest.class.getResourceAsStream(yangPath); - ArrayList al = new ArrayList(); - al.add(stream); - Set modules = yangParserImpl.parseYangModelsFromStreams(al); - return yangParserImpl.resolveSchemaContext(modules); - - } - - - @Test - public void testConversionWithAugmentChoice() throws Exception { - init("/augment_choice.yang", "/augment_choice.xml", - augmentChoiceExpectedNode()); - Document doc = loadDocument(xmlPath); - - ContainerNode built = - DomToNormalizedNodeParserFactory - .getInstance(DomUtils.defaultValueCodecProvider()) - .getContainerNodeParser() - .parse(Collections.singletonList(doc.getDocumentElement()), - containerNode); - - if (expectedNode != null) { - junit.framework.Assert.assertEquals(expectedNode, built); + SchemaContext parseTestSchema(final String yangPath) throws Exception { + + YangParserImpl yangParserImpl = new YangParserImpl(); + InputStream stream = + NormalizedNodeXmlConverterTest.class.getResourceAsStream(yangPath); + ArrayList al = new ArrayList(); + al.add(stream); + Set modules = yangParserImpl.parseYangModelsFromStreams(al); + return yangParserImpl.resolveSchemaContext(modules); + } - logger.info("{}", built); - Iterable els = - DomFromNormalizedNodeSerializerFactory - .getInstance(XmlDocumentUtils.getDocument(), - DomUtils.defaultValueCodecProvider()) - .getContainerNodeSerializer().serialize(containerNode, built); + @Test + public void testConversionWithAugmentChoice() throws Exception { + init("/augment_choice.yang", "/augment_choice.xml", + augmentChoiceExpectedNode()); + Document doc = loadDocument(xmlPath); - Element el = els.iterator().next(); + ContainerNode built = + DomToNormalizedNodeParserFactory + .getInstance(DomUtils.defaultValueCodecProvider()) + .getContainerNodeParser() + .parse(Collections.singletonList(doc.getDocumentElement()), + containerNode); - XMLUnit.setIgnoreWhitespace(true); - XMLUnit.setIgnoreComments(true); + if (expectedNode != null) { + junit.framework.Assert.assertEquals(expectedNode, built); + } - System.out.println(toString(doc.getDocumentElement())); - System.out.println(toString(el)); + logger.info("{}", built); - new Diff( - XMLUnit.buildControlDocument(toString(doc.getDocumentElement())), - XMLUnit.buildTestDocument(toString(el))).similar(); - } + Iterable els = + DomFromNormalizedNodeSerializerFactory + .getInstance(XmlDocumentUtils.getDocument(), + DomUtils.defaultValueCodecProvider()) + .getContainerNodeSerializer().serialize(containerNode, built); - private static ContainerNode listLeafListWithAttributes() { - DataContainerNodeBuilder b = - Builders.containerBuilder(); - b.withNodeIdentifier(getNodeIdentifier("container")); + Element el = els.iterator().next(); - CollectionNodeBuilder listBuilder = - Builders.mapBuilder().withNodeIdentifier(getNodeIdentifier("list")); + XMLUnit.setIgnoreWhitespace(true); + XMLUnit.setIgnoreComments(true); - Map predicates = Maps.newHashMap(); - predicates.put(getNodeIdentifier("uint32InList").getNodeType(), 3L); + System.out.println(toString(doc.getDocumentElement())); + System.out.println(toString(el)); - DataContainerNodeBuilder list1Builder = - Builders.mapEntryBuilder().withNodeIdentifier( - new InstanceIdentifier.NodeIdentifierWithPredicates( - getNodeIdentifier("list").getNodeType(), predicates)); - NormalizedNodeBuilder> uint32InListBuilder = - Builders.leafBuilder().withNodeIdentifier( - getNodeIdentifier("uint32InList")); + new Diff( + XMLUnit.buildControlDocument(toString(doc.getDocumentElement())), + XMLUnit.buildTestDocument(toString(el))).similar(); + } - list1Builder.withChild(uint32InListBuilder.withValue(3L).build()); + private static ContainerNode listLeafListWithAttributes() { + DataContainerNodeBuilder b = + Builders.containerBuilder(); + b.withNodeIdentifier(getNodeIdentifier("container")); - listBuilder.withChild(list1Builder.build()); - b.withChild(listBuilder.build()); + CollectionNodeBuilder listBuilder = + Builders.mapBuilder().withNodeIdentifier(getNodeIdentifier("list")); - NormalizedNodeBuilder> booleanBuilder = - Builders.leafBuilder().withNodeIdentifier(getNodeIdentifier("boolean")); - booleanBuilder.withValue(false); - b.withChild(booleanBuilder.build()); + Map predicates = Maps.newHashMap(); + predicates.put(getNodeIdentifier("uint32InList").getNodeType(), 3L); - ListNodeBuilder> leafListBuilder = - Builders.leafSetBuilder().withNodeIdentifier( - getNodeIdentifier("leafList")); + DataContainerNodeBuilder list1Builder = + Builders.mapEntryBuilder().withNodeIdentifier( + new InstanceIdentifier.NodeIdentifierWithPredicates( + getNodeIdentifier("list").getNodeType(), predicates)); + NormalizedNodeBuilder> uint32InListBuilder = + Builders.leafBuilder().withNodeIdentifier( + getNodeIdentifier("uint32InList")); - NormalizedNodeBuilder> leafList1Builder = - Builders.leafSetEntryBuilder().withNodeIdentifier( - new InstanceIdentifier.NodeWithValue(getNodeIdentifier("leafList") - .getNodeType(), "a")); + list1Builder.withChild(uint32InListBuilder.withValue(3L).build()); - leafList1Builder.withValue("a"); + listBuilder.withChild(list1Builder.build()); + b.withChild(listBuilder.build()); - leafListBuilder.withChild(leafList1Builder.build()); - b.withChild(leafListBuilder.build()); + NormalizedNodeBuilder> booleanBuilder = + Builders.leafBuilder().withNodeIdentifier(getNodeIdentifier("boolean")); + booleanBuilder.withValue(false); + b.withChild(booleanBuilder.build()); - return b.build(); - } + ListNodeBuilder> leafListBuilder = + Builders.leafSetBuilder().withNodeIdentifier( + getNodeIdentifier("leafList")); + NormalizedNodeBuilder> leafList1Builder = + Builders.leafSetEntryBuilder().withNodeIdentifier( + new InstanceIdentifier.NodeWithValue(getNodeIdentifier("leafList") + .getNodeType(), "a")); - @Test - public void testConversionWithAttributes() throws Exception { - init("/test.yang", "/simple_xml_with_attributes.xml", - listLeafListWithAttributes()); - Document doc = loadDocument(xmlPath); + leafList1Builder.withValue("a"); - ContainerNode built = - DomToNormalizedNodeParserFactory - .getInstance(DomUtils.defaultValueCodecProvider()) - .getContainerNodeParser() - .parse(Collections.singletonList(doc.getDocumentElement()), - containerNode); + leafListBuilder.withChild(leafList1Builder.build()); + b.withChild(leafListBuilder.build()); - if (expectedNode != null) { - junit.framework.Assert.assertEquals(expectedNode, built); + return b.build(); } - logger.info("{}", built); - Iterable els = - DomFromNormalizedNodeSerializerFactory - .getInstance(XmlDocumentUtils.getDocument(), - DomUtils.defaultValueCodecProvider()) - .getContainerNodeSerializer().serialize(containerNode, built); + @Test + public void testConversionWithAttributes() throws Exception { + init("/test.yang", "/simple_xml_with_attributes.xml", + listLeafListWithAttributes()); + Document doc = loadDocument(xmlPath); + + ContainerNode built = + DomToNormalizedNodeParserFactory + .getInstance(DomUtils.defaultValueCodecProvider()) + .getContainerNodeParser() + .parse(Collections.singletonList(doc.getDocumentElement()), + containerNode); - Element el = els.iterator().next(); + if (expectedNode != null) { + junit.framework.Assert.assertEquals(expectedNode, built); + } - XMLUnit.setIgnoreWhitespace(true); - XMLUnit.setIgnoreComments(true); + logger.info("{}", built); - System.out.println(toString(doc.getDocumentElement())); - System.out.println(toString(el)); + Iterable els = + DomFromNormalizedNodeSerializerFactory + .getInstance(XmlDocumentUtils.getDocument(), + DomUtils.defaultValueCodecProvider()) + .getContainerNodeSerializer().serialize(containerNode, built); - new Diff( - XMLUnit.buildControlDocument(toString(doc.getDocumentElement())), - XMLUnit.buildTestDocument(toString(el))).similar(); - } + Element el = els.iterator().next(); + XMLUnit.setIgnoreWhitespace(true); + XMLUnit.setIgnoreComments(true); - private Document loadDocument(final String xmlPath) throws Exception { - InputStream resourceAsStream = - NormalizedNodeXmlConverterTest.class.getResourceAsStream(xmlPath); + System.out.println(toString(doc.getDocumentElement())); + System.out.println(toString(el)); - Document currentConfigElement = readXmlToDocument(resourceAsStream); - Preconditions.checkNotNull(currentConfigElement); - return currentConfigElement; - } + new Diff( + XMLUnit.buildControlDocument(toString(doc.getDocumentElement())), + XMLUnit.buildTestDocument(toString(el))).similar(); + } - private static final DocumentBuilderFactory BUILDERFACTORY; - static { - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - factory.setNamespaceAware(true); - factory.setCoalescing(true); - factory.setIgnoringElementContentWhitespace(true); - factory.setIgnoringComments(true); - BUILDERFACTORY = factory; - } + private Document loadDocument(final String xmlPath) throws Exception { + InputStream resourceAsStream = + NormalizedNodeXmlConverterTest.class.getResourceAsStream(xmlPath); - private Document readXmlToDocument(final InputStream xmlContent) - throws IOException, SAXException { - DocumentBuilder dBuilder; - try { - dBuilder = BUILDERFACTORY.newDocumentBuilder(); - } catch (ParserConfigurationException e) { - throw new RuntimeException("Failed to parse XML document", e); + Document currentConfigElement = readXmlToDocument(resourceAsStream); + Preconditions.checkNotNull(currentConfigElement); + return currentConfigElement; } - Document doc = dBuilder.parse(xmlContent); - - doc.getDocumentElement().normalize(); - return doc; - } - - public static String toString(final Element xml) { - try { - Transformer transformer = - TransformerFactory.newInstance().newTransformer(); - transformer.setOutputProperty(OutputKeys.INDENT, "yes"); - - StreamResult result = new StreamResult(new StringWriter()); - DOMSource source = new DOMSource(xml); - transformer.transform(source, result); - - return result.getWriter().toString(); - } catch (IllegalArgumentException | TransformerFactoryConfigurationError - | TransformerException e) { - throw new RuntimeException("Unable to serialize xml element " + xml, e); + + private static final DocumentBuilderFactory BUILDERFACTORY; + + static { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setNamespaceAware(true); + factory.setCoalescing(true); + factory.setIgnoringElementContentWhitespace(true); + factory.setIgnoringComments(true); + BUILDERFACTORY = factory; + } + + private Document readXmlToDocument(final InputStream xmlContent) + throws IOException, SAXException { + DocumentBuilder dBuilder; + try { + dBuilder = BUILDERFACTORY.newDocumentBuilder(); + } catch (ParserConfigurationException e) { + throw new RuntimeException("Failed to parse XML document", e); + } + Document doc = dBuilder.parse(xmlContent); + + doc.getDocumentElement().normalize(); + return doc; + } + + public static String toString(final Element xml) { + try { + Transformer transformer = + TransformerFactory.newInstance().newTransformer(); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + + StreamResult result = new StreamResult(new StringWriter()); + DOMSource source = new DOMSource(xml); + transformer.transform(source, result); + + return result.getWriter().toString(); + } catch (IllegalArgumentException | TransformerFactoryConfigurationError + | TransformerException e) { + throw new RuntimeException("Unable to serialize xml element " + xml, e); + } + } + + @Test + public void testConversionToNormalizedXml() throws Exception { + SimpleNormalizedNodeMessage.NormalizedNodeXml nnXml = + EncoderDecoderUtil.encode(parseTestSchema("/augment_choice.yang"), + augmentChoiceExpectedNode()); + Document expectedDoc = loadDocument("/augment_choice.xml"); + Document convertedDoc = + EncoderDecoderUtil.factory.newDocumentBuilder().parse( + new ByteArrayInputStream(nnXml.getXmlString().getBytes("utf-8"))); + System.out.println(toString(convertedDoc.getDocumentElement())); + XMLUnit.setIgnoreWhitespace(true); + XMLUnit.setIgnoreComments(true); + new Diff(XMLUnit.buildControlDocument(toString(expectedDoc + .getDocumentElement())), + XMLUnit.buildTestDocument(toString(convertedDoc + .getDocumentElement()))).similar(); + System.out.println(toString(expectedDoc.getDocumentElement())); + + } + + + @Test + public void testConversionFromXmlToNormalizedNode() throws Exception { + SimpleNormalizedNodeMessage.NormalizedNodeXml nnXml = + EncoderDecoderUtil.encode(parseTestSchema("/test.yang"), + listLeafListWithAttributes()); + Document expectedDoc = loadDocument("/simple_xml_with_attributes.xml"); + Document convertedDoc = + EncoderDecoderUtil.factory.newDocumentBuilder().parse( + new ByteArrayInputStream(nnXml.getXmlString().getBytes("utf-8"))); + System.out.println(toString(convertedDoc.getDocumentElement())); + XMLUnit.setIgnoreWhitespace(true); + XMLUnit.setIgnoreComments(true); + new Diff(XMLUnit.buildControlDocument(toString(expectedDoc + .getDocumentElement())), + XMLUnit.buildTestDocument(toString(convertedDoc + .getDocumentElement()))).similar(); + System.out.println(toString(expectedDoc.getDocumentElement())); + + // now we will try to convert xml back to normalize node. + ContainerNode cn = + (ContainerNode) EncoderDecoderUtil.decode( + parseTestSchema("/test.yang"), nnXml); + junit.framework.Assert.assertEquals(listLeafListWithAttributes(), cn); + } - } - @Test - public void testConversionToNormalizedXml() throws Exception { - SimpleNormalizedNodeMessage.NormalizedNodeXml nnXml = - EncoderDecoderUtil.encode(parseTestSchema("/augment_choice.yang"), - augmentChoiceExpectedNode()); - Document expectedDoc = loadDocument("/augment_choice.xml"); - Document convertedDoc = - EncoderDecoderUtil.factory.newDocumentBuilder().parse( - new ByteArrayInputStream(nnXml.getXmlString().getBytes("utf-8"))); - System.out.println(toString(convertedDoc.getDocumentElement())); - XMLUnit.setIgnoreWhitespace(true); - XMLUnit.setIgnoreComments(true); - new Diff(XMLUnit.buildControlDocument(toString(expectedDoc - .getDocumentElement())), - XMLUnit.buildTestDocument(toString(convertedDoc - .getDocumentElement()))).similar(); - System.out.println(toString(expectedDoc.getDocumentElement())); - - } - - - @Test - public void testConversionFromXmlToNormalizedNode() throws Exception { - SimpleNormalizedNodeMessage.NormalizedNodeXml nnXml = - EncoderDecoderUtil.encode(parseTestSchema("/test.yang"), - listLeafListWithAttributes()); - Document expectedDoc = loadDocument("/simple_xml_with_attributes.xml"); - Document convertedDoc = - EncoderDecoderUtil.factory.newDocumentBuilder().parse( - new ByteArrayInputStream(nnXml.getXmlString().getBytes("utf-8"))); - System.out.println(toString(convertedDoc.getDocumentElement())); - XMLUnit.setIgnoreWhitespace(true); - XMLUnit.setIgnoreComments(true); - new Diff(XMLUnit.buildControlDocument(toString(expectedDoc - .getDocumentElement())), - XMLUnit.buildTestDocument(toString(convertedDoc - .getDocumentElement()))).similar(); - System.out.println(toString(expectedDoc.getDocumentElement())); - - // now we will try to convert xml back to normalize node. - ContainerNode cn = - (ContainerNode) EncoderDecoderUtil.decode( - parseTestSchema("/test.yang"), nnXml); - junit.framework.Assert.assertEquals(listLeafListWithAttributes(), cn); - - } - - @Test - public void testInMemoryTestModelProtoBuffEncoding() throws Exception { - - SimpleNormalizedNodeMessage.NormalizedNodeXml nnXml = - EncoderDecoderUtil.encode(parseTestSchema("/odl-datastore-test.yang"), - TestModel.createFamily()); - - Document convertedDoc = - EncoderDecoderUtil.factory.newDocumentBuilder().parse( - new ByteArrayInputStream(nnXml.getXmlString().getBytes("utf-8"))); - System.out.println(toString(convertedDoc.getDocumentElement())); - - // now we will try to convert xml back to normalize node. - ContainerNode cn = - (ContainerNode) EncoderDecoderUtil.decode( - parseTestSchema("/odl-datastore-test.yang"), nnXml); - junit.framework.Assert.assertEquals(TestModel.createFamily(), cn); - - - } } diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/cluster/datastore/util/TestModel.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/cluster/datastore/util/TestModel.java index 81878ba616..155e7ff90a 100644 --- a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/cluster/datastore/util/TestModel.java +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/cluster/datastore/util/TestModel.java @@ -78,7 +78,7 @@ public class TestModel { QName .create( "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:notification-test", - "2014-04-15", "family"); + "2014-04-17", "family"); public static final QName CHILDREN_QNAME = QName.create(FAMILY_QNAME, "children"); public static final QName GRAND_CHILDREN_QNAME = QName.create(FAMILY_QNAME, diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/transaction/ShardTransactionMessagesTest.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/transaction/ShardTransactionMessagesTest.java new file mode 100644 index 0000000000..2b1ee5630c --- /dev/null +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/transaction/ShardTransactionMessagesTest.java @@ -0,0 +1,10 @@ +package org.opendaylight.controller.protobuff.messages.transaction; + +/** + * @author: syedbahm + * Date: 7/7/14 + */ +public class ShardTransactionMessagesTest { + + +} diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/application.conf b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/application.conf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/odl-datastore-augmentation.yang b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/odl-datastore-augmentation.yang new file mode 100644 index 0000000000..77d74c47d3 --- /dev/null +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/odl-datastore-augmentation.yang @@ -0,0 +1,19 @@ +module odl-datastore-augmentation { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:aug"; + prefix "store-aug"; + + import odl-datastore-test {prefix test;revision-date "2014-03-13";} + + revision "2014-03-13" { + description "Initial revision."; + } + + + augment "/test:test" { + leaf name { + type string; + } + } + +} \ No newline at end of file diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/odl-datastore-test-notification.yang b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/odl-datastore-test-notification.yang new file mode 100644 index 0000000000..25cc53ab93 --- /dev/null +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/odl-datastore-test-notification.yang @@ -0,0 +1,33 @@ +module odl-datastore-test-notification { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:notification-test"; + prefix "notification-test-using-family-model"; + + revision "2014-04-17" { + description "Family structure created on "; + } + + container family { + leaf desc { + type string; + } + list children { + key child-number; + leaf child-number { + type uint16; + } + leaf child-name { + type string; + } + list grand-children { + key grand-child-number; + leaf grand-child-number { + type uint16; + } + leaf grand-child-name { + type string; + } + } + } + } +} \ No newline at end of file diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/odl-datastore-test.yang b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/odl-datastore-test.yang index 32ec2777ce..38ec700973 100644 --- a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/odl-datastore-test.yang +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/odl-datastore-test.yang @@ -1,33 +1,54 @@ module odl-datastore-test { yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:notification-test"; - prefix "notification-test-using-family-model"; + namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test"; + prefix "store-test"; - revision "2014-04-15" { - description "Family structure created on "; + revision "2014-03-13" { + description "Initial revision."; } - container family { + container test { leaf desc { type string; } - list children { - key child-number; - leaf child-number { + list outer-list { + key id; + leaf id { type uint16; } - leaf child-name { - type string; - } - list grand-children { - key grand-child-number; - leaf grand-child-number { - type uint16; + choice outer-choice { + case one { + leaf one { + type string; + } + } + case two-three { + leaf two { + type string; + } + leaf three { + type string; + } + } + } + list inner-list { + key name; + leaf name { + type string; } - leaf grand-child-name { + leaf value { type string; } } } + + leaf-list shoe { + type string; + } + + leaf-list number { + type uint8; + } + } } \ No newline at end of file