<!--sal-protocolbuffer-encoding-->
<module>sal-protocolbuffer-encoding</module>
+ <!--sal-distributed-datastore-->
+ <module>sal-distributed-datastore</module>
+
<!-- Yang Test Models for MD-SAL -->
<module>sal-test-model</module>
</modules>
<Private-Package></Private-Package>
<Import-Package>!*snappy;!org.jboss.*;*</Import-Package>
<Embed-Dependency>
+ sal-protocolbuffer-encoding;
!sal*;
!*config-api*;
!*testkit*;
}
@Override public void onReceive(Object message) throws Exception {
- LOG.debug("Received message {}", message);
+ LOG.debug("Received message {}", message.getClass().getSimpleName());
handleReceive(message);
- LOG.debug("Done handling message {}", message);
+ LOG.debug("Done handling message {}", message.getClass().getSimpleName());
}
protected abstract void handleReceive(Object message) throws Exception;
import org.opendaylight.controller.cluster.datastore.shardstrategy.DefaultShardStrategy;
import org.opendaylight.controller.cluster.datastore.shardstrategy.ModuleShardStrategy;
import org.opendaylight.controller.cluster.datastore.shardstrategy.ShardStrategy;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
private final List<Module> modules = new ArrayList<>();
+ private static final Logger
+ LOG = LoggerFactory.getLogger(DistributedDataStore.class);
+
public ConfigurationImpl(String moduleShardsConfigPath,
+
String modulesConfigPath){
- Config moduleShardsConfig = ConfigFactory.load(moduleShardsConfigPath);
- Config modulesConfig = ConfigFactory.load(modulesConfigPath);
+
+ File moduleShardsFile = new File("./configuration/initial/" + moduleShardsConfigPath);
+ File modulesFile = new File("./configuration/initial/" + modulesConfigPath);
+
+ Config moduleShardsConfig = null;
+ if(moduleShardsFile.exists()) {
+ LOG.info("module shards config file exists - reading config from it");
+ moduleShardsConfig = ConfigFactory.parseFile(moduleShardsFile);
+ } else {
+ LOG.warn("module shards configuration read from resource");
+ moduleShardsConfig = ConfigFactory.load(moduleShardsConfigPath);
+ }
+
+ Config modulesConfig = null;
+ if(modulesFile.exists()) {
+ LOG.info("modules config file exists - reading config from it");
+ modulesConfig = ConfigFactory.parseFile(modulesFile);
+ } else {
+ LOG.warn("modules configuration read from resource");
+ modulesConfig = ConfigFactory.load(modulesConfigPath);
+ }
readModuleShards(moduleShardsConfig);
import org.opendaylight.controller.cluster.datastore.messages.DataChangedReply;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
public class DataChangeListener extends AbstractUntypedActor {
- private final AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>> listener;
+ private final AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>> listener;
+ private final SchemaContext schemaContext;
+ private final YangInstanceIdentifier pathId;
- public DataChangeListener(
- AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>> listener) {
+ public DataChangeListener(SchemaContext schemaContext,
+ AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>> listener, YangInstanceIdentifier pathId) {
this.listener = listener;
+ this.schemaContext = schemaContext;
+ this.pathId = pathId;
}
@Override public void handleReceive(Object message) throws Exception {
- if(message instanceof DataChanged){
- DataChanged reply = (DataChanged) message;
- AsyncDataChangeEvent<InstanceIdentifier, NormalizedNode<?, ?>>
+ if(message.getClass().equals(DataChanged.SERIALIZABLE_CLASS)){
+ DataChanged reply = DataChanged.fromSerialize(schemaContext,message, pathId);
+ AsyncDataChangeEvent<YangInstanceIdentifier, NormalizedNode<?, ?>>
change = reply.getChange();
this.listener.onDataChanged(change);
if(getSender() != null){
- getSender().tell(new DataChangedReply(), getSelf());
+ getSender().tell(new DataChangedReply().toSerializable(), getSelf());
}
}
}
- public static Props props(final AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>> listener) {
+ public static Props props(final SchemaContext schemaContext, final AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>> listener, final YangInstanceIdentifier pathId) {
return Props.create(new Creator<DataChangeListener>() {
@Override
public DataChangeListener create() throws Exception {
- return new DataChangeListener(listener);
+ return new DataChangeListener(schemaContext,listener,pathId );
}
});
import org.opendaylight.controller.cluster.datastore.messages.DataChanged;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
/**
* DataChangeListenerProxy represents a single remote DataChangeListener
*/
-public class DataChangeListenerProxy implements AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>>{
+public class DataChangeListenerProxy implements AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>>{
private final ActorSelection dataChangeListenerActor;
+ private final SchemaContext schemaContext;
- public DataChangeListenerProxy(ActorSelection dataChangeListenerActor) {
+ public DataChangeListenerProxy(SchemaContext schemaContext,ActorSelection dataChangeListenerActor) {
this.dataChangeListenerActor = dataChangeListenerActor;
+ this.schemaContext = schemaContext;
}
@Override public void onDataChanged(
- AsyncDataChangeEvent<InstanceIdentifier, NormalizedNode<?, ?>> change) {
- dataChangeListenerActor.tell(new DataChanged(change), null);
+ AsyncDataChangeEvent<YangInstanceIdentifier, NormalizedNode<?, ?>> change) {
+ dataChangeListenerActor.tell(new DataChanged(schemaContext,change).toSerializable(), null);
}
}
import org.opendaylight.controller.cluster.datastore.messages.CloseDataChangeListenerRegistration;
import org.opendaylight.controller.cluster.datastore.messages.CloseDataChangeListenerRegistrationReply;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
public class DataChangeListenerRegistration extends AbstractUntypedActor {
- private final org.opendaylight.yangtools.concepts.ListenerRegistration<AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>>>
+ private final org.opendaylight.yangtools.concepts.ListenerRegistration<AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>>>
registration;
public DataChangeListenerRegistration(
- org.opendaylight.yangtools.concepts.ListenerRegistration<AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>>> registration) {
+ org.opendaylight.yangtools.concepts.ListenerRegistration<AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>>> registration) {
this.registration = registration;
}
@Override
public void handleReceive(Object message) throws Exception {
- if (message instanceof CloseDataChangeListenerRegistration) {
+ if (message.getClass().equals(CloseDataChangeListenerRegistration.SERIALIZABLE_CLASS)) {
closeListenerRegistration(
- (CloseDataChangeListenerRegistration) message);
+ new CloseDataChangeListenerRegistration());
}
}
public static Props props(
- final org.opendaylight.yangtools.concepts.ListenerRegistration<AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>>> registration) {
+ final org.opendaylight.yangtools.concepts.ListenerRegistration<AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>>> registration) {
return Props.create(new Creator<DataChangeListenerRegistration>() {
@Override
CloseDataChangeListenerRegistration message) {
registration.close();
getSender()
- .tell(new CloseDataChangeListenerRegistrationReply(), getSelf());
+ .tell(new CloseDataChangeListenerRegistrationReply().toSerializable(), getSelf());
getSelf().tell(PoisonPill.getInstance(), getSelf());
}
}
import org.opendaylight.controller.cluster.datastore.messages.CloseDataChangeListenerRegistration;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
/**
private final AsyncDataChangeListener listener;
private final ActorRef dataChangeListenerActor;
- public <L extends AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>>>
+ public <L extends AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>>>
DataChangeListenerRegistrationProxy(
ActorSelection listenerRegistrationActor,
L listener, ActorRef dataChangeListenerActor) {
@Override
public void close() {
- listenerRegistrationActor.tell(new CloseDataChangeListenerRegistration(), null);
+ listenerRegistrationActor.tell(new CloseDataChangeListenerRegistration().toSerializable(), null);
dataChangeListenerActor.tell(PoisonPill.getInstance(), null);
}
}
import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionChain;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
Executors.newFixedThreadPool(10);
public DistributedDataStore(ActorSystem actorSystem, String type, ClusterWrapper cluster, Configuration configuration) {
- this(new ActorContext(actorSystem, actorSystem.actorOf(ShardManager.props(type, cluster, configuration), "shardmanager-" + type), configuration), type);
+ this(new ActorContext(actorSystem, actorSystem
+ .actorOf(ShardManager.props(type, cluster, configuration),
+ "shardmanager-" + type), cluster, configuration), type);
}
public DistributedDataStore(ActorContext actorContext, String type) {
@Override
- public <L extends AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>>> ListenerRegistration<L> registerChangeListener(
- InstanceIdentifier path, L listener,
+ public <L extends AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>>> ListenerRegistration<L> registerChangeListener(
+ YangInstanceIdentifier path, L listener,
AsyncDataBroker.DataChangeScope scope) {
ActorRef dataChangeListenerActor = actorContext.getActorSystem().actorOf(
- DataChangeListener.props(listener));
+ DataChangeListener.props(schemaContext,listener,path ));
String shardName = ShardStrategyFactory.getStrategy(path).findShard(path);
Object result = actorContext.executeShardOperation(shardName,
new RegisterChangeListener(path, dataChangeListenerActor.path(),
- AsyncDataBroker.DataChangeScope.BASE).toSerializable(),
+ scope).toSerializable(),
ActorContext.ASK_DURATION
);
package org.opendaylight.controller.cluster.datastore;
import akka.actor.ActorSystem;
+import org.opendaylight.controller.cluster.datastore.shardstrategy.ShardStrategyFactory;
import org.opendaylight.controller.sal.core.api.model.SchemaService;
public class DistributedDataStoreFactory {
public static DistributedDataStore createInstance(String name, SchemaService schemaService){
ActorSystem actorSystem = ActorSystemFactory.getInstance();
+ Configuration config = new ConfigurationImpl("module-shards.conf", "modules.conf");
final DistributedDataStore dataStore =
- new DistributedDataStore(actorSystem, name, new ClusterWrapperImpl(actorSystem), new ConfigurationImpl("module-shards.conf", "modules.conf"));
+ new DistributedDataStore(actorSystem, name, new ClusterWrapperImpl(actorSystem),config );
+ ShardStrategyFactory.setConfiguration(config);
schemaService
.registerSchemaServiceListener(dataStore);
return dataStore;
import akka.event.LoggingAdapter;
import akka.japi.Creator;
import akka.persistence.Persistent;
+import akka.persistence.RecoveryCompleted;
import akka.persistence.UntypedProcessor;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors;
+import org.opendaylight.controller.cluster.datastore.jmx.mbeans.shard.ShardMBeanFactory;
+import org.opendaylight.controller.cluster.datastore.jmx.mbeans.shard.ShardStats;
import org.opendaylight.controller.cluster.datastore.messages.CommitTransactionReply;
import org.opendaylight.controller.cluster.datastore.messages.CreateTransaction;
import org.opendaylight.controller.cluster.datastore.messages.CreateTransactionChain;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionChain;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
private final Map<Object, DOMStoreThreePhaseCommitCohort>
modificationToCohort = new HashMap<>();
- private final LoggingAdapter log =
+ private final LoggingAdapter LOG =
Logging.getLogger(getContext().system(), this);
// By default persistent will be true and can be turned off using the system
private SchemaContext schemaContext;
+ private final ShardStats shardMBean;
+
private Shard(String name) {
String setting = System.getProperty("shard.persistent");
+
this.persistent = !"false".equals(setting);
- log.info("Creating shard : {} persistent : {}", name , persistent);
+ LOG.info("Creating shard : {} persistent : {}", name, persistent);
store = new InMemoryDOMDataStore(name, storeExecutor);
+
+ shardMBean = ShardMBeanFactory.getShardStatsMBean(name);
+
}
public static Props props(final String name) {
@Override
public void onReceive(Object message) throws Exception {
- log.debug("Received message {}", message);
+ LOG.debug("Received message " + message.getClass().toString());
if(!recoveryFinished()){
// FIXME : Properly handle recovery
return;
}
- if (message instanceof CreateTransactionChain) {
+ if (message.getClass().equals(CreateTransactionChain.SERIALIZABLE_CLASS)) {
createTransactionChain();
} else if (message.getClass().equals(RegisterChangeListener.SERIALIZABLE_CLASS)) {
registerChangeListener(RegisterChangeListener.fromSerializable(getContext().system(), message));
handleForwardedCommit((ForwardedCommitTransaction) message);
} else if (message instanceof Persistent) {
commit(((Persistent)message).payload());
- } else if (message instanceof CreateTransaction) {
- createTransaction((CreateTransaction) message);
+ } else if (message.getClass().equals(CreateTransaction.SERIALIZABLE_CLASS)) {
+ createTransaction(CreateTransaction.fromSerializable(message));
} else if(message instanceof NonPersistent){
commit(((NonPersistent)message).payload());
- } else {
- throw new Exception("Not recognized message in Shard::OnReceive"+message);
+ }else if (message instanceof RecoveryCompleted) {
+ //FIXME: PROPERLY HANDLE RECOVERY COMPLETED
+
+ }else {
+ throw new Exception("Not recognized message found message=" + message);
}
}
DOMStoreThreePhaseCommitCohort cohort =
modificationToCohort.remove(serialized);
if (cohort == null) {
- log.error(
+ LOG.error(
"Could not find cohort for modification : " + modification);
return;
}
final ListenableFuture<Void> future = cohort.commit();
+ shardMBean.incrementCommittedTransactionCount();
final ActorRef sender = getSender();
final ActorRef self = getSelf();
future.addListener(new Runnable() {
public void run() {
try {
future.get();
- sender.tell(new CommitTransactionReply(), self);
+ sender.tell(new CommitTransactionReply().toSerializable(), self);
} catch (InterruptedException | ExecutionException e) {
// FIXME : Handle this properly
- log.error(e, "An exception happened when committing");
+ LOG.error(e, "An exception happened when committing");
}
}
}, getContext().dispatcher());
private void registerChangeListener(
RegisterChangeListener registerChangeListener) {
+ LOG.debug("registerDataChangeListener for " + registerChangeListener.getPath());
+
+
ActorSelection dataChangeListenerPath = getContext()
.system().actorSelection(registerChangeListener.getDataChangeListenerPath());
- AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>>
- listener = new DataChangeListenerProxy(dataChangeListenerPath);
+ AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>>
+ listener = new DataChangeListenerProxy(schemaContext,dataChangeListenerPath);
- org.opendaylight.yangtools.concepts.ListenerRegistration<AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>>>
+ org.opendaylight.yangtools.concepts.ListenerRegistration<AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>>>
registration =
store.registerChangeListener(registerChangeListener.getPath(),
listener, registerChangeListener.getScope());
ActorRef listenerRegistration =
getContext().actorOf(
DataChangeListenerRegistration.props(registration));
+
+ LOG.debug("registerDataChangeListener sending reply, listenerRegistrationPath = " + listenerRegistration.path().toString());
+
getSender()
.tell(new RegisterChangeListenerReply(listenerRegistration.path()).toSerializable(),
getSelf());
ActorRef transactionChain =
getContext().actorOf(ShardTransactionChain.props(chain, schemaContext));
getSender()
- .tell(new CreateTransactionChainReply(transactionChain.path()),
+ .tell(new CreateTransactionChainReply(transactionChain.path()).toSerializable(),
getSelf());
}
}
import akka.actor.ActorPath;
import akka.actor.ActorRef;
import akka.actor.Address;
+import akka.actor.OneForOneStrategy;
import akka.actor.Props;
-import akka.event.Logging;
-import akka.event.LoggingAdapter;
+import akka.actor.SupervisorStrategy;
+import akka.cluster.ClusterEvent;
import akka.japi.Creator;
+import akka.japi.Function;
+import com.google.common.base.Preconditions;
import org.opendaylight.controller.cluster.datastore.messages.FindPrimary;
import org.opendaylight.controller.cluster.datastore.messages.PrimaryFound;
import org.opendaylight.controller.cluster.datastore.messages.PrimaryNotFound;
import org.opendaylight.controller.cluster.datastore.messages.UpdateSchemaContext;
+import scala.concurrent.duration.Duration;
import java.util.HashMap;
import java.util.List;
*/
public class ShardManager extends AbstractUntypedActor {
- // Stores a mapping between a shard name and the address of the current primary
- private final Map<String, Address> shardNameToPrimaryAddress =
- new HashMap<>();
-
// Stores a mapping between a member name and the address of the member
private final Map<String, Address> memberNameToAddress = new HashMap<>();
- // Stores a mapping between the shard name and all the members on which a replica of that shard are available
- private final Map<String, List<String>> shardNameToMembers =
- new HashMap<>();
-
- private final LoggingAdapter log =
- Logging.getLogger(getContext().system(), this);
-
-
private final Map<String, ActorPath> localShards = new HashMap<>();
* configuration or operational
*/
private ShardManager(String type, ClusterWrapper cluster, Configuration configuration) {
- this.type = type;
- this.cluster = cluster;
- this.configuration = configuration;
- String memberName = cluster.getCurrentMemberName();
- List<String> memberShardNames =
- configuration.getMemberShardNames(memberName);
- for(String shardName : memberShardNames){
- String shardActorName = getShardActorName(memberName, shardName);
- ActorRef actor = getContext()
- .actorOf(Shard.props(shardActorName), shardActorName);
- ActorPath path = actor.path();
- localShards.put(shardName, path);
- }
+ this.type = Preconditions.checkNotNull(type, "type should not be null");
+ this.cluster = Preconditions.checkNotNull(cluster, "cluster should not be null");
+ this.configuration = Preconditions.checkNotNull(configuration, "configuration should not be null");
+
+ // Subscribe this actor to cluster member events
+ cluster.subscribeToMemberEvents(getSelf());
+
+ // Create all the local Shards and make them a child of the ShardManager
+ // TODO: This may need to be initiated when we first get the schema context
+ createLocalShards();
}
public static Props props(final String type,
});
}
+
@Override
public void handleReceive(Object message) throws Exception {
- if (message instanceof FindPrimary) {
- FindPrimary msg = ((FindPrimary) message);
- String shardName = msg.getShardName();
-
- List<String> members =
- configuration.getMembersFromShardName(shardName);
-
- for(String memberName : members) {
- if (memberName.equals(cluster.getCurrentMemberName())) {
- // This is a local shard
- ActorPath shardPath = localShards.get(shardName);
- // FIXME: This check may be redundant
- if (shardPath == null) {
- getSender()
- .tell(new PrimaryNotFound(shardName), getSelf());
- return;
- }
- getSender().tell(new PrimaryFound(shardPath.toString()),
- getSelf());
- return;
- } else {
- Address address = memberNameToAddress.get(shardName);
- if(address != null){
- String path =
- address.toString() + "/user/" + getShardActorName(
- memberName, shardName);
- getSender().tell(new PrimaryFound(path), getSelf());
- }
+ if (message.getClass().equals(FindPrimary.SERIALIZABLE_CLASS)) {
+ findPrimary(
+ FindPrimary.fromSerializable(message));
+
+ } else if (message instanceof UpdateSchemaContext) {
+ updateSchemaContext(message);
+ } else if (message instanceof ClusterEvent.MemberUp){
+ memberUp((ClusterEvent.MemberUp) message);
+ } else if(message instanceof ClusterEvent.MemberRemoved) {
+ memberRemoved((ClusterEvent.MemberRemoved) message);
+ } else if(message instanceof ClusterEvent.UnreachableMember) {
+ ignoreMessage(message);
+ } else{
+ throw new Exception ("Not recognized message received, message="+message);
+ }
+
+ }
+
+ private void ignoreMessage(Object message){
+ LOG.debug("Unhandled message : " + message);
+ }
+
+ private void memberRemoved(ClusterEvent.MemberRemoved message) {
+ memberNameToAddress.remove(message.member().roles().head());
+ }
+
+ private void memberUp(ClusterEvent.MemberUp message) {
+ memberNameToAddress.put(message.member().roles().head(), message.member().address());
+ }
+ private void updateSchemaContext(Object message) {
+ for(ActorPath path : localShards.values()){
+ getContext().system().actorSelection(path)
+ .forward(message,
+ getContext());
+ }
+ }
+
+ private void findPrimary(FindPrimary message) {
+ String shardName = message.getShardName();
+
+ List<String> members =
+ configuration.getMembersFromShardName(shardName);
+ for(String memberName : members) {
+ if (memberName.equals(cluster.getCurrentMemberName())) {
+ // This is a local shard
+ ActorPath shardPath = localShards.get(shardName);
+ if (shardPath == null) {
+ getSender()
+ .tell(new PrimaryNotFound(shardName).toSerializable(), getSelf());
+ return;
+ }
+ getSender().tell(new PrimaryFound(shardPath.toString()).toSerializable(),
+ getSelf());
+ return;
+ } else {
+ Address address = memberNameToAddress.get(memberName);
+ if(address != null){
+ String path =
+ address.toString() + "/user/shardmanager-" + this.type + "/" + getShardActorName(
+ memberName, shardName);
+ getSender().tell(new PrimaryFound(path).toSerializable(), getSelf());
+ return;
}
- }
- getSender().tell(new PrimaryNotFound(shardName), getSelf());
- } else if (message instanceof UpdateSchemaContext) {
- for(ActorPath path : localShards.values()){
- getContext().system().actorSelection(path)
- .forward(message,
- getContext());
}
}
+
+ getSender().tell(new PrimaryNotFound(shardName).toSerializable(), getSelf());
}
private String getShardActorName(String memberName, String shardName){
return memberName + "-shard-" + shardName + "-" + this.type;
}
+ // Create the shards that are local to this member
+ private void createLocalShards() {
+ String memberName = this.cluster.getCurrentMemberName();
+ List<String> memberShardNames =
+ this.configuration.getMemberShardNames(memberName);
+ for(String shardName : memberShardNames){
+ String shardActorName = getShardActorName(memberName, shardName);
+ ActorRef actor = getContext()
+ .actorOf(Shard.props(shardActorName), shardActorName);
+ ActorPath path = actor.path();
+ localShards.put(shardName, path);
+ }
+
+ }
+
+
+ @Override
+ public SupervisorStrategy supervisorStrategy() {
+ return new OneForOneStrategy(10, Duration.create("1 minute"),
+ new Function<Throwable, SupervisorStrategy.Directive>() {
+ @Override
+ public SupervisorStrategy.Directive apply(Throwable t) {
+ return SupervisorStrategy.resume();
+ }
+ }
+ );
+
+ }
}
import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionChain;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
mergeData(MergeData.fromSerializable(message, schemaContext));
} else if (DeleteData.SERIALIZABLE_CLASS.equals(message.getClass())) {
deleteData(DeleteData.fromSerizalizable(message));
- } else if (message instanceof ReadyTransaction) {
- readyTransaction((ReadyTransaction) message);
- } else if (message instanceof CloseTransaction) {
- closeTransaction((CloseTransaction) message);
+ } else if (ReadyTransaction.SERIALIZABLE_CLASS.equals(message.getClass())) {
+ readyTransaction(new ReadyTransaction());
+ } else if (message.getClass().equals(CloseTransaction.SERIALIZABLE_CLASS)) {
+ closeTransaction(new CloseTransaction());
} else if (message instanceof GetCompositedModification) {
// This is here for testing only
getSender().tell(new GetCompositeModificationReply(
new ImmutableCompositeModification(modification)), getSelf());
}else{
- throw new Exception ("handleRecieve received an unknown mesages"+message);
+ throw new Exception ("Shard:handleRecieve received an unknown message"+message);
}
}
private void readData(ReadData message) {
final ActorRef sender = getSender();
final ActorRef self = getSelf();
- final InstanceIdentifier path = message.getPath();
+ final YangInstanceIdentifier path = message.getPath();
final ListenableFuture<Optional<NormalizedNode<?, ?>>> future =
transaction.read(path);
private void writeData(WriteData message) {
modification.addModification(
new WriteModification(message.getPath(), message.getData(),schemaContext));
+ LOG.debug("writeData at path : " + message.getPath().toString());
transaction.write(message.getPath(), message.getData());
- getSender().tell(new WriteDataReply(), getSelf());
+ getSender().tell(new WriteDataReply().toSerializable(), getSelf());
}
private void mergeData(MergeData message) {
modification.addModification(
new MergeModification(message.getPath(), message.getData(), schemaContext));
+ LOG.debug("mergeData at path : " + message.getPath().toString());
transaction.merge(message.getPath(), message.getData());
- getSender().tell(new MergeDataReply(), getSelf());
+ getSender().tell(new MergeDataReply().toSerializable(), getSelf());
}
private void deleteData(DeleteData message) {
modification.addModification(new DeleteModification(message.getPath()));
transaction.delete(message.getPath());
- getSender().tell(new DeleteDataReply(), getSelf());
+ getSender().tell(new DeleteDataReply().toSerializable(), getSelf());
}
private void readyTransaction(ReadyTransaction message) {
ActorRef cohortActor = getContext().actorOf(
ThreePhaseCommitCohort.props(cohort, shardActor, modification), "cohort");
getSender()
- .tell(new ReadyTransactionReply(cohortActor.path()), getSelf());
+ .tell(new ReadyTransactionReply(cohortActor.path()).toSerializable(), getSelf());
}
private void closeTransaction(CloseTransaction message) {
transaction.close();
- getSender().tell(new CloseTransactionReply(), getSelf());
+ getSender().tell(new CloseTransactionReply().toSerializable(), getSelf());
getSelf().tell(PoisonPill.getInstance(), getSelf());
}
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.protobuff.messages.transaction.ShardTransactionMessages;
+import org.opendaylight.controller.cluster.datastore.messages.CreateTransactionReply;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionChain;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
@Override
public void handleReceive(Object message) throws Exception {
- if (message instanceof CreateTransaction) {
- CreateTransaction createTransaction = (CreateTransaction) message;
+ if (message.getClass().equals(CreateTransaction.SERIALIZABLE_CLASS)) {
+ CreateTransaction createTransaction = CreateTransaction.fromSerializable( message);
createTransaction(createTransaction);
- } else if (message instanceof CloseTransactionChain) {
+ } else if (message.getClass().equals(CloseTransactionChain.SERIALIZABLE_CLASS)) {
chain.close();
- getSender().tell(new CloseTransactionChainReply(), getSelf());
+ getSender().tell(new CloseTransactionChainReply().toSerializable(), getSelf());
+ }else{
+ throw new Exception("Not recognized message recieved="+message);
}
}
ActorRef transactionActor = getContext().actorOf(ShardTransaction
.props(chain, transaction, getContext().parent(), schemaContext), "shard-" + createTransaction.getTransactionId());
getSender()
- .tell(ShardTransactionMessages.CreateTransactionReply.newBuilder()
- .setTransactionActorPath(transactionActor.path().toString())
- .setTransactionId(createTransaction.getTransactionId())
- .build(),
+ .tell(new CreateTransactionReply(transactionActor.path().toString(),createTransaction.getTransactionId()).toSerializable(),
getSelf());
}
@Override
public void handleReceive(Object message) throws Exception {
- if (message instanceof CanCommitTransaction) {
- canCommit((CanCommitTransaction) message);
- } else if (message instanceof PreCommitTransaction) {
- preCommit((PreCommitTransaction) message);
- } else if (message instanceof CommitTransaction) {
- commit((CommitTransaction) message);
- } else if (message instanceof AbortTransaction) {
- abort((AbortTransaction) message);
+ if (message.getClass().equals(CanCommitTransaction.SERIALIZABLE_CLASS)) {
+ canCommit(new CanCommitTransaction());
+ } else if (message.getClass().equals(PreCommitTransaction.SERIALIZABLE_CLASS)) {
+ preCommit(new PreCommitTransaction());
+ } else if (message.getClass().equals(CommitTransaction.SERIALIZABLE_CLASS)) {
+ commit(new CommitTransaction());
+ } else if (message.getClass().equals(AbortTransaction.SERIALIZABLE_CLASS)) {
+ abort(new AbortTransaction());
+ } else {
+ throw new Exception ("Not recognized message received,message="+message);
}
}
public void run() {
try {
future.get();
- sender.tell(new AbortTransactionReply(), self);
+ sender.tell(new AbortTransactionReply().toSerializable(), self);
} catch (InterruptedException | ExecutionException e) {
log.error(e, "An exception happened when aborting");
}
public void run() {
try {
future.get();
- sender.tell(new PreCommitTransactionReply(), self);
+ sender.tell(new PreCommitTransactionReply().toSerializable(), self);
} catch (InterruptedException | ExecutionException e) {
log.error(e, "An exception happened when preCommitting");
}
public void run() {
try {
Boolean canCommit = future.get();
- sender.tell(new CanCommitTransactionReply(canCommit), self);
+ sender.tell(new CanCommitTransactionReply(canCommit).toSerializable(), self);
} catch (InterruptedException | ExecutionException e) {
log.error(e, "An exception happened when aborting");
}
try {
Object response =
actorContext.executeRemoteOperation(cohort,
- new CanCommitTransaction(),
+ new CanCommitTransaction().toSerializable(),
ActorContext.ASK_DURATION);
- if (response instanceof CanCommitTransactionReply) {
+ if (response.getClass().equals(CanCommitTransactionReply.SERIALIZABLE_CLASS)) {
CanCommitTransactionReply reply =
- (CanCommitTransactionReply) response;
+ CanCommitTransactionReply.fromSerializable(response);
if (!reply.getCanCommit()) {
return false;
}
}
@Override public ListenableFuture<Void> preCommit() {
- return voidOperation(new PreCommitTransaction(), PreCommitTransactionReply.class);
+ return voidOperation(new PreCommitTransaction().toSerializable(), PreCommitTransactionReply.SERIALIZABLE_CLASS);
}
@Override public ListenableFuture<Void> abort() {
- return voidOperation(new AbortTransaction(), AbortTransactionReply.class);
+ return voidOperation(new AbortTransaction().toSerializable(), AbortTransactionReply.SERIALIZABLE_CLASS);
}
@Override public ListenableFuture<Void> commit() {
- return voidOperation(new CommitTransaction(), CommitTransactionReply.class);
+ return voidOperation(new CommitTransaction().toSerializable(), CommitTransactionReply.SERIALIZABLE_CLASS);
}
private ListenableFuture<Void> voidOperation(final Object message, final Class expectedResponseClass){
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.cluster.datastore.messages.DeleteData;
import org.opendaylight.controller.cluster.datastore.messages.MergeData;
import org.opendaylight.controller.cluster.datastore.messages.ReadData;
import org.opendaylight.controller.cluster.datastore.messages.WriteData;
import org.opendaylight.controller.cluster.datastore.shardstrategy.ShardStrategyFactory;
import org.opendaylight.controller.cluster.datastore.utils.ActorContext;
-import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages.CreateTransactionReply;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
private final TransactionType transactionType;
private final ActorContext actorContext;
- private final Map<String, ActorSelection> remoteTransactionPaths = new HashMap<>();
+ private final Map<String, TransactionContext> remoteTransactionPaths = new HashMap<>();
private final String identifier;
private final ExecutorService executor;
private final SchemaContext schemaContext;
SchemaContext schemaContext
) {
- this.identifier = "txn-" + counter.getAndIncrement();
+ this.identifier = actorContext.getCurrentMemberName() + "-txn-" + counter.getAndIncrement();
this.transactionType = transactionType;
this.actorContext = actorContext;
this.executor = executor;
}
@Override
- public ListenableFuture<Optional<NormalizedNode<?, ?>>> read(final InstanceIdentifier path) {
+ public ListenableFuture<Optional<NormalizedNode<?, ?>>> read(final YangInstanceIdentifier path) {
createTransactionIfMissing(actorContext, path);
}
@Override
- public void write(InstanceIdentifier path, NormalizedNode<?, ?> data) {
+ public void write(YangInstanceIdentifier path, NormalizedNode<?, ?> data) {
createTransactionIfMissing(actorContext, path);
}
@Override
- public void merge(InstanceIdentifier path, NormalizedNode<?, ?> data) {
+ public void merge(YangInstanceIdentifier path, NormalizedNode<?, ?> data) {
createTransactionIfMissing(actorContext, path);
}
@Override
- public void delete(InstanceIdentifier path) {
+ public void delete(YangInstanceIdentifier path) {
createTransactionIfMissing(actorContext, path);
public DOMStoreThreePhaseCommitCohort ready() {
List<ActorPath> cohortPaths = new ArrayList<>();
- for(ActorSelection remoteTransaction : remoteTransactionPaths.values()) {
- Object result = actorContext.executeRemoteOperation(remoteTransaction,
- new ReadyTransaction(),
+ for(TransactionContext transactionContext : remoteTransactionPaths.values()) {
+ Object result = actorContext.executeRemoteOperation(transactionContext.getActor(),
+ new ReadyTransaction().toSerializable(),
ActorContext.ASK_DURATION
);
- if(result instanceof ReadyTransactionReply){
- ReadyTransactionReply reply = (ReadyTransactionReply) result;
- cohortPaths.add(reply.getCohortPath());
+ if(result.getClass().equals(ReadyTransactionReply.SERIALIZABLE_CLASS)){
+ ReadyTransactionReply reply = ReadyTransactionReply.fromSerializable(actorContext.getActorSystem(),result);
+ String resolvedCohortPath = transactionContext
+ .getResolvedCohortPath(reply.getCohortPath().toString());
+ cohortPaths.add(actorContext.actorFor(resolvedCohortPath));
}
}
@Override
public void close() {
- for(ActorSelection remoteTransaction : remoteTransactionPaths.values()) {
- remoteTransaction.tell(new CloseTransaction(), null);
+ for(TransactionContext transactionContext : remoteTransactionPaths.values()) {
+ transactionContext.getActor().tell(
+ new CloseTransaction().toSerializable(), null);
}
}
- private ActorSelection remoteTransactionFromIdentifier(InstanceIdentifier path){
+ private ActorSelection remoteTransactionFromIdentifier(YangInstanceIdentifier path){
String shardName = shardNameFromIdentifier(path);
- return remoteTransactionPaths.get(shardName);
+ return remoteTransactionPaths.get(shardName).getActor();
}
- private String shardNameFromIdentifier(InstanceIdentifier path){
+ private String shardNameFromIdentifier(YangInstanceIdentifier path){
return ShardStrategyFactory.getStrategy(path).findShard(path);
}
- private void createTransactionIfMissing(ActorContext actorContext, InstanceIdentifier path) {
+ private void createTransactionIfMissing(ActorContext actorContext, YangInstanceIdentifier path) {
String shardName = ShardStrategyFactory.getStrategy(path).findShard(path);
- ActorSelection actorSelection =
+ TransactionContext transactionContext =
remoteTransactionPaths.get(shardName);
- if(actorSelection != null){
+ if(transactionContext != null){
// A transaction already exists with that shard
return;
}
- Object response = actorContext.executeShardOperation(shardName, new CreateTransaction(identifier), ActorContext.ASK_DURATION);
- if(response instanceof CreateTransactionReply){
- CreateTransactionReply reply = (CreateTransactionReply) response;
- remoteTransactionPaths.put(shardName, actorContext.actorSelection(reply.getTransactionActorPath()));
+ Object response = actorContext.executeShardOperation(shardName, new CreateTransaction(identifier).toSerializable(), ActorContext.ASK_DURATION);
+ if(response.getClass().equals(CreateTransactionReply.SERIALIZABLE_CLASS)){
+ CreateTransactionReply reply = CreateTransactionReply.fromSerializable(response);
+ String transactionPath = actorContext.getRemoteActorPath(shardName, reply.getTransactionPath());
+
+ ActorSelection transactionActor = actorContext.actorSelection(transactionPath);
+ transactionContext = new TransactionContext(shardName, transactionPath, transactionActor);
+
+ remoteTransactionPaths.put(shardName, transactionContext);
}
}
+ private class TransactionContext {
+ private final String shardName;
+ private final String actorPath;
+ private final ActorSelection actor;
+
+
+ private TransactionContext(String shardName, String actorPath,
+ ActorSelection actor) {
+ this.shardName = shardName;
+ this.actorPath = actorPath;
+ this.actor = actor;
+ }
+
+
+ public String getShardName() {
+ return shardName;
+ }
+
+ public String getActorPath() {
+ return actorPath;
+ }
+
+ public ActorSelection getActor() {
+ return actor;
+ }
+
+ public String getResolvedCohortPath(String cohortPath){
+ return actorContext.resolvePath(actorPath, cohortPath);
+ }
+ }
+
}
--- /dev/null
+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+
+package org.opendaylight.controller.cluster.datastore.jmx.mbeans;
+
+
+import com.google.common.base.Preconditions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.management.InstanceNotFoundException;
+import javax.management.MBeanRegistrationException;
+import javax.management.MBeanServer;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import java.lang.management.ManagementFactory;
+
+/**
+ * All MBeans should extend this class that help in registering and
+ * unregistering the MBeans.
+ *
+ */
+
+
+public abstract class AbstractBaseMBean {
+
+
+ public static String BASE_JMX_PREFIX = "org.opendaylight.controller:";
+ public static String JMX_TYPE_DISTRIBUTED_DATASTORE = "DistributedDatastore";
+ public static String JMX_CATEGORY_SHARD = "Shard";
+
+ private static final Logger LOG = LoggerFactory
+ .getLogger(AbstractBaseMBean.class);
+
+ MBeanServer server = ManagementFactory.getPlatformMBeanServer();
+ /**
+ * gets the MBean ObjectName
+ *
+ * @return Object name of the MBean
+ * @throws MalformedObjectNameException - The bean name does not have the right format.
+ * @throws NullPointerException - The bean name is null
+ */
+ protected ObjectName getMBeanObjectName()
+ throws MalformedObjectNameException, NullPointerException {
+ String name = BASE_JMX_PREFIX + "type="+getMBeanType()+",Category="+
+ getMBeanCategory() + ",name="+
+ getMBeanName();
+
+
+ return new ObjectName(name);
+ }
+
+ public boolean registerMBean() {
+ boolean registered = false;
+ try {
+ // Object to identify MBean
+ final ObjectName mbeanName = this.getMBeanObjectName();
+
+ Preconditions.checkArgument(mbeanName != null,
+ "Object name of the MBean cannot be null");
+
+ LOG.debug("Register MBean {}", mbeanName);
+
+ // unregistered if already registered
+ if (server.isRegistered(mbeanName)) {
+
+ LOG.debug("MBean {} found to be already registered", mbeanName);
+
+ try {
+ unregisterMBean(mbeanName);
+ } catch (Exception e) {
+
+ LOG.warn("unregister mbean {} resulted in exception {} ", mbeanName,
+ e);
+ }
+ }
+ server.registerMBean(this, mbeanName);
+
+ LOG.debug("MBean {} registered successfully",
+ mbeanName.getCanonicalName());
+ registered = true;
+ } catch (Exception e) {
+
+ LOG.error("registration failed {}", e);
+
+ }
+ return registered;
+ }
+
+
+ public boolean unregisterMBean() {
+ boolean unregister = false;
+ try {
+ ObjectName mbeanName = this.getMBeanObjectName();
+ unregister = true;
+ unregisterMBean(mbeanName);
+ } catch (Exception e) {
+
+ LOG.error("Failed when unregistering MBean {}", e);
+ }
+ return unregister;
+ }
+
+ private void unregisterMBean(ObjectName mbeanName)
+ throws MBeanRegistrationException, InstanceNotFoundException {
+
+ server.unregisterMBean(mbeanName);
+
+ }
+
+
+ /**
+ * @return name of bean
+ */
+ protected abstract String getMBeanName();
+
+ /**
+ * @return type of the MBean
+ */
+ protected abstract String getMBeanType();
+
+
+ /**
+ * @return Category name of teh bean
+ */
+ protected abstract String getMBeanCategory();
+
+ //require for test cases
+ public MBeanServer getMBeanServer() {
+ return server;
+ }
+}
--- /dev/null
+package org.opendaylight.controller.cluster.datastore.jmx.mbeans.shard;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author: syedbahm
+ * Date: 7/16/14
+ */
+public class ShardMBeanFactory {
+ private static Map<String,ShardStats> shardMBeans= new HashMap<String,ShardStats>();
+
+ public static ShardStats getShardStatsMBean(String shardName){
+ if(shardMBeans.containsKey(shardName)){
+ return shardMBeans.get(shardName);
+ }else {
+ ShardStats shardStatsMBeanImpl = new ShardStats(shardName);
+
+ if(shardStatsMBeanImpl.registerMBean()) {
+ shardMBeans.put(shardName, shardStatsMBeanImpl);
+ }
+ return shardStatsMBeanImpl;
+ }
+ }
+
+}
--- /dev/null
+package org.opendaylight.controller.cluster.datastore.jmx.mbeans.shard;
+
+import org.opendaylight.controller.cluster.datastore.jmx.mbeans.AbstractBaseMBean;
+
+/**
+ * @author: syedbahm
+ */
+public class ShardStats extends AbstractBaseMBean implements ShardStatsMBean {
+ private Long committedTransactionsCount;
+ private Long journalMessagesCount;
+ final private String shardName;
+
+ ShardStats(String shardName){
+ this.shardName = shardName;
+ committedTransactionsCount =0L;
+ journalMessagesCount = 0L;
+ };
+
+
+ @Override
+ public String getShardName() {
+ return shardName;
+ }
+
+ @Override
+ public Long getCommittedTransactionsCount() {
+ return committedTransactionsCount;
+ }
+
+ @Override
+ public Long getJournalMessagesCount() {
+ //FIXME: this will be populated once after integration with Raft stuff
+ return journalMessagesCount;
+ }
+
+
+ public Long incrementCommittedTransactionCount() {
+ return committedTransactionsCount++;
+ }
+
+
+ public void updateCommittedTransactionsCount(long currentCount){
+ committedTransactionsCount = currentCount;
+
+ }
+
+ public void updateJournalMessagesCount(long currentCount){
+ journalMessagesCount = currentCount;
+
+ }
+
+
+
+ @Override
+ protected String getMBeanName() {
+ return shardName;
+ }
+
+ @Override
+ protected String getMBeanType() {
+ return JMX_TYPE_DISTRIBUTED_DATASTORE;
+ }
+
+ @Override
+ protected String getMBeanCategory() {
+ return JMX_CATEGORY_SHARD;
+ }
+
+
+}
--- /dev/null
+package org.opendaylight.controller.cluster.datastore.jmx.mbeans.shard;
+
+/**
+ * @author: syedbahm
+ */
+public interface ShardStatsMBean {
+ String getShardName();
+ Long getCommittedTransactionsCount();
+ Long getJournalMessagesCount();
+
+}
package org.opendaylight.controller.cluster.datastore.messages;
-public class AbortTransaction {
+import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
+
+public class AbortTransaction implements SerializableMessage {
+ public static Class SERIALIZABLE_CLASS = ThreePhaseCommitCohortMessages.AbortTransaction.class;
+
+ @Override
+ public Object toSerializable() {
+ return ThreePhaseCommitCohortMessages.AbortTransaction.newBuilder().build();
+ }
}
package org.opendaylight.controller.cluster.datastore.messages;
-public class AbortTransactionReply {
+import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
+
+public class AbortTransactionReply implements SerializableMessage {
+ public static Class SERIALIZABLE_CLASS = ThreePhaseCommitCohortMessages.AbortTransactionReply.class;
+
+
+ @Override
+ public Object toSerializable() {
+ return ThreePhaseCommitCohortMessages.AbortTransactionReply.newBuilder().build();
+ }
}
package org.opendaylight.controller.cluster.datastore.messages;
-public class CanCommitTransaction {
+import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
+
+public class CanCommitTransaction implements SerializableMessage {
+ public static Class SERIALIZABLE_CLASS = ThreePhaseCommitCohortMessages.CanCommitTransaction.class;
+
+ @Override
+ public Object toSerializable() {
+ return ThreePhaseCommitCohortMessages.CanCommitTransaction.newBuilder().build();
+ }
}
package org.opendaylight.controller.cluster.datastore.messages;
-public class CanCommitTransactionReply {
+import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
+
+public class CanCommitTransactionReply implements SerializableMessage {
+ public static Class SERIALIZABLE_CLASS = ThreePhaseCommitCohortMessages.CanCommitTransactionReply.class;
private final Boolean canCommit;
public CanCommitTransactionReply(Boolean canCommit) {
public Boolean getCanCommit() {
return canCommit;
}
+
+ @Override
+ public Object toSerializable() {
+ return ThreePhaseCommitCohortMessages.CanCommitTransactionReply.newBuilder().setCanCommit(canCommit).build();
+ }
+
+
+ public static CanCommitTransactionReply fromSerializable(Object message) {
+ return new CanCommitTransactionReply(((ThreePhaseCommitCohortMessages.CanCommitTransactionReply)message).getCanCommit());
+ }
}
package org.opendaylight.controller.cluster.datastore.messages;
-public class CloseDataChangeListenerRegistration {
+import org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages;
+
+public class CloseDataChangeListenerRegistration implements SerializableMessage {
+ public static Class SERIALIZABLE_CLASS = ListenerRegistrationMessages.CloseDataChangeListenerRegistration.class;
+ @Override
+ public Object toSerializable() {
+ return ListenerRegistrationMessages.CloseDataChangeListenerRegistration.newBuilder().build();
+ }
}
package org.opendaylight.controller.cluster.datastore.messages;
-public class CloseDataChangeListenerRegistrationReply {
+import org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages;
+
+public class CloseDataChangeListenerRegistrationReply implements SerializableMessage{
+ public static Class SERIALIZABLE_CLASS = ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply.class;
+
+ @Override
+ public Object toSerializable() {
+ return ListenerRegistrationMessages.CloseDataChangeListenerRegistrationReply.newBuilder().build();
+ }
+
}
package org.opendaylight.controller.cluster.datastore.messages;
-public class CloseTransaction {
+import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages;
+
+public class CloseTransaction implements SerializableMessage{
+ public static final Class SERIALIZABLE_CLASS = ShardTransactionMessages.CloseTransaction.class;
+ @Override
+ public Object toSerializable() {
+ return ShardTransactionMessages.CloseTransaction.newBuilder().build();
+ }
}
package org.opendaylight.controller.cluster.datastore.messages;
-public class CloseTransactionChain {
+import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionChainMessages;
+
+public class CloseTransactionChain implements SerializableMessage{
+ public static final Class SERIALIZABLE_CLASS = ShardTransactionChainMessages.CloseTransactionChain.class;
+ @Override
+ public Object toSerializable() {
+ return ShardTransactionChainMessages.CloseTransactionChain.newBuilder().build();
+ }
}
package org.opendaylight.controller.cluster.datastore.messages;
-public class CloseTransactionChainReply {
+import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionChainMessages;
+
+public class CloseTransactionChainReply implements SerializableMessage {
+ public static final Class SERIALIZABLE_CLASS = ShardTransactionChainMessages.CloseTransactionChainReply.class;
+ @Override
+ public Object toSerializable() {
+ return ShardTransactionChainMessages.CloseTransactionChainReply.newBuilder().build();
+ }
+
}
package org.opendaylight.controller.cluster.datastore.messages;
-public class CloseTransactionReply {
+import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages;
+
+public class CloseTransactionReply implements SerializableMessage {
+ public static final Class SERIALIZABLE_CLASS = ShardTransactionMessages.CloseTransactionReply.class;
+ @Override
+ public Object toSerializable() {
+ return ShardTransactionMessages.CloseTransactionReply.newBuilder().build();
+ }
}
package org.opendaylight.controller.cluster.datastore.messages;
-public class CommitTransaction {
+import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
+
+public class CommitTransaction implements SerializableMessage {
+ public static Class SERIALIZABLE_CLASS = ThreePhaseCommitCohortMessages.CommitTransaction.class;
+
+ @Override
+ public Object toSerializable() {
+ return ThreePhaseCommitCohortMessages.CommitTransaction.newBuilder().build();
+ }
}
package org.opendaylight.controller.cluster.datastore.messages;
-public class CommitTransactionReply {
+import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
+
+public class CommitTransactionReply implements SerializableMessage {
+
+ public static Class SERIALIZABLE_CLASS = ThreePhaseCommitCohortMessages.CommitTransactionReply.class;
+
+ @Override
+ public Object toSerializable() {
+ return ThreePhaseCommitCohortMessages.CommitTransactionReply.newBuilder().build();
+ }
}
package org.opendaylight.controller.cluster.datastore.messages;
-public class CreateTransaction {
- private final String transactionId;
- public CreateTransaction(String transactionId){
+import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages;
- this.transactionId = transactionId;
- }
- public String getTransactionId() {
- return transactionId;
- }
+public class CreateTransaction implements SerializableMessage {
+ public static Class SERIALIZABLE_CLASS = ShardTransactionMessages.CreateTransaction.class;
+ private final String transactionId;
+
+ public CreateTransaction(String transactionId){
+
+ this.transactionId = transactionId;
+ }
+
+ public String getTransactionId() {
+ return transactionId;
+ }
+
+ @Override
+ public Object toSerializable() {
+ return ShardTransactionMessages.CreateTransaction.newBuilder().setTransactionId(transactionId).build();
+ }
+
+ public static CreateTransaction fromSerializable(Object message){
+ return new CreateTransaction(((ShardTransactionMessages.CreateTransaction)message).getTransactionId());
+ }
+
}
package org.opendaylight.controller.cluster.datastore.messages;
-public class CreateTransactionChain {
+import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionChainMessages;
+public class CreateTransactionChain implements SerializableMessage{
+ public static Class SERIALIZABLE_CLASS = ShardTransactionChainMessages.CreateTransactionChain.class;
+ @Override
+ public Object toSerializable() {
+ return ShardTransactionChainMessages.CreateTransactionChain.newBuilder().build();
+ }
}
package org.opendaylight.controller.cluster.datastore.messages;
import akka.actor.ActorPath;
+import akka.actor.ActorSystem;
+import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionChainMessages;
-public class CreateTransactionChainReply {
+public class CreateTransactionChainReply implements SerializableMessage {
+ public static final Class SERIALIZABLE_CLASS = ShardTransactionChainMessages.CreateTransactionChainReply.class;
private final ActorPath transactionChainPath;
public CreateTransactionChainReply(ActorPath transactionChainPath) {
public ActorPath getTransactionChainPath() {
return transactionChainPath;
}
+
+ @Override
+ public ShardTransactionChainMessages.CreateTransactionChainReply toSerializable() {
+ return ShardTransactionChainMessages.CreateTransactionChainReply.newBuilder()
+ .setTransactionChainPath(transactionChainPath.toString()).build();
+ }
+
+ public static CreateTransactionChainReply fromSerializable(ActorSystem actorSystem,Object serializable){
+ ShardTransactionChainMessages.CreateTransactionChainReply o = (ShardTransactionChainMessages.CreateTransactionChainReply) serializable;
+ return new CreateTransactionChainReply(
+ actorSystem.actorFor(o.getTransactionChainPath()).path());
+ }
+
}
public Object toSerializable(){
return ShardTransactionMessages.CreateTransactionReply.newBuilder()
- .setTransactionActorPath(transactionPath.toString())
+ .setTransactionActorPath(transactionPath)
.setTransactionId(transactionId)
.build();
}
package org.opendaylight.controller.cluster.datastore.messages;
+import org.opendaylight.controller.cluster.datastore.node.NormalizedNodeToNodeCodec;
+import org.opendaylight.controller.cluster.datastore.utils.InstanceIdentifierUtils;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages;
+import org.opendaylight.controller.protobuff.messages.datachange.notification.DataChangeListenerMessages;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-public class DataChanged {
- private final AsyncDataChangeEvent<InstanceIdentifier, NormalizedNode<?, ?>>
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+public class DataChanged implements SerializableMessage {
+ public static final Class SERIALIZABLE_CLASS =
+ DataChangeListenerMessages.DataChanged.class;
+ final private SchemaContext schemaContext;
+ private final AsyncDataChangeEvent<YangInstanceIdentifier, NormalizedNode<?, ?>>
change;
- public DataChanged(
- AsyncDataChangeEvent<InstanceIdentifier, NormalizedNode<?, ?>> change) {
+
+
+ public DataChanged(SchemaContext schemaContext,
+ AsyncDataChangeEvent<YangInstanceIdentifier, NormalizedNode<?, ?>> change) {
this.change = change;
+ this.schemaContext = schemaContext;
}
- public AsyncDataChangeEvent<InstanceIdentifier, NormalizedNode<?, ?>> getChange() {
+
+ public AsyncDataChangeEvent<YangInstanceIdentifier, NormalizedNode<?, ?>> getChange() {
return change;
}
+
+
+ private NormalizedNodeMessages.Node convertToNodeTree(
+ NormalizedNode<?, ?> normalizedNode) {
+
+ return new NormalizedNodeToNodeCodec(schemaContext)
+ .encode(YangInstanceIdentifier.builder().build(), normalizedNode)
+ .getNormalizedNode();
+
+ }
+
+ private Iterable<NormalizedNodeMessages.InstanceIdentifier> convertToRemovePaths(
+ Set<YangInstanceIdentifier> removedPaths) {
+ final Set<NormalizedNodeMessages.InstanceIdentifier> removedPathInstanceIds = new HashSet<>();
+ for (YangInstanceIdentifier id : removedPaths) {
+ removedPathInstanceIds.add(InstanceIdentifierUtils.toSerializable(id));
+ }
+ return new Iterable<NormalizedNodeMessages.InstanceIdentifier>() {
+ public Iterator<NormalizedNodeMessages.InstanceIdentifier> iterator() {
+ return removedPathInstanceIds.iterator();
+ }
+ };
+
+ }
+
+ private NormalizedNodeMessages.NodeMap convertToNodeMap(
+ Map<YangInstanceIdentifier, NormalizedNode<?, ?>> data) {
+ NormalizedNodeToNodeCodec normalizedNodeToNodeCodec =
+ new NormalizedNodeToNodeCodec(schemaContext);
+ NormalizedNodeMessages.NodeMap.Builder nodeMapBuilder =
+ NormalizedNodeMessages.NodeMap.newBuilder();
+ NormalizedNodeMessages.NodeMapEntry.Builder builder =
+ NormalizedNodeMessages.NodeMapEntry.newBuilder();
+ for (Map.Entry<YangInstanceIdentifier, NormalizedNode<?, ?>> entry : data
+ .entrySet()) {
+
+
+ NormalizedNodeMessages.InstanceIdentifier instanceIdentifier =
+ InstanceIdentifierUtils.toSerializable(entry.getKey());
+
+ builder.setInstanceIdentifierPath(instanceIdentifier)
+ .setNormalizedNode(normalizedNodeToNodeCodec
+ .encode(entry.getKey(), entry.getValue())
+ .getNormalizedNode());
+ nodeMapBuilder.addMapEntries(builder.build());
+ }
+ return nodeMapBuilder.build();
+ }
+
+
+ @Override
+ public Object toSerializable() {
+ return DataChangeListenerMessages.DataChanged.newBuilder()
+ .addAllRemovedPaths(convertToRemovePaths(change.getRemovedPaths()))
+ .setCreatedData(convertToNodeMap(change.getCreatedData()))
+ .setOriginalData(convertToNodeMap(change.getOriginalData()))
+ .setUpdatedData(convertToNodeMap(change.getUpdatedData()))
+ .setOriginalSubTree(convertToNodeTree(change.getOriginalSubtree()))
+ .setUpdatedSubTree(convertToNodeTree(change.getUpdatedSubtree()))
+ .build();
+ }
+
+ public static DataChanged fromSerialize(SchemaContext sc, Object message,
+ YangInstanceIdentifier pathId) {
+ DataChangeListenerMessages.DataChanged dataChanged =
+ (DataChangeListenerMessages.DataChanged) message;
+ DataChangedEvent event = new DataChangedEvent(sc);
+ if (dataChanged.getCreatedData() != null && dataChanged.getCreatedData()
+ .isInitialized()) {
+ event.setCreatedData(dataChanged.getCreatedData());
+ }
+ if (dataChanged.getOriginalData() != null && dataChanged
+ .getOriginalData().isInitialized()) {
+ event.setOriginalData(dataChanged.getOriginalData());
+ }
+
+ if (dataChanged.getUpdatedData() != null && dataChanged.getUpdatedData()
+ .isInitialized()) {
+ event.setUpdateData(dataChanged.getUpdatedData());
+ }
+
+ if (dataChanged.getOriginalSubTree() != null && dataChanged
+ .getOriginalSubTree().isInitialized()) {
+ event.setOriginalSubtree(dataChanged.getOriginalSubTree(), pathId);
+ }
+
+ if (dataChanged.getUpdatedSubTree() != null && dataChanged
+ .getUpdatedSubTree().isInitialized()) {
+ event.setUpdatedSubtree(dataChanged.getOriginalSubTree(), pathId);
+ }
+
+ if (dataChanged.getRemovedPathsList() != null && !dataChanged
+ .getRemovedPathsList().isEmpty()) {
+ event.setRemovedPaths(dataChanged.getRemovedPathsList());
+ }
+
+ return new DataChanged(sc, event);
+
+ }
+
+ static class DataChangedEvent implements
+ AsyncDataChangeEvent<YangInstanceIdentifier, NormalizedNode<?, ?>> {
+ private final SchemaContext schemaContext;
+ private Map<YangInstanceIdentifier, NormalizedNode<?, ?>> createdData;
+ private final NormalizedNodeToNodeCodec nodeCodec;
+ private Map<YangInstanceIdentifier, NormalizedNode<?, ?>> updatedData;
+ private Map<YangInstanceIdentifier, NormalizedNode<?, ?>> originalData;
+ private NormalizedNode<?, ?> originalSubTree;
+ private NormalizedNode<?, ?> updatedSubTree;
+ private Set<YangInstanceIdentifier> removedPathIds;
+
+ DataChangedEvent(SchemaContext schemaContext) {
+ this.schemaContext = schemaContext;
+ nodeCodec = new NormalizedNodeToNodeCodec(schemaContext);
+ }
+
+ @Override
+ public Map<YangInstanceIdentifier, NormalizedNode<?, ?>> getCreatedData() {
+ if(createdData == null){
+ return Collections.emptyMap();
+ }
+ return createdData;
+ }
+
+ DataChangedEvent setCreatedData(
+ NormalizedNodeMessages.NodeMap nodeMap) {
+ this.createdData = convertNodeMapToMap(nodeMap);
+ return this;
+ }
+
+ private Map<YangInstanceIdentifier, NormalizedNode<?, ?>> convertNodeMapToMap(
+ NormalizedNodeMessages.NodeMap nodeMap) {
+ Map<YangInstanceIdentifier, NormalizedNode<?, ?>> mapEntries =
+ new HashMap<YangInstanceIdentifier, NormalizedNode<?, ?>>();
+ for (NormalizedNodeMessages.NodeMapEntry nodeMapEntry : nodeMap
+ .getMapEntriesList()) {
+ YangInstanceIdentifier id = InstanceIdentifierUtils
+ .fromSerializable(nodeMapEntry.getInstanceIdentifierPath());
+ mapEntries.put(id,
+ nodeCodec.decode(id, nodeMapEntry.getNormalizedNode()));
+ }
+ return mapEntries;
+ }
+
+
+ @Override
+ public Map<YangInstanceIdentifier, NormalizedNode<?, ?>> getUpdatedData() {
+ if(updatedData == null){
+ return Collections.emptyMap();
+ }
+ return updatedData;
+ }
+
+ DataChangedEvent setUpdateData(NormalizedNodeMessages.NodeMap nodeMap) {
+ this.updatedData = convertNodeMapToMap(nodeMap);
+ return this;
+ }
+
+ @Override
+ public Set<YangInstanceIdentifier> getRemovedPaths() {
+ if (removedPathIds == null) {
+ return Collections.emptySet();
+ }
+ return removedPathIds;
+ }
+
+ public DataChangedEvent setRemovedPaths(List<NormalizedNodeMessages.InstanceIdentifier> removedPaths) {
+ Set<YangInstanceIdentifier> removedIds = new HashSet<>();
+ for (NormalizedNodeMessages.InstanceIdentifier path : removedPaths) {
+ removedIds.add(InstanceIdentifierUtils.fromSerializable(path));
+ }
+ this.removedPathIds = removedIds;
+ return this;
+ }
+
+ @Override
+ public Map<YangInstanceIdentifier, NormalizedNode<?, ?>> getOriginalData() {
+ if (originalData == null) {
+ Collections.emptyMap();
+ }
+ return originalData;
+ }
+
+ DataChangedEvent setOriginalData(
+ NormalizedNodeMessages.NodeMap nodeMap) {
+ this.originalData = convertNodeMapToMap(nodeMap);
+ return this;
+ }
+
+ @Override
+ public NormalizedNode<?, ?> getOriginalSubtree() {
+ return originalSubTree;
+ }
+
+ DataChangedEvent setOriginalSubtree(NormalizedNodeMessages.Node node,
+ YangInstanceIdentifier instanceIdentifierPath) {
+ originalSubTree = nodeCodec.decode(instanceIdentifierPath, node);
+ return this;
+ }
+
+ @Override
+ public NormalizedNode<?, ?> getUpdatedSubtree() {
+ return updatedSubTree;
+ }
+
+ DataChangedEvent setUpdatedSubtree(NormalizedNodeMessages.Node node,
+ YangInstanceIdentifier instanceIdentifierPath) {
+ updatedSubTree = nodeCodec.decode(instanceIdentifierPath, node);
+ return this;
+ }
+
+
+ }
+
+
+
}
package org.opendaylight.controller.cluster.datastore.messages;
-public class DataChangedReply {
+import org.opendaylight.controller.protobuff.messages.datachange.notification.DataChangeListenerMessages;
+
+public class DataChangedReply implements SerializableMessage {
+ public static final Class SERIALIZABLE_CLASS = DataChangeListenerMessages.DataChangedReply.class;
+ @Override
+ public Object toSerializable() {
+ return DataChangeListenerMessages.DataChangedReply.newBuilder().build();
+ }
}
import org.opendaylight.controller.cluster.datastore.utils.InstanceIdentifierUtils;
import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
public class DeleteData implements SerializableMessage {
public static final Class SERIALIZABLE_CLASS = ShardTransactionMessages.DeleteData.class;
- private final InstanceIdentifier path;
+ private final YangInstanceIdentifier path;
- public DeleteData(InstanceIdentifier path) {
+ public DeleteData(YangInstanceIdentifier path) {
this.path = path;
}
- public InstanceIdentifier getPath() {
+ public YangInstanceIdentifier getPath() {
return path;
}
@Override public Object toSerializable() {
return ShardTransactionMessages.DeleteData.newBuilder()
- .setInstanceIdentifierPathArguments(path.toString()).build();
+ .setInstanceIdentifierPathArguments(InstanceIdentifierUtils.toSerializable(path)).build();
}
public static DeleteData fromSerizalizable(Object serializable){
ShardTransactionMessages.DeleteData o = (ShardTransactionMessages.DeleteData) serializable;
- return new DeleteData(InstanceIdentifierUtils.from(o.getInstanceIdentifierPathArguments()));
+ return new DeleteData(InstanceIdentifierUtils.fromSerializable(o.getInstanceIdentifierPathArguments()));
}
}
package org.opendaylight.controller.cluster.datastore.messages;
-public class DeleteDataReply {
+import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages;
+
+public class DeleteDataReply implements SerializableMessage{
+ public static final Class SERIALIZABLE_CLASS = ShardTransactionMessages.DeleteDataReply.class;
+ @Override
+ public Object toSerializable() {
+ return ShardTransactionMessages.DeleteDataReply.newBuilder().build();
+ }
}
package org.opendaylight.controller.cluster.datastore.messages;
import com.google.common.base.Preconditions;
+import org.opendaylight.controller.protobuff.messages.shard.ShardManagerMessages;
/**
* The FindPrimary message is used to locate the primary of any given shard
*
- * TODO : Make this serializable
*/
-public class FindPrimary{
+public class FindPrimary implements SerializableMessage{
+ public static final Class SERIALIZABLE_CLASS = ShardManagerMessages.FindPrimary.class;
private final String shardName;
public FindPrimary(String shardName){
public String getShardName() {
return shardName;
}
+
+ @Override
+ public Object toSerializable() {
+ return ShardManagerMessages.FindPrimary.newBuilder().setShardName(shardName).build();
+ }
+
+ public static FindPrimary fromSerializable(Object message){
+ return new FindPrimary(((ShardManagerMessages.FindPrimary)message).getShardName());
+ }
}
import org.opendaylight.controller.cluster.datastore.utils.InstanceIdentifierUtils;
import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages;
import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
public static final Class SERIALIZABLE_CLASS = ShardTransactionMessages.MergeData.class;
- public MergeData(InstanceIdentifier path, NormalizedNode<?, ?> data,
+ public MergeData(YangInstanceIdentifier path, NormalizedNode<?, ?> data,
SchemaContext context) {
super(path, data, context);
}
@Override public Object toSerializable() {
NormalizedNodeMessages.Node normalizedNode =
- new NormalizedNodeToNodeCodec(schemaContext).encode(InstanceIdentifierUtils.from(path.toString()), data)
+ new NormalizedNodeToNodeCodec(schemaContext).encode(path, data)
.getNormalizedNode();
return ShardTransactionMessages.MergeData.newBuilder()
- .setInstanceIdentifierPathArguments(path.toString())
+ .setInstanceIdentifierPathArguments(InstanceIdentifierUtils.toSerializable(path))
.setNormalizedNode(normalizedNode).build();
}
public static MergeData fromSerializable(Object serializable, SchemaContext schemaContext){
ShardTransactionMessages.MergeData o = (ShardTransactionMessages.MergeData) serializable;
- InstanceIdentifier identifier = InstanceIdentifierUtils.from(o.getInstanceIdentifierPathArguments());
+ YangInstanceIdentifier identifier = InstanceIdentifierUtils.fromSerializable(o.getInstanceIdentifierPathArguments());
NormalizedNode<?, ?> normalizedNode =
new NormalizedNodeToNodeCodec(schemaContext)
package org.opendaylight.controller.cluster.datastore.messages;
-public class MergeDataReply {
+import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages;
+
+public class MergeDataReply implements SerializableMessage{
+ public static final Class SERIALIZABLE_CLASS = ShardTransactionMessages.MergeDataReply.class;
+
+ @Override
+ public Object toSerializable() {
+ return ShardTransactionMessages.MergeDataReply.newBuilder().build();
+ }
}
package org.opendaylight.controller.cluster.datastore.messages;
import com.google.common.base.Preconditions;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
public abstract class ModifyData implements SerializableMessage {
- protected final InstanceIdentifier path;
+ protected final YangInstanceIdentifier path;
protected final NormalizedNode<?, ?> data;
protected final SchemaContext schemaContext;
- public ModifyData(InstanceIdentifier path, NormalizedNode<?, ?> data,
+ public ModifyData(YangInstanceIdentifier path, NormalizedNode<?, ?> data,
SchemaContext context) {
Preconditions.checkNotNull(context,
"Cannot serialize an object which does not have a schema schemaContext");
this.schemaContext = context;
}
- public InstanceIdentifier getPath() {
+ public YangInstanceIdentifier getPath() {
return path;
}
package org.opendaylight.controller.cluster.datastore.messages;
-public class PreCommitTransaction {
+import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
+
+public class PreCommitTransaction implements SerializableMessage{
+
+ public static Class SERIALIZABLE_CLASS = ThreePhaseCommitCohortMessages.PreCommitTransaction.class;
+
+ @Override
+ public Object toSerializable() {
+ return ThreePhaseCommitCohortMessages.PreCommitTransaction.newBuilder().build();
+ }
}
package org.opendaylight.controller.cluster.datastore.messages;
-public class PreCommitTransactionReply {
+import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
+
+public class PreCommitTransactionReply implements SerializableMessage{
+
+ public static Class SERIALIZABLE_CLASS = ThreePhaseCommitCohortMessages.PreCommitTransactionReply.class;
+
+ @Override
+ public Object toSerializable() {
+ return ThreePhaseCommitCohortMessages.PreCommitTransactionReply.newBuilder().build();
+ }
}
package org.opendaylight.controller.cluster.datastore.messages;
-public class PrimaryFound {
+import org.opendaylight.controller.protobuff.messages.shard.ShardManagerMessages;
+
+public class PrimaryFound implements SerializableMessage {
+ public static final Class SERIALIZABLE_CLASS = ShardManagerMessages.PrimaryFound.class;
private final String primaryPath;
public PrimaryFound(String primaryPath) {
}
+ @Override
+ public Object toSerializable() {
+ return ShardManagerMessages.PrimaryFound.newBuilder().setPrimaryPath(primaryPath).build();
+ }
+
+ public static PrimaryFound fromSerializable(Object message){
+ return new PrimaryFound(((ShardManagerMessages.PrimaryFound)message).getPrimaryPath());
+ }
}
package org.opendaylight.controller.cluster.datastore.messages;
import com.google.common.base.Preconditions;
+import org.opendaylight.controller.protobuff.messages.shard.ShardManagerMessages;
-public class PrimaryNotFound {
+public class PrimaryNotFound implements SerializableMessage {
+ public static final Class SERIALIZABLE_CLASS = ShardManagerMessages.PrimaryNotFound.class;
private final String shardName;
public int hashCode() {
return shardName != null ? shardName.hashCode() : 0;
}
+
+ @Override
+ public Object toSerializable() {
+ return ShardManagerMessages.PrimaryNotFound.newBuilder().setShardName(shardName).build();
+ }
+
+ public static PrimaryNotFound fromSerializable(Object message){
+ return new PrimaryNotFound(((ShardManagerMessages.PrimaryNotFound)message).getShardName());
+ }
}
import org.opendaylight.controller.cluster.datastore.utils.InstanceIdentifierUtils;
import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
public class ReadData {
public static final Class SERIALIZABLE_CLASS = ShardTransactionMessages.ReadData.class;
- private final InstanceIdentifier path;
+ private final YangInstanceIdentifier path;
- public ReadData(InstanceIdentifier path) {
+ public ReadData(YangInstanceIdentifier path) {
this.path = path;
}
- public InstanceIdentifier getPath() {
+ public YangInstanceIdentifier getPath() {
return path;
}
public Object toSerializable(){
return ShardTransactionMessages.ReadData.newBuilder()
- .setInstanceIdentifierPathArguments(path.toString())
+ .setInstanceIdentifierPathArguments(InstanceIdentifierUtils.toSerializable(path))
.build();
}
public static ReadData fromSerializable(Object serializable){
ShardTransactionMessages.ReadData o = (ShardTransactionMessages.ReadData) serializable;
- return new ReadData(InstanceIdentifierUtils.from(o.getInstanceIdentifierPathArguments()));
+ return new ReadData(InstanceIdentifierUtils.fromSerializable(o.getInstanceIdentifierPathArguments()));
}
}
import org.opendaylight.controller.cluster.datastore.node.NormalizedNodeToNodeCodec;
import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
public class ReadDataReply implements SerializableMessage{
+
private final NormalizedNode<?, ?> normalizedNode;
private final SchemaContext schemaContext;
public static final Class SERIALIZABLE_CLASS = ShardTransactionMessages.ReadDataReply.class;
if(normalizedNode != null) {
return ShardTransactionMessages.ReadDataReply.newBuilder()
.setNormalizedNode(new NormalizedNodeToNodeCodec(schemaContext)
- .encode(InstanceIdentifier.builder().build(), normalizedNode).getNormalizedNode()
+ .encode(YangInstanceIdentifier.builder().build(), normalizedNode).getNormalizedNode()
).build();
}else{
return ShardTransactionMessages.ReadDataReply.newBuilder().build();
}
- public static ReadDataReply fromSerializable(SchemaContext schemaContext,InstanceIdentifier id,Object serializable){
+ public static ReadDataReply fromSerializable(SchemaContext schemaContext,YangInstanceIdentifier id,Object serializable){
ShardTransactionMessages.ReadDataReply o = (ShardTransactionMessages.ReadDataReply) serializable;
return new ReadDataReply(schemaContext,new NormalizedNodeToNodeCodec(schemaContext).decode(id, o.getNormalizedNode()));
}
package org.opendaylight.controller.cluster.datastore.messages;
-public class ReadyTransaction {
+import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages;
+
+public class ReadyTransaction implements SerializableMessage{
+ public static final Class SERIALIZABLE_CLASS = ShardTransactionMessages.ReadyTransaction.class;
+
+ @Override
+ public Object toSerializable() {
+ return ShardTransactionMessages.ReadyTransaction.newBuilder().build();
+ }
+
}
package org.opendaylight.controller.cluster.datastore.messages;
import akka.actor.ActorPath;
+import akka.actor.ActorSystem;
+import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages;
-public class ReadyTransactionReply {
+public class ReadyTransactionReply implements SerializableMessage {
+ public static final Class SERIALIZABLE_CLASS = ShardTransactionMessages.ReadyTransactionReply.class;
private final ActorPath cohortPath;
public ReadyTransactionReply(ActorPath cohortPath) {
public ActorPath getCohortPath() {
return cohortPath;
}
+
+ @Override
+ public ShardTransactionMessages.ReadyTransactionReply toSerializable() {
+ return ShardTransactionMessages.ReadyTransactionReply.newBuilder()
+ .setActorPath(cohortPath.toString()).build();
+ }
+
+ public static ReadyTransactionReply fromSerializable(ActorSystem actorSystem,Object serializable){
+ ShardTransactionMessages.ReadyTransactionReply o = (ShardTransactionMessages.ReadyTransactionReply) serializable;
+ return new ReadyTransactionReply(
+ actorSystem.actorFor(o.getActorPath()).path());
+ }
}
import org.opendaylight.controller.cluster.datastore.utils.InstanceIdentifierUtils;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker;
import org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
public class RegisterChangeListener implements SerializableMessage {
public static final Class SERIALIZABLE_CLASS = ListenerRegistrationMessages.RegisterChangeListener.class;
- private final InstanceIdentifier path;
+ private final YangInstanceIdentifier path;
private final ActorPath dataChangeListenerPath;
private final AsyncDataBroker.DataChangeScope scope;
- public RegisterChangeListener(InstanceIdentifier path,
+ public RegisterChangeListener(YangInstanceIdentifier path,
ActorPath dataChangeListenerPath,
AsyncDataBroker.DataChangeScope scope) {
this.path = path;
this.scope = scope;
}
- public InstanceIdentifier getPath() {
+ public YangInstanceIdentifier getPath() {
return path;
}
@Override
public ListenerRegistrationMessages.RegisterChangeListener toSerializable() {
return ListenerRegistrationMessages.RegisterChangeListener.newBuilder()
- .setInstanceIdentifierPath(path.toString())
+ .setInstanceIdentifierPath(InstanceIdentifierUtils.toSerializable(path))
.setDataChangeListenerActorPath(dataChangeListenerPath.toString())
.setDataChangeScope(scope.ordinal()).build();
}
public static RegisterChangeListener fromSerializable(ActorSystem actorSystem,Object serializable){
ListenerRegistrationMessages.RegisterChangeListener o = (ListenerRegistrationMessages.RegisterChangeListener) serializable;
- return new RegisterChangeListener(InstanceIdentifierUtils.from(o.getInstanceIdentifierPath()),
+ return new RegisterChangeListener(InstanceIdentifierUtils.fromSerializable(o.getInstanceIdentifierPath()),
actorSystem.actorFor(o.getDataChangeListenerActorPath()).path(),
AsyncDataBroker.DataChangeScope.values()[o.getDataChangeScope()]);
}
import org.opendaylight.controller.cluster.datastore.utils.InstanceIdentifierUtils;
import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages;
import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
public static final Class SERIALIZABLE_CLASS = ShardTransactionMessages.WriteData.class;
- public WriteData(InstanceIdentifier path, NormalizedNode<?, ?> data, SchemaContext schemaContext) {
+ public WriteData(YangInstanceIdentifier path, NormalizedNode<?, ?> data, SchemaContext schemaContext) {
super(path, data, schemaContext);
}
@Override public Object toSerializable() {
NormalizedNodeMessages.Node normalizedNode =
- new NormalizedNodeToNodeCodec(schemaContext).encode(
- InstanceIdentifierUtils.from(path.toString()), data)
+ new NormalizedNodeToNodeCodec(schemaContext).encode(path, data)
.getNormalizedNode();
return ShardTransactionMessages.WriteData.newBuilder()
- .setInstanceIdentifierPathArguments(path.toString())
+ .setInstanceIdentifierPathArguments(InstanceIdentifierUtils.toSerializable(path))
.setNormalizedNode(normalizedNode).build();
}
public static WriteData fromSerializable(Object serializable, SchemaContext schemaContext){
ShardTransactionMessages.WriteData o = (ShardTransactionMessages.WriteData) serializable;
- InstanceIdentifier identifier = InstanceIdentifierUtils.from(o.getInstanceIdentifierPathArguments());
+ YangInstanceIdentifier identifier = InstanceIdentifierUtils.fromSerializable(o.getInstanceIdentifierPathArguments());
NormalizedNode<?, ?> normalizedNode =
new NormalizedNodeToNodeCodec(schemaContext)
package org.opendaylight.controller.cluster.datastore.messages;
-public class WriteDataReply {
+import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages;
+
+public class WriteDataReply implements SerializableMessage{
+ public static final Class SERIALIZABLE_CLASS = ShardTransactionMessages.WriteDataReply.class;
+ @Override
+ public Object toSerializable() {
+ return ShardTransactionMessages.WriteDataReply.newBuilder().build();
+ }
}
package org.opendaylight.controller.cluster.datastore.modification;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import java.io.Serializable;
private static final long serialVersionUID = 1638042650152084457L;
- protected final InstanceIdentifier path;
+ protected final YangInstanceIdentifier path;
- protected AbstractModification(InstanceIdentifier path) {
+ protected AbstractModification(YangInstanceIdentifier path) {
this.path = path;
}
}
import org.opendaylight.controller.cluster.datastore.utils.InstanceIdentifierUtils;
import org.opendaylight.controller.protobuff.messages.persistent.PersistentMessages;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
/**
* DeleteModification store all the parameters required to delete a path from the data tree
*/
public class DeleteModification extends AbstractModification {
- public DeleteModification(InstanceIdentifier path) {
+ public DeleteModification(YangInstanceIdentifier path) {
super(path);
}
@Override public Object toSerializable() {
return PersistentMessages.Modification.newBuilder()
.setType(this.getClass().toString())
- .setPath(this.path.toString())
+ .setPath(InstanceIdentifierUtils.toSerializable(this.path))
.build();
}
public static DeleteModification fromSerializable(Object serializable){
PersistentMessages.Modification o = (PersistentMessages.Modification) serializable;
- return new DeleteModification(InstanceIdentifierUtils.from(o.getPath()));
+ return new DeleteModification(InstanceIdentifierUtils.fromSerializable(o.getPath()));
}
}
import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages;
import org.opendaylight.controller.protobuff.messages.persistent.PersistentMessages;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
private final SchemaContext schemaContext;
- public MergeModification(InstanceIdentifier path, NormalizedNode data,
+ public MergeModification(YangInstanceIdentifier path, NormalizedNode data,
SchemaContext schemaContext) {
super(path);
this.data = data;
@Override public Object toSerializable() {
NormalizedNodeMessages.Container encode =
new NormalizedNodeToNodeCodec(schemaContext).encode(
- InstanceIdentifierUtils.from(path.toString()), data);
+ path, data);
return PersistentMessages.Modification.newBuilder()
.setType(this.getClass().toString())
- .setPath(this.path.toString())
+ .setPath(InstanceIdentifierUtils.toSerializable(this.path))
.setData(encode.getNormalizedNode())
.build();
SchemaContext schemaContext) {
PersistentMessages.Modification o = (PersistentMessages.Modification) serializable;
- InstanceIdentifier path = InstanceIdentifierUtils.from(o.getPath());
+ YangInstanceIdentifier path = InstanceIdentifierUtils.fromSerializable(o.getPath());
NormalizedNode data = new NormalizedNodeToNodeCodec(schemaContext).decode(
path, o.getData());
import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages;
import org.opendaylight.controller.protobuff.messages.persistent.PersistentMessages;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
private final NormalizedNode data;
private final SchemaContext schemaContext;
- public WriteModification(InstanceIdentifier path, NormalizedNode data, SchemaContext schemaContext) {
+ public WriteModification(YangInstanceIdentifier path, NormalizedNode data, SchemaContext schemaContext) {
super(path);
this.data = data;
this.schemaContext = schemaContext;
@Override public Object toSerializable() {
NormalizedNodeMessages.Container encode =
new NormalizedNodeToNodeCodec(schemaContext).encode(
- InstanceIdentifierUtils.from(path.toString()), data);
+ path, data);
return PersistentMessages.Modification.newBuilder()
.setType(this.getClass().toString())
- .setPath(this.path.toString())
+ .setPath(InstanceIdentifierUtils.toSerializable(this.path))
.setData(encode.getNormalizedNode())
.build();
SchemaContext schemaContext) {
PersistentMessages.Modification o = (PersistentMessages.Modification) serializable;
- InstanceIdentifier path = InstanceIdentifierUtils.from(o.getPath());
+ YangInstanceIdentifier path = InstanceIdentifierUtils.fromSerializable(o.getPath());
NormalizedNode data = new NormalizedNodeToNodeCodec(schemaContext).decode(
path, o.getData());
package org.opendaylight.controller.cluster.datastore.shardstrategy;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
/**
* The DefaultShardStrategy basically puts all data into the default Shard
public static final String DEFAULT_SHARD = "default";
@Override
- public String findShard(InstanceIdentifier path) {
+ public String findShard(YangInstanceIdentifier path) {
return DEFAULT_SHARD;
}
}
package org.opendaylight.controller.cluster.datastore.shardstrategy;
import org.opendaylight.controller.cluster.datastore.Configuration;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
public class ModuleShardStrategy implements ShardStrategy {
this.configuration = configuration;
}
- @Override public String findShard(InstanceIdentifier path) {
+ @Override public String findShard(YangInstanceIdentifier path) {
return configuration.getShardNamesFromModuleName(moduleName).get(0);
}
}
package org.opendaylight.controller.cluster.datastore.shardstrategy;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
/**
* The role of ShardStrategy is to figure out which Shards a given piece of data belongs to
* @param path The location of the data in the logical tree
* @return
*/
- String findShard(InstanceIdentifier path);
+ String findShard(YangInstanceIdentifier path);
}
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import org.opendaylight.controller.cluster.datastore.Configuration;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
moduleNameToStrategyMap = configuration.getModuleNameToShardStrategyMap();
}
- public static ShardStrategy getStrategy(InstanceIdentifier path) {
+ public static ShardStrategy getStrategy(YangInstanceIdentifier path) {
Preconditions.checkState(configuration != null, "configuration should not be missing");
Preconditions.checkNotNull(path, "path should not be null");
}
- private static String getModuleName(InstanceIdentifier path) {
- String namespace = path.getLastPathArgument().getNodeType().getNamespace()
- .toASCIIString();
+ private static String getModuleName(YangInstanceIdentifier path) {
+ String namespace = path.getPathArguments().iterator().next().getNodeType().getNamespace().toASCIIString();
Optional<String> optional =
configuration.getModuleNameFromNameSpace(namespace);
import akka.actor.ActorSystem;
import akka.actor.PoisonPill;
import akka.util.Timeout;
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import org.opendaylight.controller.cluster.datastore.ClusterWrapper;
import org.opendaylight.controller.cluster.datastore.Configuration;
import org.opendaylight.controller.cluster.datastore.exceptions.PrimaryNotFoundException;
import org.opendaylight.controller.cluster.datastore.exceptions.TimeoutException;
private static final Logger
LOG = LoggerFactory.getLogger(ActorContext.class);
- public static final FiniteDuration ASK_DURATION = Duration.create(5, TimeUnit.SECONDS);
- public static final Duration AWAIT_DURATION = Duration.create(5, TimeUnit.SECONDS);
+ public static final FiniteDuration ASK_DURATION =
+ Duration.create(5, TimeUnit.SECONDS);
+ public static final Duration AWAIT_DURATION =
+ Duration.create(5, TimeUnit.SECONDS);
private final ActorSystem actorSystem;
private final ActorRef shardManager;
+ private final ClusterWrapper clusterWrapper;
private final Configuration configuration;
private SchemaContext schemaContext = null;
- public ActorContext(ActorSystem actorSystem, ActorRef shardManager, Configuration configuration){
+ public ActorContext(ActorSystem actorSystem, ActorRef shardManager,
+ ClusterWrapper clusterWrapper,
+ Configuration configuration) {
this.actorSystem = actorSystem;
this.shardManager = shardManager;
+ this.clusterWrapper = clusterWrapper;
this.configuration = configuration;
}
return shardManager;
}
- public ActorSelection actorSelection(String actorPath){
+ public ActorSelection actorSelection(String actorPath) {
return actorSystem.actorSelection(actorPath);
}
- public ActorSelection actorSelection(ActorPath actorPath){
+ public ActorSelection actorSelection(ActorPath actorPath) {
return actorSystem.actorSelection(actorPath);
}
* @return
*/
public ActorSelection findPrimary(String shardName) {
+ String path = findPrimaryPath(shardName);
+ return actorSystem.actorSelection(path);
+ }
+
+ public String findPrimaryPath(String shardName) {
Object result = executeLocalOperation(shardManager,
- new FindPrimary(shardName), ASK_DURATION);
+ new FindPrimary(shardName).toSerializable(), ASK_DURATION);
- if(result instanceof PrimaryFound){
- PrimaryFound found = (PrimaryFound) result;
+ if (result.getClass().equals(PrimaryFound.SERIALIZABLE_CLASS)) {
+ PrimaryFound found = PrimaryFound.fromSerializable(result);
- LOG.error("Primary found {}", found.getPrimaryPath());
+ LOG.debug("Primary found {}", found.getPrimaryPath());
- return actorSystem.actorSelection(found.getPrimaryPath());
+ return found.getPrimaryPath();
}
throw new PrimaryNotFoundException();
}
+
/**
* Executes an operation on a local actor and wait for it's response
+ *
* @param actor
* @param message
* @param duration
* @return The response of the operation
*/
public Object executeLocalOperation(ActorRef actor, Object message,
- FiniteDuration duration){
+ FiniteDuration duration) {
Future<Object> future =
ask(actor, message, new Timeout(duration));
/**
* Execute an operation on a remote actor and wait for it's response
+ *
* @param actor
* @param message
* @param duration
* @return
*/
public Object executeRemoteOperation(ActorSelection actor, Object message,
- FiniteDuration duration){
+ FiniteDuration duration) {
+
+ LOG.debug("Sending remote message {} to {}", message.getClass().toString(), actor.toString());
+
Future<Object> future =
ask(actor, message, new Timeout(duration));
/**
* Execute an operation on the primary for a given shard
* <p>
- * This method first finds the primary for a given shard ,then sends
- * the message to the remote shard and waits for a response
+ * This method first finds the primary for a given shard ,then sends
+ * the message to the remote shard and waits for a response
* </p>
+ *
* @param shardName
* @param message
* @param duration
- * @throws org.opendaylight.controller.cluster.datastore.exceptions.TimeoutException if the message to the remote shard times out
- * @throws org.opendaylight.controller.cluster.datastore.exceptions.PrimaryNotFoundException if the primary shard is not found
- *
* @return
+ * @throws org.opendaylight.controller.cluster.datastore.exceptions.TimeoutException if the message to the remote shard times out
+ * @throws org.opendaylight.controller.cluster.datastore.exceptions.PrimaryNotFoundException if the primary shard is not found
*/
- public Object executeShardOperation(String shardName, Object message, FiniteDuration duration){
+ public Object executeShardOperation(String shardName, Object message,
+ FiniteDuration duration) {
ActorSelection primary = findPrimary(shardName);
return executeRemoteOperation(primary, message, duration);
shardManager.tell(PoisonPill.getInstance(), null);
actorSystem.shutdown();
}
+
+ public String getRemoteActorPath(final String shardName,
+ final String localPathOfRemoteActor) {
+ final String path = findPrimaryPath(shardName);
+
+ LoadingCache<String, String> graphs = CacheBuilder.newBuilder()
+ .expireAfterAccess(2, TimeUnit.SECONDS)
+ .build(
+ new CacheLoader<String, String>() {
+ public String load(String key) {
+ return resolvePath(path, localPathOfRemoteActor);
+ }
+ }
+ );
+ return graphs.getUnchecked(localPathOfRemoteActor);
+ }
+
+ public String resolvePath(final String primaryPath,
+ final String localPathOfRemoteActor) {
+ StringBuilder builder = new StringBuilder();
+ String[] primaryPathElements = primaryPath.split("/");
+ builder.append(primaryPathElements[0]).append("//")
+ .append(primaryPathElements[1]).append(primaryPathElements[2]);
+ String[] remotePathElements = localPathOfRemoteActor.split("/");
+ for (int i = 3; i < remotePathElements.length; i++) {
+ builder.append("/").append(remotePathElements[i]);
+ }
+
+ return builder.toString();
+
+ }
+
+ public ActorPath actorFor(String path){
+ return actorSystem.actorFor(path).path();
+ }
+
+ public String getCurrentMemberName(){
+ return clusterWrapper.getCurrentMemberName();
+ }
+
}
package org.opendaylight.controller.cluster.datastore.utils;
import org.opendaylight.controller.cluster.datastore.node.utils.NodeIdentifierFactory;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.List;
* @author: syedbahm
*/
public class InstanceIdentifierUtils {
- public static String getParentPath(String currentElementPath) {
- String parentPath = "";
-
- if (currentElementPath != null) {
- String[] parentPaths = currentElementPath.split("/");
- if (parentPaths.length > 2) {
- for (int i = 0; i < parentPaths.length - 1; i++) {
- if (parentPaths[i].length() > 0) {
- parentPath += "/" + parentPaths[i];
- }
+
+ protected static final Logger logger = LoggerFactory
+ .getLogger(InstanceIdentifierUtils.class);
+
+ public static String getParentPath(String currentElementPath) {
+ String parentPath = "";
+
+ if (currentElementPath != null) {
+ String[] parentPaths = currentElementPath.split("/");
+ if (parentPaths.length > 2) {
+ for (int i = 0; i < parentPaths.length - 1; i++) {
+ if (parentPaths[i].length() > 0) {
+ parentPath += "/" + parentPaths[i];
+ }
+ }
+ }
+ }
+ return parentPath;
+ }
+
+ @Deprecated
+ public static YangInstanceIdentifier from(String path) {
+ String[] ids = path.split("/");
+
+ List<YangInstanceIdentifier.PathArgument> pathArguments =
+ new ArrayList<>();
+ for (String nodeId : ids) {
+ if (!"".equals(nodeId)) {
+ pathArguments
+ .add(NodeIdentifierFactory.getArgument(nodeId));
+ }
}
- }
+ final YangInstanceIdentifier instanceIdentifier =
+ YangInstanceIdentifier.create(pathArguments);
+ return instanceIdentifier;
}
- return parentPath;
- }
- public static InstanceIdentifier from(String path) {
- String[] ids = path.split("/");
+ /**
+ * @deprecated Use {@link org.opendaylight.controller.cluster.datastore.util.InstanceIdentifierUtils} instead
+ * @param path
+ * @return
+ */
+ @Deprecated
+ public static NormalizedNodeMessages.InstanceIdentifier toSerializable(YangInstanceIdentifier path){
+ return org.opendaylight.controller.cluster.datastore.util.InstanceIdentifierUtils.toSerializable(path);
+ }
- List<InstanceIdentifier.PathArgument> pathArguments = new ArrayList<>();
- for (String nodeId : ids) {
- if (!"".equals(nodeId)) {
- pathArguments.add(NodeIdentifierFactory.getArgument(nodeId));
- }
+ /**
+ * @deprecated Use {@link org.opendaylight.controller.cluster.datastore.util.InstanceIdentifierUtils} instead
+ * @param path
+ * @return
+ */
+ @Deprecated
+ public static YangInstanceIdentifier fromSerializable(NormalizedNodeMessages.InstanceIdentifier path){
+ return org.opendaylight.controller.cluster.datastore.util.InstanceIdentifierUtils.fromSerializable(path);
}
- final InstanceIdentifier instanceIdentifier =
- new InstanceIdentifier(pathArguments);
- return instanceIdentifier;
- }
}
--- /dev/null
+module-shards = [
+ {
+ name = "default"
+ shards = [
+ {
+ name="default",
+ replicas = [
+ "member-1",
+ ]
+ }
+ ]
+ },
+ {
+ name = "inventory"
+ shards = [
+ {
+ name="inventory"
+ replicas = [
+ "member-1",
+ ]
+ }
+ ]
+ }
+
+]
--- /dev/null
+modules = [
+ {
+ name = "inventory"
+ namespace = "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test:people"
+ shard-strategy = "module"
+ }
+]
import akka.actor.ActorRef;
import akka.actor.ActorSelection;
import akka.actor.Props;
-import akka.actor.Terminated;
import akka.testkit.JavaTestKit;
import junit.framework.Assert;
import org.junit.Test;
import org.opendaylight.controller.cluster.datastore.messages.CommitTransaction;
-import org.opendaylight.controller.cluster.datastore.messages.CommitTransactionReply;
import org.opendaylight.controller.cluster.datastore.messages.CreateTransaction;
import org.opendaylight.controller.cluster.datastore.messages.CreateTransactionChain;
import org.opendaylight.controller.cluster.datastore.messages.CreateTransactionChainReply;
new UpdateSchemaContext(TestModel.createTestContext()),
getRef());
- shard.tell(new CreateTransactionChain(), getRef());
+ shard.tell(new CreateTransactionChain().toSerializable(), getRef());
final ActorSelection transactionChain =
new ExpectMsg<ActorSelection>("CreateTransactionChainReply") {
protected ActorSelection match(Object in) {
- if (in instanceof CreateTransactionChainReply) {
+ if (in.getClass().equals(CreateTransactionChainReply.SERIALIZABLE_CLASS)) {
ActorPath transactionChainPath =
- ((CreateTransactionChainReply) in)
+ CreateTransactionChainReply.fromSerializable(getSystem(),in)
.getTransactionChainPath();
return getSystem()
.actorSelection(transactionChainPath);
Assert.assertNotNull(transactionChain);
- transactionChain.tell(new CreateTransaction("txn-1"), getRef());
+ transactionChain.tell(new CreateTransaction("txn-1").toSerializable(), getRef());
final ActorSelection transaction =
new ExpectMsg<ActorSelection>("CreateTransactionReply") {
Boolean writeDone = new ExpectMsg<Boolean>("WriteDataReply") {
protected Boolean match(Object in) {
- if (in instanceof WriteDataReply) {
+ if (in.getClass().equals(WriteDataReply.SERIALIZABLE_CLASS)) {
return true;
} else {
throw noMatch();
Assert.assertTrue(writeDone);
- transaction.tell(new ReadyTransaction(), getRef());
+ transaction.tell(new ReadyTransaction().toSerializable(), getRef());
final ActorSelection cohort =
new ExpectMsg<ActorSelection>("ReadyTransactionReply") {
protected ActorSelection match(Object in) {
- if (in instanceof ReadyTransactionReply) {
+ if (in.getClass().equals(ReadyTransactionReply.SERIALIZABLE_CLASS)) {
ActorPath cohortPath =
- ((ReadyTransactionReply) in)
+ ReadyTransactionReply.fromSerializable(getSystem(),in)
.getCohortPath();
return getSystem()
.actorSelection(cohortPath);
// Add a watch on the transaction actor so that we are notified when it dies
final ActorRef cohorActorRef = watchActor(cohort);
- cohort.tell(new PreCommitTransaction(), getRef());
+ cohort.tell(new PreCommitTransaction().toSerializable(), getRef());
Boolean preCommitDone =
new ExpectMsg<Boolean>("PreCommitTransactionReply") {
protected Boolean match(Object in) {
- if (in instanceof PreCommitTransactionReply) {
+ if (in.getClass().equals(PreCommitTransactionReply.SERIALIZABLE_CLASS)) {
return true;
} else {
throw noMatch();
Assert.assertTrue(preCommitDone);
- // FIXME : When we commit on the cohort it "kills" the Transaction.
- // This in turn kills the child of Transaction as well.
- // The order in which we receive the terminated event for both
- // these actors is not fixed which may cause this test to fail
- cohort.tell(new CommitTransaction(), getRef());
+ cohort.tell(new CommitTransaction().toSerializable(), getRef());
- final Boolean terminatedCohort =
- new ExpectMsg<Boolean>("Terminated Cohort") {
- protected Boolean match(Object in) {
- if (in instanceof Terminated) {
- return cohorActorRef.equals(((Terminated) in).actor());
- } else {
- throw noMatch();
- }
- }
- }.get(); // this extracts the received message
-
- Assert.assertTrue(terminatedCohort);
-
-
- final Boolean terminatedTransaction =
- new ExpectMsg<Boolean>("Terminated Transaction") {
- protected Boolean match(Object in) {
- if (in instanceof Terminated) {
- return transactionActorRef.equals(((Terminated) in).actor());
- } else {
- throw noMatch();
- }
- }
- }.get(); // this extracts the received message
-
- Assert.assertTrue(terminatedTransaction);
-
- final Boolean commitDone =
- new ExpectMsg<Boolean>("CommitTransactionReply") {
- protected Boolean match(Object in) {
- if (in instanceof CommitTransactionReply) {
- return true;
- } else {
- throw noMatch();
- }
- }
- }.get(); // this extracts the received message
-
- Assert.assertTrue(commitDone);
+ // FIXME : Add assertions that the commit worked and that the cohort and transaction actors were terminated
}
package org.opendaylight.controller.cluster.datastore;
+import com.typesafe.config.ConfigFactory;
import junit.framework.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
+import java.io.File;
import java.util.List;
import static org.junit.Assert.assertTrue;
assertTrue(memberShardNames.contains("people-1"));
assertTrue(memberShardNames.contains("cars-1"));
}
+
+ @Test
+ public void testReadConfigurationFromFile(){
+ File f = new File("./module-shards.conf");
+ ConfigFactory.parseFile(f);
+ }
}
import org.opendaylight.controller.cluster.datastore.utils.ActorContext;
import org.opendaylight.controller.cluster.datastore.utils.DoNothingActor;
import org.opendaylight.controller.cluster.datastore.utils.MessageCollectorActor;
+import org.opendaylight.controller.cluster.datastore.utils.MockClusterWrapper;
import org.opendaylight.controller.cluster.datastore.utils.MockConfiguration;
+import org.opendaylight.controller.md.cluster.datastore.model.CompositeModel;
+import org.opendaylight.controller.md.cluster.datastore.model.TestModel;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class DataChangeListenerProxyTest extends AbstractActorTest {
- private static class MockDataChangeEvent implements
- AsyncDataChangeEvent<InstanceIdentifier,NormalizedNode<?,?>> {
+ private static class MockDataChangedEvent implements AsyncDataChangeEvent<YangInstanceIdentifier, NormalizedNode<?, ?>> {
+ Map<YangInstanceIdentifier,NormalizedNode<?,?>> createdData = new HashMap();
+ Map<YangInstanceIdentifier,NormalizedNode<?,?>> updatedData = new HashMap();
+ Map<YangInstanceIdentifier,NormalizedNode<?,?>> originalData = new HashMap();
- @Override
- public Map<InstanceIdentifier, NormalizedNode<?, ?>> getCreatedData() {
- throw new UnsupportedOperationException("getCreatedData");
- }
- @Override
- public Map<InstanceIdentifier, NormalizedNode<?, ?>> getUpdatedData() {
- throw new UnsupportedOperationException("getUpdatedData");
- }
- @Override public Set<InstanceIdentifier> getRemovedPaths() {
- throw new UnsupportedOperationException("getRemovedPaths");
- }
+ @Override
+ public Map<YangInstanceIdentifier, NormalizedNode<?, ?>> getCreatedData() {
+ createdData.put(YangInstanceIdentifier.builder().build(), CompositeModel.createDocumentOne(CompositeModel.createTestContext()));
+ return createdData;
+ }
- @Override
- public Map<InstanceIdentifier, NormalizedNode<?, ?>> getOriginalData() {
- throw new UnsupportedOperationException("getOriginalData");
- }
+ @Override
+ public Map<YangInstanceIdentifier, NormalizedNode<?, ?>> getUpdatedData() {
+ updatedData.put(YangInstanceIdentifier.builder().build(), CompositeModel.createTestContainer());
+ return updatedData;
- @Override public NormalizedNode<?, ?> getOriginalSubtree() {
- throw new UnsupportedOperationException("getOriginalSubtree");
- }
+ }
- @Override public NormalizedNode<?, ?> getUpdatedSubtree() {
- throw new UnsupportedOperationException("getUpdatedSubtree");
- }
+ @Override
+ public Set<YangInstanceIdentifier> getRemovedPaths() {
+ Set<YangInstanceIdentifier>ids = new HashSet();
+ ids.add( CompositeModel.TEST_PATH);
+ return ids;
}
- @Test
+ @Override
+ public Map<YangInstanceIdentifier, NormalizedNode<?, ?>> getOriginalData() {
+ originalData.put(YangInstanceIdentifier.builder().build(), CompositeModel.createFamily());
+ return originalData;
+ }
+
+ @Override public NormalizedNode<?, ?> getOriginalSubtree() {
+ return CompositeModel.createFamily() ;
+ }
+
+ @Override public NormalizedNode<?, ?> getUpdatedSubtree() {
+ return CompositeModel.createTestContainer();
+ }
+ }
+
+
+ @Test
public void testOnDataChanged() throws Exception {
final Props props = Props.create(MessageCollectorActor.class);
final ActorRef actorRef = getSystem().actorOf(props);
DataChangeListenerProxy dataChangeListenerProxy =
- new DataChangeListenerProxy(
+ new DataChangeListenerProxy(TestModel.createTestContext(),
getSystem().actorSelection(actorRef.path()));
- dataChangeListenerProxy.onDataChanged(new MockDataChangeEvent());
+ dataChangeListenerProxy.onDataChanged(new MockDataChangedEvent());
//Check if it was received by the remote actor
ActorContext
- testContext = new ActorContext(getSystem(), getSystem().actorOf(Props.create(DoNothingActor.class)), new MockConfiguration());
+ testContext = new ActorContext(getSystem(), getSystem().actorOf(Props.create(DoNothingActor.class)), new MockClusterWrapper(), new MockConfiguration());
Object messages = testContext
.executeLocalOperation(actorRef, "messages",
ActorContext.ASK_DURATION);
Assert.assertEquals(1, listMessages.size());
- Assert.assertTrue(listMessages.get(0) instanceof DataChanged);
+ Assert.assertTrue(listMessages.get(0).getClass().equals(DataChanged.SERIALIZABLE_CLASS));
}
}
import org.opendaylight.controller.cluster.datastore.utils.ActorContext;
import org.opendaylight.controller.cluster.datastore.utils.DoNothingActor;
import org.opendaylight.controller.cluster.datastore.utils.MessageCollectorActor;
+import org.opendaylight.controller.cluster.datastore.utils.MockClusterWrapper;
import org.opendaylight.controller.cluster.datastore.utils.MockConfiguration;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import java.util.List;
private ActorRef dataChangeListenerActor = getSystem().actorOf(Props.create(DoNothingActor.class));
private static class MockDataChangeListener implements
- AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>> {
+ AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>> {
@Override public void onDataChanged(
- AsyncDataChangeEvent<InstanceIdentifier, NormalizedNode<?, ?>> change) {
+ AsyncDataChangeEvent<YangInstanceIdentifier, NormalizedNode<?, ?>> change) {
throw new UnsupportedOperationException("onDataChanged");
}
}
//Check if it was received by the remote actor
ActorContext
- testContext = new ActorContext(getSystem(), getSystem().actorOf(Props.create(DoNothingActor.class)), new MockConfiguration());
+ testContext = new ActorContext(getSystem(), getSystem().actorOf(Props.create(DoNothingActor.class)),new MockClusterWrapper(), new MockConfiguration());
Object messages = testContext
.executeLocalOperation(actorRef, "messages",
ActorContext.ASK_DURATION);
Assert.assertEquals(1, listMessages.size());
- Assert.assertTrue(listMessages.get(0) instanceof CloseDataChangeListenerRegistration);
+ Assert.assertTrue(listMessages.get(0).getClass().equals(CloseDataChangeListenerRegistration.SERIALIZABLE_CLASS));
}
}
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener;
import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import static org.junit.Assert.assertEquals;
new Within(duration("1 seconds")) {
protected void run() {
- subject.tell(new CloseDataChangeListenerRegistration(), getRef());
+ subject.tell(new CloseDataChangeListenerRegistration().toSerializable(), getRef());
final String out = new ExpectMsg<String>("match hint") {
// do not put code outside this method, will run afterwards
protected String match(Object in) {
- if (in instanceof CloseDataChangeListenerRegistrationReply) {
+ if (in.getClass().equals(CloseDataChangeListenerRegistrationReply.SERIALIZABLE_CLASS)) {
return "match";
} else {
throw noMatch();
}};
}
- private AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>> noOpDataChangeListener(){
- return new AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>>() {
+ private AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>> noOpDataChangeListener(){
+ return new AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>>() {
@Override
- public void onDataChanged(AsyncDataChangeEvent<InstanceIdentifier, NormalizedNode<?, ?>> change) {
+ public void onDataChanged(AsyncDataChangeEvent<YangInstanceIdentifier, NormalizedNode<?, ?>> change) {
}
};
import org.junit.Test;
import org.opendaylight.controller.cluster.datastore.messages.DataChanged;
import org.opendaylight.controller.cluster.datastore.messages.DataChangedReply;
+import org.opendaylight.controller.md.cluster.datastore.model.CompositeModel;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
public class DataChangeListenerTest extends AbstractActorTest {
- private static class MockDataChangedEvent implements AsyncDataChangeEvent<InstanceIdentifier, NormalizedNode<?, ?>> {
+ private static class MockDataChangedEvent implements AsyncDataChangeEvent<YangInstanceIdentifier, NormalizedNode<?, ?>> {
+ Map<YangInstanceIdentifier,NormalizedNode<?,?>> createdData = new HashMap();
+ Map<YangInstanceIdentifier,NormalizedNode<?,?>> updatedData = new HashMap();
+ Map<YangInstanceIdentifier,NormalizedNode<?,?>> originalData = new HashMap();
+
+
@Override
- public Map<InstanceIdentifier, NormalizedNode<?, ?>> getCreatedData() {
- throw new UnsupportedOperationException("getCreatedData");
+ public Map<YangInstanceIdentifier, NormalizedNode<?, ?>> getCreatedData() {
+ createdData.put(CompositeModel.FAMILY_PATH, CompositeModel.createFamily());
+ return createdData;
}
@Override
- public Map<InstanceIdentifier, NormalizedNode<?, ?>> getUpdatedData() {
- throw new UnsupportedOperationException("getUpdatedData");
+ public Map<YangInstanceIdentifier, NormalizedNode<?, ?>> getUpdatedData() {
+ updatedData.put(CompositeModel.FAMILY_PATH, CompositeModel.createFamily());
+ return updatedData;
+
}
- @Override public Set<InstanceIdentifier> getRemovedPaths() {
- throw new UnsupportedOperationException("getRemovedPaths");
+ @Override
+ public Set<YangInstanceIdentifier> getRemovedPaths() {
+ Set<YangInstanceIdentifier>ids = new HashSet();
+ ids.add( CompositeModel.TEST_PATH);
+ return ids;
}
@Override
- public Map<InstanceIdentifier, NormalizedNode<?, ?>> getOriginalData() {
- throw new UnsupportedOperationException("getOriginalData");
+ public Map<YangInstanceIdentifier, NormalizedNode<?, ?>> getOriginalData() {
+ originalData.put(CompositeModel.FAMILY_PATH, CompositeModel.createFamily());
+ return originalData;
}
@Override public NormalizedNode<?, ?> getOriginalSubtree() {
- throw new UnsupportedOperationException("getOriginalSubtree");
+
+
+ return originalData.put(CompositeModel.FAMILY_PATH, CompositeModel.createFamily());
}
@Override public NormalizedNode<?, ?> getUpdatedSubtree() {
- throw new UnsupportedOperationException("getUpdatedSubtree");
+
+ //fixme: need to have some valid data here
+ return originalData.put(CompositeModel.FAMILY_PATH, CompositeModel.createFamily());
}
}
- private class MockDataChangeListener implements AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>> {
+ private class MockDataChangeListener implements AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>> {
private boolean gotIt = false;
+ private AsyncDataChangeEvent<YangInstanceIdentifier, NormalizedNode<?, ?>> change;
@Override public void onDataChanged(
- AsyncDataChangeEvent<InstanceIdentifier, NormalizedNode<?, ?>> change) {
- gotIt = true;
+ AsyncDataChangeEvent<YangInstanceIdentifier, NormalizedNode<?, ?>> change) {
+ gotIt = true;this.change=change;
}
public boolean gotIt() {
return gotIt;
}
+ public AsyncDataChangeEvent<YangInstanceIdentifier, NormalizedNode<?, ?>> getChange(){
+ return change;
+ }
}
@Test
public void testDataChanged(){
new JavaTestKit(getSystem()) {{
final MockDataChangeListener listener = new MockDataChangeListener();
- final Props props = DataChangeListener.props(listener);
+ final Props props = DataChangeListener.props(CompositeModel.createTestContext(),listener,CompositeModel.FAMILY_PATH );
final ActorRef subject =
getSystem().actorOf(props, "testDataChanged");
protected void run() {
subject.tell(
- new DataChanged(new MockDataChangedEvent()),
+ new DataChanged(CompositeModel.createTestContext(),new MockDataChangedEvent()).toSerializable(),
getRef());
final Boolean out = new ExpectMsg<Boolean>("dataChanged") {
// do not put code outside this method, will run afterwards
protected Boolean match(Object in) {
- if (in instanceof DataChangedReply) {
- DataChangedReply reply =
- (DataChangedReply) in;
+ if (in.getClass().equals(DataChangedReply.SERIALIZABLE_CLASS)) {
+
return true;
} else {
throw noMatch();
assertTrue(out);
assertTrue(listener.gotIt());
+ assertNotNull(listener.getChange().getCreatedData());
// Will wait for the rest of the 3 seconds
expectNoMsg();
}
import akka.actor.ActorRef;
import akka.actor.Props;
import junit.framework.Assert;
-
import org.opendaylight.controller.cluster.datastore.messages.RegisterChangeListenerReply;
import org.opendaylight.controller.cluster.datastore.shardstrategy.ShardStrategyFactory;
import org.opendaylight.controller.cluster.datastore.utils.DoNothingActor;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionChain;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
public class DistributedDataStoreTest extends AbstractActorTest{
public void testRegisterChangeListener() throws Exception {
mockActorContext.setExecuteShardOperationResponse(new RegisterChangeListenerReply(doNothingActorRef.path()).toSerializable());
ListenerRegistration registration =
- distributedDataStore.registerChangeListener(TestModel.TEST_PATH, new AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>>() {
+ distributedDataStore.registerChangeListener(TestModel.TEST_PATH, new AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>>() {
@Override
- public void onDataChanged(AsyncDataChangeEvent<InstanceIdentifier, NormalizedNode<?, ?>> change) {
+ public void onDataChanged(AsyncDataChangeEvent<YangInstanceIdentifier, NormalizedNode<?, ?>> change) {
throw new UnsupportedOperationException("onDataChanged");
}
}, AsyncDataBroker.DataChangeScope.BASE);
import akka.actor.Props;
import akka.testkit.JavaTestKit;
import akka.testkit.TestActorRef;
+import junit.framework.Assert;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
private static ActorSystem system;
@BeforeClass
- public static void setUp(){
+ public static void setUp() {
system = ActorSystem.create("test");
}
@AfterClass
- public static void tearDown(){
+ public static void tearDown() {
JavaTestKit.shutdownActorSystem(system);
system = null;
}
public void testOnReceiveFindPrimaryForNonExistentShard() throws Exception {
new JavaTestKit(system) {{
- final Props props = ShardManager.props("config", new MockClusterWrapper(), new MockConfiguration());
- final TestActorRef<ShardManager> subject = TestActorRef.create(system, props);
+ final Props props = ShardManager
+ .props("config", new MockClusterWrapper(),
+ new MockConfiguration());
+ final TestActorRef<ShardManager> subject =
+ TestActorRef.create(system, props);
new Within(duration("1 seconds")) {
protected void run() {
- subject.tell(new FindPrimary("inventory"), getRef());
+ subject.tell(new FindPrimary("inventory").toSerializable(), getRef());
- expectMsgEquals(Duration.Zero(), new PrimaryNotFound("inventory"));
+ expectMsgEquals(Duration.Zero(),
+ new PrimaryNotFound("inventory").toSerializable());
// Will wait for the rest of the 3 seconds
expectNoMsg();
}};
}
- @Test
- public void testOnReceiveFindPrimaryForExistentShard() throws Exception {
+ @Test
+ public void testOnReceiveFindPrimaryForExistentShard() throws Exception {
+
+ new JavaTestKit(system) {{
+ final Props props = ShardManager
+ .props("config", new MockClusterWrapper(),
+ new MockConfiguration());
+ final TestActorRef<ShardManager> subject =
+ TestActorRef.create(system, props);
+
+ // the run() method needs to finish within 3 seconds
+ new Within(duration("1 seconds")) {
+ protected void run() {
+
+ subject.tell(new FindPrimary(Shard.DEFAULT_NAME).toSerializable(), getRef());
+
+ expectMsgClass(PrimaryFound.SERIALIZABLE_CLASS);
+
+ expectNoMsg();
+ }
+ };
+ }};
+ }
+
+ @Test
+ public void testOnReceiveMemberUp() throws Exception {
+
+ new JavaTestKit(system) {{
+ final Props props = ShardManager
+ .props("config", new MockClusterWrapper(),
+ new MockConfiguration());
+ final TestActorRef<ShardManager> subject =
+ TestActorRef.create(system, props);
- new JavaTestKit(system) {{
- final Props props = ShardManager.props("config", new MockClusterWrapper(), new MockConfiguration());
- final TestActorRef<ShardManager> subject = TestActorRef.create(system, props);
+ // the run() method needs to finish within 3 seconds
+ new Within(duration("1 seconds")) {
+ protected void run() {
+
+ MockClusterWrapper.sendMemberUp(subject, "member-2", getRef().path().toString());
- // the run() method needs to finish within 3 seconds
- new Within(duration("1 seconds")) {
- protected void run() {
+ subject.tell(new FindPrimary("astronauts").toSerializable(), getRef());
- subject.tell(new FindPrimary(Shard.DEFAULT_NAME), getRef());
+ final String out = new ExpectMsg<String>("primary found") {
+ // do not put code outside this method, will run afterwards
+ protected String match(Object in) {
+ if (in.getClass().equals(PrimaryFound.SERIALIZABLE_CLASS)) {
+ PrimaryFound f = PrimaryFound.fromSerializable(in);
+ return f.getPrimaryPath();
+ } else {
+ throw noMatch();
+ }
+ }
+ }.get(); // this extracts the received message
+
+ Assert.assertTrue(out, out.contains("member-2-shard-astronauts-config"));
+
+ expectNoMsg();
+ }
+ };
+ }};
+ }
+
+ @Test
+ public void testOnReceiveMemberDown() throws Exception {
+
+ new JavaTestKit(system) {{
+ final Props props = ShardManager
+ .props("config", new MockClusterWrapper(),
+ new MockConfiguration());
+ final TestActorRef<ShardManager> subject =
+ TestActorRef.create(system, props);
+
+ // the run() method needs to finish within 3 seconds
+ new Within(duration("1 seconds")) {
+ protected void run() {
+
+ MockClusterWrapper.sendMemberUp(subject, "member-2", getRef().path().toString());
+
+ subject.tell(new FindPrimary("astronauts").toSerializable(), getRef());
+
+ expectMsgClass(PrimaryFound.SERIALIZABLE_CLASS);
+
+ MockClusterWrapper.sendMemberRemoved(subject, "member-2", getRef().path().toString());
+
+ subject.tell(new FindPrimary("astronauts").toSerializable(), getRef());
+
+ expectMsgClass(PrimaryNotFound.SERIALIZABLE_CLASS);
+
+ expectNoMsg();
+ }
+ };
+ }};
+ }
- expectMsgClass(PrimaryFound.class);
- expectNoMsg();
- }
- };
- }};
- }
}
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.md.cluster.datastore.model.SchemaContextHelper;
-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;
+import org.opendaylight.controller.md.cluster.datastore.model.SchemaContextHelper;
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.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages.CreateTransactionReply;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import static org.junit.Assert.assertEquals;
new Within(duration("1 seconds")) {
protected void run() {
- subject.tell(new CreateTransactionChain(), getRef());
+ subject.tell(new CreateTransactionChain().toSerializable(), getRef());
final String out = new ExpectMsg<String>("match hint") {
// do not put code outside this method, will run afterwards
protected String match(Object in) {
- if (in instanceof CreateTransactionChainReply) {
+ if (in.getClass().equals(CreateTransactionChainReply.SERIALIZABLE_CLASS)){
CreateTransactionChainReply reply =
- (CreateTransactionChainReply) in;
+ CreateTransactionChainReply.fromSerializable(getSystem(),in);
return reply.getTransactionChainPath()
.toString();
} else {
new UpdateSchemaContext(TestModel.createTestContext()),
getRef());
- subject.tell(new CreateTransaction("txn-1"),
+ subject.tell(new CreateTransaction("txn-1").toSerializable(),
getRef());
final String out = new ExpectMsg<String>("match hint") {
- private AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>> noOpDataChangeListener() {
- return new AsyncDataChangeListener<InstanceIdentifier, NormalizedNode<?, ?>>() {
+ private AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>> noOpDataChangeListener() {
+ return new AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>>() {
@Override
public void onDataChanged(
- AsyncDataChangeEvent<InstanceIdentifier, NormalizedNode<?, ?>> change) {
+ AsyncDataChangeEvent<YangInstanceIdentifier, NormalizedNode<?, ?>> change) {
}
};
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.protobuff.messages.transaction.ShardTransactionMessages.CreateTransactionReply;
+import org.opendaylight.controller.cluster.datastore.messages.CreateTransactionReply;
import org.opendaylight.controller.md.cluster.datastore.model.TestModel;
import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
final Props props = ShardTransactionChain.props(store.createTransactionChain(), TestModel.createTestContext());
final ActorRef subject = getSystem().actorOf(props, "testCreateTransaction");
- new Within(duration("1 seconds")) {
+ new Within(duration("1 seconds")) {
protected void run() {
- subject.tell(new CreateTransaction("txn-1"), getRef());
+ subject.tell(new CreateTransaction("txn-1").toSerializable(), getRef());
final String out = new ExpectMsg<String>("match hint") {
// do not put code outside this method, will run afterwards
protected String match(Object in) {
- if (in instanceof CreateTransactionReply) {
- return ((CreateTransactionReply) in).getTransactionActorPath().toString();
- } else {
+ if (in.getClass().equals(CreateTransactionReply.SERIALIZABLE_CLASS)) {
+ return CreateTransactionReply.fromSerializable(in).getTransactionPath();
+ }else{
throw noMatch();
}
}
}.get(); // this extracts the received message
- assertEquals("Unexpected transaction path " + out,
- "akka://test/user/testCreateTransaction/shard-txn-1",
- out);
+ assertEquals("Unexpected transaction path " + out,
+ "akka://test/user/testCreateTransaction/shard-txn-1",
+ out);
- // Will wait for the rest of the 3 seconds
+ // Will wait for the rest of the 3 seconds
expectNoMsg();
}
new Within(duration("1 seconds")) {
protected void run() {
- subject.tell(new CloseTransactionChain(), getRef());
+ subject.tell(new CloseTransactionChain().toSerializable(), getRef());
final String out = new ExpectMsg<String>("match hint") {
// do not put code outside this method, will run afterwards
protected String match(Object in) {
- if (in instanceof CloseTransactionChainReply) {
+ if (in.getClass().equals(CloseTransactionChainReply.SERIALIZABLE_CLASS)) {
return "match";
} else {
throw noMatch();
import org.opendaylight.controller.cluster.datastore.modification.WriteModification;
import org.opendaylight.controller.md.cluster.datastore.model.TestModel;
import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
protected void run() {
subject.tell(
- new ReadData(InstanceIdentifier.builder().build()).toSerializable(),
+ new ReadData(YangInstanceIdentifier.builder().build()).toSerializable(),
getRef());
final String out = new ExpectMsg<String>("match hint") {
// do not put code outside this method, will run afterwards
protected String match(Object in) {
if (in.getClass().equals(ReadDataReply.SERIALIZABLE_CLASS)) {
- if (ReadDataReply.fromSerializable(testSchemaContext,InstanceIdentifier.builder().build(), in)
+ if (ReadDataReply.fromSerializable(testSchemaContext,YangInstanceIdentifier.builder().build(), in)
.getNormalizedNode()!= null) {
return "match";
}
final String out = new ExpectMsg<String>("match hint") {
// do not put code outside this method, will run afterwards
protected String match(Object in) {
- if (in instanceof WriteDataReply) {
+ if (in.getClass().equals(WriteDataReply.SERIALIZABLE_CLASS)) {
return "match";
} else {
throw noMatch();
final String out = new ExpectMsg<String>(duration("500 milliseconds"), "match hint") {
// do not put code outside this method, will run afterwards
protected String match(Object in) {
- if (in instanceof MergeDataReply) {
+ if (in.getClass().equals(MergeDataReply.SERIALIZABLE_CLASS)) {
return "match";
} else {
throw noMatch();
final String out = new ExpectMsg<String>("match hint") {
// do not put code outside this method, will run afterwards
protected String match(Object in) {
- if (in instanceof DeleteDataReply) {
+ if (in.getClass().equals(DeleteDataReply.SERIALIZABLE_CLASS)) {
return "match";
} else {
throw noMatch();
new Within(duration("1 seconds")) {
protected void run() {
- subject.tell(new ReadyTransaction(), getRef());
+ subject.tell(new ReadyTransaction().toSerializable(), getRef());
final String out = new ExpectMsg<String>("match hint") {
// do not put code outside this method, will run afterwards
protected String match(Object in) {
- if (in instanceof ReadyTransactionReply) {
+ if (in.getClass().equals(ReadyTransactionReply.SERIALIZABLE_CLASS)) {
return "match";
} else {
throw noMatch();
new Within(duration("2 seconds")) {
protected void run() {
- subject.tell(new CloseTransaction(), getRef());
+ subject.tell(new CloseTransaction().toSerializable(), getRef());
final String out = new ExpectMsg<String>("match hint") {
// do not put code outside this method, will run afterwards
protected String match(Object in) {
- if (in instanceof CloseTransactionReply) {
+ if (in.getClass().equals(CloseTransactionReply.SERIALIZABLE_CLASS)) {
return "match";
} else {
throw noMatch();
@Test
public void testCanCommit() throws Exception {
- actorContext.setExecuteRemoteOperationResponse(new CanCommitTransactionReply(true));
+ actorContext.setExecuteRemoteOperationResponse(new CanCommitTransactionReply(true).toSerializable());
ListenableFuture<Boolean> future = proxy.canCommit();
@Test
public void testPreCommit() throws Exception {
- actorContext.setExecuteRemoteOperationResponse(new PreCommitTransactionReply());
+ actorContext.setExecuteRemoteOperationResponse(new PreCommitTransactionReply().toSerializable());
ListenableFuture<Void> future = proxy.preCommit();
@Test
public void testAbort() throws Exception {
- actorContext.setExecuteRemoteOperationResponse(new AbortTransactionReply());
+ actorContext.setExecuteRemoteOperationResponse(new AbortTransactionReply().toSerializable());
ListenableFuture<Void> future = proxy.abort();
@Test
public void testCommit() throws Exception {
- actorContext.setExecuteRemoteOperationResponse(new CommitTransactionReply());
+ actorContext.setExecuteRemoteOperationResponse(new CommitTransactionReply().toSerializable());
ListenableFuture<Void> future = proxy.commit();
import com.google.common.base.Optional;
import com.google.common.util.concurrent.ListenableFuture;
import junit.framework.Assert;
+import org.junit.Before;
import org.junit.Test;
import org.opendaylight.controller.cluster.datastore.messages.CloseTransaction;
import org.opendaylight.controller.cluster.datastore.messages.DeleteData;
import org.opendaylight.controller.cluster.datastore.messages.MergeData;
+import org.opendaylight.controller.cluster.datastore.messages.PrimaryFound;
import org.opendaylight.controller.cluster.datastore.messages.ReadDataReply;
import org.opendaylight.controller.cluster.datastore.messages.ReadyTransactionReply;
import org.opendaylight.controller.cluster.datastore.messages.WriteData;
+import org.opendaylight.controller.cluster.datastore.shardstrategy.ShardStrategyFactory;
import org.opendaylight.controller.cluster.datastore.utils.ActorContext;
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.cluster.datastore.utils.MockClusterWrapper;
import org.opendaylight.controller.cluster.datastore.utils.MockConfiguration;
import org.opendaylight.controller.md.cluster.datastore.model.TestModel;
import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages.CreateTransactionReply;
public class TransactionProxyTest extends AbstractActorTest {
+ private final Configuration configuration = new MockConfiguration();
+
private final ActorContext testContext =
- new ActorContext(getSystem(), getSystem().actorOf(Props.create(DoNothingActor.class)), new MockConfiguration());
+ new ActorContext(getSystem(), getSystem().actorOf(Props.create(DoNothingActor.class)), new MockClusterWrapper(), configuration );
private ExecutorService transactionExecutor =
Executors.newSingleThreadExecutor();
+ @Before
+ public void setUp(){
+ ShardStrategyFactory.setConfiguration(configuration);
+ }
+
@Test
public void testRead() throws Exception {
final Props props = Props.create(DoNothingActor.class);
final ActorRef actorRef = getSystem().actorOf(props);
final MockActorContext actorContext = new MockActorContext(this.getSystem());
+ actorContext.setExecuteLocalOperationResponse(createPrimaryFound(actorRef));
actorContext.setExecuteShardOperationResponse(createTransactionReply(actorRef));
actorContext.setExecuteRemoteOperationResponse("message");
final ActorRef actorRef = getSystem().actorOf(props);
final MockActorContext actorContext = new MockActorContext(this.getSystem());
+ actorContext.setExecuteLocalOperationResponse(createPrimaryFound(actorRef));
actorContext.setExecuteShardOperationResponse(createTransactionReply(actorRef));
actorContext.setExecuteRemoteOperationResponse("message");
final ActorRef actorRef = getSystem().actorOf(props);
final MockActorContext actorContext = new MockActorContext(this.getSystem());
+ actorContext.setExecuteLocalOperationResponse(createPrimaryFound(actorRef));
actorContext.setExecuteShardOperationResponse(createTransactionReply(actorRef));
actorContext.setExecuteRemoteOperationResponse("message");
Assert.assertEquals(WriteData.SERIALIZABLE_CLASS, listMessages.get(0).getClass());
}
+ private Object createPrimaryFound(ActorRef actorRef) {
+ return new PrimaryFound(actorRef.path().toString()).toSerializable();
+ }
+
@Test
public void testMerge() throws Exception {
final Props props = Props.create(MessageCollectorActor.class);
final ActorRef actorRef = getSystem().actorOf(props);
final MockActorContext actorContext = new MockActorContext(this.getSystem());
+ actorContext.setExecuteLocalOperationResponse(createPrimaryFound(actorRef));
actorContext.setExecuteShardOperationResponse(createTransactionReply(actorRef));
actorContext.setExecuteRemoteOperationResponse("message");
final ActorRef actorRef = getSystem().actorOf(props);
final MockActorContext actorContext = new MockActorContext(this.getSystem());
+ actorContext.setExecuteLocalOperationResponse(createPrimaryFound(actorRef));
actorContext.setExecuteShardOperationResponse(createTransactionReply(actorRef));
actorContext.setExecuteRemoteOperationResponse("message");
final ActorRef doNothingActorRef = getSystem().actorOf(props);
final MockActorContext actorContext = new MockActorContext(this.getSystem());
+ actorContext.setExecuteLocalOperationResponse(createPrimaryFound(doNothingActorRef));
actorContext.setExecuteShardOperationResponse(createTransactionReply(doNothingActorRef));
- actorContext.setExecuteRemoteOperationResponse(new ReadyTransactionReply(doNothingActorRef.path()));
+ actorContext.setExecuteRemoteOperationResponse(new ReadyTransactionReply(doNothingActorRef.path()).toSerializable());
TransactionProxy transactionProxy =
new TransactionProxy(actorContext,
final ActorRef actorRef = getSystem().actorOf(props);
final MockActorContext actorContext = new MockActorContext(this.getSystem());
+ actorContext.setExecuteLocalOperationResponse(createPrimaryFound(actorRef));
actorContext.setExecuteShardOperationResponse(createTransactionReply(actorRef));
actorContext.setExecuteRemoteOperationResponse("message");
Assert.assertEquals(1, listMessages.size());
- Assert.assertTrue(listMessages.get(0) instanceof CloseTransaction);
+ Assert.assertTrue(listMessages.get(0).getClass().equals(CloseTransaction.SERIALIZABLE_CLASS));
}
private CreateTransactionReply createTransactionReply(ActorRef actorRef){
--- /dev/null
+package org.opendaylight.controller.cluster.datastore.jmx.mbeans.shard;
+
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.opendaylight.controller.cluster.datastore.jmx.mbeans.AbstractBaseMBean;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+public class ShardStatsTest {
+ private MBeanServer mbeanServer;
+ private ShardStats shardStats;
+ private ObjectName testMBeanName;
+
+ @Before
+ public void setUp() throws Exception {
+
+ shardStats = new ShardStats("shard-1");
+ shardStats.registerMBean();
+ mbeanServer= shardStats.getMBeanServer();
+ String objectName = AbstractBaseMBean.BASE_JMX_PREFIX + "type="+shardStats.getMBeanType()+",Category="+
+ shardStats.getMBeanCategory() + ",name="+
+ shardStats.getMBeanName();
+ testMBeanName = new ObjectName(objectName);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ shardStats.unregisterMBean();
+ }
+
+ @Test
+ public void testGetShardName() throws Exception {
+
+ Object attribute = mbeanServer.getAttribute(testMBeanName,"ShardName");
+ Assert.assertEquals((String) attribute, "shard-1");
+
+ }
+
+ @Test
+ public void testGetCommittedTransactionsCount() throws Exception {
+ //let us increment some transactions count and then check
+ shardStats.incrementCommittedTransactionCount();
+ shardStats.incrementCommittedTransactionCount();
+ shardStats.incrementCommittedTransactionCount();
+
+ //now let us get from MBeanServer what is the transaction count.
+ Object attribute = mbeanServer.getAttribute(testMBeanName,"CommittedTransactionsCount");
+ Assert.assertEquals((Long) attribute, (Long)3L);
+
+
+ }
+}
\ No newline at end of file
import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadTransaction;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
public abstract class AbstractModificationTest {
cohort.commit();
}
- protected Optional<NormalizedNode<?,?>> readData(InstanceIdentifier path) throws Exception{
+ protected Optional<NormalizedNode<?,?>> readData(YangInstanceIdentifier path) throws Exception{
DOMStoreReadTransaction transaction = store.newReadOnlyTransaction();
ListenableFuture<Optional<NormalizedNode<?, ?>>> future = transaction.read(path);
return future.get();
import org.opendaylight.controller.cluster.datastore.ConfigurationImpl;
import org.opendaylight.controller.md.cluster.datastore.model.CarsModel;
import org.opendaylight.controller.md.cluster.datastore.model.TestModel;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertTrue;
@Test
public void testGetStrategyForKnownModuleName() {
ShardStrategy strategy =
- ShardStrategyFactory.getStrategy(InstanceIdentifier.of(CarsModel.BASE_QNAME));
+ ShardStrategyFactory.getStrategy(
+ YangInstanceIdentifier.of(CarsModel.BASE_QNAME));
assertTrue(strategy instanceof ModuleShardStrategy);
}
--- /dev/null
+package org.opendaylight.controller.cluster.datastore.utils;
+
+import akka.actor.ActorRef;
+import akka.actor.ActorSystem;
+import org.junit.Test;
+import org.opendaylight.controller.cluster.datastore.AbstractActorTest;
+import org.opendaylight.controller.cluster.datastore.ClusterWrapper;
+import org.opendaylight.controller.cluster.datastore.Configuration;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.mock;
+
+public class ActorContextTest extends AbstractActorTest{
+ @Test
+ public void testResolvePathForRemoteActor(){
+ ActorContext actorContext =
+ new ActorContext(mock(ActorSystem.class), mock(ActorRef.class),mock(
+ ClusterWrapper.class),
+ mock(Configuration.class));
+
+ String actual = actorContext.resolvePath(
+ "akka.tcp://system@127.0.0.1:2550/user/shardmanager/shard",
+ "akka://system/user/shardmanager/shard/transaction");
+
+ String expected = "akka.tcp://system@127.0.0.1:2550/user/shardmanager/shard/transaction";
+
+ assertEquals(expected, actual);
+ }
+
+ @Test
+ public void testResolvePathForLocalActor(){
+ ActorContext actorContext =
+ new ActorContext(getSystem(), mock(ActorRef.class), mock(ClusterWrapper.class),
+ mock(Configuration.class));
+
+ String actual = actorContext.resolvePath(
+ "akka://system/user/shardmanager/shard",
+ "akka://system/user/shardmanager/shard/transaction");
+
+ String expected = "akka://system/user/shardmanager/shard/transaction";
+
+ assertEquals(expected, actual);
+
+ System.out.println(actorContext
+ .actorFor("akka://system/user/shardmanager/shard/transaction"));
+ }
+}
private Object executeLocalOperationResponse;
public MockActorContext(ActorSystem actorSystem) {
- super(actorSystem, null, new MockConfiguration());
+ super(actorSystem, null, new MockClusterWrapper(), new MockConfiguration());
}
public MockActorContext(ActorSystem actorSystem, ActorRef shardManager) {
- super(actorSystem, shardManager, new MockConfiguration());
+ super(actorSystem, shardManager, new MockClusterWrapper(), new MockConfiguration());
}
Object executeLocalOperationResponse) {
this.executeLocalOperationResponse = executeLocalOperationResponse;
}
+
+ @Override public Object executeLocalOperation(ActorRef actor,
+ Object message, FiniteDuration duration) {
+ return this.executeLocalOperationResponse;
+ }
}
package org.opendaylight.controller.cluster.datastore.utils;
import akka.actor.ActorRef;
+import akka.actor.AddressFromURIString;
+import akka.cluster.ClusterEvent;
+import akka.cluster.MemberStatus;
+import akka.cluster.UniqueAddress;
import org.opendaylight.controller.cluster.datastore.ClusterWrapper;
+import scala.collection.JavaConversions;
+
+import java.util.HashSet;
+import java.util.Set;
public class MockClusterWrapper implements ClusterWrapper{
@Override public void subscribeToMemberEvents(ActorRef actorRef) {
- throw new UnsupportedOperationException("subscribeToMemberEvents");
}
@Override public String getCurrentMemberName() {
return "member-1";
}
+
+ public static void sendMemberUp(ActorRef to, String memberName, String address){
+ to.tell(createMemberUp(memberName, address), null);
+ }
+
+ public static void sendMemberRemoved(ActorRef to, String memberName, String address){
+ to.tell(createMemberRemoved(memberName, address), null);
+ }
+
+ private static ClusterEvent.MemberRemoved createMemberRemoved(String memberName, String address) {
+ akka.cluster.UniqueAddress uniqueAddress = new UniqueAddress(
+ AddressFromURIString.parse(address), 55);
+
+ Set<String> roles = new HashSet<>();
+
+ roles.add(memberName);
+
+ akka.cluster.Member member = new akka.cluster.Member(uniqueAddress, 1, MemberStatus
+ .removed(),
+ JavaConversions.asScalaSet(roles).<String>toSet());
+
+ return new ClusterEvent.MemberRemoved(member, MemberStatus.up());
+
+ }
+
+
+ private static ClusterEvent.MemberUp createMemberUp(String memberName, String address) {
+ akka.cluster.UniqueAddress uniqueAddress = new UniqueAddress(
+ AddressFromURIString.parse(address), 55);
+
+ Set<String> roles = new HashSet<>();
+
+ roles.add(memberName);
+
+ akka.cluster.Member member = new akka.cluster.Member(uniqueAddress, 1, MemberStatus.up(),
+ JavaConversions.asScalaSet(roles).<String>toSet());
+
+ return new ClusterEvent.MemberUp(member);
+ }
}
import org.opendaylight.controller.cluster.datastore.Configuration;
import org.opendaylight.controller.cluster.datastore.shardstrategy.ShardStrategy;
-import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
public class MockConfiguration implements Configuration{
@Override public List<String> getMemberShardNames(String memberName) {
- List<String> shardNames = new ArrayList<>();
- shardNames.add("default");
- return shardNames;
+ return Arrays.asList("default");
}
@Override public Optional<String> getModuleNameFromNameSpace(
}
@Override public List<String> getMembersFromShardName(String shardName) {
- List<String> shardNames = new ArrayList<>();
- shardNames.add("member-1");
- return shardNames;
+ if("default".equals(shardName)) {
+ return Arrays.asList("member-1", "member-2");
+ } else if("astronauts".equals(shardName)){
+ return Arrays.asList("member-2", "member-3");
+ }
+
+ return Collections.EMPTY_LIST;
}
}
public static void assertFirstSentMessage(ActorSystem actorSystem, ActorRef actorRef, Class clazz){
ActorContext testContext = new ActorContext(actorSystem, actorSystem.actorOf(
- Props.create(DoNothingActor.class)), new MockConfiguration());
+ Props.create(DoNothingActor.class)), new MockClusterWrapper(), new MockConfiguration());
Object messages = testContext
.executeLocalOperation(actorRef, "messages",
ActorContext.ASK_DURATION);
package org.opendaylight.controller.md.cluster.datastore.model;
import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
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;
public static final QName BASE_QNAME = QName.create("urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test:cars", "2014-03-13",
"cars");
- public static final InstanceIdentifier BASE_PATH = InstanceIdentifier.of(BASE_QNAME);
+ public static final YangInstanceIdentifier BASE_PATH = YangInstanceIdentifier.of(BASE_QNAME);
public static final QName CARS_QNAME = QName.create(BASE_QNAME, "cars");
public static final QName CAR_QNAME = QName.create(CARS_QNAME, "car");
// Create a list builder
CollectionNodeBuilder<MapEntryNode, MapNode> cars =
ImmutableMapNodeBuilder.create().withNodeIdentifier(
- new InstanceIdentifier.NodeIdentifier(
- QName.create(CARS_QNAME, "car")));
+ new YangInstanceIdentifier.NodeIdentifier(
+ CAR_QNAME));
// Create an entry for the car altima
MapEntryNode altima =
- ImmutableNodes.mapEntryBuilder(CARS_QNAME, CAR_NAME_QNAME, "altima")
+ ImmutableNodes.mapEntryBuilder(CAR_QNAME, CAR_NAME_QNAME, "altima")
.withChild(ImmutableNodes.leafNode(CAR_NAME_QNAME, "altima"))
.withChild(ImmutableNodes.leafNode(CAR_PRICE_QNAME, 1000))
.build();
// Create an entry for the car accord
MapEntryNode honda =
- ImmutableNodes.mapEntryBuilder(CARS_QNAME, CAR_NAME_QNAME, "accord")
+ ImmutableNodes.mapEntryBuilder(CAR_QNAME, CAR_NAME_QNAME, "accord")
.withChild(ImmutableNodes.leafNode(CAR_NAME_QNAME, "accord"))
.withChild(ImmutableNodes.leafNode(CAR_PRICE_QNAME, 2000))
.build();
cars.withChild(honda);
return ImmutableContainerNodeBuilder.create()
- .withNodeIdentifier(new InstanceIdentifier.NodeIdentifier(BASE_QNAME))
+ .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(BASE_QNAME))
.withChild(cars.build())
.build();
public static NormalizedNode emptyContainer(){
return ImmutableContainerNodeBuilder.create()
- .withNodeIdentifier(new InstanceIdentifier.NodeIdentifier(BASE_QNAME))
+ .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(BASE_QNAME))
.build();
}
--- /dev/null
+package org.opendaylight.controller.md.cluster.datastore.model;
+
+import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+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.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.schema.Builders;
+import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
+import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.CollectionNodeBuilder;
+import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeAttrBuilder;
+import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeBuilder;
+import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder;
+import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableLeafSetEntryNodeBuilder;
+import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableLeafSetNodeBuilder;
+import org.opendaylight.yangtools.yang.model.api.Module;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import static org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.mapEntry;
+import static org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.mapEntryBuilder;
+import static org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.mapNodeBuilder;
+
+public class CompositeModel {
+
+ public static final QName TEST_QNAME = QName.create(
+ "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test",
+ "2014-03-13", "test");
+
+ public static final QName AUG_QNAME = QName.create(
+ "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:aug",
+ "2014-03-13", "name");
+
+ public static final QName DESC_QNAME = QName.create(TEST_QNAME, "desc");
+ public static final QName OUTER_LIST_QNAME = QName.create(TEST_QNAME,
+ "outer-list");
+ public static final QName INNER_LIST_QNAME = QName.create(TEST_QNAME,
+ "inner-list");
+ public static final QName OUTER_CHOICE_QNAME = QName.create(TEST_QNAME,
+ "outer-choice");
+ public static final QName ID_QNAME = QName.create(TEST_QNAME, "id");
+ public static final QName NAME_QNAME = QName.create(TEST_QNAME, "name");
+ public static final QName VALUE_QNAME = QName.create(TEST_QNAME, "value");
+ private static final String DATASTORE_TEST_YANG = "/odl-datastore-test.yang";
+ private static final String DATASTORE_AUG_YANG =
+ "/odl-datastore-augmentation.yang";
+ private static final String DATASTORE_TEST_NOTIFICATION_YANG =
+ "/odl-datastore-test-notification.yang";
+
+
+ public static final YangInstanceIdentifier TEST_PATH = YangInstanceIdentifier
+ .of(TEST_QNAME);
+ public static final YangInstanceIdentifier DESC_PATH = YangInstanceIdentifier
+ .builder(TEST_PATH).node(DESC_QNAME).build();
+ public static final YangInstanceIdentifier OUTER_LIST_PATH = YangInstanceIdentifier
+ .builder(TEST_PATH).node(OUTER_LIST_QNAME).build();
+ public static final QName TWO_QNAME = QName.create(TEST_QNAME, "two");
+ public static final QName THREE_QNAME = QName.create(TEST_QNAME, "three");
+
+ private static final Integer ONE_ID = 1;
+ private static final Integer TWO_ID = 2;
+ private static final String TWO_ONE_NAME = "one";
+ private static final String TWO_TWO_NAME = "two";
+ private static final String DESC = "Hello there";
+
+ // Family specific constants
+ public static final QName FAMILY_QNAME =
+ QName
+ .create(
+ "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:notification-test",
+ "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,
+ "grand-children");
+ public static final QName CHILD_NUMBER_QNAME = QName.create(FAMILY_QNAME,
+ "child-number");
+ public static final QName CHILD_NAME_QNAME = QName.create(FAMILY_QNAME,
+ "child-name");
+ public static final QName GRAND_CHILD_NUMBER_QNAME = QName.create(
+ FAMILY_QNAME, "grand-child-number");
+ public static final QName GRAND_CHILD_NAME_QNAME = QName.create(FAMILY_QNAME,
+ "grand-child-name");
+
+ public static final YangInstanceIdentifier FAMILY_PATH = YangInstanceIdentifier
+ .of(FAMILY_QNAME);
+ public static final YangInstanceIdentifier FAMILY_DESC_PATH = YangInstanceIdentifier
+ .builder(FAMILY_PATH).node(DESC_QNAME).build();
+ public static final YangInstanceIdentifier CHILDREN_PATH = YangInstanceIdentifier
+ .builder(FAMILY_PATH).node(CHILDREN_QNAME).build();
+
+ private static final Integer FIRST_CHILD_ID = 1;
+ private static final Integer SECOND_CHILD_ID = 2;
+
+ private static final String FIRST_CHILD_NAME = "first child";
+ private static final String SECOND_CHILD_NAME = "second child";
+
+ private static final Integer FIRST_GRAND_CHILD_ID = 1;
+ private static final Integer SECOND_GRAND_CHILD_ID = 2;
+
+ private static final String FIRST_GRAND_CHILD_NAME = "first grand child";
+ private static final String SECOND_GRAND_CHILD_NAME = "second grand child";
+
+ // first child
+ private static final YangInstanceIdentifier CHILDREN_1_PATH = YangInstanceIdentifier
+ .builder(CHILDREN_PATH)
+ .nodeWithKey(CHILDREN_QNAME, CHILD_NUMBER_QNAME, FIRST_CHILD_ID) //
+ .build();
+ private static final YangInstanceIdentifier CHILDREN_1_NAME_PATH =
+ YangInstanceIdentifier.builder(CHILDREN_PATH)
+ .nodeWithKey(CHILDREN_QNAME, CHILD_NAME_QNAME, FIRST_CHILD_NAME) //
+ .build();
+
+ private static final YangInstanceIdentifier CHILDREN_2_PATH = YangInstanceIdentifier
+ .builder(CHILDREN_PATH)
+ .nodeWithKey(CHILDREN_QNAME, CHILD_NUMBER_QNAME, SECOND_CHILD_ID) //
+ .build();
+ private static final YangInstanceIdentifier CHILDREN_2_NAME_PATH =
+ YangInstanceIdentifier.builder(CHILDREN_PATH)
+ .nodeWithKey(CHILDREN_QNAME, CHILD_NAME_QNAME, SECOND_CHILD_NAME) //
+ .build();
+
+
+ private static final YangInstanceIdentifier GRAND_CHILD_1_PATH =
+ YangInstanceIdentifier.builder(CHILDREN_1_PATH)
+ .node(GRAND_CHILDREN_QNAME)
+ //
+ .nodeWithKey(GRAND_CHILDREN_QNAME, GRAND_CHILD_NUMBER_QNAME,
+ FIRST_GRAND_CHILD_ID) //
+ .build();
+
+ private static final YangInstanceIdentifier GRAND_CHILD_1_NAME_PATH =
+ YangInstanceIdentifier.builder(CHILDREN_1_PATH)
+ .node(GRAND_CHILDREN_QNAME)
+ //
+ .nodeWithKey(GRAND_CHILDREN_QNAME, GRAND_CHILD_NAME_QNAME,
+ FIRST_GRAND_CHILD_NAME) //
+ .build();
+
+ private static final YangInstanceIdentifier GRAND_CHILD_2_PATH =
+ YangInstanceIdentifier.builder(CHILDREN_2_PATH)
+ .node(GRAND_CHILDREN_QNAME)
+ //
+ .nodeWithKey(GRAND_CHILDREN_QNAME, GRAND_CHILD_NUMBER_QNAME,
+ SECOND_GRAND_CHILD_ID) //
+ .build();
+
+ private static final YangInstanceIdentifier GRAND_CHILD_2_NAME_PATH =
+ YangInstanceIdentifier.builder(CHILDREN_2_PATH)
+ .node(GRAND_CHILDREN_QNAME)
+ //
+ .nodeWithKey(GRAND_CHILDREN_QNAME, GRAND_CHILD_NAME_QNAME,
+ SECOND_GRAND_CHILD_NAME) //
+ .build();
+
+ private static final YangInstanceIdentifier DESC_PATH_ID = YangInstanceIdentifier
+ .builder(DESC_PATH).build();
+ private static final YangInstanceIdentifier OUTER_LIST_1_PATH =
+ YangInstanceIdentifier.builder(OUTER_LIST_PATH)
+ .nodeWithKey(OUTER_LIST_QNAME, ID_QNAME, ONE_ID) //
+ .build();
+
+ private static final YangInstanceIdentifier OUTER_LIST_2_PATH =
+ YangInstanceIdentifier.builder(OUTER_LIST_PATH)
+ .nodeWithKey(OUTER_LIST_QNAME, ID_QNAME, TWO_ID) //
+ .build();
+
+ private static final YangInstanceIdentifier TWO_TWO_PATH = YangInstanceIdentifier
+ .builder(OUTER_LIST_2_PATH).node(INNER_LIST_QNAME) //
+ .nodeWithKey(INNER_LIST_QNAME, NAME_QNAME, TWO_TWO_NAME) //
+ .build();
+
+ private static final YangInstanceIdentifier TWO_TWO_VALUE_PATH =
+ YangInstanceIdentifier.builder(TWO_TWO_PATH).node(VALUE_QNAME) //
+ .build();
+
+ private static final MapEntryNode BAR_NODE = mapEntryBuilder(
+ OUTER_LIST_QNAME, ID_QNAME, TWO_ID) //
+ .withChild(mapNodeBuilder(INNER_LIST_QNAME) //
+ .withChild(mapEntry(INNER_LIST_QNAME, NAME_QNAME, TWO_ONE_NAME)) //
+ .withChild(mapEntry(INNER_LIST_QNAME, NAME_QNAME, TWO_TWO_NAME)) //
+ .build()) //
+ .build();
+
+ public static final InputStream getDatastoreTestInputStream() {
+ return getInputStream(DATASTORE_TEST_YANG);
+ }
+
+ public static final InputStream getDatastoreAugInputStream() {
+ return getInputStream(DATASTORE_AUG_YANG);
+ }
+
+ public static final InputStream getDatastoreTestNotificationInputStream() {
+ return getInputStream(DATASTORE_TEST_NOTIFICATION_YANG);
+ }
+
+ private static InputStream getInputStream(final String resourceName) {
+ return TestModel.class.getResourceAsStream(resourceName);
+ }
+
+ public static SchemaContext createTestContext() {
+ List<InputStream> inputStreams = new ArrayList<>();
+ inputStreams.add(getDatastoreTestInputStream());
+ inputStreams.add(getDatastoreAugInputStream());
+ inputStreams.add(getDatastoreTestNotificationInputStream());
+
+ YangParserImpl parser = new YangParserImpl();
+ Set<Module> modules = parser.parseYangModelsFromStreams(inputStreams);
+ return parser.resolveSchemaContext(modules);
+ }
+
+ /**
+ * Returns a test document
+ *
+ * <pre>
+ * test
+ * outer-list
+ * id 1
+ * outer-list
+ * id 2
+ * inner-list
+ * name "one"
+ * inner-list
+ * name "two"
+ *
+ * </pre>
+ *
+ * @return
+ */
+ public static NormalizedNode<?, ?> createDocumentOne(
+ SchemaContext schemaContext) {
+ return ImmutableContainerNodeBuilder
+ .create()
+ .withNodeIdentifier(
+ new YangInstanceIdentifier.NodeIdentifier(schemaContext.getQName()))
+ .withChild(createTestContainer()).build();
+
+ }
+
+ public static ContainerNode createTestContainer() {
+
+
+ final LeafSetEntryNode<Object> nike =
+ ImmutableLeafSetEntryNodeBuilder
+ .create()
+ .withNodeIdentifier(
+ new YangInstanceIdentifier.NodeWithValue(QName.create(TEST_QNAME,
+ "shoe"), "nike")).withValue("nike").build();
+ final LeafSetEntryNode<Object> puma =
+ ImmutableLeafSetEntryNodeBuilder
+ .create()
+ .withNodeIdentifier(
+ new YangInstanceIdentifier.NodeWithValue(QName.create(TEST_QNAME,
+ "shoe"), "puma")).withValue("puma").build();
+ final LeafSetNode<Object> shoes =
+ ImmutableLeafSetNodeBuilder
+ .create()
+ .withNodeIdentifier(
+ new YangInstanceIdentifier.NodeIdentifier(QName.create(TEST_QNAME,
+ "shoe"))).withChild(nike).withChild(puma).build();
+
+
+ final LeafSetEntryNode<Object> five =
+ ImmutableLeafSetEntryNodeBuilder
+ .create()
+ .withNodeIdentifier(
+ (new YangInstanceIdentifier.NodeWithValue(QName.create(TEST_QNAME,
+ "number"), 5))).withValue(5).build();
+ final LeafSetEntryNode<Object> fifteen =
+ ImmutableLeafSetEntryNodeBuilder
+ .create()
+ .withNodeIdentifier(
+ (new YangInstanceIdentifier.NodeWithValue(QName.create(TEST_QNAME,
+ "number"), 15))).withValue(15).build();
+ final LeafSetNode<Object> numbers =
+ ImmutableLeafSetNodeBuilder
+ .create()
+ .withNodeIdentifier(
+ new YangInstanceIdentifier.NodeIdentifier(QName.create(TEST_QNAME,
+ "number"))).withChild(five).withChild(fifteen).build();
+
+
+ Set<QName> childAugmentations = new HashSet<>();
+ childAugmentations.add(AUG_QNAME);
+ final YangInstanceIdentifier.AugmentationIdentifier augmentationIdentifier =
+ new YangInstanceIdentifier.AugmentationIdentifier(null, childAugmentations);
+ final AugmentationNode augmentationNode =
+ Builders.augmentationBuilder()
+ .withNodeIdentifier(augmentationIdentifier)
+ .withChild(ImmutableNodes.leafNode(AUG_QNAME, "First Test"))
+ .build();
+ return ImmutableContainerNodeBuilder
+ .create()
+ .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(TEST_QNAME))
+ .withChild(ImmutableNodes.leafNode(DESC_QNAME, DESC))
+ .withChild(augmentationNode)
+ .withChild(shoes)
+ .withChild(numbers)
+ .withChild(
+ mapNodeBuilder(OUTER_LIST_QNAME)
+ .withChild(mapEntry(OUTER_LIST_QNAME, ID_QNAME, ONE_ID))
+ .withChild(BAR_NODE).build()).build();
+
+ }
+
+
+ public static ContainerNode createFamily() {
+ final DataContainerNodeAttrBuilder<YangInstanceIdentifier.NodeIdentifier, ContainerNode> familyContainerBuilder =
+ ImmutableContainerNodeBuilder.create().withNodeIdentifier(
+ new YangInstanceIdentifier.NodeIdentifier(FAMILY_QNAME));
+
+ final CollectionNodeBuilder<MapEntryNode, MapNode> childrenBuilder =
+ mapNodeBuilder(CHILDREN_QNAME);
+
+ final DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode> firstChildBuilder =
+ mapEntryBuilder(CHILDREN_QNAME, CHILD_NUMBER_QNAME, FIRST_CHILD_ID);
+ final DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode> secondChildBuilder =
+ mapEntryBuilder(CHILDREN_QNAME, CHILD_NUMBER_QNAME, SECOND_CHILD_ID);
+
+ final DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode> firstGrandChildBuilder =
+ mapEntryBuilder(GRAND_CHILDREN_QNAME, GRAND_CHILD_NUMBER_QNAME,
+ FIRST_GRAND_CHILD_ID);
+ final DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode> secondGrandChildBuilder =
+ mapEntryBuilder(GRAND_CHILDREN_QNAME, GRAND_CHILD_NUMBER_QNAME,
+ SECOND_GRAND_CHILD_ID);
+
+ firstGrandChildBuilder
+ .withChild(
+ ImmutableNodes.leafNode(GRAND_CHILD_NUMBER_QNAME,
+ FIRST_GRAND_CHILD_ID)).withChild(
+ ImmutableNodes.leafNode(GRAND_CHILD_NAME_QNAME,
+ FIRST_GRAND_CHILD_NAME));
+
+ secondGrandChildBuilder.withChild(
+ ImmutableNodes
+ .leafNode(GRAND_CHILD_NUMBER_QNAME, SECOND_GRAND_CHILD_ID))
+ .withChild(
+ ImmutableNodes.leafNode(GRAND_CHILD_NAME_QNAME,
+ SECOND_GRAND_CHILD_NAME));
+
+ firstChildBuilder
+ .withChild(ImmutableNodes.leafNode(CHILD_NUMBER_QNAME, FIRST_CHILD_ID))
+ .withChild(ImmutableNodes.leafNode(CHILD_NAME_QNAME, FIRST_CHILD_NAME))
+ .withChild(
+ mapNodeBuilder(GRAND_CHILDREN_QNAME).withChild(
+ firstGrandChildBuilder.build()).build());
+
+
+ secondChildBuilder
+ .withChild(ImmutableNodes.leafNode(CHILD_NUMBER_QNAME, SECOND_CHILD_ID))
+ .withChild(ImmutableNodes.leafNode(CHILD_NAME_QNAME, SECOND_CHILD_NAME))
+ .withChild(
+ mapNodeBuilder(GRAND_CHILDREN_QNAME).withChild(
+ firstGrandChildBuilder.build()).build());
+
+ childrenBuilder.withChild(firstChildBuilder.build());
+ childrenBuilder.withChild(secondChildBuilder.build());
+
+ return familyContainerBuilder.withChild(childrenBuilder.build()).build();
+ }
+
+}
package org.opendaylight.controller.md.cluster.datastore.model;
import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
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;
public static final QName BASE_QNAME = QName.create("urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test:people", "2014-03-13",
"people");
- public static final InstanceIdentifier BASE_PATH = InstanceIdentifier.of(BASE_QNAME);
+ public static final YangInstanceIdentifier BASE_PATH = YangInstanceIdentifier.of(BASE_QNAME);
public static final QName PEOPLE_QNAME = QName.create(BASE_QNAME, "people");
public static final QName PERSON_QNAME = QName.create(PEOPLE_QNAME, "person");
public static final QName PERSON_NAME_QNAME = QName.create(PERSON_QNAME, "name");
// Create a list builder
CollectionNodeBuilder<MapEntryNode, MapNode> cars =
ImmutableMapNodeBuilder.create().withNodeIdentifier(
- new InstanceIdentifier.NodeIdentifier(
- QName.create(PEOPLE_QNAME, "person")));
+ new YangInstanceIdentifier.NodeIdentifier(
+ PERSON_QNAME));
// Create an entry for the person jack
MapEntryNode jack =
- ImmutableNodes.mapEntryBuilder(PEOPLE_QNAME, PERSON_NAME_QNAME, "jack")
+ ImmutableNodes.mapEntryBuilder(PERSON_QNAME, PERSON_NAME_QNAME, "jack")
.withChild(ImmutableNodes.leafNode(PERSON_NAME_QNAME, "jack"))
.withChild(ImmutableNodes.leafNode(PERSON_AGE_QNAME, 100))
.build();
// Create an entry for the person jill
MapEntryNode jill =
- ImmutableNodes.mapEntryBuilder(PEOPLE_QNAME, PERSON_NAME_QNAME, "jill")
+ ImmutableNodes.mapEntryBuilder(PERSON_QNAME, PERSON_NAME_QNAME, "jill")
.withChild(ImmutableNodes.leafNode(PERSON_NAME_QNAME, "jill"))
.withChild(ImmutableNodes.leafNode(PERSON_AGE_QNAME, 200))
.build();
cars.withChild(jill);
return ImmutableContainerNodeBuilder.create()
- .withNodeIdentifier(new InstanceIdentifier.NodeIdentifier(BASE_QNAME))
+ .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(BASE_QNAME))
.withChild(cars.build())
.build();
public static NormalizedNode emptyContainer(){
return ImmutableContainerNodeBuilder.create()
.withNodeIdentifier(
- new InstanceIdentifier.NodeIdentifier(BASE_QNAME))
+ new YangInstanceIdentifier.NodeIdentifier(BASE_QNAME))
.build();
}
import org.junit.Test;
import org.opendaylight.controller.cluster.datastore.node.NormalizedNodeToNodeCodec;
import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
public class SampleModelsTest {
@Test
public void testPeopleModel(){
- NormalizedNode<?, ?> expected = PeopleModel.emptyContainer();
+ NormalizedNode<?, ?> expected = PeopleModel.create();
NormalizedNodeMessages.Container node =
new NormalizedNodeToNodeCodec(SchemaContextHelper.full())
- .encode(InstanceIdentifier.of(PeopleModel.BASE_QNAME),
+ .encode(YangInstanceIdentifier.of(PeopleModel.BASE_QNAME),
expected);
NormalizedNodeMessages.Node normalizedNode =
node.getNormalizedNode();
- NormalizedNode<?,?> actual = new NormalizedNodeToNodeCodec(SchemaContextHelper.full()).decode(InstanceIdentifier.of(PeopleModel.BASE_QNAME),
+ NormalizedNode<?,?> actual = new NormalizedNodeToNodeCodec(SchemaContextHelper.full()).decode(YangInstanceIdentifier.of(PeopleModel.BASE_QNAME),
normalizedNode);
- Assert.assertEquals(expected, actual);
+ Assert.assertEquals(expected.toString(), actual.toString());
}
@Test
public void testCarsModel(){
- NormalizedNode<?, ?> expected = CarsModel.emptyContainer();
+ NormalizedNode<?, ?> expected = CarsModel.create();
NormalizedNodeMessages.Container node =
new NormalizedNodeToNodeCodec(SchemaContextHelper.full())
- .encode(InstanceIdentifier.of(CarsModel.BASE_QNAME),
+ .encode(YangInstanceIdentifier.of(CarsModel.BASE_QNAME),
expected);
NormalizedNodeMessages.Node normalizedNode =
node.getNormalizedNode();
- NormalizedNode<?,?> actual = new NormalizedNodeToNodeCodec(SchemaContextHelper.full()).decode(InstanceIdentifier.of(CarsModel.BASE_QNAME),
+ NormalizedNode<?,?> actual = new NormalizedNodeToNodeCodec(SchemaContextHelper.full()).decode(
+ YangInstanceIdentifier.of(CarsModel.BASE_QNAME),
normalizedNode);
- Assert.assertEquals(expected, actual);
+ Assert.assertEquals(expected.toString(), actual.toString());
}
}
package org.opendaylight.controller.md.cluster.datastore.model;
import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
public static final QName VALUE_QNAME = QName.create(TEST_QNAME, "value");
private static final String DATASTORE_TEST_YANG = "/odl-datastore-test.yang";
- public static final InstanceIdentifier TEST_PATH = InstanceIdentifier.of(TEST_QNAME);
- public static final InstanceIdentifier OUTER_LIST_PATH = InstanceIdentifier.builder(TEST_PATH).node(OUTER_LIST_QNAME).build();
+ public static final YangInstanceIdentifier TEST_PATH = YangInstanceIdentifier.of(TEST_QNAME);
+ public static final YangInstanceIdentifier OUTER_LIST_PATH = YangInstanceIdentifier.builder(TEST_PATH).node(OUTER_LIST_QNAME).build();
public static final QName TWO_QNAME = QName.create(TEST_QNAME,"two");
public static final QName THREE_QNAME = QName.create(TEST_QNAME,"three");
}
}
-}
\ No newline at end of file
+}
--- /dev/null
+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
--- /dev/null
+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
#to remove trailing spaces in the code files
find src/main/java -type f -name '*.java' -exec sed --in-place 's/[[:space:]]\+$//' {} \+
+
+#to remove trailing spaces in the generated code on OSX
+find src/main/java -type f -print0 |xargs -0 perl -pi -e 's/ +$//'
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
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.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.api.schema.NormalizedNodeContainer;
import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
/**
* NormalizedNodeBuilder is a builder that walks through a tree like structure and constructs a
* NormalizedNode from it.
- *
+ * <p/>
* 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
*
public abstract class NodeToNormalizedNodeBuilder<T extends PathArgument>
implements Identifiable<T> {
- private final T identifier;
+ private final T identifier;
- protected static final Logger logger = LoggerFactory
- .getLogger(NodeToNormalizedNodeBuilder.class);
+ protected static final Logger logger = LoggerFactory
+ .getLogger(NodeToNormalizedNodeBuilder.class);
- @Override
- public T getIdentifier() {
- return identifier;
- };
+ @Override
+ public T getIdentifier() {
+ return identifier;
+ }
- protected NodeToNormalizedNodeBuilder(final T identifier) {
- super();
- this.identifier = 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 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<QName> getQNameIdentifiers() {
- return Collections.singleton(identifier.getNodeType());
- }
+ /**
+ * @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;
+ }
- public abstract NodeToNormalizedNodeBuilder<?> getChild(
- final PathArgument child);
+ protected Set<QName> getQNameIdentifiers() {
+ return Collections.singleton(identifier.getNodeType());
+ }
- public abstract NodeToNormalizedNodeBuilder<?> getChild(QName child);
+ public abstract NodeToNormalizedNodeBuilder<?> getChild(
+ final PathArgument child);
- public abstract NormalizedNode<?, ?> normalize(QName nodeType, Node node);
+ public abstract NodeToNormalizedNodeBuilder<?> getChild(QName child);
+ public abstract NormalizedNode<?, ?> normalize(QName nodeType, Node node);
- private static abstract class SimpleTypeNormalization<T extends PathArgument>
- extends NodeToNormalizedNodeBuilder<T> {
- protected SimpleTypeNormalization(final T identifier) {
- super(identifier);
- }
+ private static abstract class SimpleTypeNormalization<T extends PathArgument>
+ extends NodeToNormalizedNodeBuilder<T> {
- @Override
- public NormalizedNode<?, ?> normalize(final QName nodeType, final Node node) {
- checkArgument(node != null);
- return normalizeImpl(nodeType, node);
- }
+ protected SimpleTypeNormalization(final T identifier) {
+ super(identifier);
+ }
- protected abstract NormalizedNode<?, ?> normalizeImpl(QName nodeType,
- Node node);
+ @Override
+ public NormalizedNode<?, ?> normalize(final QName nodeType,
+ final Node node) {
+ checkArgument(node != null);
+ return normalizeImpl(nodeType, node);
+ }
- @Override
- public NodeToNormalizedNodeBuilder<?> getChild(final PathArgument child) {
- return null;
- }
+ protected abstract NormalizedNode<?, ?> normalizeImpl(QName nodeType,
+ Node node);
- @Override
- public NodeToNormalizedNodeBuilder<?> getChild(final QName child) {
- return null;
- }
+ @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;
+ }
- @Override
- public NormalizedNode<?, ?> createDefault(final PathArgument currentArg) {
- // TODO Auto-generated method stub
- return null;
}
- }
- private static final class LeafNormalization extends
- SimpleTypeNormalization<NodeIdentifier> {
+ private static final class LeafNormalization extends
+ SimpleTypeNormalization<NodeIdentifier> {
- protected LeafNormalization(final NodeIdentifier identifier) {
- super(identifier);
- }
+ private final LeafSchemaNode schema;
- @Override
- protected NormalizedNode<?, ?> normalizeImpl(final QName nodeType,
- final Node node) {
- return ImmutableNodes.leafNode(nodeType, node.getValue());
+ protected LeafNormalization(final LeafSchemaNode schema, final NodeIdentifier identifier) {
+ super(identifier);
+ this.schema = schema;
+ }
+
+ @Override
+ protected NormalizedNode<?, ?> normalizeImpl(final QName nodeType,
+ final Node node) {
+ Object value = NodeValueCodec.toTypeSafeValue(this.schema, this.schema.getType(), node);
+ return ImmutableNodes.leafNode(nodeType, value);
+
+ }
}
- }
- private static final class LeafListEntryNormalization extends
- SimpleTypeNormalization<NodeWithValue> {
+ private static final class LeafListEntryNormalization extends
+ SimpleTypeNormalization<NodeWithValue> {
- public LeafListEntryNormalization(final LeafListSchemaNode potential) {
- super(new NodeWithValue(potential.getQName(), null));
- }
+ private final LeafListSchemaNode schema;
- @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();
- }
+ public LeafListEntryNormalization(final LeafListSchemaNode potential) {
+ super(new NodeWithValue(potential.getQName(), null));
+ this.schema = potential;
+ }
+ @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);
+ }
- @Override
- public boolean isKeyedEntry() {
- return true;
- }
- }
+ Object value = NodeValueCodec.toTypeSafeValue(this.schema, this.schema.getType(), node);
- private static abstract class NodeToNormalizationNodeOperation<T extends PathArgument>
- extends NodeToNormalizedNodeBuilder<T> {
+ NodeWithValue nodeId = new NodeWithValue(nodeType, value);
+ return Builders.leafSetEntryBuilder().withNodeIdentifier(nodeId)
+ .withValue(value).build();
+ }
- 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())&& !node.getType().equals(ContainerNode.class.getSimpleName())) {
- checkArgument(nodeType != null);
- }
-
- NormalizedNodeContainerBuilder builder = createBuilder(node);
-
- Set<NodeToNormalizedNodeBuilder<?>> usedMixins = new HashSet<>();
-
- logNode(node);
-
- if (node.getChildCount() == 0 && !node.getType().equals(ContainerNode.class.getSimpleName())) {
- 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());
+ @Override
+ public boolean isKeyedEntry() {
+ return true;
}
- builder.addChild(child);
- }
+ }
- final List<Node> children = node.getChildList();
- for (Node nodeChild : children) {
- PathArgument childPathArgument =
- NodeIdentifierFactory.getArgument(nodeChild.getPath());
+ private static abstract class NodeToNormalizationNodeOperation<T extends PathArgument>
+ extends NodeToNormalizedNodeBuilder<T> {
- QName childNodeType = null;
- NodeToNormalizedNodeBuilder childOp = null;
+ 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())
+ && !node.getType().equals(ContainerNode.class.getSimpleName())
+ && !node.getType().equals(MapNode.class.getSimpleName())) {
+ checkArgument(nodeType != null);
+ }
+
+ NormalizedNodeContainerBuilder builder = createBuilder(node);
+
+ Set<NodeToNormalizedNodeBuilder<?>> usedMixins = new HashSet<>();
+
+ logNode(node);
+
+ if (node.getChildCount() == 0 && (
+ node.getType().equals(LeafSetEntryNode.class.getSimpleName())
+ || node.getType().equals(LeafNode.class.getSimpleName()))) {
+ PathArgument childPathArgument =
+ NodeIdentifierFactory.getArgument(node.getPath());
+
+ final NormalizedNode child;
+ 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<Node> 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);
+ checkArgument(childOp instanceof AugmentationNormalization, 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
+ // skipping 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;
+ }
- 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);
}
- }
+ 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());
+ }
- try {
- return (NormalizedNodeContainer<?, ?, ?>) builder.build();
- } catch (Exception e) {
- return null;
- }
+ @SuppressWarnings("rawtypes")
+ protected abstract NormalizedNodeContainerBuilder createBuilder(
+ final Node node);
}
- 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<T extends PathArgument>
+ extends NodeToNormalizationNodeOperation<T> {
- }
+ private final DataNodeContainer schema;
+ private final Map<QName, NodeToNormalizedNodeBuilder<?>> byQName;
+ private final Map<PathArgument, NodeToNormalizedNodeBuilder<?>> byArg;
- private static abstract class DataContainerNormalizationOperation<T extends PathArgument>
- extends NodeToNormalizationNodeOperation<T> {
+ protected DataContainerNormalizationOperation(final T identifier,
+ final DataNodeContainer schema) {
+ super(identifier);
+ this.schema = schema;
+ this.byArg = new ConcurrentHashMap<>();
+ this.byQName = new ConcurrentHashMap<>();
+ }
- private final DataNodeContainer schema;
- private final Map<QName, NodeToNormalizedNodeBuilder<?>> byQName;
- private final Map<PathArgument, NodeToNormalizedNodeBuilder<?>> byArg;
+ @Override
+ public NodeToNormalizedNodeBuilder<?> getChild(
+ final PathArgument child) {
+ NodeToNormalizedNodeBuilder<?> potential = byArg.get(child);
+ if (potential != null) {
+ return potential;
+ }
+ potential = fromSchema(schema, child);
+ return register(potential);
+ }
- 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 QName child) {
+ if (child == null) {
+ return null;
+ }
+
+ NodeToNormalizedNodeBuilder<?> potential = byQName.get(child);
+ if (potential != null) {
+ return potential;
+ }
+ potential = fromSchemaAndPathArgument(schema, child);
+ return register(potential);
+ }
- @Override
- public NodeToNormalizedNodeBuilder<?> getChild(final PathArgument child) {
- NodeToNormalizedNodeBuilder<?> potential = byArg.get(child);
- if (potential != null) {
- return potential;
- }
- potential = fromSchema(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;
+ }
- @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);
+
+ private static final class ListItemNormalization extends
+ DataContainerNormalizationOperation<NodeIdentifierWithPredicates> {
+
+ private final List<QName> keyDefinition;
+ private final ListSchemaNode schemaNode;
+
+ protected ListItemNormalization(
+ final NodeIdentifierWithPredicates identifier,
+ final ListSchemaNode schema) {
+ super(identifier, schema);
+ this.schemaNode = schema;
+ keyDefinition = schema.getKeyDefinition();
}
- }
- return potential;
- }
- }
+ @Override
+ protected NormalizedNodeContainerBuilder createBuilder(
+ final Node node) {
+ NodeIdentifierWithPredicates nodeIdentifierWithPredicates =
+ (NodeIdentifierWithPredicates) NodeIdentifierFactory
+ .createPathArgument(node
+ .getPath(), schemaNode);
+ return Builders.mapEntryBuilder()
+ .withNodeIdentifier(
+ nodeIdentifierWithPredicates
+ );
+ }
- private static final class ListItemNormalization extends
- DataContainerNormalizationOperation<NodeIdentifierWithPredicates> {
+ @Override
+ public NormalizedNode<?, ?> createDefault(
+ final PathArgument currentArg) {
+ DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode>
+ builder =
+ Builders.mapEntryBuilder().withNodeIdentifier(
+ (NodeIdentifierWithPredicates) currentArg);
+ for (Entry<QName, Object> 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();
+ }
- private final List<QName> keyDefinition;
- private final ListSchemaNode schemaNode;
- protected ListItemNormalization(
- final NodeIdentifierWithPredicates identifier,
- final ListSchemaNode schema) {
- super(identifier, schema);
- this.schemaNode = schema;
- keyDefinition = schema.getKeyDefinition();
+ @Override
+ public boolean isKeyedEntry() {
+ return true;
+ }
}
- @Override
- protected NormalizedNodeContainerBuilder createBuilder(final Node node) {
- return Builders.mapEntryBuilder().withNodeIdentifier(
- (NodeIdentifierWithPredicates) NodeIdentifierFactory.getArgument(node
- .getPath()));
- }
- @Override
- public NormalizedNode<?, ?> createDefault(final PathArgument currentArg) {
- DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> builder =
- Builders.mapEntryBuilder().withNodeIdentifier(
- (NodeIdentifierWithPredicates) currentArg);
- for (Entry<QName, Object> 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();
- }
+ private static final class ContainerNormalization extends
+ DataContainerNormalizationOperation<NodeIdentifier> {
+ protected ContainerNormalization(final ContainerSchemaNode schema) {
+ super(new NodeIdentifier(schema.getQName()), schema);
+ }
- @Override
- public boolean isKeyedEntry() {
- return true;
- }
- }
+ @Override
+ protected NormalizedNodeContainerBuilder createBuilder(
+ final Node node) {
+ return Builders.containerBuilder()
+ .withNodeIdentifier(getIdentifier());
+ }
- private static final class ContainerNormalization extends
- DataContainerNormalizationOperation<NodeIdentifier> {
+ @Override
+ public NormalizedNode<?, ?> createDefault(
+ final PathArgument currentArg) {
+ return Builders.containerBuilder()
+ .withNodeIdentifier((NodeIdentifier) currentArg).build();
+ }
- 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<T extends PathArgument>
+ extends NodeToNormalizationNodeOperation<T> {
- }
+ protected MixinNormalizationOp(final T identifier) {
+ super(identifier);
+ }
- private static abstract class MixinNormalizationOp<T extends PathArgument>
- extends NodeToNormalizationNodeOperation<T> {
+ @Override
+ public final boolean isMixin() {
+ return true;
+ }
- protected MixinNormalizationOp(final T identifier) {
- super(identifier);
}
- @Override
- public final boolean isMixin() {
- return true;
- }
- }
+ private static final class LeafListMixinNormalization extends
+ MixinNormalizationOp<NodeIdentifier> {
- private static final class LeafListMixinNormalization extends
- MixinNormalizationOp<NodeIdentifier> {
+ private final NodeToNormalizedNodeBuilder<?> innerOp;
- private final NodeToNormalizedNodeBuilder<?> innerOp;
+ public LeafListMixinNormalization(final LeafListSchemaNode potential) {
+ super(new NodeIdentifier(potential.getQName()));
+ innerOp = new LeafListEntryNormalization(potential);
+ }
- 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
- 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 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 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;
+ }
- @Override
- public NodeToNormalizedNodeBuilder<?> getChild(final QName child) {
- if (getIdentifier().getNodeType().equals(child)) {
- return innerOp;
- }
- return null;
}
- }
- private static final class AugmentationNormalization extends
- MixinNormalizationOp<AugmentationIdentifier> {
+ private static final class AugmentationNormalization extends
+ MixinNormalizationOp<AugmentationIdentifier> {
+
+ private final Map<QName, NodeToNormalizedNodeBuilder<?>> byQName;
+ private final Map<PathArgument, NodeToNormalizedNodeBuilder<?>> byArg;
- private final Map<QName, NodeToNormalizedNodeBuilder<?>> byQName;
- private final Map<PathArgument, NodeToNormalizedNodeBuilder<?>> byArg;
+ public AugmentationNormalization(final AugmentationSchema augmentation,
+ final DataNodeContainer schema) {
+ super(augmentationIdentifierFrom(augmentation));
- public AugmentationNormalization(final AugmentationSchema augmentation,
- final DataNodeContainer schema) {
- super(augmentationIdentifierFrom(augmentation));
+ ImmutableMap.Builder<QName, NodeToNormalizedNodeBuilder<?>>
+ byQNameBuilder =
+ ImmutableMap.builder();
+ ImmutableMap.Builder<PathArgument, NodeToNormalizedNodeBuilder<?>>
+ byArgBuilder =
+ ImmutableMap.builder();
- ImmutableMap.Builder<QName, NodeToNormalizedNodeBuilder<?>> byQNameBuilder =
- ImmutableMap.builder();
- ImmutableMap.Builder<PathArgument, NodeToNormalizedNodeBuilder<?>> 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();
- 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 PathArgument child) {
- return byArg.get(child);
- }
+ @Override
+ public NodeToNormalizedNodeBuilder<?> getChild(final QName child) {
+ return byQName.get(child);
+ }
- @Override
- public NodeToNormalizedNodeBuilder<?> getChild(final QName child) {
- return byQName.get(child);
- }
+ @Override
+ protected Set<QName> getQNameIdentifiers() {
+ return getIdentifier().getPossibleChildNames();
+ }
- @Override
- protected Set<QName> getQNameIdentifiers() {
- return getIdentifier().getPossibleChildNames();
- }
+ @SuppressWarnings("rawtypes")
+ @Override
+ protected NormalizedNodeContainerBuilder createBuilder(
+ final Node node) {
+ return Builders.augmentationBuilder()
+ .withNodeIdentifier(getIdentifier());
+ }
- @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();
+ }
- @Override
- public NormalizedNode<?, ?> createDefault(final PathArgument currentArg) {
- return Builders.augmentationBuilder().withNodeIdentifier(getIdentifier())
- .build();
}
- }
- private static final class ListMixinNormalization extends
- MixinNormalizationOp<NodeIdentifier> {
+ private static final class ListMixinNormalization extends
+ MixinNormalizationOp<NodeIdentifier> {
- private final ListItemNormalization innerNode;
+ private final ListItemNormalization innerNode;
- public ListMixinNormalization(final ListSchemaNode list) {
- super(new NodeIdentifier(list.getQName()));
- this.innerNode =
- new ListItemNormalization(new NodeIdentifierWithPredicates(
- list.getQName(), Collections.<QName, Object>emptyMap()), list);
- }
+ public ListMixinNormalization(final ListSchemaNode list) {
+ super(new NodeIdentifier(list.getQName()));
+ this.innerNode =
+ new ListItemNormalization(new NodeIdentifierWithPredicates(
+ list.getQName(), Collections.<QName, Object>emptyMap()),
+ list);
+ }
- @SuppressWarnings("rawtypes")
- @Override
- protected NormalizedNodeContainerBuilder createBuilder(
- final Node node) {
- return Builders.mapBuilder().withNodeIdentifier(getIdentifier());
- }
+ @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 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 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;
- }
+ @Override
+ public NodeToNormalizedNodeBuilder<?> getChild(final QName child) {
+ if (getIdentifier().getNodeType().equals(child)) {
+ return innerNode;
+ }
+ return null;
+ }
- }
-
- private static class ChoiceNodeNormalization extends
- MixinNormalizationOp<NodeIdentifier> {
-
- private final ImmutableMap<QName, NodeToNormalizedNodeBuilder<?>> byQName;
- private final ImmutableMap<PathArgument, NodeToNormalizedNodeBuilder<?>> byArg;
-
- protected ChoiceNodeNormalization(
- final org.opendaylight.yangtools.yang.model.api.ChoiceNode schema) {
- super(new NodeIdentifier(schema.getQName()));
- ImmutableMap.Builder<QName, NodeToNormalizedNodeBuilder<?>> byQNameBuilder =
- ImmutableMap.builder();
- ImmutableMap.Builder<PathArgument, NodeToNormalizedNodeBuilder<?>> 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);
- }
+ private static class ChoiceNodeNormalization extends
+ MixinNormalizationOp<NodeIdentifier> {
+
+ private final ImmutableMap<QName, NodeToNormalizedNodeBuilder<?>>
+ byQName;
+ private final ImmutableMap<PathArgument, NodeToNormalizedNodeBuilder<?>>
+ byArg;
+
+ protected ChoiceNodeNormalization(
+ final org.opendaylight.yangtools.yang.model.api.ChoiceNode schema) {
+ super(new NodeIdentifier(schema.getQName()));
+ ImmutableMap.Builder<QName, NodeToNormalizedNodeBuilder<?>>
+ byQNameBuilder =
+ ImmutableMap.builder();
+ ImmutableMap.Builder<PathArgument, NodeToNormalizedNodeBuilder<?>>
+ 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
- protected NormalizedNodeContainerBuilder createBuilder(final Node node) {
- return Builders.choiceBuilder().withNodeIdentifier(getIdentifier());
- }
+ @Override
+ public NodeToNormalizedNodeBuilder<?> getChild(
+ final PathArgument child) {
+ return byArg.get(child);
+ }
- @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<org.opendaylight.yangtools.yang.model.api.ChoiceNode> 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());
- }
- }
+ @Override
+ public NodeToNormalizedNodeBuilder<?> getChild(final QName child) {
+ return byQName.get(child);
+ }
- 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<org.opendaylight.yangtools.yang.model.api.ChoiceNode> 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<QName> 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;
- }
+ @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();
+ }
}
- if (augmentation != null) {
- return new AugmentationNormalization(augmentation, schema);
- } else {
- return null;
+
+ /**
+ * Find an appropriate NormalizedNodeBuilder using both the schema and the
+ * Path Argument
+ *
+ * @param schema
+ * @param child
+ * @return
+ */
+ public static NodeToNormalizedNodeBuilder<?> fromSchemaAndPathArgument(
+ final DataNodeContainer schema, final QName child) {
+ DataSchemaNode potential = schema.getDataChildByName(child);
+ if (potential == null) {
+ Iterable<org.opendaylight.yangtools.yang.model.api.ChoiceNode>
+ 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 the schema in an instance of DataSchemaNode and the potential
+ // is augmenting something then there is a chance that this may be
+ // and augmentation node
+ if ((schema instanceof DataSchemaNode)
+ && potential.isAugmenting()) {
+
+ AugmentationNormalization augmentation =
+ fromAugmentation(schema, (AugmentationTarget) schema,
+ potential);
+
+ // If an augmentation normalization (builder) is not found then
+ // we fall through to the regular processing
+ if(augmentation != null){
+ return augmentation;
+ }
+ }
+ 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<org.opendaylight.yangtools.yang.model.api.ChoiceNode> 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;
}
- }
-
- /**
- *
- * @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());
+
+
+ /**
+ * Create an AugmentationIdentifier based on the AugmentationSchema
+ *
+ * @param augmentation
+ * @return
+ */
+ public static AugmentationIdentifier augmentationIdentifierFrom(
+ final AugmentationSchema augmentation) {
+ ImmutableSet.Builder<QName> potentialChildren = ImmutableSet.builder();
+ for (DataSchemaNode child : augmentation.getChildNodes()) {
+ potentialChildren.add(child.getQName());
+ }
+ return new AugmentationIdentifier(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;
+ }
}
- 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);
+
+ /**
+ * @param schema
+ * @param child
+ * @return
+ */
+ private static NodeToNormalizedNodeBuilder<?> fromSchema(
+ final DataNodeContainer schema, final PathArgument child) {
+ if (child instanceof AugmentationIdentifier) {
+ QName childQName = ((AugmentationIdentifier) child)
+ .getPossibleChildNames().iterator().next();
+
+ return fromSchemaAndPathArgument(schema, childQName);
+ }
+ 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((LeafSchemaNode) potential,
+ 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;
}
- return null;
- }
- public static NodeToNormalizedNodeBuilder<?> from(final SchemaContext ctx) {
- return new ContainerNormalization(ctx);
- }
+ public static NodeToNormalizedNodeBuilder<?> from(final SchemaContext ctx) {
+ return new ContainerNormalization(ctx);
+ }
- public abstract NormalizedNode<?, ?> createDefault(PathArgument currentArg);
+ public abstract NormalizedNode<?, ?> createDefault(PathArgument currentArg);
}
--- /dev/null
+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.controller.cluster.datastore.node;
+
+import org.opendaylight.controller.cluster.datastore.node.utils.QNameFactory;
+import org.opendaylight.controller.cluster.datastore.util.InstanceIdentifierUtils;
+import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages;
+import org.opendaylight.yangtools.yang.data.api.codec.BitsCodec;
+import org.opendaylight.yangtools.yang.data.impl.codec.TypeDefinitionAwareCodec;
+import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
+import org.opendaylight.yangtools.yang.model.util.IdentityrefType;
+import org.opendaylight.yangtools.yang.model.util.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.model.util.Leafref;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class NodeValueCodec {
+ protected static final Logger logger = LoggerFactory
+ .getLogger(NodeValueCodec.class);
+
+ public static Object toTypeSafeValue(DataSchemaNode schema, TypeDefinition type, NormalizedNodeMessages.Node node){
+
+ String value = node.getValue();
+
+ if(schema != null && value != null){
+ TypeDefinition<?> baseType = type;
+
+ while (baseType.getBaseType() != null) {
+ baseType = baseType.getBaseType();
+ }
+
+ TypeDefinitionAwareCodec<Object, ? extends TypeDefinition<?>> codec =
+ TypeDefinitionAwareCodec.from(type);
+
+ if(codec instanceof BitsCodec){
+ if(value.contains("[]")){
+ value = "";
+ } else {
+ value = value.replace("[", "");
+ value = value.replace("]", "");
+ value = value.replace(",", " ");
+ }
+ }
+
+ if (codec != null) {
+ return codec.deserialize(value);
+ } else if(baseType instanceof Leafref) {
+ return value;
+ } else if(baseType instanceof IdentityrefType) {
+ return QNameFactory.create(value);
+ } else if(baseType instanceof InstanceIdentifier) {
+ return InstanceIdentifierUtils.fromSerializable(node.getInstanceIdentifierValue());
+ } else {
+ logger.error("Could not figure out how to transform value " + value + " for schemaType " + type);
+ }
+ }
+
+ return value;
+ }
+}
public NormalizedNode<?,?> decode(YangInstanceIdentifier id, NormalizedNodeMessages.Node node){
NodeToNormalizedNodeBuilder currentOp = NodeToNormalizedNodeBuilder.from(ctx);
- for(YangInstanceIdentifier.PathArgument pathArgument : id.getPath()){
+ for(YangInstanceIdentifier.PathArgument pathArgument : id.getPathArguments()){
currentOp = currentOp.getChild(pathArgument);
}
nodeType = pathArgument.getNodeType();
}
}
- try {
- if((node != null)&& (!node.getType().isEmpty())){
- return currentOp.normalize(nodeType, node);
- }else{
- return null;
- }
- } catch(RuntimeException e){
- throw e;
- }
+ if((node != null)&& (!node.getType().isEmpty())){
+ return currentOp.normalize(nodeType, node);
+ } else{
+ return null;
+ }
}
package org.opendaylight.controller.cluster.datastore.node;
+import com.google.common.base.Preconditions;
+import org.opendaylight.controller.cluster.datastore.util.InstanceIdentifierUtils;
import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages;
import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node;
import org.opendaylight.yangtools.yang.common.QName;
/**
* NormalizedNodeToProtocolBufferNode walks the NormalizedNode tree converting it to the
* NormalizedMessage.Node
- *
+ * <p/>
* {@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;
+ private final Node.Builder builderRoot;
+ private NormalizedNodeMessages.Container container;
- public NormalizedNodeToProtocolBufferNode() {
+ public NormalizedNodeToProtocolBufferNode() {
- builderRoot = Node.newBuilder();
- }
-
- public void encode(String parentPath, NormalizedNode<?, ?> normalizedNode) {
- if (parentPath == null) {
- parentPath = "";
+ builderRoot = Node.newBuilder();
}
- NormalizedNodeMessages.Container.Builder containerBuilder =
- NormalizedNodeMessages.Container.newBuilder();
+ public void encode(String parentPath, NormalizedNode<?, ?> normalizedNode) {
+ if (parentPath == null) {
+ parentPath = "";
+ }
+
+ NormalizedNodeMessages.Container.Builder containerBuilder =
+ NormalizedNodeMessages.Container.newBuilder();
- if(normalizedNode != null) {
+ if (normalizedNode != null) {
- navigateNormalizedNode(0, parentPath, normalizedNode, builderRoot);
- // here we need to put back the Node Tree in Container
+ navigateNormalizedNode(0, parentPath, normalizedNode, builderRoot);
+ // here we need to put back the Node Tree in Container
- container= containerBuilder.setParentPath(parentPath).setNormalizedNode(
- builderRoot.build()).build();
- }else {
- //this can happen when an attempt was made to read from datastore and normalized node was null.
- container = containerBuilder.setParentPath(parentPath).build();
+ container =
+ containerBuilder.setParentPath(parentPath).setNormalizedNode(
+ builderRoot.build()).build();
+ } else {
+ //this can happen when an attempt was made to read from datastore and normalized node was null.
+ container = containerBuilder.setParentPath(parentPath).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<DataContainerChild<? extends YangInstanceIdentifier.PathArgument, ?>>
+ 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 void navigateDataContainerNode(int level,final String parentPath,
- final DataContainerNode<?> dataContainerNode, Node.Builder builderParent) {
+ 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()
+ );
+ }
- String newParentPath = parentPath + "/" + dataContainerNode.getIdentifier().toString();
- String type = getDataContainerType(dataContainerNode).getSimpleName();
- builderParent.setPath(dataContainerNode.getIdentifier().toString())
- .setType(type);
+ private void navigateNormalizedNodeContainerMixin(int level,
+ final String parentPath,
+ NormalizedNodeContainer<?, ?, ?> node, Node.Builder builderParent) {
+ String newParentPath =
+ parentPath + "/" + node.getIdentifier().toString();
- final Iterable<DataContainerChild<? extends YangInstanceIdentifier.PathArgument, ?>> value =
- dataContainerNode.getValue();
- for (NormalizedNode<?, ?> node : value) {
- Node.Builder builderChild = Node.newBuilder();
- if (node instanceof MixinNode && node instanceof NormalizedNodeContainer) {
+ builderParent.setPath(node.getIdentifier().toString()).setType(
+ this.getDataContainerType(node).getSimpleName());
+ final Iterable<? extends NormalizedNode<?, ?>> 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);
- 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<? extends NormalizedNode<?, ?>> 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) {
- private void navigateNormalizedNode(int level,
- String parentPath,NormalizedNode<?, ?> normalizedNode, Node.Builder builderParent) {
+ final DataContainerNode<?> dataContainerNode =
+ (DataContainerNode) normalizedNode;
- if (normalizedNode instanceof DataContainerNode) {
+ navigateDataContainerNode(level + 1, parentPath, dataContainerNode,
+ builderParent);
+ } else if (normalizedNode instanceof MixinNode
+ && normalizedNode instanceof NormalizedNodeContainer) {
- final DataContainerNode<?> dataContainerNode =
- (DataContainerNode) normalizedNode;
+ navigateNormalizedNodeContainerMixin(level, parentPath,
+ (NormalizedNodeContainer<?, ?, ?>) normalizedNode,
+ builderParent);
+ } else {
+ if (normalizedNode instanceof LeafNode) {
+ buildLeafNode(parentPath, normalizedNode, builderParent);
+ } else if (normalizedNode instanceof LeafSetEntryNode) {
+ buildLeafSetEntryNode(parentPath, normalizedNode,
+ builderParent);
+ }
- 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<QName, String> attributes = leafSetEntryNode.getAttributes();
+ if (!attributes.isEmpty()) {
+ NormalizedNodeMessages.Attribute.Builder builder = null;
+ for (Map.Entry<QName, String> attribute : attributes.entrySet()) {
+ builder = NormalizedNodeMessages.Attribute.newBuilder();
+
+ builder
+ .setName(attribute.getKey().toString())
+ .setValue(normalizedNode.getValue().toString());
+
+ builderParent.addAttributes(builder.build());
+ }
+ }
+ buildNodeValue(normalizedNode, builderParent);
}
- }
-
- private void buildLeafSetEntryNode(String parentPath,NormalizedNode<?, ?> normalizedNode,
- Node.Builder builderParent) {
- String path = parentPath + "/" + normalizedNode.getIdentifier().toString();
- LeafSetEntryNode leafSetEntryNode = (LeafSetEntryNode) normalizedNode;
- Map<QName, String> attributes = leafSetEntryNode.getAttributes();
- if (!attributes.isEmpty()) {
- NormalizedNodeMessages.Attribute.Builder builder = null;
- for (Map.Entry<QName, String> attribute : attributes.entrySet()) {
- builder = NormalizedNodeMessages.Attribute.newBuilder();
- builder.setName(attribute.getKey().toString()).setValue(
- normalizedNode.getValue().toString());
- builderParent.addAttributes(builder.build());
- }
+ private void buildLeafNode(String parentPath,
+ NormalizedNode<?, ?> normalizedNode,
+ Node.Builder builderParent) {
+ Preconditions.checkNotNull(parentPath);
+ Preconditions.checkNotNull(normalizedNode);
+ String path =
+ parentPath + "/" + normalizedNode.getIdentifier().toString();
+ LeafNode leafNode = (LeafNode) normalizedNode;
+ Map<QName, String> attributes = leafNode.getAttributes();
+ if (!attributes.isEmpty()) {
+ NormalizedNodeMessages.Attribute.Builder builder = null;
+ for (Map.Entry<QName, String> attribute : attributes.entrySet()) {
+ builder = NormalizedNodeMessages.Attribute.newBuilder();
+ builder
+ .setName(attribute.getKey().toString())
+ .setValue(attribute.getValue().toString());
+
+ builderParent.addAttributes(builder.build());
+ }
+ }
+
+ Object value = normalizedNode.getValue();
+ if (value == null) {
+ builderParent
+ .setPath(normalizedNode.getIdentifier().toString())
+ .setType(LeafNode.class.getSimpleName())
+ .setValueType(String.class.getSimpleName())
+ .setValue("");
+ } else {
+ buildNodeValue(normalizedNode, builderParent);
+ }
}
- 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<QName, String> attributes = leafNode.getAttributes();
- if (!attributes.isEmpty()) {
- NormalizedNodeMessages.Attribute.Builder builder = null;
- for (Map.Entry<QName, String> attribute : attributes.entrySet()) {
- builder = NormalizedNodeMessages.Attribute.newBuilder();
- builder.setName(attribute.getKey().toString()).setValue(
- normalizedNode.getValue().toString());
- builderParent.addAttributes(builder.build());
- }
+
+ private void buildNodeValue(NormalizedNode<?, ?> normalizedNode,
+ Node.Builder builderParent) {
+
+ Object value = normalizedNode.getValue();
+
+ builderParent
+ .setPath(normalizedNode.getIdentifier().toString())
+ .setType(LeafNode.class.getSimpleName())
+ .setValueType((value.getClass().getSimpleName()))
+ .setValue(value.toString());
+
+ if(value.getClass().equals(YangInstanceIdentifier.class)){
+ builderParent.setInstanceIdentifierValue(
+ InstanceIdentifierUtils
+ .toSerializable((YangInstanceIdentifier) value));
+ }
}
- builderParent.setPath(normalizedNode.getIdentifier().toString()).setType(
- LeafNode.class.getSimpleName()).setValue(normalizedNode.getValue().toString());
- }
- public NormalizedNodeMessages.Container getContainer() {
- return container;
- }
+ public NormalizedNodeMessages.Container getContainer() {
+ return container;
+ }
}
package org.opendaylight.controller.cluster.datastore.node.utils;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
import java.util.HashMap;
import java.util.Map;
synchronized (cache){
value = cache.get(id);
if(value == null) {
- value = createPathArgument(id);
+ value = createPathArgument(id, null);
cache.put(id, value);
}
}
return value;
}
- private static YangInstanceIdentifier.PathArgument createPathArgument(String id){
+ public static YangInstanceIdentifier.PathArgument getArgument(String id, DataSchemaNode schemaNode){
+ YangInstanceIdentifier.PathArgument value = cache.get(id);
+ if(value == null){
+ synchronized (cache){
+ value = cache.get(id);
+ if(value == null) {
+ value = createPathArgument(id, schemaNode);
+ cache.put(id, value);
+ }
+ }
+ }
+ return value;
+ }
+
+ public static YangInstanceIdentifier.PathArgument createPathArgument(String id, DataSchemaNode schemaNode){
final NodeIdentifierWithPredicatesGenerator
- nodeIdentifierWithPredicatesGenerator = new NodeIdentifierWithPredicatesGenerator(id);
+ nodeIdentifierWithPredicatesGenerator = new NodeIdentifierWithPredicatesGenerator(id, schemaNode);
if(nodeIdentifierWithPredicatesGenerator.matches()){
return nodeIdentifierWithPredicatesGenerator.getPathArgument();
}
final NodeIdentifierWithValueGenerator
- nodeWithValueGenerator = new NodeIdentifierWithValueGenerator(id);
+ nodeWithValueGenerator = new NodeIdentifierWithValueGenerator(id, schemaNode);
if(nodeWithValueGenerator.matches()){
return nodeWithValueGenerator.getPathArgument();
}
private final boolean doesMatch;
private final ListSchemaNode listSchemaNode;
- public NodeIdentifierWithPredicatesGenerator(String id){
- this(id, null);
- }
-
- public NodeIdentifierWithPredicatesGenerator(String id, ListSchemaNode schemaNode){
+ public NodeIdentifierWithPredicatesGenerator(String id, DataSchemaNode schemaNode){
this.id = id;
matcher = pattern.matcher(this.id);
doesMatch = matcher.matches();
- this.listSchemaNode = schemaNode;
+
+ if(schemaNode instanceof ListSchemaNode){
+ this.listSchemaNode = (ListSchemaNode) schemaNode;
+ } else {
+ this.listSchemaNode = null;
+ }
}
package org.opendaylight.controller.cluster.datastore.node.utils;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.impl.codec.TypeDefinitionAwareCodec;
+import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode;
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 DataSchemaNode schemaNode;
+ private static final Pattern pattern = Pattern.compile("(.*)\\Q[\\E(.*)\\Q]\\E");
private final Matcher matcher;
private final boolean doesMatch;
- public NodeIdentifierWithValueGenerator(String id){
+ public NodeIdentifierWithValueGenerator(String id, DataSchemaNode schemaNode){
this.id = id;
+ this.schemaNode = schemaNode;
matcher = pattern.matcher(this.id);
doesMatch = matcher.matches();
}
final String value = matcher.group(2);
return new YangInstanceIdentifier.NodeWithValue(
- QNameFactory.create(name), value);
+ QNameFactory.create(name), getValue(value));
}
+
+ private Object getValue(String value){
+ if(schemaNode != null){
+ if(schemaNode instanceof LeafListSchemaNode){
+ return TypeDefinitionAwareCodec
+ .from(LeafListSchemaNode.class.cast(schemaNode).getType()).deserialize(value);
+
+ }
+ }
+ return value;
+ }
+
}
--- /dev/null
+package org.opendaylight.controller.cluster.datastore.util;
+
+import org.opendaylight.controller.cluster.datastore.node.utils.NodeIdentifierFactory;
+import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages;
+import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * This class contains utility methods for converting an MD-SAL
+ * YangInstanceIdentifier to and from other representations.
+ * <p>
+ * The representations convered for now are,
+ *
+ * <ul>
+ * <li>String</li>
+ * <li>Protocol Buffer</li>
+ * </ul>
+ */
+public class InstanceIdentifierUtils {
+
+ protected static final Logger logger = LoggerFactory
+ .getLogger(InstanceIdentifierUtils.class);
+
+ @Deprecated
+ public static YangInstanceIdentifier from(String path) {
+ String[] ids = path.split("/");
+
+ List<YangInstanceIdentifier.PathArgument> pathArguments =
+ new ArrayList<>();
+ for (String nodeId : ids) {
+ if (!"".equals(nodeId)) {
+ pathArguments
+ .add(NodeIdentifierFactory.getArgument(nodeId));
+ }
+ }
+ final YangInstanceIdentifier instanceIdentifier =
+ YangInstanceIdentifier.create(pathArguments);
+ return instanceIdentifier;
+ }
+
+
+ /**
+ * Convert an MD-SAL YangInstanceIdentifier into a protocol buffer version of it
+ *
+ * @param path an MD-SAL YangInstanceIdentifier
+ * @return a protocol buffer version of the MD-SAL YangInstanceIdentifier
+ */
+ public static NormalizedNodeMessages.InstanceIdentifier toSerializable(YangInstanceIdentifier path){
+ NormalizedNodeMessages.InstanceIdentifier.Builder builder =
+ NormalizedNodeMessages.InstanceIdentifier.newBuilder();
+
+ try {
+
+ for (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument pathArgument : path
+ .getPathArguments()) {
+
+ String nodeType = "";
+ if(!(pathArgument instanceof YangInstanceIdentifier.AugmentationIdentifier)){
+ nodeType = pathArgument.getNodeType().toString();
+ }
+
+ NormalizedNodeMessages.PathArgument serializablePathArgument =
+ NormalizedNodeMessages.PathArgument.newBuilder()
+ .setValue(pathArgument.toString())
+ .setType(pathArgument.getClass().getSimpleName())
+ .setNodeType(NormalizedNodeMessages.QName.newBuilder()
+ .setValue(nodeType))
+ .addAllAttributes(getPathArgumentAttributes(
+ pathArgument))
+ .build();
+
+ builder.addArguments(serializablePathArgument);
+ }
+
+ } catch(Exception e){
+ logger.error("An exception occurred", e);
+ }
+ return builder.build();
+ }
+
+
+ /**
+ * Convert a protocol buffer version of the MD-SAL YangInstanceIdentifier into
+ * the MD-SAL version of the YangInstanceIdentifier
+ *
+ * @param path a protocol buffer version of the MD-SAL YangInstanceIdentifier
+ * @return an MD-SAL YangInstanceIdentifier
+ */
+ public static YangInstanceIdentifier fromSerializable(NormalizedNodeMessages.InstanceIdentifier path){
+
+ List<YangInstanceIdentifier.PathArgument> pathArguments =
+ new ArrayList<>();
+
+ for(NormalizedNodeMessages.PathArgument pathArgument : path.getArgumentsList()){
+
+ pathArguments
+ .add(parsePathArgument(pathArgument));
+
+ }
+
+ final YangInstanceIdentifier instanceIdentifier = YangInstanceIdentifier.create(pathArguments);
+
+ return instanceIdentifier;
+ }
+
+ /**
+ * Take the various attributes of a PathArgument and package them up as
+ * protocol buffer attributes.
+ * <p>
+ *
+ * PathArguments have 4 subtypes and each of the various subtypes have
+ * different attributes
+ * <ul>
+ * <li>
+ * NodeIdentifier is the most basic PathArgument. It is used for
+ * ContainerNode, LeafNode etc and has no attributes
+ * </li>
+ * <li>
+ * NodeWithValue has only a single attribute. It is used for
+ * LeafListEntryNodes and the attribute it contains is the value
+ * of the entry
+ * </li>
+ * <li>
+ * NodeIdentifierWithPredicates has a map of attributes.
+ * It is used to represent a ListItemNode. Each entry
+ * in the map of attributes represents the key and value of the
+ * keys in that entry.
+ * </li>
+ * <li>
+ * AugmentationIdentifier has a list of unnamed attributes. Each
+ * attribute represents the possible children that can go within
+ * an augmentation entry.
+ * </li>
+ * </ul>
+ * @param pathArgument
+ * @return
+ */
+ private static Iterable<? extends NormalizedNodeMessages.Attribute> getPathArgumentAttributes(
+ YangInstanceIdentifier.PathArgument pathArgument) {
+ List<NormalizedNodeMessages.Attribute> attributes = new ArrayList<>();
+
+
+
+ if (pathArgument instanceof YangInstanceIdentifier.NodeWithValue) {
+ YangInstanceIdentifier.NodeWithValue identifier
+ = (YangInstanceIdentifier.NodeWithValue) pathArgument;
+
+ NormalizedNodeMessages.Attribute attribute =
+ NormalizedNodeMessages.Attribute.newBuilder()
+ .setName("name")
+ .setValue(identifier.getValue().toString())
+ .setType(identifier.getValue().getClass().getSimpleName())
+ .build();
+
+ attributes.add(attribute);
+ } else if (pathArgument instanceof YangInstanceIdentifier.NodeIdentifierWithPredicates) {
+ YangInstanceIdentifier.NodeIdentifierWithPredicates identifier
+ = (YangInstanceIdentifier.NodeIdentifierWithPredicates) pathArgument;
+
+ for (QName key : identifier.getKeyValues().keySet()) {
+ Object value = identifier.getKeyValues().get(key);
+ NormalizedNodeMessages.Attribute attribute =
+ NormalizedNodeMessages.Attribute.newBuilder()
+ .setName(key.toString())
+ .setValue(value.toString())
+ .setType(value.getClass().getSimpleName())
+ .build();
+
+ attributes.add(attribute);
+
+ }
+
+ } else if(pathArgument instanceof YangInstanceIdentifier.AugmentationIdentifier) {
+ YangInstanceIdentifier.AugmentationIdentifier identifier
+ = (YangInstanceIdentifier.AugmentationIdentifier) pathArgument;
+
+ for (QName key : identifier.getPossibleChildNames()) {
+ Object value = key;
+ NormalizedNodeMessages.Attribute attribute =
+ NormalizedNodeMessages.Attribute.newBuilder()
+ .setName(key.toString())
+ .setValue(value.toString())
+ .setType(value.getClass().getSimpleName())
+ .build();
+
+ attributes.add(attribute);
+
+ }
+ }
+
+ return attributes;
+ }
+
+
+ /**
+ * Parse a protocol buffer PathArgument and return an MD-SAL PathArgument
+ *
+ * @param pathArgument protocol buffer PathArgument
+ * @return MD-SAL PathArgument
+ */
+ private static YangInstanceIdentifier.PathArgument parsePathArgument(NormalizedNodeMessages.PathArgument pathArgument) {
+ if (YangInstanceIdentifier.NodeWithValue.class.getSimpleName().equals(pathArgument.getType())) {
+
+ YangInstanceIdentifier.NodeWithValue nodeWithValue =
+ new YangInstanceIdentifier.NodeWithValue(
+ QName.create(pathArgument.getNodeType().getValue()),
+ parseAttribute(pathArgument.getAttributes(0)));
+
+ return nodeWithValue;
+
+ } else if(YangInstanceIdentifier.NodeIdentifierWithPredicates.class.getSimpleName().equals(pathArgument.getType())){
+
+ YangInstanceIdentifier.NodeIdentifierWithPredicates
+ nodeIdentifierWithPredicates =
+ new YangInstanceIdentifier.NodeIdentifierWithPredicates(
+ QName.create(pathArgument.getNodeType().getValue()), toAttributesMap(pathArgument.getAttributesList()));
+
+ return nodeIdentifierWithPredicates;
+
+ } else if(YangInstanceIdentifier.AugmentationIdentifier.class.getSimpleName().equals(pathArgument.getType())){
+
+ Set<QName> qNameSet = new HashSet<>();
+
+ for(NormalizedNodeMessages.Attribute attribute : pathArgument.getAttributesList()){
+ qNameSet.add(QName.create(attribute.getValue()));
+ }
+
+ return new YangInstanceIdentifier.AugmentationIdentifier(qNameSet);
+ }
+
+ return NodeIdentifierFactory.getArgument(pathArgument.getValue());
+ }
+
+ private static Map<QName, Object> toAttributesMap(
+ List<NormalizedNodeMessages.Attribute> attributesList) {
+
+ Map<QName, Object> map = new HashMap<>();
+
+ for(NormalizedNodeMessages.Attribute attribute : attributesList){
+ String name = attribute.getName();
+ Object value = parseAttribute(attribute);
+
+ map.put(QName.create(name), value);
+ }
+
+ return map;
+ }
+
+ /**
+ * FIXME: This method only covers a subset of values that may go in an InstanceIdentifier
+ *
+ * @param attribute
+ * @return
+ */
+ private static Object parseAttribute(NormalizedNodeMessages.Attribute attribute){
+ if(Short.class.getSimpleName().equals(attribute.getType())) {
+ return Short.parseShort(attribute.getValue());
+ } else if(Long.class.getSimpleName().equals(attribute.getType())){
+ return Long.parseLong(attribute.getValue());
+ } else if(Boolean.class.getSimpleName().equals(attribute.getType())){
+ return Boolean.parseBoolean(attribute.getValue());
+ } else if(Integer.class.getSimpleName().equals(attribute.getType())){
+ return Integer.parseInt(attribute.getValue());
+ }
+
+ return attribute.getValue();
+ }
+}
*/
com.google.protobuf.ByteString
getValueBytes();
+
+ // optional string type = 3;
+ /**
+ * <code>optional string type = 3;</code>
+ */
+ boolean hasType();
+ /**
+ * <code>optional string type = 3;</code>
+ */
+ java.lang.String getType();
+ /**
+ * <code>optional string type = 3;</code>
+ */
+ com.google.protobuf.ByteString
+ getTypeBytes();
}
/**
* Protobuf type {@code org.opendaylight.controller.mdsal.Attribute}
value_ = input.readBytes();
break;
}
+ case 26: {
+ bitField0_ |= 0x00000004;
+ type_ = input.readBytes();
+ break;
+ }
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
}
}
+ // optional string type = 3;
+ public static final int TYPE_FIELD_NUMBER = 3;
+ private java.lang.Object type_;
+ /**
+ * <code>optional string type = 3;</code>
+ */
+ public boolean hasType() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ * <code>optional string type = 3;</code>
+ */
+ 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;
+ }
+ }
+ /**
+ * <code>optional string type = 3;</code>
+ */
+ 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;
+ }
+ }
+
private void initFields() {
name_ = "";
value_ = "";
+ type_ = "";
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeBytes(2, getValueBytes());
}
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ output.writeBytes(3, getTypeBytes());
+ }
getUnknownFields().writeTo(output);
}
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, getValueBytes());
}
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(3, getTypeBytes());
+ }
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
bitField0_ = (bitField0_ & ~0x00000001);
value_ = "";
bitField0_ = (bitField0_ & ~0x00000002);
+ type_ = "";
+ bitField0_ = (bitField0_ & ~0x00000004);
return this;
}
to_bitField0_ |= 0x00000002;
}
result.value_ = value_;
+ if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
+ to_bitField0_ |= 0x00000004;
+ }
+ result.type_ = type_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
value_ = other.value_;
onChanged();
}
+ if (other.hasType()) {
+ bitField0_ |= 0x00000004;
+ type_ = other.type_;
+ onChanged();
+ }
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
return this;
}
+ // optional string type = 3;
+ private java.lang.Object type_ = "";
+ /**
+ * <code>optional string type = 3;</code>
+ */
+ public boolean hasType() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ * <code>optional string type = 3;</code>
+ */
+ 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;
+ }
+ }
+ /**
+ * <code>optional string type = 3;</code>
+ */
+ 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;
+ }
+ }
+ /**
+ * <code>optional string type = 3;</code>
+ */
+ public Builder setType(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000004;
+ type_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string type = 3;</code>
+ */
+ public Builder clearType() {
+ bitField0_ = (bitField0_ & ~0x00000004);
+ type_ = getDefaultInstance().getType();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string type = 3;</code>
+ */
+ public Builder setTypeBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000004;
+ type_ = value;
+ onChanged();
+ return this;
+ }
+
// @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.Attribute)
}
// @@protoc_insertion_point(class_scope:org.opendaylight.controller.mdsal.Attribute)
}
- public interface NodeOrBuilder
+ public interface QNameOrBuilder
extends com.google.protobuf.MessageOrBuilder {
- // required string path = 1;
- /**
- * <code>required string path = 1;</code>
- */
- boolean hasPath();
- /**
- * <code>required string path = 1;</code>
- */
- java.lang.String getPath();
- /**
- * <code>required string path = 1;</code>
- */
- com.google.protobuf.ByteString
- getPathBytes();
-
- // optional string type = 2;
- /**
- * <code>optional string type = 2;</code>
- */
- boolean hasType();
- /**
- * <code>optional string type = 2;</code>
- */
- java.lang.String getType();
- /**
- * <code>optional string type = 2;</code>
- */
- com.google.protobuf.ByteString
- getTypeBytes();
-
- // repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
- */
- java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute>
- getAttributesList();
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
- */
- org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute getAttributes(int index);
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
- */
- int getAttributesCount();
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
- */
- java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder>
- getAttributesOrBuilderList();
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
- */
- org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder getAttributesOrBuilder(
- int index);
-
- // repeated .org.opendaylight.controller.mdsal.Node child = 4;
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
- */
- java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node>
- getChildList();
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
- */
- org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getChild(int index);
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
- */
- int getChildCount();
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
- */
- java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder>
- getChildOrBuilderList();
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
- */
- org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getChildOrBuilder(
- int index);
-
- // optional string value = 5;
+ // required string value = 1;
/**
- * <code>optional string value = 5;</code>
+ * <code>required string value = 1;</code>
*/
boolean hasValue();
/**
- * <code>optional string value = 5;</code>
+ * <code>required string value = 1;</code>
*/
java.lang.String getValue();
/**
- * <code>optional string value = 5;</code>
+ * <code>required string value = 1;</code>
*/
com.google.protobuf.ByteString
getValueBytes();
}
/**
- * Protobuf type {@code org.opendaylight.controller.mdsal.Node}
+ * Protobuf type {@code org.opendaylight.controller.mdsal.QName}
*/
- public static final class Node extends
+ public static final class QName extends
com.google.protobuf.GeneratedMessage
- implements NodeOrBuilder {
- // Use Node.newBuilder() to construct.
- private Node(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ implements QNameOrBuilder {
+ // Use QName.newBuilder() to construct.
+ private QName(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
- private Node(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+ private QName(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
- private static final Node defaultInstance;
- public static Node getDefaultInstance() {
+ private static final QName defaultInstance;
+ public static QName getDefaultInstance() {
return defaultInstance;
}
- public Node getDefaultInstanceForType() {
+ public QName getDefaultInstanceForType() {
return defaultInstance;
}
getUnknownFields() {
return this.unknownFields;
}
- private Node(
+ private QName(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
}
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<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute>();
- 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<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node>();
- 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;
}
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;
+ return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_QName_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
- return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_Node_fieldAccessorTable
+ return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_QName_fieldAccessorTable
.ensureFieldAccessorsInitialized(
- org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.class, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder.class);
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.class, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.Builder.class);
}
- public static com.google.protobuf.Parser<Node> PARSER =
- new com.google.protobuf.AbstractParser<Node>() {
- public Node parsePartialFrom(
+ public static com.google.protobuf.Parser<QName> PARSER =
+ new com.google.protobuf.AbstractParser<QName>() {
+ public QName parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
- return new Node(input, extensionRegistry);
+ return new QName(input, extensionRegistry);
}
};
@java.lang.Override
- public com.google.protobuf.Parser<Node> getParserForType() {
+ public com.google.protobuf.Parser<QName> getParserForType() {
return PARSER;
}
private int bitField0_;
- // required string path = 1;
- public static final int PATH_FIELD_NUMBER = 1;
- private java.lang.Object path_;
- /**
- * <code>required string path = 1;</code>
- */
- public boolean hasPath() {
- return ((bitField0_ & 0x00000001) == 0x00000001);
- }
- /**
- * <code>required string path = 1;</code>
- */
- 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;
- }
- }
- /**
- * <code>required string path = 1;</code>
- */
- 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_;
- /**
- * <code>optional string type = 2;</code>
- */
- public boolean hasType() {
- return ((bitField0_ & 0x00000002) == 0x00000002);
- }
- /**
- * <code>optional string type = 2;</code>
- */
- 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;
- }
- }
- /**
- * <code>optional string type = 2;</code>
- */
- 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<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute> attributes_;
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
- */
- public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute> getAttributesList() {
- return attributes_;
- }
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
- */
- public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder>
- getAttributesOrBuilderList() {
- return attributes_;
- }
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
- */
- public int getAttributesCount() {
- return attributes_.size();
- }
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
- */
- public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute getAttributes(int index) {
- return attributes_.get(index);
- }
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
- */
- 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<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node> child_;
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
- */
- public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node> getChildList() {
- return child_;
- }
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
- */
- public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder>
- getChildOrBuilderList() {
- return child_;
- }
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
- */
- public int getChildCount() {
- return child_.size();
- }
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
- */
- public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getChild(int index) {
- return child_.get(index);
- }
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
- */
- 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;
+ // required string value = 1;
+ public static final int VALUE_FIELD_NUMBER = 1;
private java.lang.Object value_;
/**
- * <code>optional string value = 5;</code>
+ * <code>required string value = 1;</code>
*/
public boolean hasValue() {
- return ((bitField0_ & 0x00000004) == 0x00000004);
+ return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
- * <code>optional string value = 5;</code>
+ * <code>required string value = 1;</code>
*/
public java.lang.String getValue() {
java.lang.Object ref = value_;
}
}
/**
- * <code>optional string value = 5;</code>
+ * <code>required string value = 1;</code>
*/
public com.google.protobuf.ByteString
getValueBytes() {
}
private void initFields() {
- path_ = "";
- type_ = "";
- attributes_ = java.util.Collections.emptyList();
- child_ = java.util.Collections.emptyList();
value_ = "";
}
private byte memoizedIsInitialized = -1;
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
- if (!hasPath()) {
+ if (!hasValue()) {
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;
}
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());
+ output.writeBytes(1, getValueBytes());
}
getUnknownFields().writeTo(output);
}
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());
+ .computeBytesSize(1, getValueBytes());
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return super.writeReplace();
}
- public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node parseFrom(
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName 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(
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName 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)
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
- public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node parseFrom(
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName 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)
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
- public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node parseFrom(
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName 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)
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
- public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node parseDelimitedFrom(
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName 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(
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName 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(
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
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) {
+ public static Builder newBuilder(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
return builder;
}
/**
- * Protobuf type {@code org.opendaylight.controller.mdsal.Node}
+ * Protobuf type {@code org.opendaylight.controller.mdsal.QName}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
- implements org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder {
+ implements org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QNameOrBuilder {
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;
+ return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_QName_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
- return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_Node_fieldAccessorTable
+ return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_QName_fieldAccessorTable
.ensureFieldAccessorsInitialized(
- org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.class, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder.class);
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.class, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.Builder.class);
}
- // Construct using org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.newBuilder()
+ // Construct using org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
- getAttributesFieldBuilder();
- getChildFieldBuilder();
}
}
private static Builder create() {
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);
+ bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
- return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_Node_descriptor;
+ return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_QName_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.QName getDefaultInstanceForType() {
+ return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.getDefaultInstance();
}
- public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node build() {
- org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node result = buildPartial();
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName build() {
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName 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);
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName buildPartial() {
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName result = new org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName(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();
}
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);
+ if (other instanceof org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName) {
+ return mergeFrom((org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName)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_);
- }
- }
- }
+ public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName other) {
+ if (other == org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.getDefaultInstance()) return this;
if (other.hasValue()) {
- bitField0_ |= 0x00000010;
+ bitField0_ |= 0x00000001;
value_ = other.value_;
onChanged();
}
}
public final boolean isInitialized() {
- if (!hasPath()) {
+ if (!hasValue()) {
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;
}
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
- org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node parsedMessage = null;
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName 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();
+ parsedMessage = (org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
}
private int bitField0_;
- // required string path = 1;
- private java.lang.Object path_ = "";
+ // required string value = 1;
+ private java.lang.Object value_ = "";
/**
- * <code>required string path = 1;</code>
+ * <code>required string value = 1;</code>
*/
- public boolean hasPath() {
+ public boolean hasValue() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
- * <code>required string path = 1;</code>
+ * <code>required string value = 1;</code>
*/
- public java.lang.String getPath() {
- java.lang.Object ref = path_;
+ 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();
- path_ = s;
+ value_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
- * <code>required string path = 1;</code>
+ * <code>required string value = 1;</code>
*/
public com.google.protobuf.ByteString
- getPathBytes() {
- java.lang.Object ref = path_;
+ getValueBytes() {
+ java.lang.Object ref = value_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
- path_ = b;
+ value_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
- * <code>required string path = 1;</code>
+ * <code>required string value = 1;</code>
*/
- public Builder setPath(
+ public Builder setValue(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
- path_ = value;
+ value_ = value;
onChanged();
return this;
}
/**
- * <code>required string path = 1;</code>
+ * <code>required string value = 1;</code>
*/
- public Builder clearPath() {
+ public Builder clearValue() {
bitField0_ = (bitField0_ & ~0x00000001);
- path_ = getDefaultInstance().getPath();
+ value_ = getDefaultInstance().getValue();
onChanged();
return this;
}
/**
- * <code>required string path = 1;</code>
+ * <code>required string value = 1;</code>
*/
- public Builder setPathBytes(
+ public Builder setValueBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
- path_ = value;
+ value_ = value;
onChanged();
return this;
}
- // optional string type = 2;
- private java.lang.Object type_ = "";
- /**
- * <code>optional string type = 2;</code>
- */
- public boolean hasType() {
- return ((bitField0_ & 0x00000002) == 0x00000002);
- }
- /**
- * <code>optional string type = 2;</code>
- */
- 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;
- }
- }
- /**
- * <code>optional string type = 2;</code>
- */
- 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;
- }
- }
- /**
- * <code>optional string type = 2;</code>
- */
- public Builder setType(
- java.lang.String value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000002;
- type_ = value;
- onChanged();
- return this;
- }
- /**
- * <code>optional string type = 2;</code>
- */
- public Builder clearType() {
- bitField0_ = (bitField0_ & ~0x00000002);
- type_ = getDefaultInstance().getType();
- onChanged();
- return this;
- }
- /**
- * <code>optional string type = 2;</code>
- */
- public Builder setTypeBytes(
- com.google.protobuf.ByteString value) {
- if (value == null) {
- throw new NullPointerException();
+ // @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.QName)
+ }
+
+ static {
+ defaultInstance = new QName(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:org.opendaylight.controller.mdsal.QName)
}
- bitField0_ |= 0x00000002;
- type_ = value;
- onChanged();
- return this;
- }
- // repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;
- private java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute> attributes_ =
- java.util.Collections.emptyList();
- private void ensureAttributesIsMutable() {
- if (!((bitField0_ & 0x00000004) == 0x00000004)) {
- attributes_ = new java.util.ArrayList<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute>(attributes_);
- bitField0_ |= 0x00000004;
- }
- }
+ public interface PathArgumentOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
- 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_;
+ // required string value = 1;
+ /**
+ * <code>required string value = 1;</code>
+ */
+ boolean hasValue();
+ /**
+ * <code>required string value = 1;</code>
+ */
+ java.lang.String getValue();
+ /**
+ * <code>required string value = 1;</code>
+ */
+ com.google.protobuf.ByteString
+ getValueBytes();
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
- */
- public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute> getAttributesList() {
- if (attributesBuilder_ == null) {
- return java.util.Collections.unmodifiableList(attributes_);
- } else {
- return attributesBuilder_.getMessageList();
- }
- }
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
- */
- public int getAttributesCount() {
- if (attributesBuilder_ == null) {
- return attributes_.size();
- } else {
- return attributesBuilder_.getCount();
+ // optional string type = 2;
+ /**
+ * <code>optional string type = 2;</code>
+ *
+ * <pre>
+ *NodeIdentifier, NodeWithValue, NodeIdentifierWithPredicates
+ * </pre>
+ */
+ boolean hasType();
+ /**
+ * <code>optional string type = 2;</code>
+ *
+ * <pre>
+ *NodeIdentifier, NodeWithValue, NodeIdentifierWithPredicates
+ * </pre>
+ */
+ java.lang.String getType();
+ /**
+ * <code>optional string type = 2;</code>
+ *
+ * <pre>
+ *NodeIdentifier, NodeWithValue, NodeIdentifierWithPredicates
+ * </pre>
+ */
+ com.google.protobuf.ByteString
+ getTypeBytes();
+
+ // optional .org.opendaylight.controller.mdsal.QName nodeType = 3;
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.QName nodeType = 3;</code>
+ */
+ boolean hasNodeType();
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.QName nodeType = 3;</code>
+ */
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName getNodeType();
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.QName nodeType = 3;</code>
+ */
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QNameOrBuilder getNodeTypeOrBuilder();
+
+ // repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute>
+ getAttributesList();
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute getAttributes(int index);
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ int getAttributesCount();
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder>
+ getAttributesOrBuilderList();
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder getAttributesOrBuilder(
+ int index);
+ }
+ /**
+ * Protobuf type {@code org.opendaylight.controller.mdsal.PathArgument}
+ */
+ public static final class PathArgument extends
+ com.google.protobuf.GeneratedMessage
+ implements PathArgumentOrBuilder {
+ // Use PathArgument.newBuilder() to construct.
+ private PathArgument(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private PathArgument(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final PathArgument defaultInstance;
+ public static PathArgument getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public PathArgument getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private PathArgument(
+ 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;
+ value_ = input.readBytes();
+ break;
+ }
+ case 18: {
+ bitField0_ |= 0x00000002;
+ type_ = input.readBytes();
+ break;
+ }
+ case 26: {
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ subBuilder = nodeType_.toBuilder();
+ }
+ nodeType_ = input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(nodeType_);
+ nodeType_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000004;
+ break;
+ }
+ case 34: {
+ if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
+ attributes_ = new java.util.ArrayList<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute>();
+ mutable_bitField0_ |= 0x00000008;
+ }
+ attributes_.add(input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.PARSER, extensionRegistry));
+ 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_ & 0x00000008) == 0x00000008)) {
+ attributes_ = java.util.Collections.unmodifiableList(attributes_);
+ }
+ 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_PathArgument_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_PathArgument_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument.class, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<PathArgument> PARSER =
+ new com.google.protobuf.AbstractParser<PathArgument>() {
+ public PathArgument parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new PathArgument(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<PathArgument> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required string value = 1;
+ public static final int VALUE_FIELD_NUMBER = 1;
+ private java.lang.Object value_;
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public boolean hasValue() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ 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;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ 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;
+ }
+ }
+
+ // optional string type = 2;
+ public static final int TYPE_FIELD_NUMBER = 2;
+ private java.lang.Object type_;
+ /**
+ * <code>optional string type = 2;</code>
+ *
+ * <pre>
+ *NodeIdentifier, NodeWithValue, NodeIdentifierWithPredicates
+ * </pre>
+ */
+ public boolean hasType() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>optional string type = 2;</code>
+ *
+ * <pre>
+ *NodeIdentifier, NodeWithValue, NodeIdentifierWithPredicates
+ * </pre>
+ */
+ 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;
+ }
+ }
+ /**
+ * <code>optional string type = 2;</code>
+ *
+ * <pre>
+ *NodeIdentifier, NodeWithValue, NodeIdentifierWithPredicates
+ * </pre>
+ */
+ 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;
+ }
+ }
+
+ // optional .org.opendaylight.controller.mdsal.QName nodeType = 3;
+ public static final int NODETYPE_FIELD_NUMBER = 3;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName nodeType_;
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.QName nodeType = 3;</code>
+ */
+ public boolean hasNodeType() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.QName nodeType = 3;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName getNodeType() {
+ return nodeType_;
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.QName nodeType = 3;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QNameOrBuilder getNodeTypeOrBuilder() {
+ return nodeType_;
+ }
+
+ // repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;
+ public static final int ATTRIBUTES_FIELD_NUMBER = 4;
+ private java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute> attributes_;
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute> getAttributesList() {
+ return attributes_;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder>
+ getAttributesOrBuilderList() {
+ return attributes_;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ public int getAttributesCount() {
+ return attributes_.size();
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute getAttributes(int index) {
+ return attributes_.get(index);
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder getAttributesOrBuilder(
+ int index) {
+ return attributes_.get(index);
+ }
+
+ private void initFields() {
+ value_ = "";
+ type_ = "";
+ nodeType_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.getDefaultInstance();
+ attributes_ = java.util.Collections.emptyList();
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ if (!hasValue()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (hasNodeType()) {
+ if (!getNodeType().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ for (int i = 0; i < getAttributesCount(); i++) {
+ if (!getAttributes(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, getValueBytes());
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ output.writeBytes(2, getTypeBytes());
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ output.writeMessage(3, nodeType_);
+ }
+ for (int i = 0; i < attributes_.size(); i++) {
+ output.writeMessage(4, attributes_.get(i));
+ }
+ 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, getValueBytes());
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(2, getTypeBytes());
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(3, nodeType_);
+ }
+ for (int i = 0; i < attributes_.size(); i++) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(4, attributes_.get(i));
+ }
+ 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.PathArgument parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument 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.PathArgument parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument 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.PathArgument parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument 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.PathArgument parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument 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.PathArgument parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument 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.PathArgument 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.PathArgument}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgumentOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_PathArgument_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_PathArgument_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument.class, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument.Builder.class);
+ }
+
+ // Construct using org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getNodeTypeFieldBuilder();
+ getAttributesFieldBuilder();
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ value_ = "";
+ bitField0_ = (bitField0_ & ~0x00000001);
+ type_ = "";
+ bitField0_ = (bitField0_ & ~0x00000002);
+ if (nodeTypeBuilder_ == null) {
+ nodeType_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.getDefaultInstance();
+ } else {
+ nodeTypeBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000004);
+ if (attributesBuilder_ == null) {
+ attributes_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000008);
+ } else {
+ attributesBuilder_.clear();
+ }
+ 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_PathArgument_descriptor;
+ }
+
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument getDefaultInstanceForType() {
+ return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument.getDefaultInstance();
+ }
+
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument build() {
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument buildPartial() {
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument result = new org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.value_ = value_;
+ if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ result.type_ = type_;
+ if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
+ to_bitField0_ |= 0x00000004;
+ }
+ if (nodeTypeBuilder_ == null) {
+ result.nodeType_ = nodeType_;
+ } else {
+ result.nodeType_ = nodeTypeBuilder_.build();
+ }
+ if (attributesBuilder_ == null) {
+ if (((bitField0_ & 0x00000008) == 0x00000008)) {
+ attributes_ = java.util.Collections.unmodifiableList(attributes_);
+ bitField0_ = (bitField0_ & ~0x00000008);
+ }
+ result.attributes_ = attributes_;
+ } else {
+ result.attributes_ = attributesBuilder_.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.PathArgument) {
+ return mergeFrom((org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument other) {
+ if (other == org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument.getDefaultInstance()) return this;
+ if (other.hasValue()) {
+ bitField0_ |= 0x00000001;
+ value_ = other.value_;
+ onChanged();
+ }
+ if (other.hasType()) {
+ bitField0_ |= 0x00000002;
+ type_ = other.type_;
+ onChanged();
+ }
+ if (other.hasNodeType()) {
+ mergeNodeType(other.getNodeType());
+ }
+ if (attributesBuilder_ == null) {
+ if (!other.attributes_.isEmpty()) {
+ if (attributes_.isEmpty()) {
+ attributes_ = other.attributes_;
+ bitField0_ = (bitField0_ & ~0x00000008);
+ } else {
+ ensureAttributesIsMutable();
+ attributes_.addAll(other.attributes_);
+ }
+ onChanged();
+ }
+ } else {
+ if (!other.attributes_.isEmpty()) {
+ if (attributesBuilder_.isEmpty()) {
+ attributesBuilder_.dispose();
+ attributesBuilder_ = null;
+ attributes_ = other.attributes_;
+ bitField0_ = (bitField0_ & ~0x00000008);
+ attributesBuilder_ =
+ com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
+ getAttributesFieldBuilder() : null;
+ } else {
+ attributesBuilder_.addAllMessages(other.attributes_);
+ }
+ }
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ if (!hasValue()) {
+
+ return false;
+ }
+ if (hasNodeType()) {
+ if (!getNodeType().isInitialized()) {
+
+ return false;
+ }
+ }
+ for (int i = 0; i < getAttributesCount(); i++) {
+ if (!getAttributes(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.PathArgument parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // required string value = 1;
+ private java.lang.Object value_ = "";
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public boolean hasValue() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ 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;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ 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;
+ }
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder setValue(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ value_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder clearValue() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ value_ = getDefaultInstance().getValue();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required string value = 1;</code>
+ */
+ public Builder setValueBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ value_ = value;
+ onChanged();
+ return this;
+ }
+
+ // optional string type = 2;
+ private java.lang.Object type_ = "";
+ /**
+ * <code>optional string type = 2;</code>
+ *
+ * <pre>
+ *NodeIdentifier, NodeWithValue, NodeIdentifierWithPredicates
+ * </pre>
+ */
+ public boolean hasType() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>optional string type = 2;</code>
+ *
+ * <pre>
+ *NodeIdentifier, NodeWithValue, NodeIdentifierWithPredicates
+ * </pre>
+ */
+ 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;
+ }
+ }
+ /**
+ * <code>optional string type = 2;</code>
+ *
+ * <pre>
+ *NodeIdentifier, NodeWithValue, NodeIdentifierWithPredicates
+ * </pre>
+ */
+ 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;
+ }
+ }
+ /**
+ * <code>optional string type = 2;</code>
+ *
+ * <pre>
+ *NodeIdentifier, NodeWithValue, NodeIdentifierWithPredicates
+ * </pre>
+ */
+ public Builder setType(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ type_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string type = 2;</code>
+ *
+ * <pre>
+ *NodeIdentifier, NodeWithValue, NodeIdentifierWithPredicates
+ * </pre>
+ */
+ public Builder clearType() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ type_ = getDefaultInstance().getType();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string type = 2;</code>
+ *
+ * <pre>
+ *NodeIdentifier, NodeWithValue, NodeIdentifierWithPredicates
+ * </pre>
+ */
+ public Builder setTypeBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ type_ = value;
+ onChanged();
+ return this;
+ }
+
+ // optional .org.opendaylight.controller.mdsal.QName nodeType = 3;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName nodeType_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QNameOrBuilder> nodeTypeBuilder_;
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.QName nodeType = 3;</code>
+ */
+ public boolean hasNodeType() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.QName nodeType = 3;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName getNodeType() {
+ if (nodeTypeBuilder_ == null) {
+ return nodeType_;
+ } else {
+ return nodeTypeBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.QName nodeType = 3;</code>
+ */
+ public Builder setNodeType(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName value) {
+ if (nodeTypeBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ nodeType_ = value;
+ onChanged();
+ } else {
+ nodeTypeBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.QName nodeType = 3;</code>
+ */
+ public Builder setNodeType(
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.Builder builderForValue) {
+ if (nodeTypeBuilder_ == null) {
+ nodeType_ = builderForValue.build();
+ onChanged();
+ } else {
+ nodeTypeBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.QName nodeType = 3;</code>
+ */
+ public Builder mergeNodeType(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName value) {
+ if (nodeTypeBuilder_ == null) {
+ if (((bitField0_ & 0x00000004) == 0x00000004) &&
+ nodeType_ != org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.getDefaultInstance()) {
+ nodeType_ =
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.newBuilder(nodeType_).mergeFrom(value).buildPartial();
+ } else {
+ nodeType_ = value;
+ }
+ onChanged();
+ } else {
+ nodeTypeBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.QName nodeType = 3;</code>
+ */
+ public Builder clearNodeType() {
+ if (nodeTypeBuilder_ == null) {
+ nodeType_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.getDefaultInstance();
+ onChanged();
+ } else {
+ nodeTypeBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000004);
+ return this;
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.QName nodeType = 3;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.Builder getNodeTypeBuilder() {
+ bitField0_ |= 0x00000004;
+ onChanged();
+ return getNodeTypeFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.QName nodeType = 3;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QNameOrBuilder getNodeTypeOrBuilder() {
+ if (nodeTypeBuilder_ != null) {
+ return nodeTypeBuilder_.getMessageOrBuilder();
+ } else {
+ return nodeType_;
+ }
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.QName nodeType = 3;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QNameOrBuilder>
+ getNodeTypeFieldBuilder() {
+ if (nodeTypeBuilder_ == null) {
+ nodeTypeBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QNameOrBuilder>(
+ nodeType_,
+ getParentForChildren(),
+ isClean());
+ nodeType_ = null;
+ }
+ return nodeTypeBuilder_;
+ }
+
+ // repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;
+ private java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute> attributes_ =
+ java.util.Collections.emptyList();
+ private void ensureAttributesIsMutable() {
+ if (!((bitField0_ & 0x00000008) == 0x00000008)) {
+ attributes_ = new java.util.ArrayList<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute>(attributes_);
+ bitField0_ |= 0x00000008;
+ }
+ }
+
+ 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_;
+
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute> getAttributesList() {
+ if (attributesBuilder_ == null) {
+ return java.util.Collections.unmodifiableList(attributes_);
+ } else {
+ return attributesBuilder_.getMessageList();
+ }
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ public int getAttributesCount() {
+ if (attributesBuilder_ == null) {
+ return attributes_.size();
+ } else {
+ return attributesBuilder_.getCount();
+ }
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute getAttributes(int index) {
+ if (attributesBuilder_ == null) {
+ return attributes_.get(index);
+ } else {
+ return attributesBuilder_.getMessage(index);
+ }
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ 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;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ 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;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ 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;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ 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;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ 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;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ 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;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ public Builder addAllAttributes(
+ java.lang.Iterable<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute> values) {
+ if (attributesBuilder_ == null) {
+ ensureAttributesIsMutable();
+ super.addAll(values, attributes_);
+ onChanged();
+ } else {
+ attributesBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ public Builder clearAttributes() {
+ if (attributesBuilder_ == null) {
+ attributes_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000008);
+ onChanged();
+ } else {
+ attributesBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ public Builder removeAttributes(int index) {
+ if (attributesBuilder_ == null) {
+ ensureAttributesIsMutable();
+ attributes_.remove(index);
+ onChanged();
+ } else {
+ attributesBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder getAttributesBuilder(
+ int index) {
+ return getAttributesFieldBuilder().getBuilder(index);
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder getAttributesOrBuilder(
+ int index) {
+ if (attributesBuilder_ == null) {
+ return attributes_.get(index); } else {
+ return attributesBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder>
+ getAttributesOrBuilderList() {
+ if (attributesBuilder_ != null) {
+ return attributesBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(attributes_);
+ }
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder addAttributesBuilder() {
+ return getAttributesFieldBuilder().addBuilder(
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.getDefaultInstance());
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ 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());
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
+ */
+ public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder>
+ 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_ & 0x00000008) == 0x00000008),
+ getParentForChildren(),
+ isClean());
+ attributes_ = null;
+ }
+ return attributesBuilder_;
+ }
+
+ // @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.PathArgument)
+ }
+
+ static {
+ defaultInstance = new PathArgument(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:org.opendaylight.controller.mdsal.PathArgument)
+ }
+
+ public interface InstanceIdentifierOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument>
+ getArgumentsList();
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument getArguments(int index);
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ int getArgumentsCount();
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgumentOrBuilder>
+ getArgumentsOrBuilderList();
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgumentOrBuilder getArgumentsOrBuilder(
+ int index);
+ }
+ /**
+ * Protobuf type {@code org.opendaylight.controller.mdsal.InstanceIdentifier}
+ */
+ public static final class InstanceIdentifier extends
+ com.google.protobuf.GeneratedMessage
+ implements InstanceIdentifierOrBuilder {
+ // Use InstanceIdentifier.newBuilder() to construct.
+ private InstanceIdentifier(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private InstanceIdentifier(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final InstanceIdentifier defaultInstance;
+ public static InstanceIdentifier getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public InstanceIdentifier getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private InstanceIdentifier(
+ 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: {
+ if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
+ arguments_ = new java.util.ArrayList<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument>();
+ mutable_bitField0_ |= 0x00000001;
+ }
+ arguments_.add(input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument.PARSER, extensionRegistry));
+ 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_ & 0x00000001) == 0x00000001)) {
+ arguments_ = java.util.Collections.unmodifiableList(arguments_);
+ }
+ 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_InstanceIdentifier_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_InstanceIdentifier_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.class, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<InstanceIdentifier> PARSER =
+ new com.google.protobuf.AbstractParser<InstanceIdentifier>() {
+ public InstanceIdentifier parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new InstanceIdentifier(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<InstanceIdentifier> getParserForType() {
+ return PARSER;
+ }
+
+ // repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;
+ public static final int ARGUMENTS_FIELD_NUMBER = 1;
+ private java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument> arguments_;
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument> getArgumentsList() {
+ return arguments_;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgumentOrBuilder>
+ getArgumentsOrBuilderList() {
+ return arguments_;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ public int getArgumentsCount() {
+ return arguments_.size();
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument getArguments(int index) {
+ return arguments_.get(index);
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgumentOrBuilder getArgumentsOrBuilder(
+ int index) {
+ return arguments_.get(index);
+ }
+
+ private void initFields() {
+ arguments_ = java.util.Collections.emptyList();
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ for (int i = 0; i < getArgumentsCount(); i++) {
+ if (!getArguments(i).isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ for (int i = 0; i < arguments_.size(); i++) {
+ output.writeMessage(1, arguments_.get(i));
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ for (int i = 0; i < arguments_.size(); i++) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, arguments_.get(i));
+ }
+ 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.InstanceIdentifier parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier 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.InstanceIdentifier parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier 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.InstanceIdentifier parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier 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.InstanceIdentifier parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier 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.InstanceIdentifier parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier 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.InstanceIdentifier 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.InstanceIdentifier}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_InstanceIdentifier_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_InstanceIdentifier_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.class, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder.class);
+ }
+
+ // Construct using org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
+ }
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getArgumentsFieldBuilder();
+ }
+ }
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ if (argumentsBuilder_ == null) {
+ arguments_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ } else {
+ argumentsBuilder_.clear();
+ }
+ 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_InstanceIdentifier_descriptor;
+ }
+
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getDefaultInstanceForType() {
+ return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+ }
+
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier build() {
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier buildPartial() {
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier result = new org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier(this);
+ int from_bitField0_ = bitField0_;
+ if (argumentsBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ arguments_ = java.util.Collections.unmodifiableList(arguments_);
+ bitField0_ = (bitField0_ & ~0x00000001);
+ }
+ result.arguments_ = arguments_;
+ } else {
+ result.arguments_ = argumentsBuilder_.build();
+ }
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier) {
+ return mergeFrom((org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier other) {
+ if (other == org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance()) return this;
+ if (argumentsBuilder_ == null) {
+ if (!other.arguments_.isEmpty()) {
+ if (arguments_.isEmpty()) {
+ arguments_ = other.arguments_;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ } else {
+ ensureArgumentsIsMutable();
+ arguments_.addAll(other.arguments_);
+ }
+ onChanged();
+ }
+ } else {
+ if (!other.arguments_.isEmpty()) {
+ if (argumentsBuilder_.isEmpty()) {
+ argumentsBuilder_.dispose();
+ argumentsBuilder_ = null;
+ arguments_ = other.arguments_;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ argumentsBuilder_ =
+ com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
+ getArgumentsFieldBuilder() : null;
+ } else {
+ argumentsBuilder_.addAllMessages(other.arguments_);
+ }
+ }
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ for (int i = 0; i < getArgumentsCount(); i++) {
+ if (!getArguments(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.InstanceIdentifier parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;
+ private java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument> arguments_ =
+ java.util.Collections.emptyList();
+ private void ensureArgumentsIsMutable() {
+ if (!((bitField0_ & 0x00000001) == 0x00000001)) {
+ arguments_ = new java.util.ArrayList<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument>(arguments_);
+ bitField0_ |= 0x00000001;
+ }
+ }
+
+ private com.google.protobuf.RepeatedFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgumentOrBuilder> argumentsBuilder_;
+
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument> getArgumentsList() {
+ if (argumentsBuilder_ == null) {
+ return java.util.Collections.unmodifiableList(arguments_);
+ } else {
+ return argumentsBuilder_.getMessageList();
+ }
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ public int getArgumentsCount() {
+ if (argumentsBuilder_ == null) {
+ return arguments_.size();
+ } else {
+ return argumentsBuilder_.getCount();
+ }
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument getArguments(int index) {
+ if (argumentsBuilder_ == null) {
+ return arguments_.get(index);
+ } else {
+ return argumentsBuilder_.getMessage(index);
+ }
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ public Builder setArguments(
+ int index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument value) {
+ if (argumentsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureArgumentsIsMutable();
+ arguments_.set(index, value);
+ onChanged();
+ } else {
+ argumentsBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ public Builder setArguments(
+ int index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument.Builder builderForValue) {
+ if (argumentsBuilder_ == null) {
+ ensureArgumentsIsMutable();
+ arguments_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ argumentsBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ public Builder addArguments(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument value) {
+ if (argumentsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureArgumentsIsMutable();
+ arguments_.add(value);
+ onChanged();
+ } else {
+ argumentsBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ public Builder addArguments(
+ int index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument value) {
+ if (argumentsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureArgumentsIsMutable();
+ arguments_.add(index, value);
+ onChanged();
+ } else {
+ argumentsBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ public Builder addArguments(
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument.Builder builderForValue) {
+ if (argumentsBuilder_ == null) {
+ ensureArgumentsIsMutable();
+ arguments_.add(builderForValue.build());
+ onChanged();
+ } else {
+ argumentsBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ public Builder addArguments(
+ int index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument.Builder builderForValue) {
+ if (argumentsBuilder_ == null) {
+ ensureArgumentsIsMutable();
+ arguments_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ argumentsBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ public Builder addAllArguments(
+ java.lang.Iterable<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument> values) {
+ if (argumentsBuilder_ == null) {
+ ensureArgumentsIsMutable();
+ super.addAll(values, arguments_);
+ onChanged();
+ } else {
+ argumentsBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ public Builder clearArguments() {
+ if (argumentsBuilder_ == null) {
+ arguments_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ } else {
+ argumentsBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ public Builder removeArguments(int index) {
+ if (argumentsBuilder_ == null) {
+ ensureArgumentsIsMutable();
+ arguments_.remove(index);
+ onChanged();
+ } else {
+ argumentsBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument.Builder getArgumentsBuilder(
+ int index) {
+ return getArgumentsFieldBuilder().getBuilder(index);
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgumentOrBuilder getArgumentsOrBuilder(
+ int index) {
+ if (argumentsBuilder_ == null) {
+ return arguments_.get(index); } else {
+ return argumentsBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgumentOrBuilder>
+ getArgumentsOrBuilderList() {
+ if (argumentsBuilder_ != null) {
+ return argumentsBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(arguments_);
+ }
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument.Builder addArgumentsBuilder() {
+ return getArgumentsFieldBuilder().addBuilder(
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument.getDefaultInstance());
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument.Builder addArgumentsBuilder(
+ int index) {
+ return getArgumentsFieldBuilder().addBuilder(
+ index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument.getDefaultInstance());
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
+ */
+ public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument.Builder>
+ getArgumentsBuilderList() {
+ return getArgumentsFieldBuilder().getBuilderList();
+ }
+ private com.google.protobuf.RepeatedFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgumentOrBuilder>
+ getArgumentsFieldBuilder() {
+ if (argumentsBuilder_ == null) {
+ argumentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgumentOrBuilder>(
+ arguments_,
+ ((bitField0_ & 0x00000001) == 0x00000001),
+ getParentForChildren(),
+ isClean());
+ arguments_ = null;
+ }
+ return argumentsBuilder_;
+ }
+
+ // @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.InstanceIdentifier)
+ }
+
+ static {
+ defaultInstance = new InstanceIdentifier(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:org.opendaylight.controller.mdsal.InstanceIdentifier)
+ }
+
+ public interface NodeOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // optional string path = 1;
+ /**
+ * <code>optional string path = 1;</code>
+ */
+ boolean hasPath();
+ /**
+ * <code>optional string path = 1;</code>
+ */
+ java.lang.String getPath();
+ /**
+ * <code>optional string path = 1;</code>
+ */
+ com.google.protobuf.ByteString
+ getPathBytes();
+
+ // optional string type = 2;
+ /**
+ * <code>optional string type = 2;</code>
+ */
+ boolean hasType();
+ /**
+ * <code>optional string type = 2;</code>
+ */
+ java.lang.String getType();
+ /**
+ * <code>optional string type = 2;</code>
+ */
+ com.google.protobuf.ByteString
+ getTypeBytes();
+
+ // repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute>
+ getAttributesList();
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute getAttributes(int index);
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ int getAttributesCount();
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder>
+ getAttributesOrBuilderList();
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder getAttributesOrBuilder(
+ int index);
+
+ // repeated .org.opendaylight.controller.mdsal.Node child = 4;
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node>
+ getChildList();
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getChild(int index);
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ int getChildCount();
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder>
+ getChildOrBuilderList();
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getChildOrBuilder(
+ int index);
+
+ // optional string value = 5;
+ /**
+ * <code>optional string value = 5;</code>
+ */
+ boolean hasValue();
+ /**
+ * <code>optional string value = 5;</code>
+ */
+ java.lang.String getValue();
+ /**
+ * <code>optional string value = 5;</code>
+ */
+ com.google.protobuf.ByteString
+ getValueBytes();
+
+ // optional string valueType = 6;
+ /**
+ * <code>optional string valueType = 6;</code>
+ */
+ boolean hasValueType();
+ /**
+ * <code>optional string valueType = 6;</code>
+ */
+ java.lang.String getValueType();
+ /**
+ * <code>optional string valueType = 6;</code>
+ */
+ com.google.protobuf.ByteString
+ getValueTypeBytes();
+
+ // repeated string bitsValue = 7;
+ /**
+ * <code>repeated string bitsValue = 7;</code>
+ */
+ java.util.List<java.lang.String>
+ getBitsValueList();
+ /**
+ * <code>repeated string bitsValue = 7;</code>
+ */
+ int getBitsValueCount();
+ /**
+ * <code>repeated string bitsValue = 7;</code>
+ */
+ java.lang.String getBitsValue(int index);
+ /**
+ * <code>repeated string bitsValue = 7;</code>
+ */
+ com.google.protobuf.ByteString
+ getBitsValueBytes(int index);
+
+ // optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 8;
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 8;</code>
+ */
+ boolean hasInstanceIdentifierValue();
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 8;</code>
+ */
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getInstanceIdentifierValue();
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 8;</code>
+ */
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getInstanceIdentifierValueOrBuilder();
+ }
+ /**
+ * 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<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute>();
+ 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<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node>();
+ 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;
+ }
+ case 50: {
+ bitField0_ |= 0x00000008;
+ valueType_ = input.readBytes();
+ break;
+ }
+ case 58: {
+ if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
+ bitsValue_ = new com.google.protobuf.LazyStringArrayList();
+ mutable_bitField0_ |= 0x00000040;
+ }
+ bitsValue_.add(input.readBytes());
+ break;
+ }
+ case 66: {
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ subBuilder = instanceIdentifierValue_.toBuilder();
+ }
+ instanceIdentifierValue_ = input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(instanceIdentifierValue_);
+ instanceIdentifierValue_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000010;
+ 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_);
+ }
+ if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
+ bitsValue_ = new com.google.protobuf.UnmodifiableLazyStringList(bitsValue_);
+ }
+ 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<Node> PARSER =
+ new com.google.protobuf.AbstractParser<Node>() {
+ 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<Node> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // optional string path = 1;
+ public static final int PATH_FIELD_NUMBER = 1;
+ private java.lang.Object path_;
+ /**
+ * <code>optional string path = 1;</code>
+ */
+ public boolean hasPath() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>optional string path = 1;</code>
+ */
+ 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;
+ }
+ }
+ /**
+ * <code>optional string path = 1;</code>
+ */
+ 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_;
+ /**
+ * <code>optional string type = 2;</code>
+ */
+ public boolean hasType() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>optional string type = 2;</code>
+ */
+ 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;
+ }
+ }
+ /**
+ * <code>optional string type = 2;</code>
+ */
+ 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<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute> attributes_;
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute> getAttributesList() {
+ return attributes_;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder>
+ getAttributesOrBuilderList() {
+ return attributes_;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ public int getAttributesCount() {
+ return attributes_.size();
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute getAttributes(int index) {
+ return attributes_.get(index);
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ 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<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node> child_;
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node> getChildList() {
+ return child_;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder>
+ getChildOrBuilderList() {
+ return child_;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ public int getChildCount() {
+ return child_.size();
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getChild(int index) {
+ return child_.get(index);
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ 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_;
+ /**
+ * <code>optional string value = 5;</code>
+ */
+ public boolean hasValue() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ * <code>optional string value = 5;</code>
+ */
+ 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;
+ }
+ }
+ /**
+ * <code>optional string value = 5;</code>
+ */
+ 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;
+ }
+ }
+
+ // optional string valueType = 6;
+ public static final int VALUETYPE_FIELD_NUMBER = 6;
+ private java.lang.Object valueType_;
+ /**
+ * <code>optional string valueType = 6;</code>
+ */
+ public boolean hasValueType() {
+ return ((bitField0_ & 0x00000008) == 0x00000008);
+ }
+ /**
+ * <code>optional string valueType = 6;</code>
+ */
+ public java.lang.String getValueType() {
+ java.lang.Object ref = valueType_;
+ 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()) {
+ valueType_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <code>optional string valueType = 6;</code>
+ */
+ public com.google.protobuf.ByteString
+ getValueTypeBytes() {
+ java.lang.Object ref = valueType_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ valueType_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ // repeated string bitsValue = 7;
+ public static final int BITSVALUE_FIELD_NUMBER = 7;
+ private com.google.protobuf.LazyStringList bitsValue_;
+ /**
+ * <code>repeated string bitsValue = 7;</code>
+ */
+ public java.util.List<java.lang.String>
+ getBitsValueList() {
+ return bitsValue_;
+ }
+ /**
+ * <code>repeated string bitsValue = 7;</code>
+ */
+ public int getBitsValueCount() {
+ return bitsValue_.size();
+ }
+ /**
+ * <code>repeated string bitsValue = 7;</code>
+ */
+ public java.lang.String getBitsValue(int index) {
+ return bitsValue_.get(index);
+ }
+ /**
+ * <code>repeated string bitsValue = 7;</code>
+ */
+ public com.google.protobuf.ByteString
+ getBitsValueBytes(int index) {
+ return bitsValue_.getByteString(index);
+ }
+
+ // optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 8;
+ public static final int INSTANCEIDENTIFIERVALUE_FIELD_NUMBER = 8;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier instanceIdentifierValue_;
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 8;</code>
+ */
+ public boolean hasInstanceIdentifierValue() {
+ return ((bitField0_ & 0x00000010) == 0x00000010);
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 8;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getInstanceIdentifierValue() {
+ return instanceIdentifierValue_;
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 8;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getInstanceIdentifierValueOrBuilder() {
+ return instanceIdentifierValue_;
+ }
+
+ private void initFields() {
+ path_ = "";
+ type_ = "";
+ attributes_ = java.util.Collections.emptyList();
+ child_ = java.util.Collections.emptyList();
+ value_ = "";
+ valueType_ = "";
+ bitsValue_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ instanceIdentifierValue_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+ }
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized != -1) return isInitialized == 1;
+
+ 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;
+ }
+ }
+ if (hasInstanceIdentifierValue()) {
+ if (!getInstanceIdentifierValue().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());
+ }
+ if (((bitField0_ & 0x00000008) == 0x00000008)) {
+ output.writeBytes(6, getValueTypeBytes());
+ }
+ for (int i = 0; i < bitsValue_.size(); i++) {
+ output.writeBytes(7, bitsValue_.getByteString(i));
+ }
+ if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ output.writeMessage(8, instanceIdentifierValue_);
+ }
+ 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());
+ }
+ if (((bitField0_ & 0x00000008) == 0x00000008)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(6, getValueTypeBytes());
+ }
+ {
+ int dataSize = 0;
+ for (int i = 0; i < bitsValue_.size(); i++) {
+ dataSize += com.google.protobuf.CodedOutputStream
+ .computeBytesSizeNoTag(bitsValue_.getByteString(i));
+ }
+ size += dataSize;
+ size += 1 * getBitsValueList().size();
+ }
+ if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(8, instanceIdentifierValue_);
+ }
+ 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<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();
+ getInstanceIdentifierValueFieldBuilder();
+ }
+ }
+ 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);
+ valueType_ = "";
+ bitField0_ = (bitField0_ & ~0x00000020);
+ bitsValue_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000040);
+ if (instanceIdentifierValueBuilder_ == null) {
+ instanceIdentifierValue_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+ } else {
+ instanceIdentifierValueBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000080);
+ 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_;
+ if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
+ to_bitField0_ |= 0x00000008;
+ }
+ result.valueType_ = valueType_;
+ if (((bitField0_ & 0x00000040) == 0x00000040)) {
+ bitsValue_ = new com.google.protobuf.UnmodifiableLazyStringList(
+ bitsValue_);
+ bitField0_ = (bitField0_ & ~0x00000040);
+ }
+ result.bitsValue_ = bitsValue_;
+ if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
+ to_bitField0_ |= 0x00000010;
+ }
+ if (instanceIdentifierValueBuilder_ == null) {
+ result.instanceIdentifierValue_ = instanceIdentifierValue_;
+ } else {
+ result.instanceIdentifierValue_ = instanceIdentifierValueBuilder_.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.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();
+ }
+ if (other.hasValueType()) {
+ bitField0_ |= 0x00000020;
+ valueType_ = other.valueType_;
+ onChanged();
+ }
+ if (!other.bitsValue_.isEmpty()) {
+ if (bitsValue_.isEmpty()) {
+ bitsValue_ = other.bitsValue_;
+ bitField0_ = (bitField0_ & ~0x00000040);
+ } else {
+ ensureBitsValueIsMutable();
+ bitsValue_.addAll(other.bitsValue_);
+ }
+ onChanged();
+ }
+ if (other.hasInstanceIdentifierValue()) {
+ mergeInstanceIdentifierValue(other.getInstanceIdentifierValue());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ return this;
+ }
+
+ public final boolean isInitialized() {
+ 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;
+ }
+ }
+ if (hasInstanceIdentifierValue()) {
+ if (!getInstanceIdentifierValue().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_;
+
+ // optional string path = 1;
+ private java.lang.Object path_ = "";
+ /**
+ * <code>optional string path = 1;</code>
+ */
+ public boolean hasPath() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>optional string path = 1;</code>
+ */
+ 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;
+ }
+ }
+ /**
+ * <code>optional string path = 1;</code>
+ */
+ 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;
+ }
+ }
+ /**
+ * <code>optional string path = 1;</code>
+ */
+ public Builder setPath(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ path_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string path = 1;</code>
+ */
+ public Builder clearPath() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ path_ = getDefaultInstance().getPath();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string path = 1;</code>
+ */
+ 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_ = "";
+ /**
+ * <code>optional string type = 2;</code>
+ */
+ public boolean hasType() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>optional string type = 2;</code>
+ */
+ 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;
+ }
+ }
+ /**
+ * <code>optional string type = 2;</code>
+ */
+ 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;
+ }
+ }
+ /**
+ * <code>optional string type = 2;</code>
+ */
+ public Builder setType(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ type_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string type = 2;</code>
+ */
+ public Builder clearType() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ type_ = getDefaultInstance().getType();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string type = 2;</code>
+ */
+ 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<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute> attributes_ =
+ java.util.Collections.emptyList();
+ private void ensureAttributesIsMutable() {
+ if (!((bitField0_ & 0x00000004) == 0x00000004)) {
+ attributes_ = new java.util.ArrayList<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute>(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_;
+
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute> getAttributesList() {
+ if (attributesBuilder_ == null) {
+ return java.util.Collections.unmodifiableList(attributes_);
+ } else {
+ return attributesBuilder_.getMessageList();
+ }
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ public int getAttributesCount() {
+ if (attributesBuilder_ == null) {
+ return attributes_.size();
+ } else {
+ return attributesBuilder_.getCount();
+ }
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute getAttributes(int index) {
+ if (attributesBuilder_ == null) {
+ return attributes_.get(index);
+ } else {
+ return attributesBuilder_.getMessage(index);
+ }
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ 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;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ 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;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ 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;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ 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;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ 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;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ 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;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ public Builder addAllAttributes(
+ java.lang.Iterable<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute> values) {
+ if (attributesBuilder_ == null) {
+ ensureAttributesIsMutable();
+ super.addAll(values, attributes_);
+ onChanged();
+ } else {
+ attributesBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ public Builder clearAttributes() {
+ if (attributesBuilder_ == null) {
+ attributes_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000004);
+ onChanged();
+ } else {
+ attributesBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ public Builder removeAttributes(int index) {
+ if (attributesBuilder_ == null) {
+ ensureAttributesIsMutable();
+ attributes_.remove(index);
+ onChanged();
+ } else {
+ attributesBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder getAttributesBuilder(
+ int index) {
+ return getAttributesFieldBuilder().getBuilder(index);
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder getAttributesOrBuilder(
+ int index) {
+ if (attributesBuilder_ == null) {
+ return attributes_.get(index); } else {
+ return attributesBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder>
+ getAttributesOrBuilderList() {
+ if (attributesBuilder_ != null) {
+ return attributesBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(attributes_);
+ }
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder addAttributesBuilder() {
+ return getAttributesFieldBuilder().addBuilder(
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.getDefaultInstance());
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ 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());
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ */
+ public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder>
+ 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<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node> child_ =
+ java.util.Collections.emptyList();
+ private void ensureChildIsMutable() {
+ if (!((bitField0_ & 0x00000008) == 0x00000008)) {
+ child_ = new java.util.ArrayList<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node>(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_;
+
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node> getChildList() {
+ if (childBuilder_ == null) {
+ return java.util.Collections.unmodifiableList(child_);
+ } else {
+ return childBuilder_.getMessageList();
+ }
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ public int getChildCount() {
+ if (childBuilder_ == null) {
+ return child_.size();
+ } else {
+ return childBuilder_.getCount();
+ }
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getChild(int index) {
+ if (childBuilder_ == null) {
+ return child_.get(index);
+ } else {
+ return childBuilder_.getMessage(index);
+ }
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ 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;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ 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;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ 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;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ 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;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ 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;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ 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;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ public Builder addAllChild(
+ java.lang.Iterable<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node> values) {
+ if (childBuilder_ == null) {
+ ensureChildIsMutable();
+ super.addAll(values, child_);
+ onChanged();
+ } else {
+ childBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ public Builder clearChild() {
+ if (childBuilder_ == null) {
+ child_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000008);
+ onChanged();
+ } else {
+ childBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ public Builder removeChild(int index) {
+ if (childBuilder_ == null) {
+ ensureChildIsMutable();
+ child_.remove(index);
+ onChanged();
+ } else {
+ childBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder getChildBuilder(
+ int index) {
+ return getChildFieldBuilder().getBuilder(index);
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getChildOrBuilder(
+ int index) {
+ if (childBuilder_ == null) {
+ return child_.get(index); } else {
+ return childBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder>
+ getChildOrBuilderList() {
+ if (childBuilder_ != null) {
+ return childBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(child_);
+ }
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder addChildBuilder() {
+ return getChildFieldBuilder().addBuilder(
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance());
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ 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());
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ */
+ public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder>
+ 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_ = "";
+ /**
+ * <code>optional string value = 5;</code>
+ */
+ public boolean hasValue() {
+ return ((bitField0_ & 0x00000010) == 0x00000010);
+ }
+ /**
+ * <code>optional string value = 5;</code>
+ */
+ 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;
+ }
+ }
+ /**
+ * <code>optional string value = 5;</code>
+ */
+ 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;
+ }
+ }
+ /**
+ * <code>optional string value = 5;</code>
+ */
+ public Builder setValue(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000010;
+ value_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string value = 5;</code>
+ */
+ public Builder clearValue() {
+ bitField0_ = (bitField0_ & ~0x00000010);
+ value_ = getDefaultInstance().getValue();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string value = 5;</code>
+ */
+ public Builder setValueBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000010;
+ value_ = value;
+ onChanged();
+ return this;
+ }
+
+ // optional string valueType = 6;
+ private java.lang.Object valueType_ = "";
+ /**
+ * <code>optional string valueType = 6;</code>
+ */
+ public boolean hasValueType() {
+ return ((bitField0_ & 0x00000020) == 0x00000020);
+ }
+ /**
+ * <code>optional string valueType = 6;</code>
+ */
+ public java.lang.String getValueType() {
+ java.lang.Object ref = valueType_;
+ if (!(ref instanceof java.lang.String)) {
+ java.lang.String s = ((com.google.protobuf.ByteString) ref)
+ .toStringUtf8();
+ valueType_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <code>optional string valueType = 6;</code>
+ */
+ public com.google.protobuf.ByteString
+ getValueTypeBytes() {
+ java.lang.Object ref = valueType_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ valueType_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <code>optional string valueType = 6;</code>
+ */
+ public Builder setValueType(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000020;
+ valueType_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string valueType = 6;</code>
+ */
+ public Builder clearValueType() {
+ bitField0_ = (bitField0_ & ~0x00000020);
+ valueType_ = getDefaultInstance().getValueType();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string valueType = 6;</code>
+ */
+ public Builder setValueTypeBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000020;
+ valueType_ = value;
+ onChanged();
+ return this;
+ }
+
+ // repeated string bitsValue = 7;
+ private com.google.protobuf.LazyStringList bitsValue_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ private void ensureBitsValueIsMutable() {
+ if (!((bitField0_ & 0x00000040) == 0x00000040)) {
+ bitsValue_ = new com.google.protobuf.LazyStringArrayList(bitsValue_);
+ bitField0_ |= 0x00000040;
+ }
+ }
+ /**
+ * <code>repeated string bitsValue = 7;</code>
+ */
+ public java.util.List<java.lang.String>
+ getBitsValueList() {
+ return java.util.Collections.unmodifiableList(bitsValue_);
+ }
+ /**
+ * <code>repeated string bitsValue = 7;</code>
+ */
+ public int getBitsValueCount() {
+ return bitsValue_.size();
+ }
+ /**
+ * <code>repeated string bitsValue = 7;</code>
+ */
+ public java.lang.String getBitsValue(int index) {
+ return bitsValue_.get(index);
+ }
+ /**
+ * <code>repeated string bitsValue = 7;</code>
+ */
+ public com.google.protobuf.ByteString
+ getBitsValueBytes(int index) {
+ return bitsValue_.getByteString(index);
+ }
+ /**
+ * <code>repeated string bitsValue = 7;</code>
+ */
+ public Builder setBitsValue(
+ int index, java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureBitsValueIsMutable();
+ bitsValue_.set(index, value);
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>repeated string bitsValue = 7;</code>
+ */
+ public Builder addBitsValue(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureBitsValueIsMutable();
+ bitsValue_.add(value);
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>repeated string bitsValue = 7;</code>
+ */
+ public Builder addAllBitsValue(
+ java.lang.Iterable<java.lang.String> values) {
+ ensureBitsValueIsMutable();
+ super.addAll(values, bitsValue_);
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>repeated string bitsValue = 7;</code>
+ */
+ public Builder clearBitsValue() {
+ bitsValue_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000040);
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>repeated string bitsValue = 7;</code>
+ */
+ public Builder addBitsValueBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureBitsValueIsMutable();
+ bitsValue_.add(value);
+ onChanged();
+ return this;
+ }
+
+ // optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 8;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier instanceIdentifierValue_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder> instanceIdentifierValueBuilder_;
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 8;</code>
+ */
+ public boolean hasInstanceIdentifierValue() {
+ return ((bitField0_ & 0x00000080) == 0x00000080);
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 8;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getInstanceIdentifierValue() {
+ if (instanceIdentifierValueBuilder_ == null) {
+ return instanceIdentifierValue_;
+ } else {
+ return instanceIdentifierValueBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 8;</code>
+ */
+ public Builder setInstanceIdentifierValue(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier value) {
+ if (instanceIdentifierValueBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ instanceIdentifierValue_ = value;
+ onChanged();
+ } else {
+ instanceIdentifierValueBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000080;
+ return this;
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 8;</code>
+ */
+ public Builder setInstanceIdentifierValue(
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder builderForValue) {
+ if (instanceIdentifierValueBuilder_ == null) {
+ instanceIdentifierValue_ = builderForValue.build();
+ onChanged();
+ } else {
+ instanceIdentifierValueBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000080;
+ return this;
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 8;</code>
+ */
+ public Builder mergeInstanceIdentifierValue(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier value) {
+ if (instanceIdentifierValueBuilder_ == null) {
+ if (((bitField0_ & 0x00000080) == 0x00000080) &&
+ instanceIdentifierValue_ != org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance()) {
+ instanceIdentifierValue_ =
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.newBuilder(instanceIdentifierValue_).mergeFrom(value).buildPartial();
+ } else {
+ instanceIdentifierValue_ = value;
+ }
+ onChanged();
+ } else {
+ instanceIdentifierValueBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000080;
+ return this;
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 8;</code>
+ */
+ public Builder clearInstanceIdentifierValue() {
+ if (instanceIdentifierValueBuilder_ == null) {
+ instanceIdentifierValue_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+ onChanged();
+ } else {
+ instanceIdentifierValueBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000080);
+ return this;
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 8;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder getInstanceIdentifierValueBuilder() {
+ bitField0_ |= 0x00000080;
+ onChanged();
+ return getInstanceIdentifierValueFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 8;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getInstanceIdentifierValueOrBuilder() {
+ if (instanceIdentifierValueBuilder_ != null) {
+ return instanceIdentifierValueBuilder_.getMessageOrBuilder();
+ } else {
+ return instanceIdentifierValue_;
+ }
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 8;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>
+ getInstanceIdentifierValueFieldBuilder() {
+ if (instanceIdentifierValueBuilder_ == null) {
+ instanceIdentifierValueBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>(
+ instanceIdentifierValue_,
+ getParentForChildren(),
+ isClean());
+ instanceIdentifierValue_ = null;
+ }
+ return instanceIdentifierValueBuilder_;
+ }
+
+ // @@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;
+ /**
+ * <code>required string parentPath = 1;</code>
+ */
+ boolean hasParentPath();
+ /**
+ * <code>required string parentPath = 1;</code>
+ */
+ java.lang.String getParentPath();
+ /**
+ * <code>required string parentPath = 1;</code>
+ */
+ com.google.protobuf.ByteString
+ getParentPathBytes();
+
+ // optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ */
+ boolean hasNormalizedNode();
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ */
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getNormalizedNode();
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ */
+ 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<Container> PARSER =
+ new com.google.protobuf.AbstractParser<Container>() {
+ 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<Container> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required string parentPath = 1;
+ public static final int PARENTPATH_FIELD_NUMBER = 1;
+ private java.lang.Object parentPath_;
+ /**
+ * <code>required string parentPath = 1;</code>
+ */
+ public boolean hasParentPath() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string parentPath = 1;</code>
+ */
+ 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;
+ }
+ }
+ /**
+ * <code>required string parentPath = 1;</code>
+ */
+ 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;
+ }
+ }
+
+ // optional .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_;
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ */
+ public boolean hasNormalizedNode() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getNormalizedNode() {
+ return normalizedNode_;
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ */
+ 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()) {
+ 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<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()) {
+ 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_ = "";
/**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ * <code>required string parentPath = 1;</code>
*/
- public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute getAttributes(int index) {
- if (attributesBuilder_ == null) {
- return attributes_.get(index);
+ public boolean hasParentPath() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string parentPath = 1;</code>
+ */
+ 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 attributesBuilder_.getMessage(index);
+ return (java.lang.String) ref;
}
}
/**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ * <code>required string parentPath = 1;</code>
*/
- public Builder setAttributes(
- int index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute value) {
- if (attributesBuilder_ == null) {
+ 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;
+ }
+ }
+ /**
+ * <code>required string parentPath = 1;</code>
+ */
+ public Builder setParentPath(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ parentPath_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required string parentPath = 1;</code>
+ */
+ public Builder clearParentPath() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ parentPath_ = getDefaultInstance().getParentPath();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required string parentPath = 1;</code>
+ */
+ public Builder setParentPathBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ parentPath_ = value;
+ onChanged();
+ return this;
+ }
+
+ // optional .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_;
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ */
+ public boolean hasNormalizedNode() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getNormalizedNode() {
+ if (normalizedNodeBuilder_ == null) {
+ return normalizedNode_;
+ } else {
+ return normalizedNodeBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ */
+ public Builder setNormalizedNode(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node value) {
+ if (normalizedNodeBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
- ensureAttributesIsMutable();
- attributes_.set(index, value);
+ normalizedNode_ = value;
onChanged();
} else {
- attributesBuilder_.setMessage(index, value);
+ normalizedNodeBuilder_.setMessage(value);
}
+ bitField0_ |= 0x00000002;
return this;
}
/**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
*/
- public Builder setAttributes(
- int index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder builderForValue) {
- if (attributesBuilder_ == null) {
- ensureAttributesIsMutable();
- attributes_.set(index, builderForValue.build());
+ public Builder setNormalizedNode(
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder builderForValue) {
+ if (normalizedNodeBuilder_ == null) {
+ normalizedNode_ = builderForValue.build();
onChanged();
} else {
- attributesBuilder_.setMessage(index, builderForValue.build());
+ normalizedNodeBuilder_.setMessage(builderForValue.build());
}
+ bitField0_ |= 0x00000002;
return this;
}
/**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
*/
- public Builder addAttributes(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute value) {
- if (attributesBuilder_ == null) {
- if (value == null) {
- throw new NullPointerException();
+ 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;
}
- ensureAttributesIsMutable();
- attributes_.add(value);
onChanged();
} else {
- attributesBuilder_.addMessage(value);
+ normalizedNodeBuilder_.mergeFrom(value);
}
+ bitField0_ |= 0x00000002;
return this;
}
/**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
*/
- 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);
+ public Builder clearNormalizedNode() {
+ if (normalizedNodeBuilder_ == null) {
+ normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance();
onChanged();
} else {
- attributesBuilder_.addMessage(index, value);
+ normalizedNodeBuilder_.clear();
}
+ bitField0_ = (bitField0_ & ~0x00000002);
return this;
}
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
- */
- 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;
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder getNormalizedNodeBuilder() {
+ bitField0_ |= 0x00000002;
+ onChanged();
+ return getNormalizedNodeFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getNormalizedNodeOrBuilder() {
+ if (normalizedNodeBuilder_ != null) {
+ return normalizedNodeBuilder_.getMessageOrBuilder();
+ } else {
+ return normalizedNode_;
+ }
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ */
+ 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)
+ }
+
+ public interface NodeMapEntryOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;
+ /**
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
+ */
+ boolean hasInstanceIdentifierPath();
+ /**
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
+ */
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getInstanceIdentifierPath();
+ /**
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
+ */
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getInstanceIdentifierPathOrBuilder();
+
+ // optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ */
+ boolean hasNormalizedNode();
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ */
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getNormalizedNode();
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ */
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getNormalizedNodeOrBuilder();
+ }
+ /**
+ * Protobuf type {@code org.opendaylight.controller.mdsal.NodeMapEntry}
+ */
+ public static final class NodeMapEntry extends
+ com.google.protobuf.GeneratedMessage
+ implements NodeMapEntryOrBuilder {
+ // Use NodeMapEntry.newBuilder() to construct.
+ private NodeMapEntry(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private NodeMapEntry(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final NodeMapEntry defaultInstance;
+ public static NodeMapEntry getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public NodeMapEntry getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private NodeMapEntry(
+ 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: {
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ subBuilder = instanceIdentifierPath_.toBuilder();
+ }
+ instanceIdentifierPath_ = input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(instanceIdentifierPath_);
+ instanceIdentifierPath_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000001;
+ 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_NodeMapEntry_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_NodeMapEntry_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry.class, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<NodeMapEntry> PARSER =
+ new com.google.protobuf.AbstractParser<NodeMapEntry>() {
+ public NodeMapEntry parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new NodeMapEntry(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<NodeMapEntry> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;
+ public static final int INSTANCEIDENTIFIERPATH_FIELD_NUMBER = 1;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier instanceIdentifierPath_;
+ /**
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
+ */
+ public boolean hasInstanceIdentifierPath() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getInstanceIdentifierPath() {
+ return instanceIdentifierPath_;
+ }
+ /**
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getInstanceIdentifierPathOrBuilder() {
+ return instanceIdentifierPath_;
+ }
+
+ // optional .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_;
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ */
+ public boolean hasNormalizedNode() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getNormalizedNode() {
+ return normalizedNode_;
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getNormalizedNodeOrBuilder() {
+ return normalizedNode_;
+ }
+
+ private void initFields() {
+ instanceIdentifierPath_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.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 (!hasInstanceIdentifierPath()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ if (!getInstanceIdentifierPath().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
}
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
- */
- 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());
+ if (hasNormalizedNode()) {
+ if (!getNormalizedNode().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
}
- return this;
}
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
- */
- public Builder addAllAttributes(
- java.lang.Iterable<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute> values) {
- if (attributesBuilder_ == null) {
- ensureAttributesIsMutable();
- super.addAll(values, attributes_);
- onChanged();
- } else {
- attributesBuilder_.addAllMessages(values);
- }
- return this;
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeMessage(1, instanceIdentifierPath_);
}
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
- */
- public Builder clearAttributes() {
- if (attributesBuilder_ == null) {
- attributes_ = java.util.Collections.emptyList();
- bitField0_ = (bitField0_ & ~0x00000004);
- onChanged();
- } else {
- attributesBuilder_.clear();
- }
- return this;
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ output.writeMessage(2, normalizedNode_);
}
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
- */
- public Builder removeAttributes(int index) {
- if (attributesBuilder_ == null) {
- ensureAttributesIsMutable();
- attributes_.remove(index);
- onChanged();
- } else {
- attributesBuilder_.remove(index);
- }
- return this;
+ 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
+ .computeMessageSize(1, instanceIdentifierPath_);
}
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
- */
- public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder getAttributesBuilder(
- int index) {
- return getAttributesFieldBuilder().getBuilder(index);
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(2, normalizedNode_);
}
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
- */
- public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder getAttributesOrBuilder(
- int index) {
- if (attributesBuilder_ == null) {
- return attributes_.get(index); } else {
- return attributesBuilder_.getMessageOrBuilder(index);
- }
+ 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.NodeMapEntry parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry 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.NodeMapEntry parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry 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.NodeMapEntry parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry 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.NodeMapEntry parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry 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.NodeMapEntry parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry 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.NodeMapEntry 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.NodeMapEntry}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntryOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_NodeMapEntry_descriptor;
}
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
- */
- public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder>
- getAttributesOrBuilderList() {
- if (attributesBuilder_ != null) {
- return attributesBuilder_.getMessageOrBuilderList();
- } else {
- return java.util.Collections.unmodifiableList(attributes_);
- }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_NodeMapEntry_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry.class, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry.Builder.class);
}
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
- */
- public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder addAttributesBuilder() {
- return getAttributesFieldBuilder().addBuilder(
- org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.getDefaultInstance());
+
+ // Construct using org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry.newBuilder()
+ private Builder() {
+ maybeForceBuilderInitialization();
}
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
- */
- 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());
+
+ private Builder(
+ com.google.protobuf.GeneratedMessage.BuilderParent parent) {
+ super(parent);
+ maybeForceBuilderInitialization();
}
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
- */
- public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder>
- getAttributesBuilderList() {
- return getAttributesFieldBuilder().getBuilderList();
+ private void maybeForceBuilderInitialization() {
+ if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getInstanceIdentifierPathFieldBuilder();
+ getNormalizedNodeFieldBuilder();
+ }
}
- 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;
+ private static Builder create() {
+ return new Builder();
+ }
+
+ public Builder clear() {
+ super.clear();
+ if (instanceIdentifierPathBuilder_ == null) {
+ instanceIdentifierPath_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+ } else {
+ instanceIdentifierPathBuilder_.clear();
}
- return attributesBuilder_;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ if (normalizedNodeBuilder_ == null) {
+ normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance();
+ } else {
+ normalizedNodeBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000002);
+ return this;
}
- // repeated .org.opendaylight.controller.mdsal.Node child = 4;
- private java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node> child_ =
- java.util.Collections.emptyList();
- private void ensureChildIsMutable() {
- if (!((bitField0_ & 0x00000008) == 0x00000008)) {
- child_ = new java.util.ArrayList<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node>(child_);
- bitField0_ |= 0x00000008;
- }
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
}
- 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_;
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_NodeMapEntry_descriptor;
+ }
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
- */
- public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node> getChildList() {
- if (childBuilder_ == null) {
- return java.util.Collections.unmodifiableList(child_);
- } else {
- return childBuilder_.getMessageList();
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry getDefaultInstanceForType() {
+ return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry.getDefaultInstance();
+ }
+
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry build() {
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
}
+ return result;
}
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
- */
- public int getChildCount() {
- if (childBuilder_ == null) {
- return child_.size();
+
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry buildPartial() {
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry result = new org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ if (instanceIdentifierPathBuilder_ == null) {
+ result.instanceIdentifierPath_ = instanceIdentifierPath_;
} else {
- return childBuilder_.getCount();
+ result.instanceIdentifierPath_ = instanceIdentifierPathBuilder_.build();
}
- }
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
- */
- public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getChild(int index) {
- if (childBuilder_ == null) {
- return child_.get(index);
+ if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ if (normalizedNodeBuilder_ == null) {
+ result.normalizedNode_ = normalizedNode_;
} else {
- return childBuilder_.getMessage(index);
+ result.normalizedNode_ = normalizedNodeBuilder_.build();
}
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
}
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
- */
- 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();
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry) {
+ return mergeFrom((org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry)other);
} else {
- childBuilder_.setMessage(index, value);
+ super.mergeFrom(other);
+ return this;
}
- return this;
}
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
- */
- 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());
+
+ public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry other) {
+ if (other == org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry.getDefaultInstance()) return this;
+ if (other.hasInstanceIdentifierPath()) {
+ mergeInstanceIdentifierPath(other.getInstanceIdentifierPath());
+ }
+ if (other.hasNormalizedNode()) {
+ mergeNormalizedNode(other.getNormalizedNode());
}
+ this.mergeUnknownFields(other.getUnknownFields());
return this;
}
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
- */
- public Builder addChild(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node value) {
- if (childBuilder_ == null) {
- if (value == null) {
- throw new NullPointerException();
+
+ public final boolean isInitialized() {
+ if (!hasInstanceIdentifierPath()) {
+
+ return false;
+ }
+ if (!getInstanceIdentifierPath().isInitialized()) {
+
+ return false;
+ }
+ if (hasNormalizedNode()) {
+ if (!getNormalizedNode().isInitialized()) {
+
+ return false;
}
- ensureChildIsMutable();
- child_.add(value);
- onChanged();
- } else {
- childBuilder_.addMessage(value);
}
- return this;
+ return true;
}
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
- */
- public Builder addChild(
- int index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node value) {
- if (childBuilder_ == null) {
- if (value == null) {
- throw new NullPointerException();
+
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
}
- ensureChildIsMutable();
- child_.add(index, value);
- onChanged();
- } else {
- childBuilder_.addMessage(index, value);
}
return this;
}
+ private int bitField0_;
+
+ // required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier instanceIdentifierPath_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder> instanceIdentifierPathBuilder_;
/**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
*/
- public Builder addChild(
- org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder builderForValue) {
- if (childBuilder_ == null) {
- ensureChildIsMutable();
- child_.add(builderForValue.build());
- onChanged();
+ public boolean hasInstanceIdentifierPath() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getInstanceIdentifierPath() {
+ if (instanceIdentifierPathBuilder_ == null) {
+ return instanceIdentifierPath_;
} else {
- childBuilder_.addMessage(builderForValue.build());
+ return instanceIdentifierPathBuilder_.getMessage();
}
- return this;
}
/**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
*/
- public Builder addChild(
- int index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder builderForValue) {
- if (childBuilder_ == null) {
- ensureChildIsMutable();
- child_.add(index, builderForValue.build());
+ public Builder setInstanceIdentifierPath(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier value) {
+ if (instanceIdentifierPathBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ instanceIdentifierPath_ = value;
onChanged();
} else {
- childBuilder_.addMessage(index, builderForValue.build());
+ instanceIdentifierPathBuilder_.setMessage(value);
}
+ bitField0_ |= 0x00000001;
return this;
}
/**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
*/
- public Builder addAllChild(
- java.lang.Iterable<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node> values) {
- if (childBuilder_ == null) {
- ensureChildIsMutable();
- super.addAll(values, child_);
+ public Builder setInstanceIdentifierPath(
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder builderForValue) {
+ if (instanceIdentifierPathBuilder_ == null) {
+ instanceIdentifierPath_ = builderForValue.build();
onChanged();
} else {
- childBuilder_.addAllMessages(values);
+ instanceIdentifierPathBuilder_.setMessage(builderForValue.build());
}
+ bitField0_ |= 0x00000001;
return this;
}
/**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
*/
- public Builder clearChild() {
- if (childBuilder_ == null) {
- child_ = java.util.Collections.emptyList();
- bitField0_ = (bitField0_ & ~0x00000008);
+ public Builder mergeInstanceIdentifierPath(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier value) {
+ if (instanceIdentifierPathBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) == 0x00000001) &&
+ instanceIdentifierPath_ != org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance()) {
+ instanceIdentifierPath_ =
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.newBuilder(instanceIdentifierPath_).mergeFrom(value).buildPartial();
+ } else {
+ instanceIdentifierPath_ = value;
+ }
onChanged();
} else {
- childBuilder_.clear();
+ instanceIdentifierPathBuilder_.mergeFrom(value);
}
+ bitField0_ |= 0x00000001;
return this;
}
/**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
*/
- public Builder removeChild(int index) {
- if (childBuilder_ == null) {
- ensureChildIsMutable();
- child_.remove(index);
+ public Builder clearInstanceIdentifierPath() {
+ if (instanceIdentifierPathBuilder_ == null) {
+ instanceIdentifierPath_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
onChanged();
} else {
- childBuilder_.remove(index);
+ instanceIdentifierPathBuilder_.clear();
}
+ bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
/**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
- */
- public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder getChildBuilder(
- int index) {
- return getChildFieldBuilder().getBuilder(index);
- }
- /**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
*/
- public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getChildOrBuilder(
- int index) {
- if (childBuilder_ == null) {
- return child_.get(index); } else {
- return childBuilder_.getMessageOrBuilder(index);
- }
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder getInstanceIdentifierPathBuilder() {
+ bitField0_ |= 0x00000001;
+ onChanged();
+ return getInstanceIdentifierPathFieldBuilder().getBuilder();
}
/**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
*/
- public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder>
- getChildOrBuilderList() {
- if (childBuilder_ != null) {
- return childBuilder_.getMessageOrBuilderList();
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getInstanceIdentifierPathOrBuilder() {
+ if (instanceIdentifierPathBuilder_ != null) {
+ return instanceIdentifierPathBuilder_.getMessageOrBuilder();
} else {
- return java.util.Collections.unmodifiableList(child_);
+ return instanceIdentifierPath_;
}
}
/**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
*/
- public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder addChildBuilder() {
- return getChildFieldBuilder().addBuilder(
- org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance());
+ private com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>
+ getInstanceIdentifierPathFieldBuilder() {
+ if (instanceIdentifierPathBuilder_ == null) {
+ instanceIdentifierPathBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>(
+ instanceIdentifierPath_,
+ getParentForChildren(),
+ isClean());
+ instanceIdentifierPath_ = null;
+ }
+ return instanceIdentifierPathBuilder_;
}
+
+ // optional .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_;
/**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
*/
- 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());
+ public boolean hasNormalizedNode() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
- * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
*/
- public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder>
- 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;
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getNormalizedNode() {
+ if (normalizedNodeBuilder_ == null) {
+ return normalizedNode_;
+ } else {
+ return normalizedNodeBuilder_.getMessage();
}
- return childBuilder_;
}
-
- // optional string value = 5;
- private java.lang.Object value_ = "";
/**
- * <code>optional string value = 5;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
*/
- public boolean hasValue() {
- return ((bitField0_ & 0x00000010) == 0x00000010);
+ 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;
}
/**
- * <code>optional string value = 5;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
*/
- 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;
+ public Builder setNormalizedNode(
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder builderForValue) {
+ if (normalizedNodeBuilder_ == null) {
+ normalizedNode_ = builderForValue.build();
+ onChanged();
} else {
- return (java.lang.String) ref;
+ normalizedNodeBuilder_.setMessage(builderForValue.build());
}
+ bitField0_ |= 0x00000002;
+ return this;
}
/**
- * <code>optional string value = 5;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
*/
- 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;
+ 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 {
- return (com.google.protobuf.ByteString) ref;
+ normalizedNodeBuilder_.mergeFrom(value);
}
+ bitField0_ |= 0x00000002;
+ return this;
}
/**
- * <code>optional string value = 5;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
*/
- public Builder setValue(
- java.lang.String value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000010;
- value_ = value;
- onChanged();
+ 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;
}
/**
- * <code>optional string value = 5;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
*/
- public Builder clearValue() {
- bitField0_ = (bitField0_ & ~0x00000010);
- value_ = getDefaultInstance().getValue();
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder getNormalizedNodeBuilder() {
+ bitField0_ |= 0x00000002;
onChanged();
- return this;
+ return getNormalizedNodeFieldBuilder().getBuilder();
}
/**
- * <code>optional string value = 5;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
*/
- public Builder setValueBytes(
- com.google.protobuf.ByteString value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000010;
- value_ = value;
- onChanged();
- return this;
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getNormalizedNodeOrBuilder() {
+ if (normalizedNodeBuilder_ != null) {
+ return normalizedNodeBuilder_.getMessageOrBuilder();
+ } else {
+ return normalizedNode_;
+ }
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ */
+ 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.Node)
+ // @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.NodeMapEntry)
}
static {
- defaultInstance = new Node(true);
+ defaultInstance = new NodeMapEntry(true);
defaultInstance.initFields();
}
- // @@protoc_insertion_point(class_scope:org.opendaylight.controller.mdsal.Node)
+ // @@protoc_insertion_point(class_scope:org.opendaylight.controller.mdsal.NodeMapEntry)
}
- public interface ContainerOrBuilder
+ public interface NodeMapOrBuilder
extends com.google.protobuf.MessageOrBuilder {
- // required string parentPath = 1;
- /**
- * <code>required string parentPath = 1;</code>
- */
- boolean hasParentPath();
+ // repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;
/**
- * <code>required string parentPath = 1;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
*/
- java.lang.String getParentPath();
+ java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry>
+ getMapEntriesList();
/**
- * <code>required string parentPath = 1;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
*/
- com.google.protobuf.ByteString
- getParentPathBytes();
-
- // optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry getMapEntries(int index);
/**
- * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
*/
- boolean hasNormalizedNode();
+ int getMapEntriesCount();
/**
- * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
*/
- org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getNormalizedNode();
+ java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntryOrBuilder>
+ getMapEntriesOrBuilderList();
/**
- * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
*/
- org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getNormalizedNodeOrBuilder();
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntryOrBuilder getMapEntriesOrBuilder(
+ int index);
}
/**
- * Protobuf type {@code org.opendaylight.controller.mdsal.Container}
+ * Protobuf type {@code org.opendaylight.controller.mdsal.NodeMap}
*/
- public static final class Container extends
+ public static final class NodeMap extends
com.google.protobuf.GeneratedMessage
- implements ContainerOrBuilder {
- // Use Container.newBuilder() to construct.
- private Container(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ implements NodeMapOrBuilder {
+ // Use NodeMap.newBuilder() to construct.
+ private NodeMap(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
- private Container(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+ private NodeMap(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
- private static final Container defaultInstance;
- public static Container getDefaultInstance() {
+ private static final NodeMap defaultInstance;
+ public static NodeMap getDefaultInstance() {
return defaultInstance;
}
- public Container getDefaultInstanceForType() {
+ public NodeMap getDefaultInstanceForType() {
return defaultInstance;
}
getUnknownFields() {
return this.unknownFields;
}
- private Container(
+ private NodeMap(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
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();
+ if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
+ mapEntries_ = new java.util.ArrayList<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry>();
+ mutable_bitField0_ |= 0x00000001;
}
- bitField0_ |= 0x00000002;
+ mapEntries_.add(input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry.PARSER, extensionRegistry));
break;
}
}
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
+ if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
+ mapEntries_ = java.util.Collections.unmodifiableList(mapEntries_);
+ }
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;
+ return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_NodeMap_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
- return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_Container_fieldAccessorTable
+ return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_NodeMap_fieldAccessorTable
.ensureFieldAccessorsInitialized(
- org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container.class, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container.Builder.class);
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.class, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.Builder.class);
}
- public static com.google.protobuf.Parser<Container> PARSER =
- new com.google.protobuf.AbstractParser<Container>() {
- public Container parsePartialFrom(
+ public static com.google.protobuf.Parser<NodeMap> PARSER =
+ new com.google.protobuf.AbstractParser<NodeMap>() {
+ public NodeMap parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
- return new Container(input, extensionRegistry);
+ return new NodeMap(input, extensionRegistry);
}
};
@java.lang.Override
- public com.google.protobuf.Parser<Container> getParserForType() {
+ public com.google.protobuf.Parser<NodeMap> getParserForType() {
return PARSER;
}
- private int bitField0_;
- // required string parentPath = 1;
- public static final int PARENTPATH_FIELD_NUMBER = 1;
- private java.lang.Object parentPath_;
+ // repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;
+ public static final int MAPENTRIES_FIELD_NUMBER = 1;
+ private java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry> mapEntries_;
/**
- * <code>required string parentPath = 1;</code>
- */
- public boolean hasParentPath() {
- return ((bitField0_ & 0x00000001) == 0x00000001);
- }
- /**
- * <code>required string parentPath = 1;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
*/
- 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;
- }
+ public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry> getMapEntriesList() {
+ return mapEntries_;
}
/**
- * <code>required string parentPath = 1;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
*/
- 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;
- }
+ public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntryOrBuilder>
+ getMapEntriesOrBuilderList() {
+ return mapEntries_;
}
-
- // optional .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_;
/**
- * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
*/
- public boolean hasNormalizedNode() {
- return ((bitField0_ & 0x00000002) == 0x00000002);
+ public int getMapEntriesCount() {
+ return mapEntries_.size();
}
/**
- * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
*/
- public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getNormalizedNode() {
- return normalizedNode_;
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry getMapEntries(int index) {
+ return mapEntries_.get(index);
}
/**
- * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
*/
- public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getNormalizedNodeOrBuilder() {
- return normalizedNode_;
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntryOrBuilder getMapEntriesOrBuilder(
+ int index) {
+ return mapEntries_.get(index);
}
private void initFields() {
- parentPath_ = "";
- normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance();
+ mapEntries_ = java.util.Collections.emptyList();
}
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()) {
- if (!getNormalizedNode().isInitialized()) {
+ for (int i = 0; i < getMapEntriesCount(); i++) {
+ if (!getMapEntries(i).isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
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_);
+ for (int i = 0; i < mapEntries_.size(); i++) {
+ output.writeMessage(1, mapEntries_.get(i));
}
getUnknownFields().writeTo(output);
}
if (size != -1) return size;
size = 0;
- if (((bitField0_ & 0x00000001) == 0x00000001)) {
- size += com.google.protobuf.CodedOutputStream
- .computeBytesSize(1, getParentPathBytes());
- }
- if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ for (int i = 0; i < mapEntries_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
- .computeMessageSize(2, normalizedNode_);
+ .computeMessageSize(1, mapEntries_.get(i));
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return super.writeReplace();
}
- public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container parseFrom(
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap 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(
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap 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)
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
- public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container parseFrom(
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap 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)
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
- public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container parseFrom(
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap 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)
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
- public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container parseDelimitedFrom(
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap 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(
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap 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(
+ public static org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
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) {
+ public static Builder newBuilder(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
return builder;
}
/**
- * Protobuf type {@code org.opendaylight.controller.mdsal.Container}
+ * Protobuf type {@code org.opendaylight.controller.mdsal.NodeMap}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
- implements org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.ContainerOrBuilder {
+ implements org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapOrBuilder {
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;
+ return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_NodeMap_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
- return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_Container_fieldAccessorTable
+ return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_NodeMap_fieldAccessorTable
.ensureFieldAccessorsInitialized(
- org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container.class, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container.Builder.class);
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.class, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.Builder.class);
}
- // Construct using org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container.newBuilder()
+ // Construct using org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
- getNormalizedNodeFieldBuilder();
+ getMapEntriesFieldBuilder();
}
}
private static Builder create() {
public Builder clear() {
super.clear();
- parentPath_ = "";
- bitField0_ = (bitField0_ & ~0x00000001);
- if (normalizedNodeBuilder_ == null) {
- normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance();
+ if (mapEntriesBuilder_ == null) {
+ mapEntries_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
} else {
- normalizedNodeBuilder_.clear();
+ mapEntriesBuilder_.clear();
}
- bitField0_ = (bitField0_ & ~0x00000002);
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
- return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_Container_descriptor;
+ return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.internal_static_org_opendaylight_controller_mdsal_NodeMap_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.NodeMap getDefaultInstanceForType() {
+ return org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.getDefaultInstance();
}
- public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container build() {
- org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container result = buildPartial();
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap build() {
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap 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);
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap buildPartial() {
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap result = new org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap(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_;
+ if (mapEntriesBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ mapEntries_ = java.util.Collections.unmodifiableList(mapEntries_);
+ bitField0_ = (bitField0_ & ~0x00000001);
+ }
+ result.mapEntries_ = mapEntries_;
} else {
- result.normalizedNode_ = normalizedNodeBuilder_.build();
+ result.mapEntries_ = mapEntriesBuilder_.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);
+ if (other instanceof org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap) {
+ return mergeFrom((org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap)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());
+ public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap other) {
+ if (other == org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.getDefaultInstance()) return this;
+ if (mapEntriesBuilder_ == null) {
+ if (!other.mapEntries_.isEmpty()) {
+ if (mapEntries_.isEmpty()) {
+ mapEntries_ = other.mapEntries_;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ } else {
+ ensureMapEntriesIsMutable();
+ mapEntries_.addAll(other.mapEntries_);
+ }
+ onChanged();
+ }
+ } else {
+ if (!other.mapEntries_.isEmpty()) {
+ if (mapEntriesBuilder_.isEmpty()) {
+ mapEntriesBuilder_.dispose();
+ mapEntriesBuilder_ = null;
+ mapEntries_ = other.mapEntries_;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ mapEntriesBuilder_ =
+ com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
+ getMapEntriesFieldBuilder() : null;
+ } else {
+ mapEntriesBuilder_.addAllMessages(other.mapEntries_);
+ }
+ }
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
- if (!hasParentPath()) {
-
- return false;
- }
- if (hasNormalizedNode()) {
- if (!getNormalizedNode().isInitialized()) {
+ for (int i = 0; i < getMapEntriesCount(); i++) {
+ if (!getMapEntries(i).isInitialized()) {
return false;
}
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
- org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container parsedMessage = null;
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap 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();
+ parsedMessage = (org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
}
private int bitField0_;
- // required string parentPath = 1;
- private java.lang.Object parentPath_ = "";
+ // repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;
+ private java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry> mapEntries_ =
+ java.util.Collections.emptyList();
+ private void ensureMapEntriesIsMutable() {
+ if (!((bitField0_ & 0x00000001) == 0x00000001)) {
+ mapEntries_ = new java.util.ArrayList<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry>(mapEntries_);
+ bitField0_ |= 0x00000001;
+ }
+ }
+
+ private com.google.protobuf.RepeatedFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntryOrBuilder> mapEntriesBuilder_;
+
/**
- * <code>required string parentPath = 1;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
*/
- public boolean hasParentPath() {
- return ((bitField0_ & 0x00000001) == 0x00000001);
+ public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry> getMapEntriesList() {
+ if (mapEntriesBuilder_ == null) {
+ return java.util.Collections.unmodifiableList(mapEntries_);
+ } else {
+ return mapEntriesBuilder_.getMessageList();
+ }
}
/**
- * <code>required string parentPath = 1;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
*/
- 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;
+ public int getMapEntriesCount() {
+ if (mapEntriesBuilder_ == null) {
+ return mapEntries_.size();
} else {
- return (java.lang.String) ref;
+ return mapEntriesBuilder_.getCount();
}
}
/**
- * <code>required string parentPath = 1;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
*/
- 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;
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry getMapEntries(int index) {
+ if (mapEntriesBuilder_ == null) {
+ return mapEntries_.get(index);
} else {
- return (com.google.protobuf.ByteString) ref;
+ return mapEntriesBuilder_.getMessage(index);
}
}
/**
- * <code>required string parentPath = 1;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
*/
- public Builder setParentPath(
- java.lang.String value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000001;
- parentPath_ = value;
- onChanged();
+ public Builder setMapEntries(
+ int index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry value) {
+ if (mapEntriesBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureMapEntriesIsMutable();
+ mapEntries_.set(index, value);
+ onChanged();
+ } else {
+ mapEntriesBuilder_.setMessage(index, value);
+ }
return this;
}
/**
- * <code>required string parentPath = 1;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
*/
- public Builder clearParentPath() {
- bitField0_ = (bitField0_ & ~0x00000001);
- parentPath_ = getDefaultInstance().getParentPath();
- onChanged();
+ public Builder setMapEntries(
+ int index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry.Builder builderForValue) {
+ if (mapEntriesBuilder_ == null) {
+ ensureMapEntriesIsMutable();
+ mapEntries_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ mapEntriesBuilder_.setMessage(index, builderForValue.build());
+ }
return this;
}
/**
- * <code>required string parentPath = 1;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
*/
- public Builder setParentPathBytes(
- com.google.protobuf.ByteString value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000001;
- parentPath_ = value;
- onChanged();
+ public Builder addMapEntries(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry value) {
+ if (mapEntriesBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureMapEntriesIsMutable();
+ mapEntries_.add(value);
+ onChanged();
+ } else {
+ mapEntriesBuilder_.addMessage(value);
+ }
return this;
}
-
- // optional .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_;
/**
- * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
*/
- public boolean hasNormalizedNode() {
- return ((bitField0_ & 0x00000002) == 0x00000002);
+ public Builder addMapEntries(
+ int index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry value) {
+ if (mapEntriesBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureMapEntriesIsMutable();
+ mapEntries_.add(index, value);
+ onChanged();
+ } else {
+ mapEntriesBuilder_.addMessage(index, value);
+ }
+ return this;
}
/**
- * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
*/
- public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getNormalizedNode() {
- if (normalizedNodeBuilder_ == null) {
- return normalizedNode_;
+ public Builder addMapEntries(
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry.Builder builderForValue) {
+ if (mapEntriesBuilder_ == null) {
+ ensureMapEntriesIsMutable();
+ mapEntries_.add(builderForValue.build());
+ onChanged();
} else {
- return normalizedNodeBuilder_.getMessage();
+ mapEntriesBuilder_.addMessage(builderForValue.build());
}
+ return this;
}
/**
- * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
*/
- public Builder setNormalizedNode(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node value) {
- if (normalizedNodeBuilder_ == null) {
- if (value == null) {
- throw new NullPointerException();
- }
- normalizedNode_ = value;
+ public Builder addMapEntries(
+ int index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry.Builder builderForValue) {
+ if (mapEntriesBuilder_ == null) {
+ ensureMapEntriesIsMutable();
+ mapEntries_.add(index, builderForValue.build());
onChanged();
} else {
- normalizedNodeBuilder_.setMessage(value);
+ mapEntriesBuilder_.addMessage(index, builderForValue.build());
}
- bitField0_ |= 0x00000002;
return this;
}
/**
- * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
*/
- public Builder setNormalizedNode(
- org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder builderForValue) {
- if (normalizedNodeBuilder_ == null) {
- normalizedNode_ = builderForValue.build();
+ public Builder addAllMapEntries(
+ java.lang.Iterable<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry> values) {
+ if (mapEntriesBuilder_ == null) {
+ ensureMapEntriesIsMutable();
+ super.addAll(values, mapEntries_);
onChanged();
} else {
- normalizedNodeBuilder_.setMessage(builderForValue.build());
+ mapEntriesBuilder_.addAllMessages(values);
}
- bitField0_ |= 0x00000002;
return this;
}
/**
- * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
*/
- 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;
- }
+ public Builder clearMapEntries() {
+ if (mapEntriesBuilder_ == null) {
+ mapEntries_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
- normalizedNodeBuilder_.mergeFrom(value);
+ mapEntriesBuilder_.clear();
}
- bitField0_ |= 0x00000002;
return this;
}
/**
- * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
*/
- public Builder clearNormalizedNode() {
- if (normalizedNodeBuilder_ == null) {
- normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance();
+ public Builder removeMapEntries(int index) {
+ if (mapEntriesBuilder_ == null) {
+ ensureMapEntriesIsMutable();
+ mapEntries_.remove(index);
onChanged();
} else {
- normalizedNodeBuilder_.clear();
+ mapEntriesBuilder_.remove(index);
}
- bitField0_ = (bitField0_ & ~0x00000002);
return this;
}
/**
- * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
*/
- public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder getNormalizedNodeBuilder() {
- bitField0_ |= 0x00000002;
- onChanged();
- return getNormalizedNodeFieldBuilder().getBuilder();
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry.Builder getMapEntriesBuilder(
+ int index) {
+ return getMapEntriesFieldBuilder().getBuilder(index);
}
/**
- * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
*/
- public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getNormalizedNodeOrBuilder() {
- if (normalizedNodeBuilder_ != null) {
- return normalizedNodeBuilder_.getMessageOrBuilder();
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntryOrBuilder getMapEntriesOrBuilder(
+ int index) {
+ if (mapEntriesBuilder_ == null) {
+ return mapEntries_.get(index); } else {
+ return mapEntriesBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
+ */
+ public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntryOrBuilder>
+ getMapEntriesOrBuilderList() {
+ if (mapEntriesBuilder_ != null) {
+ return mapEntriesBuilder_.getMessageOrBuilderList();
} else {
- return normalizedNode_;
+ return java.util.Collections.unmodifiableList(mapEntries_);
}
}
/**
- * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
*/
- 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_,
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry.Builder addMapEntriesBuilder() {
+ return getMapEntriesFieldBuilder().addBuilder(
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry.getDefaultInstance());
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry.Builder addMapEntriesBuilder(
+ int index) {
+ return getMapEntriesFieldBuilder().addBuilder(
+ index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry.getDefaultInstance());
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
+ */
+ public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry.Builder>
+ getMapEntriesBuilderList() {
+ return getMapEntriesFieldBuilder().getBuilderList();
+ }
+ private com.google.protobuf.RepeatedFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntryOrBuilder>
+ getMapEntriesFieldBuilder() {
+ if (mapEntriesBuilder_ == null) {
+ mapEntriesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntryOrBuilder>(
+ mapEntries_,
+ ((bitField0_ & 0x00000001) == 0x00000001),
getParentForChildren(),
isClean());
- normalizedNode_ = null;
+ mapEntries_ = null;
}
- return normalizedNodeBuilder_;
+ return mapEntriesBuilder_;
}
- // @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.Container)
+ // @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.NodeMap)
}
static {
- defaultInstance = new Container(true);
+ defaultInstance = new NodeMap(true);
defaultInstance.initFields();
}
- // @@protoc_insertion_point(class_scope:org.opendaylight.controller.mdsal.Container)
+ // @@protoc_insertion_point(class_scope:org.opendaylight.controller.mdsal.NodeMap)
}
private static com.google.protobuf.Descriptors.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_QName_descriptor;
+ private static
+ com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internal_static_org_opendaylight_controller_mdsal_QName_fieldAccessorTable;
+ private static com.google.protobuf.Descriptors.Descriptor
+ internal_static_org_opendaylight_controller_mdsal_PathArgument_descriptor;
+ private static
+ com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internal_static_org_opendaylight_controller_mdsal_PathArgument_fieldAccessorTable;
+ private static com.google.protobuf.Descriptors.Descriptor
+ internal_static_org_opendaylight_controller_mdsal_InstanceIdentifier_descriptor;
+ private static
+ com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internal_static_org_opendaylight_controller_mdsal_InstanceIdentifier_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_org_opendaylight_controller_mdsal_Node_descriptor;
private static
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_org_opendaylight_controller_mdsal_Container_fieldAccessorTable;
+ private static com.google.protobuf.Descriptors.Descriptor
+ internal_static_org_opendaylight_controller_mdsal_NodeMapEntry_descriptor;
+ private static
+ com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internal_static_org_opendaylight_controller_mdsal_NodeMapEntry_fieldAccessorTable;
+ private static com.google.protobuf.Descriptors.Descriptor
+ internal_static_org_opendaylight_controller_mdsal_NodeMap_descriptor;
+ private static
+ com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internal_static_org_opendaylight_controller_mdsal_NodeMap_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
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 \001" +
- "(\0132\'.org.opendaylight.controller.mdsal.N" +
- "odeBO\n5org.opendaylight.controller.proto",
- "buff.messages.commonB\026NormalizedNodeMess" +
- "ages"
+ "ler.mdsal\"6\n\tAttribute\022\014\n\004name\030\001 \002(\t\022\r\n\005" +
+ "value\030\002 \001(\t\022\014\n\004type\030\003 \001(\t\"\026\n\005QName\022\r\n\005va" +
+ "lue\030\001 \002(\t\"\251\001\n\014PathArgument\022\r\n\005value\030\001 \002(" +
+ "\t\022\014\n\004type\030\002 \001(\t\022:\n\010nodeType\030\003 \001(\0132(.org." +
+ "opendaylight.controller.mdsal.QName\022@\n\na" +
+ "ttributes\030\004 \003(\0132,.org.opendaylight.contr" +
+ "oller.mdsal.Attribute\"X\n\022InstanceIdentif" +
+ "ier\022B\n\targuments\030\001 \003(\0132/.org.opendayligh" +
+ "t.controller.mdsal.PathArgument\"\251\002\n\004Node",
+ "\022\014\n\004path\030\001 \001(\t\022\014\n\004type\030\002 \001(\t\022@\n\nattribut" +
+ "es\030\003 \003(\0132,.org.opendaylight.controller.m" +
+ "dsal.Attribute\0226\n\005child\030\004 \003(\0132\'.org.open" +
+ "daylight.controller.mdsal.Node\022\r\n\005value\030" +
+ "\005 \001(\t\022\021\n\tvalueType\030\006 \001(\t\022\021\n\tbitsValue\030\007 " +
+ "\003(\t\022V\n\027instanceIdentifierValue\030\010 \001(\01325.o" +
+ "rg.opendaylight.controller.mdsal.Instanc" +
+ "eIdentifier\"`\n\tContainer\022\022\n\nparentPath\030\001" +
+ " \002(\t\022?\n\016normalizedNode\030\002 \001(\0132\'.org.opend" +
+ "aylight.controller.mdsal.Node\"\246\001\n\014NodeMa",
+ "pEntry\022U\n\026instanceIdentifierPath\030\001 \002(\01325" +
+ ".org.opendaylight.controller.mdsal.Insta" +
+ "nceIdentifier\022?\n\016normalizedNode\030\002 \001(\0132\'." +
+ "org.opendaylight.controller.mdsal.Node\"N" +
+ "\n\007NodeMap\022C\n\nmapEntries\030\001 \003(\0132/.org.open" +
+ "daylight.controller.mdsal.NodeMapEntryBO" +
+ "\n5org.opendaylight.controller.protobuff." +
+ "messages.commonB\026NormalizedNodeMessages"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
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 =
+ new java.lang.String[] { "Name", "Value", "Type", });
+ internal_static_org_opendaylight_controller_mdsal_QName_descriptor =
getDescriptor().getMessageTypes().get(1);
+ internal_static_org_opendaylight_controller_mdsal_QName_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessage.FieldAccessorTable(
+ internal_static_org_opendaylight_controller_mdsal_QName_descriptor,
+ new java.lang.String[] { "Value", });
+ internal_static_org_opendaylight_controller_mdsal_PathArgument_descriptor =
+ getDescriptor().getMessageTypes().get(2);
+ internal_static_org_opendaylight_controller_mdsal_PathArgument_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessage.FieldAccessorTable(
+ internal_static_org_opendaylight_controller_mdsal_PathArgument_descriptor,
+ new java.lang.String[] { "Value", "Type", "NodeType", "Attributes", });
+ internal_static_org_opendaylight_controller_mdsal_InstanceIdentifier_descriptor =
+ getDescriptor().getMessageTypes().get(3);
+ internal_static_org_opendaylight_controller_mdsal_InstanceIdentifier_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessage.FieldAccessorTable(
+ internal_static_org_opendaylight_controller_mdsal_InstanceIdentifier_descriptor,
+ new java.lang.String[] { "Arguments", });
+ internal_static_org_opendaylight_controller_mdsal_Node_descriptor =
+ getDescriptor().getMessageTypes().get(4);
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", });
+ new java.lang.String[] { "Path", "Type", "Attributes", "Child", "Value", "ValueType", "BitsValue", "InstanceIdentifierValue", });
internal_static_org_opendaylight_controller_mdsal_Container_descriptor =
- getDescriptor().getMessageTypes().get(2);
+ getDescriptor().getMessageTypes().get(5);
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", });
+ internal_static_org_opendaylight_controller_mdsal_NodeMapEntry_descriptor =
+ getDescriptor().getMessageTypes().get(6);
+ internal_static_org_opendaylight_controller_mdsal_NodeMapEntry_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessage.FieldAccessorTable(
+ internal_static_org_opendaylight_controller_mdsal_NodeMapEntry_descriptor,
+ new java.lang.String[] { "InstanceIdentifierPath", "NormalizedNode", });
+ internal_static_org_opendaylight_controller_mdsal_NodeMap_descriptor =
+ getDescriptor().getMessageTypes().get(7);
+ internal_static_org_opendaylight_controller_mdsal_NodeMap_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessage.FieldAccessorTable(
+ internal_static_org_opendaylight_controller_mdsal_NodeMap_descriptor,
+ new java.lang.String[] { "MapEntries", });
return null;
}
};
public interface DataChangedOrBuilder
extends com.google.protobuf.MessageOrBuilder {
- // repeated string instanceIdentifierPathArguments = 1;
+ // optional .org.opendaylight.controller.mdsal.Node originalSubTree = 1;
/**
- * <code>repeated string instanceIdentifierPathArguments = 1;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node originalSubTree = 1;</code>
*/
- java.util.List<java.lang.String>
- getInstanceIdentifierPathArgumentsList();
+ boolean hasOriginalSubTree();
/**
- * <code>repeated string instanceIdentifierPathArguments = 1;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node originalSubTree = 1;</code>
*/
- int getInstanceIdentifierPathArgumentsCount();
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getOriginalSubTree();
/**
- * <code>repeated string instanceIdentifierPathArguments = 1;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node originalSubTree = 1;</code>
*/
- java.lang.String getInstanceIdentifierPathArguments(int index);
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getOriginalSubTreeOrBuilder();
+
+ // optional .org.opendaylight.controller.mdsal.Node updatedSubTree = 2;
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.Node updatedSubTree = 2;</code>
+ */
+ boolean hasUpdatedSubTree();
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.Node updatedSubTree = 2;</code>
+ */
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getUpdatedSubTree();
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.Node updatedSubTree = 2;</code>
+ */
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getUpdatedSubTreeOrBuilder();
+
+ // optional .org.opendaylight.controller.mdsal.NodeMap originalData = 3;
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap originalData = 3;</code>
+ */
+ boolean hasOriginalData();
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap originalData = 3;</code>
+ */
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap getOriginalData();
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap originalData = 3;</code>
+ */
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapOrBuilder getOriginalDataOrBuilder();
+
+ // optional .org.opendaylight.controller.mdsal.NodeMap updatedData = 4;
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap updatedData = 4;</code>
+ */
+ boolean hasUpdatedData();
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap updatedData = 4;</code>
+ */
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap getUpdatedData();
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap updatedData = 4;</code>
+ */
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapOrBuilder getUpdatedDataOrBuilder();
+
+ // optional .org.opendaylight.controller.mdsal.NodeMap createdData = 5;
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap createdData = 5;</code>
+ */
+ boolean hasCreatedData();
/**
- * <code>repeated string instanceIdentifierPathArguments = 1;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap createdData = 5;</code>
*/
- com.google.protobuf.ByteString
- getInstanceIdentifierPathArgumentsBytes(int index);
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap getCreatedData();
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap createdData = 5;</code>
+ */
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapOrBuilder getCreatedDataOrBuilder();
- // required .org.opendaylight.controller.mdsal.Node normalizedNode = 2;
+ // repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
+ */
+ java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier>
+ getRemovedPathsList();
/**
- * <code>required .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
*/
- boolean hasNormalizedNode();
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getRemovedPaths(int index);
/**
- * <code>required .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
*/
- org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getNormalizedNode();
+ int getRemovedPathsCount();
/**
- * <code>required .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
*/
- org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getNormalizedNodeOrBuilder();
+ java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>
+ getRemovedPathsOrBuilderList();
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
+ */
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getRemovedPathsOrBuilder(
+ int index);
}
/**
* Protobuf type {@code org.opendaylight.controller.mdsal.DataChanged}
break;
}
case 10: {
- if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
- instanceIdentifierPathArguments_ = new com.google.protobuf.LazyStringArrayList();
- mutable_bitField0_ |= 0x00000001;
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ subBuilder = originalSubTree_.toBuilder();
}
- instanceIdentifierPathArguments_.add(input.readBytes());
+ originalSubTree_ = input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(originalSubTree_);
+ originalSubTree_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000001;
break;
}
case 18: {
org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder subBuilder = null;
- if (((bitField0_ & 0x00000001) == 0x00000001)) {
- subBuilder = normalizedNode_.toBuilder();
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ subBuilder = updatedSubTree_.toBuilder();
}
- normalizedNode_ = input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.PARSER, extensionRegistry);
+ updatedSubTree_ = input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.PARSER, extensionRegistry);
if (subBuilder != null) {
- subBuilder.mergeFrom(normalizedNode_);
- normalizedNode_ = subBuilder.buildPartial();
+ subBuilder.mergeFrom(updatedSubTree_);
+ updatedSubTree_ = subBuilder.buildPartial();
}
- bitField0_ |= 0x00000001;
+ bitField0_ |= 0x00000002;
+ break;
+ }
+ case 26: {
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ subBuilder = originalData_.toBuilder();
+ }
+ originalData_ = input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(originalData_);
+ originalData_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000004;
+ break;
+ }
+ case 34: {
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000008) == 0x00000008)) {
+ subBuilder = updatedData_.toBuilder();
+ }
+ updatedData_ = input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(updatedData_);
+ updatedData_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000008;
+ break;
+ }
+ case 42: {
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ subBuilder = createdData_.toBuilder();
+ }
+ createdData_ = input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(createdData_);
+ createdData_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000010;
+ break;
+ }
+ case 50: {
+ if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
+ removedPaths_ = new java.util.ArrayList<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier>();
+ mutable_bitField0_ |= 0x00000020;
+ }
+ removedPaths_.add(input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.PARSER, extensionRegistry));
break;
}
}
throw new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this);
} finally {
- if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
- instanceIdentifierPathArguments_ = new com.google.protobuf.UnmodifiableLazyStringList(instanceIdentifierPathArguments_);
+ if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
+ removedPaths_ = java.util.Collections.unmodifiableList(removedPaths_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
private int bitField0_;
- // repeated string instanceIdentifierPathArguments = 1;
- public static final int INSTANCEIDENTIFIERPATHARGUMENTS_FIELD_NUMBER = 1;
- private com.google.protobuf.LazyStringList instanceIdentifierPathArguments_;
+ // optional .org.opendaylight.controller.mdsal.Node originalSubTree = 1;
+ public static final int ORIGINALSUBTREE_FIELD_NUMBER = 1;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node originalSubTree_;
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.Node originalSubTree = 1;</code>
+ */
+ public boolean hasOriginalSubTree() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.Node originalSubTree = 1;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getOriginalSubTree() {
+ return originalSubTree_;
+ }
/**
- * <code>repeated string instanceIdentifierPathArguments = 1;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node originalSubTree = 1;</code>
*/
- public java.util.List<java.lang.String>
- getInstanceIdentifierPathArgumentsList() {
- return instanceIdentifierPathArguments_;
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getOriginalSubTreeOrBuilder() {
+ return originalSubTree_;
}
+
+ // optional .org.opendaylight.controller.mdsal.Node updatedSubTree = 2;
+ public static final int UPDATEDSUBTREE_FIELD_NUMBER = 2;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node updatedSubTree_;
/**
- * <code>repeated string instanceIdentifierPathArguments = 1;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node updatedSubTree = 2;</code>
*/
- public int getInstanceIdentifierPathArgumentsCount() {
- return instanceIdentifierPathArguments_.size();
+ public boolean hasUpdatedSubTree() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
- * <code>repeated string instanceIdentifierPathArguments = 1;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node updatedSubTree = 2;</code>
*/
- public java.lang.String getInstanceIdentifierPathArguments(int index) {
- return instanceIdentifierPathArguments_.get(index);
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getUpdatedSubTree() {
+ return updatedSubTree_;
}
/**
- * <code>repeated string instanceIdentifierPathArguments = 1;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node updatedSubTree = 2;</code>
*/
- public com.google.protobuf.ByteString
- getInstanceIdentifierPathArgumentsBytes(int index) {
- return instanceIdentifierPathArguments_.getByteString(index);
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getUpdatedSubTreeOrBuilder() {
+ return updatedSubTree_;
}
- // 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_;
+ // optional .org.opendaylight.controller.mdsal.NodeMap originalData = 3;
+ public static final int ORIGINALDATA_FIELD_NUMBER = 3;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap originalData_;
/**
- * <code>required .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap originalData = 3;</code>
*/
- public boolean hasNormalizedNode() {
- return ((bitField0_ & 0x00000001) == 0x00000001);
+ public boolean hasOriginalData() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
- * <code>required .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap originalData = 3;</code>
*/
- public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getNormalizedNode() {
- return normalizedNode_;
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap getOriginalData() {
+ return originalData_;
}
/**
- * <code>required .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap originalData = 3;</code>
*/
- public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getNormalizedNodeOrBuilder() {
- return normalizedNode_;
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapOrBuilder getOriginalDataOrBuilder() {
+ return originalData_;
+ }
+
+ // optional .org.opendaylight.controller.mdsal.NodeMap updatedData = 4;
+ public static final int UPDATEDDATA_FIELD_NUMBER = 4;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap updatedData_;
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap updatedData = 4;</code>
+ */
+ public boolean hasUpdatedData() {
+ return ((bitField0_ & 0x00000008) == 0x00000008);
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap updatedData = 4;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap getUpdatedData() {
+ return updatedData_;
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap updatedData = 4;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapOrBuilder getUpdatedDataOrBuilder() {
+ return updatedData_;
+ }
+
+ // optional .org.opendaylight.controller.mdsal.NodeMap createdData = 5;
+ public static final int CREATEDDATA_FIELD_NUMBER = 5;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap createdData_;
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap createdData = 5;</code>
+ */
+ public boolean hasCreatedData() {
+ return ((bitField0_ & 0x00000010) == 0x00000010);
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap createdData = 5;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap getCreatedData() {
+ return createdData_;
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap createdData = 5;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapOrBuilder getCreatedDataOrBuilder() {
+ return createdData_;
+ }
+
+ // repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;
+ public static final int REMOVEDPATHS_FIELD_NUMBER = 6;
+ private java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier> removedPaths_;
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
+ */
+ public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier> getRemovedPathsList() {
+ return removedPaths_;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
+ */
+ public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>
+ getRemovedPathsOrBuilderList() {
+ return removedPaths_;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
+ */
+ public int getRemovedPathsCount() {
+ return removedPaths_.size();
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getRemovedPaths(int index) {
+ return removedPaths_.get(index);
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getRemovedPathsOrBuilder(
+ int index) {
+ return removedPaths_.get(index);
}
private void initFields() {
- instanceIdentifierPathArguments_ = com.google.protobuf.LazyStringArrayList.EMPTY;
- normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance();
+ originalSubTree_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance();
+ updatedSubTree_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance();
+ originalData_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.getDefaultInstance();
+ updatedData_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.getDefaultInstance();
+ createdData_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.getDefaultInstance();
+ removedPaths_ = java.util.Collections.emptyList();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
- if (!hasNormalizedNode()) {
- memoizedIsInitialized = 0;
- return false;
+ if (hasOriginalSubTree()) {
+ if (!getOriginalSubTree().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ if (hasUpdatedSubTree()) {
+ if (!getUpdatedSubTree().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ if (hasOriginalData()) {
+ if (!getOriginalData().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ if (hasUpdatedData()) {
+ if (!getUpdatedData().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
+ }
+ if (hasCreatedData()) {
+ if (!getCreatedData().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
}
- if (!getNormalizedNode().isInitialized()) {
- memoizedIsInitialized = 0;
- return false;
+ for (int i = 0; i < getRemovedPathsCount(); i++) {
+ if (!getRemovedPaths(i).isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
}
memoizedIsInitialized = 1;
return true;
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
- for (int i = 0; i < instanceIdentifierPathArguments_.size(); i++) {
- output.writeBytes(1, instanceIdentifierPathArguments_.getByteString(i));
- }
if (((bitField0_ & 0x00000001) == 0x00000001)) {
- output.writeMessage(2, normalizedNode_);
+ output.writeMessage(1, originalSubTree_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ output.writeMessage(2, updatedSubTree_);
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ output.writeMessage(3, originalData_);
+ }
+ if (((bitField0_ & 0x00000008) == 0x00000008)) {
+ output.writeMessage(4, updatedData_);
+ }
+ if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ output.writeMessage(5, createdData_);
+ }
+ for (int i = 0; i < removedPaths_.size(); i++) {
+ output.writeMessage(6, removedPaths_.get(i));
}
getUnknownFields().writeTo(output);
}
if (size != -1) return size;
size = 0;
- {
- int dataSize = 0;
- for (int i = 0; i < instanceIdentifierPathArguments_.size(); i++) {
- dataSize += com.google.protobuf.CodedOutputStream
- .computeBytesSizeNoTag(instanceIdentifierPathArguments_.getByteString(i));
- }
- size += dataSize;
- size += 1 * getInstanceIdentifierPathArgumentsList().size();
- }
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
- .computeMessageSize(2, normalizedNode_);
+ .computeMessageSize(1, originalSubTree_);
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(2, updatedSubTree_);
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(3, originalData_);
+ }
+ if (((bitField0_ & 0x00000008) == 0x00000008)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(4, updatedData_);
+ }
+ if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(5, createdData_);
+ }
+ for (int i = 0; i < removedPaths_.size(); i++) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(6, removedPaths_.get(i));
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
- getNormalizedNodeFieldBuilder();
+ getOriginalSubTreeFieldBuilder();
+ getUpdatedSubTreeFieldBuilder();
+ getOriginalDataFieldBuilder();
+ getUpdatedDataFieldBuilder();
+ getCreatedDataFieldBuilder();
+ getRemovedPathsFieldBuilder();
}
}
private static Builder create() {
public Builder clear() {
super.clear();
- instanceIdentifierPathArguments_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ if (originalSubTreeBuilder_ == null) {
+ originalSubTree_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance();
+ } else {
+ originalSubTreeBuilder_.clear();
+ }
bitField0_ = (bitField0_ & ~0x00000001);
- if (normalizedNodeBuilder_ == null) {
- normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance();
+ if (updatedSubTreeBuilder_ == null) {
+ updatedSubTree_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance();
} else {
- normalizedNodeBuilder_.clear();
+ updatedSubTreeBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000002);
+ if (originalDataBuilder_ == null) {
+ originalData_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.getDefaultInstance();
+ } else {
+ originalDataBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000004);
+ if (updatedDataBuilder_ == null) {
+ updatedData_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.getDefaultInstance();
+ } else {
+ updatedDataBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000008);
+ if (createdDataBuilder_ == null) {
+ createdData_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.getDefaultInstance();
+ } else {
+ createdDataBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000010);
+ if (removedPathsBuilder_ == null) {
+ removedPaths_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000020);
+ } else {
+ removedPathsBuilder_.clear();
+ }
return this;
}
org.opendaylight.controller.protobuff.messages.datachange.notification.DataChangeListenerMessages.DataChanged result = new org.opendaylight.controller.protobuff.messages.datachange.notification.DataChangeListenerMessages.DataChanged(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
- if (((bitField0_ & 0x00000001) == 0x00000001)) {
- instanceIdentifierPathArguments_ = new com.google.protobuf.UnmodifiableLazyStringList(
- instanceIdentifierPathArguments_);
- bitField0_ = (bitField0_ & ~0x00000001);
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ if (originalSubTreeBuilder_ == null) {
+ result.originalSubTree_ = originalSubTree_;
+ } else {
+ result.originalSubTree_ = originalSubTreeBuilder_.build();
}
- result.instanceIdentifierPathArguments_ = instanceIdentifierPathArguments_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
- to_bitField0_ |= 0x00000001;
+ to_bitField0_ |= 0x00000002;
+ }
+ if (updatedSubTreeBuilder_ == null) {
+ result.updatedSubTree_ = updatedSubTree_;
+ } else {
+ result.updatedSubTree_ = updatedSubTreeBuilder_.build();
+ }
+ if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
+ to_bitField0_ |= 0x00000004;
+ }
+ if (originalDataBuilder_ == null) {
+ result.originalData_ = originalData_;
+ } else {
+ result.originalData_ = originalDataBuilder_.build();
+ }
+ if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
+ to_bitField0_ |= 0x00000008;
+ }
+ if (updatedDataBuilder_ == null) {
+ result.updatedData_ = updatedData_;
+ } else {
+ result.updatedData_ = updatedDataBuilder_.build();
}
- if (normalizedNodeBuilder_ == null) {
- result.normalizedNode_ = normalizedNode_;
+ if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
+ to_bitField0_ |= 0x00000010;
+ }
+ if (createdDataBuilder_ == null) {
+ result.createdData_ = createdData_;
+ } else {
+ result.createdData_ = createdDataBuilder_.build();
+ }
+ if (removedPathsBuilder_ == null) {
+ if (((bitField0_ & 0x00000020) == 0x00000020)) {
+ removedPaths_ = java.util.Collections.unmodifiableList(removedPaths_);
+ bitField0_ = (bitField0_ & ~0x00000020);
+ }
+ result.removedPaths_ = removedPaths_;
} else {
- result.normalizedNode_ = normalizedNodeBuilder_.build();
+ result.removedPaths_ = removedPathsBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.datachange.notification.DataChangeListenerMessages.DataChanged other) {
if (other == org.opendaylight.controller.protobuff.messages.datachange.notification.DataChangeListenerMessages.DataChanged.getDefaultInstance()) return this;
- if (!other.instanceIdentifierPathArguments_.isEmpty()) {
- if (instanceIdentifierPathArguments_.isEmpty()) {
- instanceIdentifierPathArguments_ = other.instanceIdentifierPathArguments_;
- bitField0_ = (bitField0_ & ~0x00000001);
- } else {
- ensureInstanceIdentifierPathArgumentsIsMutable();
- instanceIdentifierPathArguments_.addAll(other.instanceIdentifierPathArguments_);
- }
- onChanged();
+ if (other.hasOriginalSubTree()) {
+ mergeOriginalSubTree(other.getOriginalSubTree());
+ }
+ if (other.hasUpdatedSubTree()) {
+ mergeUpdatedSubTree(other.getUpdatedSubTree());
}
- if (other.hasNormalizedNode()) {
- mergeNormalizedNode(other.getNormalizedNode());
+ if (other.hasOriginalData()) {
+ mergeOriginalData(other.getOriginalData());
+ }
+ if (other.hasUpdatedData()) {
+ mergeUpdatedData(other.getUpdatedData());
+ }
+ if (other.hasCreatedData()) {
+ mergeCreatedData(other.getCreatedData());
+ }
+ if (removedPathsBuilder_ == null) {
+ if (!other.removedPaths_.isEmpty()) {
+ if (removedPaths_.isEmpty()) {
+ removedPaths_ = other.removedPaths_;
+ bitField0_ = (bitField0_ & ~0x00000020);
+ } else {
+ ensureRemovedPathsIsMutable();
+ removedPaths_.addAll(other.removedPaths_);
+ }
+ onChanged();
+ }
+ } else {
+ if (!other.removedPaths_.isEmpty()) {
+ if (removedPathsBuilder_.isEmpty()) {
+ removedPathsBuilder_.dispose();
+ removedPathsBuilder_ = null;
+ removedPaths_ = other.removedPaths_;
+ bitField0_ = (bitField0_ & ~0x00000020);
+ removedPathsBuilder_ =
+ com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
+ getRemovedPathsFieldBuilder() : null;
+ } else {
+ removedPathsBuilder_.addAllMessages(other.removedPaths_);
+ }
+ }
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
- if (!hasNormalizedNode()) {
+ if (hasOriginalSubTree()) {
+ if (!getOriginalSubTree().isInitialized()) {
- return false;
+ return false;
+ }
}
- if (!getNormalizedNode().isInitialized()) {
+ if (hasUpdatedSubTree()) {
+ if (!getUpdatedSubTree().isInitialized()) {
- return false;
+ return false;
+ }
+ }
+ if (hasOriginalData()) {
+ if (!getOriginalData().isInitialized()) {
+
+ return false;
+ }
+ }
+ if (hasUpdatedData()) {
+ if (!getUpdatedData().isInitialized()) {
+
+ return false;
+ }
+ }
+ if (hasCreatedData()) {
+ if (!getCreatedData().isInitialized()) {
+
+ return false;
+ }
+ }
+ for (int i = 0; i < getRemovedPathsCount(); i++) {
+ if (!getRemovedPaths(i).isInitialized()) {
+
+ return false;
+ }
}
return true;
}
}
private int bitField0_;
- // repeated string instanceIdentifierPathArguments = 1;
- private com.google.protobuf.LazyStringList instanceIdentifierPathArguments_ = com.google.protobuf.LazyStringArrayList.EMPTY;
- private void ensureInstanceIdentifierPathArgumentsIsMutable() {
- if (!((bitField0_ & 0x00000001) == 0x00000001)) {
- instanceIdentifierPathArguments_ = new com.google.protobuf.LazyStringArrayList(instanceIdentifierPathArguments_);
- bitField0_ |= 0x00000001;
- }
- }
+ // optional .org.opendaylight.controller.mdsal.Node originalSubTree = 1;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node originalSubTree_ = 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> originalSubTreeBuilder_;
/**
- * <code>repeated string instanceIdentifierPathArguments = 1;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node originalSubTree = 1;</code>
*/
- public java.util.List<java.lang.String>
- getInstanceIdentifierPathArgumentsList() {
- return java.util.Collections.unmodifiableList(instanceIdentifierPathArguments_);
+ public boolean hasOriginalSubTree() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
- * <code>repeated string instanceIdentifierPathArguments = 1;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node originalSubTree = 1;</code>
*/
- public int getInstanceIdentifierPathArgumentsCount() {
- return instanceIdentifierPathArguments_.size();
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getOriginalSubTree() {
+ if (originalSubTreeBuilder_ == null) {
+ return originalSubTree_;
+ } else {
+ return originalSubTreeBuilder_.getMessage();
+ }
}
/**
- * <code>repeated string instanceIdentifierPathArguments = 1;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node originalSubTree = 1;</code>
*/
- public java.lang.String getInstanceIdentifierPathArguments(int index) {
- return instanceIdentifierPathArguments_.get(index);
+ public Builder setOriginalSubTree(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node value) {
+ if (originalSubTreeBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ originalSubTree_ = value;
+ onChanged();
+ } else {
+ originalSubTreeBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
}
/**
- * <code>repeated string instanceIdentifierPathArguments = 1;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node originalSubTree = 1;</code>
*/
- public com.google.protobuf.ByteString
- getInstanceIdentifierPathArgumentsBytes(int index) {
- return instanceIdentifierPathArguments_.getByteString(index);
+ public Builder setOriginalSubTree(
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder builderForValue) {
+ if (originalSubTreeBuilder_ == null) {
+ originalSubTree_ = builderForValue.build();
+ onChanged();
+ } else {
+ originalSubTreeBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000001;
+ return this;
}
/**
- * <code>repeated string instanceIdentifierPathArguments = 1;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node originalSubTree = 1;</code>
*/
- public Builder setInstanceIdentifierPathArguments(
- int index, java.lang.String value) {
- if (value == null) {
- throw new NullPointerException();
- }
- ensureInstanceIdentifierPathArgumentsIsMutable();
- instanceIdentifierPathArguments_.set(index, value);
- onChanged();
+ public Builder mergeOriginalSubTree(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node value) {
+ if (originalSubTreeBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) == 0x00000001) &&
+ originalSubTree_ != org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance()) {
+ originalSubTree_ =
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.newBuilder(originalSubTree_).mergeFrom(value).buildPartial();
+ } else {
+ originalSubTree_ = value;
+ }
+ onChanged();
+ } else {
+ originalSubTreeBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000001;
return this;
}
/**
- * <code>repeated string instanceIdentifierPathArguments = 1;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node originalSubTree = 1;</code>
*/
- public Builder addInstanceIdentifierPathArguments(
- java.lang.String value) {
- if (value == null) {
- throw new NullPointerException();
- }
- ensureInstanceIdentifierPathArgumentsIsMutable();
- instanceIdentifierPathArguments_.add(value);
- onChanged();
+ public Builder clearOriginalSubTree() {
+ if (originalSubTreeBuilder_ == null) {
+ originalSubTree_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance();
+ onChanged();
+ } else {
+ originalSubTreeBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
/**
- * <code>repeated string instanceIdentifierPathArguments = 1;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node originalSubTree = 1;</code>
*/
- public Builder addAllInstanceIdentifierPathArguments(
- java.lang.Iterable<java.lang.String> values) {
- ensureInstanceIdentifierPathArgumentsIsMutable();
- super.addAll(values, instanceIdentifierPathArguments_);
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder getOriginalSubTreeBuilder() {
+ bitField0_ |= 0x00000001;
onChanged();
- return this;
+ return getOriginalSubTreeFieldBuilder().getBuilder();
}
/**
- * <code>repeated string instanceIdentifierPathArguments = 1;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node originalSubTree = 1;</code>
*/
- public Builder clearInstanceIdentifierPathArguments() {
- instanceIdentifierPathArguments_ = com.google.protobuf.LazyStringArrayList.EMPTY;
- bitField0_ = (bitField0_ & ~0x00000001);
- onChanged();
- return this;
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getOriginalSubTreeOrBuilder() {
+ if (originalSubTreeBuilder_ != null) {
+ return originalSubTreeBuilder_.getMessageOrBuilder();
+ } else {
+ return originalSubTree_;
+ }
}
/**
- * <code>repeated string instanceIdentifierPathArguments = 1;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node originalSubTree = 1;</code>
*/
- public Builder addInstanceIdentifierPathArgumentsBytes(
- com.google.protobuf.ByteString value) {
- if (value == null) {
- throw new NullPointerException();
- }
- ensureInstanceIdentifierPathArgumentsIsMutable();
- instanceIdentifierPathArguments_.add(value);
- onChanged();
- return this;
+ 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>
+ getOriginalSubTreeFieldBuilder() {
+ if (originalSubTreeBuilder_ == null) {
+ originalSubTreeBuilder_ = 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>(
+ originalSubTree_,
+ getParentForChildren(),
+ isClean());
+ originalSubTree_ = null;
+ }
+ return originalSubTreeBuilder_;
}
- // 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();
+ // optional .org.opendaylight.controller.mdsal.Node updatedSubTree = 2;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node updatedSubTree_ = 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_;
+ 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> updatedSubTreeBuilder_;
/**
- * <code>required .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node updatedSubTree = 2;</code>
*/
- public boolean hasNormalizedNode() {
+ public boolean hasUpdatedSubTree() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
- * <code>required .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node updatedSubTree = 2;</code>
*/
- public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getNormalizedNode() {
- if (normalizedNodeBuilder_ == null) {
- return normalizedNode_;
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node getUpdatedSubTree() {
+ if (updatedSubTreeBuilder_ == null) {
+ return updatedSubTree_;
} else {
- return normalizedNodeBuilder_.getMessage();
+ return updatedSubTreeBuilder_.getMessage();
}
}
/**
- * <code>required .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node updatedSubTree = 2;</code>
*/
- public Builder setNormalizedNode(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node value) {
- if (normalizedNodeBuilder_ == null) {
+ public Builder setUpdatedSubTree(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node value) {
+ if (updatedSubTreeBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
- normalizedNode_ = value;
+ updatedSubTree_ = value;
onChanged();
} else {
- normalizedNodeBuilder_.setMessage(value);
+ updatedSubTreeBuilder_.setMessage(value);
}
bitField0_ |= 0x00000002;
return this;
}
/**
- * <code>required .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node updatedSubTree = 2;</code>
*/
- public Builder setNormalizedNode(
+ public Builder setUpdatedSubTree(
org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder builderForValue) {
- if (normalizedNodeBuilder_ == null) {
- normalizedNode_ = builderForValue.build();
+ if (updatedSubTreeBuilder_ == null) {
+ updatedSubTree_ = builderForValue.build();
onChanged();
} else {
- normalizedNodeBuilder_.setMessage(builderForValue.build());
+ updatedSubTreeBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000002;
return this;
}
/**
- * <code>required .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node updatedSubTree = 2;</code>
*/
- public Builder mergeNormalizedNode(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node value) {
- if (normalizedNodeBuilder_ == null) {
+ public Builder mergeUpdatedSubTree(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node value) {
+ if (updatedSubTreeBuilder_ == 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();
+ updatedSubTree_ != org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance()) {
+ updatedSubTree_ =
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.newBuilder(updatedSubTree_).mergeFrom(value).buildPartial();
} else {
- normalizedNode_ = value;
+ updatedSubTree_ = value;
}
onChanged();
} else {
- normalizedNodeBuilder_.mergeFrom(value);
+ updatedSubTreeBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000002;
return this;
}
/**
- * <code>required .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node updatedSubTree = 2;</code>
*/
- public Builder clearNormalizedNode() {
- if (normalizedNodeBuilder_ == null) {
- normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance();
+ public Builder clearUpdatedSubTree() {
+ if (updatedSubTreeBuilder_ == null) {
+ updatedSubTree_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance();
onChanged();
} else {
- normalizedNodeBuilder_.clear();
+ updatedSubTreeBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000002);
return this;
}
/**
- * <code>required .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node updatedSubTree = 2;</code>
*/
- public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder getNormalizedNodeBuilder() {
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder getUpdatedSubTreeBuilder() {
bitField0_ |= 0x00000002;
onChanged();
- return getNormalizedNodeFieldBuilder().getBuilder();
+ return getUpdatedSubTreeFieldBuilder().getBuilder();
}
/**
- * <code>required .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node updatedSubTree = 2;</code>
*/
- public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getNormalizedNodeOrBuilder() {
- if (normalizedNodeBuilder_ != null) {
- return normalizedNodeBuilder_.getMessageOrBuilder();
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder getUpdatedSubTreeOrBuilder() {
+ if (updatedSubTreeBuilder_ != null) {
+ return updatedSubTreeBuilder_.getMessageOrBuilder();
} else {
- return normalizedNode_;
+ return updatedSubTree_;
}
}
/**
- * <code>required .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
+ * <code>optional .org.opendaylight.controller.mdsal.Node updatedSubTree = 2;</code>
*/
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<
+ getUpdatedSubTreeFieldBuilder() {
+ if (updatedSubTreeBuilder_ == null) {
+ updatedSubTreeBuilder_ = 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_,
+ updatedSubTree_,
+ getParentForChildren(),
+ isClean());
+ updatedSubTree_ = null;
+ }
+ return updatedSubTreeBuilder_;
+ }
+
+ // optional .org.opendaylight.controller.mdsal.NodeMap originalData = 3;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap originalData_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapOrBuilder> originalDataBuilder_;
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap originalData = 3;</code>
+ */
+ public boolean hasOriginalData() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap originalData = 3;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap getOriginalData() {
+ if (originalDataBuilder_ == null) {
+ return originalData_;
+ } else {
+ return originalDataBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap originalData = 3;</code>
+ */
+ public Builder setOriginalData(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap value) {
+ if (originalDataBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ originalData_ = value;
+ onChanged();
+ } else {
+ originalDataBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap originalData = 3;</code>
+ */
+ public Builder setOriginalData(
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.Builder builderForValue) {
+ if (originalDataBuilder_ == null) {
+ originalData_ = builderForValue.build();
+ onChanged();
+ } else {
+ originalDataBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap originalData = 3;</code>
+ */
+ public Builder mergeOriginalData(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap value) {
+ if (originalDataBuilder_ == null) {
+ if (((bitField0_ & 0x00000004) == 0x00000004) &&
+ originalData_ != org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.getDefaultInstance()) {
+ originalData_ =
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.newBuilder(originalData_).mergeFrom(value).buildPartial();
+ } else {
+ originalData_ = value;
+ }
+ onChanged();
+ } else {
+ originalDataBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000004;
+ return this;
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap originalData = 3;</code>
+ */
+ public Builder clearOriginalData() {
+ if (originalDataBuilder_ == null) {
+ originalData_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.getDefaultInstance();
+ onChanged();
+ } else {
+ originalDataBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000004);
+ return this;
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap originalData = 3;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.Builder getOriginalDataBuilder() {
+ bitField0_ |= 0x00000004;
+ onChanged();
+ return getOriginalDataFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap originalData = 3;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapOrBuilder getOriginalDataOrBuilder() {
+ if (originalDataBuilder_ != null) {
+ return originalDataBuilder_.getMessageOrBuilder();
+ } else {
+ return originalData_;
+ }
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap originalData = 3;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapOrBuilder>
+ getOriginalDataFieldBuilder() {
+ if (originalDataBuilder_ == null) {
+ originalDataBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapOrBuilder>(
+ originalData_,
+ getParentForChildren(),
+ isClean());
+ originalData_ = null;
+ }
+ return originalDataBuilder_;
+ }
+
+ // optional .org.opendaylight.controller.mdsal.NodeMap updatedData = 4;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap updatedData_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapOrBuilder> updatedDataBuilder_;
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap updatedData = 4;</code>
+ */
+ public boolean hasUpdatedData() {
+ return ((bitField0_ & 0x00000008) == 0x00000008);
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap updatedData = 4;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap getUpdatedData() {
+ if (updatedDataBuilder_ == null) {
+ return updatedData_;
+ } else {
+ return updatedDataBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap updatedData = 4;</code>
+ */
+ public Builder setUpdatedData(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap value) {
+ if (updatedDataBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ updatedData_ = value;
+ onChanged();
+ } else {
+ updatedDataBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000008;
+ return this;
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap updatedData = 4;</code>
+ */
+ public Builder setUpdatedData(
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.Builder builderForValue) {
+ if (updatedDataBuilder_ == null) {
+ updatedData_ = builderForValue.build();
+ onChanged();
+ } else {
+ updatedDataBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000008;
+ return this;
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap updatedData = 4;</code>
+ */
+ public Builder mergeUpdatedData(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap value) {
+ if (updatedDataBuilder_ == null) {
+ if (((bitField0_ & 0x00000008) == 0x00000008) &&
+ updatedData_ != org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.getDefaultInstance()) {
+ updatedData_ =
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.newBuilder(updatedData_).mergeFrom(value).buildPartial();
+ } else {
+ updatedData_ = value;
+ }
+ onChanged();
+ } else {
+ updatedDataBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000008;
+ return this;
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap updatedData = 4;</code>
+ */
+ public Builder clearUpdatedData() {
+ if (updatedDataBuilder_ == null) {
+ updatedData_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.getDefaultInstance();
+ onChanged();
+ } else {
+ updatedDataBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000008);
+ return this;
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap updatedData = 4;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.Builder getUpdatedDataBuilder() {
+ bitField0_ |= 0x00000008;
+ onChanged();
+ return getUpdatedDataFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap updatedData = 4;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapOrBuilder getUpdatedDataOrBuilder() {
+ if (updatedDataBuilder_ != null) {
+ return updatedDataBuilder_.getMessageOrBuilder();
+ } else {
+ return updatedData_;
+ }
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap updatedData = 4;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapOrBuilder>
+ getUpdatedDataFieldBuilder() {
+ if (updatedDataBuilder_ == null) {
+ updatedDataBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapOrBuilder>(
+ updatedData_,
+ getParentForChildren(),
+ isClean());
+ updatedData_ = null;
+ }
+ return updatedDataBuilder_;
+ }
+
+ // optional .org.opendaylight.controller.mdsal.NodeMap createdData = 5;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap createdData_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapOrBuilder> createdDataBuilder_;
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap createdData = 5;</code>
+ */
+ public boolean hasCreatedData() {
+ return ((bitField0_ & 0x00000010) == 0x00000010);
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap createdData = 5;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap getCreatedData() {
+ if (createdDataBuilder_ == null) {
+ return createdData_;
+ } else {
+ return createdDataBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap createdData = 5;</code>
+ */
+ public Builder setCreatedData(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap value) {
+ if (createdDataBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ createdData_ = value;
+ onChanged();
+ } else {
+ createdDataBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000010;
+ return this;
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap createdData = 5;</code>
+ */
+ public Builder setCreatedData(
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.Builder builderForValue) {
+ if (createdDataBuilder_ == null) {
+ createdData_ = builderForValue.build();
+ onChanged();
+ } else {
+ createdDataBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000010;
+ return this;
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap createdData = 5;</code>
+ */
+ public Builder mergeCreatedData(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap value) {
+ if (createdDataBuilder_ == null) {
+ if (((bitField0_ & 0x00000010) == 0x00000010) &&
+ createdData_ != org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.getDefaultInstance()) {
+ createdData_ =
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.newBuilder(createdData_).mergeFrom(value).buildPartial();
+ } else {
+ createdData_ = value;
+ }
+ onChanged();
+ } else {
+ createdDataBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000010;
+ return this;
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap createdData = 5;</code>
+ */
+ public Builder clearCreatedData() {
+ if (createdDataBuilder_ == null) {
+ createdData_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.getDefaultInstance();
+ onChanged();
+ } else {
+ createdDataBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000010);
+ return this;
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap createdData = 5;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.Builder getCreatedDataBuilder() {
+ bitField0_ |= 0x00000010;
+ onChanged();
+ return getCreatedDataFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap createdData = 5;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapOrBuilder getCreatedDataOrBuilder() {
+ if (createdDataBuilder_ != null) {
+ return createdDataBuilder_.getMessageOrBuilder();
+ } else {
+ return createdData_;
+ }
+ }
+ /**
+ * <code>optional .org.opendaylight.controller.mdsal.NodeMap createdData = 5;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapOrBuilder>
+ getCreatedDataFieldBuilder() {
+ if (createdDataBuilder_ == null) {
+ createdDataBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapOrBuilder>(
+ createdData_,
+ getParentForChildren(),
+ isClean());
+ createdData_ = null;
+ }
+ return createdDataBuilder_;
+ }
+
+ // repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;
+ private java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier> removedPaths_ =
+ java.util.Collections.emptyList();
+ private void ensureRemovedPathsIsMutable() {
+ if (!((bitField0_ & 0x00000020) == 0x00000020)) {
+ removedPaths_ = new java.util.ArrayList<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier>(removedPaths_);
+ bitField0_ |= 0x00000020;
+ }
+ }
+
+ private com.google.protobuf.RepeatedFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder> removedPathsBuilder_;
+
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
+ */
+ public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier> getRemovedPathsList() {
+ if (removedPathsBuilder_ == null) {
+ return java.util.Collections.unmodifiableList(removedPaths_);
+ } else {
+ return removedPathsBuilder_.getMessageList();
+ }
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
+ */
+ public int getRemovedPathsCount() {
+ if (removedPathsBuilder_ == null) {
+ return removedPaths_.size();
+ } else {
+ return removedPathsBuilder_.getCount();
+ }
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getRemovedPaths(int index) {
+ if (removedPathsBuilder_ == null) {
+ return removedPaths_.get(index);
+ } else {
+ return removedPathsBuilder_.getMessage(index);
+ }
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
+ */
+ public Builder setRemovedPaths(
+ int index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier value) {
+ if (removedPathsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureRemovedPathsIsMutable();
+ removedPaths_.set(index, value);
+ onChanged();
+ } else {
+ removedPathsBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
+ */
+ public Builder setRemovedPaths(
+ int index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder builderForValue) {
+ if (removedPathsBuilder_ == null) {
+ ensureRemovedPathsIsMutable();
+ removedPaths_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ removedPathsBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
+ */
+ public Builder addRemovedPaths(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier value) {
+ if (removedPathsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureRemovedPathsIsMutable();
+ removedPaths_.add(value);
+ onChanged();
+ } else {
+ removedPathsBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
+ */
+ public Builder addRemovedPaths(
+ int index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier value) {
+ if (removedPathsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureRemovedPathsIsMutable();
+ removedPaths_.add(index, value);
+ onChanged();
+ } else {
+ removedPathsBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
+ */
+ public Builder addRemovedPaths(
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder builderForValue) {
+ if (removedPathsBuilder_ == null) {
+ ensureRemovedPathsIsMutable();
+ removedPaths_.add(builderForValue.build());
+ onChanged();
+ } else {
+ removedPathsBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
+ */
+ public Builder addRemovedPaths(
+ int index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder builderForValue) {
+ if (removedPathsBuilder_ == null) {
+ ensureRemovedPathsIsMutable();
+ removedPaths_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ removedPathsBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
+ */
+ public Builder addAllRemovedPaths(
+ java.lang.Iterable<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier> values) {
+ if (removedPathsBuilder_ == null) {
+ ensureRemovedPathsIsMutable();
+ super.addAll(values, removedPaths_);
+ onChanged();
+ } else {
+ removedPathsBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
+ */
+ public Builder clearRemovedPaths() {
+ if (removedPathsBuilder_ == null) {
+ removedPaths_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000020);
+ onChanged();
+ } else {
+ removedPathsBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
+ */
+ public Builder removeRemovedPaths(int index) {
+ if (removedPathsBuilder_ == null) {
+ ensureRemovedPathsIsMutable();
+ removedPaths_.remove(index);
+ onChanged();
+ } else {
+ removedPathsBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder getRemovedPathsBuilder(
+ int index) {
+ return getRemovedPathsFieldBuilder().getBuilder(index);
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getRemovedPathsOrBuilder(
+ int index) {
+ if (removedPathsBuilder_ == null) {
+ return removedPaths_.get(index); } else {
+ return removedPathsBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
+ */
+ public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>
+ getRemovedPathsOrBuilderList() {
+ if (removedPathsBuilder_ != null) {
+ return removedPathsBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(removedPaths_);
+ }
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder addRemovedPathsBuilder() {
+ return getRemovedPathsFieldBuilder().addBuilder(
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance());
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder addRemovedPathsBuilder(
+ int index) {
+ return getRemovedPathsFieldBuilder().addBuilder(
+ index, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance());
+ }
+ /**
+ * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
+ */
+ public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder>
+ getRemovedPathsBuilderList() {
+ return getRemovedPathsFieldBuilder().getBuilderList();
+ }
+ private com.google.protobuf.RepeatedFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>
+ getRemovedPathsFieldBuilder() {
+ if (removedPathsBuilder_ == null) {
+ removedPathsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>(
+ removedPaths_,
+ ((bitField0_ & 0x00000020) == 0x00000020),
getParentForChildren(),
isClean());
- normalizedNode_ = null;
+ removedPaths_ = null;
}
- return normalizedNodeBuilder_;
+ return removedPathsBuilder_;
}
// @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.DataChanged)
static {
java.lang.String[] descriptorData = {
"\n\030DataChangeListener.proto\022!org.opendayl" +
- "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"
+ "ight.controller.mdsal\032\014Common.proto\"\241\003\n\013" +
+ "DataChanged\022@\n\017originalSubTree\030\001 \001(\0132\'.o" +
+ "rg.opendaylight.controller.mdsal.Node\022?\n" +
+ "\016updatedSubTree\030\002 \001(\0132\'.org.opendaylight" +
+ ".controller.mdsal.Node\022@\n\014originalData\030\003" +
+ " \001(\0132*.org.opendaylight.controller.mdsal" +
+ ".NodeMap\022?\n\013updatedData\030\004 \001(\0132*.org.open" +
+ "daylight.controller.mdsal.NodeMap\022?\n\013cre" +
+ "atedData\030\005 \001(\0132*.org.opendaylight.contro",
+ "ller.mdsal.NodeMap\022K\n\014removedPaths\030\006 \003(\013" +
+ "25.org.opendaylight.controller.mdsal.Ins" +
+ "tanceIdentifier\"\022\n\020DataChangedReplyBd\nFo" +
+ "rg.opendaylight.controller.protobuff.mes" +
+ "sages.datachange.notificationB\032DataChang" +
+ "eListenerMessages"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
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", "NormalizedNode", });
+ new java.lang.String[] { "OriginalSubTree", "UpdatedSubTree", "OriginalData", "UpdatedData", "CreatedData", "RemovedPaths", });
internal_static_org_opendaylight_controller_mdsal_DataChangedReply_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_org_opendaylight_controller_mdsal_DataChangedReply_fieldAccessorTable = new
com.google.protobuf.ByteString
getTypeBytes();
- // required string path = 2;
+ // required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2;
/**
- * <code>required string path = 2;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2;</code>
*/
boolean hasPath();
/**
- * <code>required string path = 2;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2;</code>
*/
- java.lang.String getPath();
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getPath();
/**
- * <code>required string path = 2;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2;</code>
*/
- com.google.protobuf.ByteString
- getPathBytes();
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getPathOrBuilder();
// optional .org.opendaylight.controller.mdsal.Node data = 3;
/**
break;
}
case 18: {
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ subBuilder = path_.toBuilder();
+ }
+ path_ = input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(path_);
+ path_ = subBuilder.buildPartial();
+ }
bitField0_ |= 0x00000002;
- path_ = input.readBytes();
break;
}
case 26: {
}
}
- // required string path = 2;
+ // required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2;
public static final int PATH_FIELD_NUMBER = 2;
- private java.lang.Object path_;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier path_;
/**
- * <code>required string path = 2;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2;</code>
*/
public boolean hasPath() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
- * <code>required string path = 2;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2;</code>
*/
- 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;
- }
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getPath() {
+ return path_;
}
/**
- * <code>required string path = 2;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2;</code>
*/
- 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;
- }
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getPathOrBuilder() {
+ return path_;
}
// optional .org.opendaylight.controller.mdsal.Node data = 3;
private void initFields() {
type_ = "";
- path_ = "";
+ path_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
data_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance();
}
private byte memoizedIsInitialized = -1;
memoizedIsInitialized = 0;
return false;
}
+ if (!getPath().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
if (hasData()) {
if (!getData().isInitialized()) {
memoizedIsInitialized = 0;
output.writeBytes(1, getTypeBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
- output.writeBytes(2, getPathBytes());
+ output.writeMessage(2, path_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeMessage(3, data_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
- .computeBytesSize(2, getPathBytes());
+ .computeMessageSize(2, path_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getPathFieldBuilder();
getDataFieldBuilder();
}
}
super.clear();
type_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
- path_ = "";
+ if (pathBuilder_ == null) {
+ path_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+ } else {
+ pathBuilder_.clear();
+ }
bitField0_ = (bitField0_ & ~0x00000002);
if (dataBuilder_ == null) {
data_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance();
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
- result.path_ = path_;
+ if (pathBuilder_ == null) {
+ result.path_ = path_;
+ } else {
+ result.path_ = pathBuilder_.build();
+ }
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
onChanged();
}
if (other.hasPath()) {
- bitField0_ |= 0x00000002;
- path_ = other.path_;
- onChanged();
+ mergePath(other.getPath());
}
if (other.hasData()) {
mergeData(other.getData());
return false;
}
+ if (!getPath().isInitialized()) {
+
+ return false;
+ }
if (hasData()) {
if (!getData().isInitialized()) {
return this;
}
- // required string path = 2;
- private java.lang.Object path_ = "";
+ // required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier path_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder> pathBuilder_;
/**
- * <code>required string path = 2;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2;</code>
*/
public boolean hasPath() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
- * <code>required string path = 2;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2;</code>
*/
- 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;
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getPath() {
+ if (pathBuilder_ == null) {
+ return path_;
} else {
- return (java.lang.String) ref;
+ return pathBuilder_.getMessage();
}
}
/**
- * <code>required string path = 2;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2;</code>
*/
- 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;
+ public Builder setPath(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier value) {
+ if (pathBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ path_ = value;
+ onChanged();
} else {
- return (com.google.protobuf.ByteString) ref;
+ pathBuilder_.setMessage(value);
}
+ bitField0_ |= 0x00000002;
+ return this;
}
/**
- * <code>required string path = 2;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2;</code>
*/
public Builder setPath(
- java.lang.String value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000002;
- path_ = value;
- onChanged();
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder builderForValue) {
+ if (pathBuilder_ == null) {
+ path_ = builderForValue.build();
+ onChanged();
+ } else {
+ pathBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000002;
return this;
}
/**
- * <code>required string path = 2;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2;</code>
+ */
+ public Builder mergePath(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier value) {
+ if (pathBuilder_ == null) {
+ if (((bitField0_ & 0x00000002) == 0x00000002) &&
+ path_ != org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance()) {
+ path_ =
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.newBuilder(path_).mergeFrom(value).buildPartial();
+ } else {
+ path_ = value;
+ }
+ onChanged();
+ } else {
+ pathBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000002;
+ return this;
+ }
+ /**
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2;</code>
*/
public Builder clearPath() {
+ if (pathBuilder_ == null) {
+ path_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+ onChanged();
+ } else {
+ pathBuilder_.clear();
+ }
bitField0_ = (bitField0_ & ~0x00000002);
- path_ = getDefaultInstance().getPath();
- onChanged();
return this;
}
/**
- * <code>required string path = 2;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2;</code>
*/
- public Builder setPathBytes(
- com.google.protobuf.ByteString value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000002;
- path_ = value;
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder getPathBuilder() {
+ bitField0_ |= 0x00000002;
onChanged();
- return this;
+ return getPathFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getPathOrBuilder() {
+ if (pathBuilder_ != null) {
+ return pathBuilder_.getMessageOrBuilder();
+ } else {
+ return path_;
+ }
+ }
+ /**
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>
+ getPathFieldBuilder() {
+ if (pathBuilder_ == null) {
+ pathBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>(
+ path_,
+ getParentForChildren(),
+ isClean());
+ path_ = null;
+ }
+ return pathBuilder_;
}
// optional .org.opendaylight.controller.mdsal.Node data = 3;
static {
java.lang.String[] descriptorData = {
"\n\020Persistent.proto\022!org.opendaylight.con" +
- "troller.mdsal\032\014Common.proto\"a\n\014Modificat" +
- "ion\022\014\n\004type\030\001 \002(\t\022\014\n\004path\030\002 \002(\t\0225\n\004data\030" +
- "\003 \001(\0132\'.org.opendaylight.controller.mdsa" +
- "l.Node\"^\n\025CompositeModification\022E\n\014modif" +
- "ication\030\001 \003(\0132/.org.opendaylight.control" +
- "ler.mdsal.ModificationBO\n9org.opendaylig" +
- "ht.controller.protobuff.messages.persist" +
- "entB\022PersistentMessages"
+ "troller.mdsal\032\014Common.proto\"\230\001\n\014Modifica" +
+ "tion\022\014\n\004type\030\001 \002(\t\022C\n\004path\030\002 \002(\01325.org.o" +
+ "pendaylight.controller.mdsal.InstanceIde" +
+ "ntifier\0225\n\004data\030\003 \001(\0132\'.org.opendaylight" +
+ ".controller.mdsal.Node\"^\n\025CompositeModif" +
+ "ication\022E\n\014modification\030\001 \003(\0132/.org.open" +
+ "daylight.controller.mdsal.ModificationBO" +
+ "\n9org.opendaylight.controller.protobuff." +
+ "messages.persistentB\022PersistentMessages"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
public interface RegisterChangeListenerOrBuilder
extends com.google.protobuf.MessageOrBuilder {
- // required string instanceIdentifierPath = 1;
+ // required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;
/**
- * <code>required string instanceIdentifierPath = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
*/
boolean hasInstanceIdentifierPath();
/**
- * <code>required string instanceIdentifierPath = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
*/
- java.lang.String getInstanceIdentifierPath();
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getInstanceIdentifierPath();
/**
- * <code>required string instanceIdentifierPath = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
*/
- com.google.protobuf.ByteString
- getInstanceIdentifierPathBytes();
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getInstanceIdentifierPathOrBuilder();
// required string dataChangeListenerActorPath = 2;
/**
break;
}
case 10: {
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ subBuilder = instanceIdentifierPath_.toBuilder();
+ }
+ instanceIdentifierPath_ = input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(instanceIdentifierPath_);
+ instanceIdentifierPath_ = subBuilder.buildPartial();
+ }
bitField0_ |= 0x00000001;
- instanceIdentifierPath_ = input.readBytes();
break;
}
case 18: {
}
private int bitField0_;
- // required string instanceIdentifierPath = 1;
+ // required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;
public static final int INSTANCEIDENTIFIERPATH_FIELD_NUMBER = 1;
- private java.lang.Object instanceIdentifierPath_;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier instanceIdentifierPath_;
/**
- * <code>required string instanceIdentifierPath = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
*/
public boolean hasInstanceIdentifierPath() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
- * <code>required string instanceIdentifierPath = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
*/
- public java.lang.String getInstanceIdentifierPath() {
- java.lang.Object ref = instanceIdentifierPath_;
- 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()) {
- instanceIdentifierPath_ = s;
- }
- return s;
- }
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getInstanceIdentifierPath() {
+ return instanceIdentifierPath_;
}
/**
- * <code>required string instanceIdentifierPath = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
*/
- public com.google.protobuf.ByteString
- getInstanceIdentifierPathBytes() {
- java.lang.Object ref = instanceIdentifierPath_;
- if (ref instanceof java.lang.String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- instanceIdentifierPath_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getInstanceIdentifierPathOrBuilder() {
+ return instanceIdentifierPath_;
}
// required string dataChangeListenerActorPath = 2;
}
private void initFields() {
- instanceIdentifierPath_ = "";
+ instanceIdentifierPath_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
dataChangeListenerActorPath_ = "";
dataChangeScope_ = 0;
}
memoizedIsInitialized = 0;
return false;
}
+ if (!getInstanceIdentifierPath().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
memoizedIsInitialized = 1;
return true;
}
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
- output.writeBytes(1, getInstanceIdentifierPathBytes());
+ output.writeMessage(1, instanceIdentifierPath_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeBytes(2, getDataChangeListenerActorPathBytes());
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
- .computeBytesSize(1, getInstanceIdentifierPathBytes());
+ .computeMessageSize(1, instanceIdentifierPath_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getInstanceIdentifierPathFieldBuilder();
}
}
private static Builder create() {
public Builder clear() {
super.clear();
- instanceIdentifierPath_ = "";
+ if (instanceIdentifierPathBuilder_ == null) {
+ instanceIdentifierPath_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+ } else {
+ instanceIdentifierPathBuilder_.clear();
+ }
bitField0_ = (bitField0_ & ~0x00000001);
dataChangeListenerActorPath_ = "";
bitField0_ = (bitField0_ & ~0x00000002);
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
- result.instanceIdentifierPath_ = instanceIdentifierPath_;
+ if (instanceIdentifierPathBuilder_ == null) {
+ result.instanceIdentifierPath_ = instanceIdentifierPath_;
+ } else {
+ result.instanceIdentifierPath_ = instanceIdentifierPathBuilder_.build();
+ }
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.RegisterChangeListener other) {
if (other == org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages.RegisterChangeListener.getDefaultInstance()) return this;
if (other.hasInstanceIdentifierPath()) {
- bitField0_ |= 0x00000001;
- instanceIdentifierPath_ = other.instanceIdentifierPath_;
- onChanged();
+ mergeInstanceIdentifierPath(other.getInstanceIdentifierPath());
}
if (other.hasDataChangeListenerActorPath()) {
bitField0_ |= 0x00000002;
return false;
}
+ if (!getInstanceIdentifierPath().isInitialized()) {
+
+ return false;
+ }
return true;
}
}
private int bitField0_;
- // required string instanceIdentifierPath = 1;
- private java.lang.Object instanceIdentifierPath_ = "";
+ // required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier instanceIdentifierPath_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder> instanceIdentifierPathBuilder_;
/**
- * <code>required string instanceIdentifierPath = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
*/
public boolean hasInstanceIdentifierPath() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
- * <code>required string instanceIdentifierPath = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
*/
- public java.lang.String getInstanceIdentifierPath() {
- java.lang.Object ref = instanceIdentifierPath_;
- if (!(ref instanceof java.lang.String)) {
- java.lang.String s = ((com.google.protobuf.ByteString) ref)
- .toStringUtf8();
- instanceIdentifierPath_ = s;
- return s;
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getInstanceIdentifierPath() {
+ if (instanceIdentifierPathBuilder_ == null) {
+ return instanceIdentifierPath_;
} else {
- return (java.lang.String) ref;
+ return instanceIdentifierPathBuilder_.getMessage();
}
}
/**
- * <code>required string instanceIdentifierPath = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
*/
- public com.google.protobuf.ByteString
- getInstanceIdentifierPathBytes() {
- java.lang.Object ref = instanceIdentifierPath_;
- if (ref instanceof String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- instanceIdentifierPath_ = b;
- return b;
+ public Builder setInstanceIdentifierPath(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier value) {
+ if (instanceIdentifierPathBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ instanceIdentifierPath_ = value;
+ onChanged();
} else {
- return (com.google.protobuf.ByteString) ref;
+ instanceIdentifierPathBuilder_.setMessage(value);
}
+ bitField0_ |= 0x00000001;
+ return this;
}
/**
- * <code>required string instanceIdentifierPath = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
*/
public Builder setInstanceIdentifierPath(
- java.lang.String value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000001;
- instanceIdentifierPath_ = value;
- onChanged();
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder builderForValue) {
+ if (instanceIdentifierPathBuilder_ == null) {
+ instanceIdentifierPath_ = builderForValue.build();
+ onChanged();
+ } else {
+ instanceIdentifierPathBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
+ */
+ public Builder mergeInstanceIdentifierPath(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier value) {
+ if (instanceIdentifierPathBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) == 0x00000001) &&
+ instanceIdentifierPath_ != org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance()) {
+ instanceIdentifierPath_ =
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.newBuilder(instanceIdentifierPath_).mergeFrom(value).buildPartial();
+ } else {
+ instanceIdentifierPath_ = value;
+ }
+ onChanged();
+ } else {
+ instanceIdentifierPathBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000001;
return this;
}
/**
- * <code>required string instanceIdentifierPath = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
*/
public Builder clearInstanceIdentifierPath() {
+ if (instanceIdentifierPathBuilder_ == null) {
+ instanceIdentifierPath_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+ onChanged();
+ } else {
+ instanceIdentifierPathBuilder_.clear();
+ }
bitField0_ = (bitField0_ & ~0x00000001);
- instanceIdentifierPath_ = getDefaultInstance().getInstanceIdentifierPath();
- onChanged();
return this;
}
/**
- * <code>required string instanceIdentifierPath = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
*/
- public Builder setInstanceIdentifierPathBytes(
- com.google.protobuf.ByteString value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000001;
- instanceIdentifierPath_ = value;
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder getInstanceIdentifierPathBuilder() {
+ bitField0_ |= 0x00000001;
onChanged();
- return this;
+ return getInstanceIdentifierPathFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getInstanceIdentifierPathOrBuilder() {
+ if (instanceIdentifierPathBuilder_ != null) {
+ return instanceIdentifierPathBuilder_.getMessageOrBuilder();
+ } else {
+ return instanceIdentifierPath_;
+ }
+ }
+ /**
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>
+ getInstanceIdentifierPathFieldBuilder() {
+ if (instanceIdentifierPathBuilder_ == null) {
+ instanceIdentifierPathBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>(
+ instanceIdentifierPath_,
+ getParentForChildren(),
+ isClean());
+ instanceIdentifierPath_ = null;
+ }
+ return instanceIdentifierPathBuilder_;
}
// required string dataChangeListenerActorPath = 2;
static {
java.lang.String[] descriptorData = {
"\n\032ListenerRegistration.proto\022!org.openda" +
- "ylight.controller.mdsal\"%\n#CloseDataChan" +
- "geListenerRegistration\"*\n(CloseDataChang" +
- "eListenerRegistrationReply\"v\n\026RegisterCh" +
- "angeListener\022\036\n\026instanceIdentifierPath\030\001" +
- " \002(\t\022#\n\033dataChangeListenerActorPath\030\002 \002(" +
- "\t\022\027\n\017dataChangeScope\030\003 \002(\005\"?\n\033RegisterCh" +
- "angeListenerReply\022 \n\030listenerRegistratio" +
- "nPath\030\001 \002(\tB[\n;org.opendaylight.controll" +
- "er.protobuff.messages.registrationB\034List",
- "enerRegistrationMessages"
+ "ylight.controller.mdsal\032\014Common.proto\"%\n" +
+ "#CloseDataChangeListenerRegistration\"*\n(" +
+ "CloseDataChangeListenerRegistrationReply" +
+ "\"\255\001\n\026RegisterChangeListener\022U\n\026instanceI" +
+ "dentifierPath\030\001 \002(\01325.org.opendaylight.c" +
+ "ontroller.mdsal.InstanceIdentifier\022#\n\033da" +
+ "taChangeListenerActorPath\030\002 \002(\t\022\027\n\017dataC" +
+ "hangeScope\030\003 \002(\005\"?\n\033RegisterChangeListen" +
+ "erReply\022 \n\030listenerRegistrationPath\030\001 \002(",
+ "\tB[\n;org.opendaylight.controller.protobu" +
+ "ff.messages.registrationB\034ListenerRegist" +
+ "rationMessages"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.getDescriptor(),
}, assigner);
}
public interface PrimaryFoundOrBuilder
extends com.google.protobuf.MessageOrBuilder {
+
+ // required string primaryPath = 1;
+ /**
+ * <code>required string primaryPath = 1;</code>
+ */
+ boolean hasPrimaryPath();
+ /**
+ * <code>required string primaryPath = 1;</code>
+ */
+ java.lang.String getPrimaryPath();
+ /**
+ * <code>required string primaryPath = 1;</code>
+ */
+ com.google.protobuf.ByteString
+ getPrimaryPathBytes();
}
/**
* Protobuf type {@code org.opendaylight.controller.mdsal.PrimaryFound}
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 {
}
break;
}
+ case 10: {
+ bitField0_ |= 0x00000001;
+ primaryPath_ = input.readBytes();
+ break;
+ }
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
return PARSER;
}
+ private int bitField0_;
+ // required string primaryPath = 1;
+ public static final int PRIMARYPATH_FIELD_NUMBER = 1;
+ private java.lang.Object primaryPath_;
+ /**
+ * <code>required string primaryPath = 1;</code>
+ */
+ public boolean hasPrimaryPath() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string primaryPath = 1;</code>
+ */
+ public java.lang.String getPrimaryPath() {
+ java.lang.Object ref = primaryPath_;
+ 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()) {
+ primaryPath_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <code>required string primaryPath = 1;</code>
+ */
+ public com.google.protobuf.ByteString
+ getPrimaryPathBytes() {
+ java.lang.Object ref = primaryPath_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ primaryPath_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
private void initFields() {
+ primaryPath_ = "";
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
+ if (!hasPrimaryPath()) {
+ 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, getPrimaryPathBytes());
+ }
getUnknownFields().writeTo(output);
}
if (size != -1) return size;
size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(1, getPrimaryPathBytes());
+ }
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
public Builder clear() {
super.clear();
+ primaryPath_ = "";
+ bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
public org.opendaylight.controller.protobuff.messages.shard.ShardManagerMessages.PrimaryFound buildPartial() {
org.opendaylight.controller.protobuff.messages.shard.ShardManagerMessages.PrimaryFound result = new org.opendaylight.controller.protobuff.messages.shard.ShardManagerMessages.PrimaryFound(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.primaryPath_ = primaryPath_;
+ result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.shard.ShardManagerMessages.PrimaryFound other) {
if (other == org.opendaylight.controller.protobuff.messages.shard.ShardManagerMessages.PrimaryFound.getDefaultInstance()) return this;
+ if (other.hasPrimaryPath()) {
+ bitField0_ |= 0x00000001;
+ primaryPath_ = other.primaryPath_;
+ onChanged();
+ }
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
+ if (!hasPrimaryPath()) {
+
+ return false;
+ }
return true;
}
}
return this;
}
+ private int bitField0_;
+
+ // required string primaryPath = 1;
+ private java.lang.Object primaryPath_ = "";
+ /**
+ * <code>required string primaryPath = 1;</code>
+ */
+ public boolean hasPrimaryPath() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string primaryPath = 1;</code>
+ */
+ public java.lang.String getPrimaryPath() {
+ java.lang.Object ref = primaryPath_;
+ if (!(ref instanceof java.lang.String)) {
+ java.lang.String s = ((com.google.protobuf.ByteString) ref)
+ .toStringUtf8();
+ primaryPath_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <code>required string primaryPath = 1;</code>
+ */
+ public com.google.protobuf.ByteString
+ getPrimaryPathBytes() {
+ java.lang.Object ref = primaryPath_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ primaryPath_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <code>required string primaryPath = 1;</code>
+ */
+ public Builder setPrimaryPath(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ primaryPath_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required string primaryPath = 1;</code>
+ */
+ public Builder clearPrimaryPath() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ primaryPath_ = getDefaultInstance().getPrimaryPath();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required string primaryPath = 1;</code>
+ */
+ public Builder setPrimaryPathBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ primaryPath_ = value;
+ onChanged();
+ return this;
+ }
// @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.PrimaryFound)
}
public interface PrimaryNotFoundOrBuilder
extends com.google.protobuf.MessageOrBuilder {
+
+ // required string shardName = 1;
+ /**
+ * <code>required string shardName = 1;</code>
+ */
+ boolean hasShardName();
+ /**
+ * <code>required string shardName = 1;</code>
+ */
+ java.lang.String getShardName();
+ /**
+ * <code>required string shardName = 1;</code>
+ */
+ com.google.protobuf.ByteString
+ getShardNameBytes();
}
/**
* Protobuf type {@code org.opendaylight.controller.mdsal.PrimaryNotFound}
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 {
}
break;
}
+ case 10: {
+ bitField0_ |= 0x00000001;
+ shardName_ = input.readBytes();
+ break;
+ }
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
return PARSER;
}
+ private int bitField0_;
+ // required string shardName = 1;
+ public static final int SHARDNAME_FIELD_NUMBER = 1;
+ private java.lang.Object shardName_;
+ /**
+ * <code>required string shardName = 1;</code>
+ */
+ public boolean hasShardName() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string shardName = 1;</code>
+ */
+ public java.lang.String getShardName() {
+ java.lang.Object ref = shardName_;
+ 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()) {
+ shardName_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <code>required string shardName = 1;</code>
+ */
+ public com.google.protobuf.ByteString
+ getShardNameBytes() {
+ java.lang.Object ref = shardName_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ shardName_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
private void initFields() {
+ shardName_ = "";
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
+ if (!hasShardName()) {
+ 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, getShardNameBytes());
+ }
getUnknownFields().writeTo(output);
}
if (size != -1) return size;
size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(1, getShardNameBytes());
+ }
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
public Builder clear() {
super.clear();
+ shardName_ = "";
+ bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
public org.opendaylight.controller.protobuff.messages.shard.ShardManagerMessages.PrimaryNotFound buildPartial() {
org.opendaylight.controller.protobuff.messages.shard.ShardManagerMessages.PrimaryNotFound result = new org.opendaylight.controller.protobuff.messages.shard.ShardManagerMessages.PrimaryNotFound(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.shardName_ = shardName_;
+ result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.shard.ShardManagerMessages.PrimaryNotFound other) {
if (other == org.opendaylight.controller.protobuff.messages.shard.ShardManagerMessages.PrimaryNotFound.getDefaultInstance()) return this;
+ if (other.hasShardName()) {
+ bitField0_ |= 0x00000001;
+ shardName_ = other.shardName_;
+ onChanged();
+ }
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
+ if (!hasShardName()) {
+
+ return false;
+ }
return true;
}
}
return this;
}
+ private int bitField0_;
+
+ // required string shardName = 1;
+ private java.lang.Object shardName_ = "";
+ /**
+ * <code>required string shardName = 1;</code>
+ */
+ public boolean hasShardName() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string shardName = 1;</code>
+ */
+ public java.lang.String getShardName() {
+ java.lang.Object ref = shardName_;
+ if (!(ref instanceof java.lang.String)) {
+ java.lang.String s = ((com.google.protobuf.ByteString) ref)
+ .toStringUtf8();
+ shardName_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <code>required string shardName = 1;</code>
+ */
+ public com.google.protobuf.ByteString
+ getShardNameBytes() {
+ java.lang.Object ref = shardName_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ shardName_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <code>required string shardName = 1;</code>
+ */
+ public Builder setShardName(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ shardName_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required string shardName = 1;</code>
+ */
+ public Builder clearShardName() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ shardName_ = getDefaultInstance().getShardName();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required string shardName = 1;</code>
+ */
+ public Builder setShardNameBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ shardName_ = value;
+ onChanged();
+ return this;
+ }
// @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.PrimaryNotFound)
}
java.lang.String[] descriptorData = {
"\n\022ShardManager.proto\022!org.opendaylight.c" +
"ontroller.mdsal\" \n\013FindPrimary\022\021\n\tshardN" +
- "ame\030\001 \002(\t\"\016\n\014PrimaryFound\"\021\n\017PrimaryNotF" +
- "oundBL\n4org.opendaylight.controller.prot" +
+ "ame\030\001 \002(\t\"#\n\014PrimaryFound\022\023\n\013primaryPath" +
+ "\030\001 \002(\t\"$\n\017PrimaryNotFound\022\021\n\tshardName\030\001" +
+ " \002(\tBL\n4org.opendaylight.controller.prot" +
"obuff.messages.shardB\024ShardManagerMessag" +
"es"
};
internal_static_org_opendaylight_controller_mdsal_PrimaryFound_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_org_opendaylight_controller_mdsal_PrimaryFound_descriptor,
- new java.lang.String[] { });
+ new java.lang.String[] { "PrimaryPath", });
internal_static_org_opendaylight_controller_mdsal_PrimaryNotFound_descriptor =
getDescriptor().getMessageTypes().get(2);
internal_static_org_opendaylight_controller_mdsal_PrimaryNotFound_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_org_opendaylight_controller_mdsal_PrimaryNotFound_descriptor,
- new java.lang.String[] { });
+ new java.lang.String[] { "ShardName", });
return null;
}
};
public interface CreateTransactionOrBuilder
extends com.google.protobuf.MessageOrBuilder {
+
+ // required string transactionId = 1;
+ /**
+ * <code>required string transactionId = 1;</code>
+ */
+ boolean hasTransactionId();
+ /**
+ * <code>required string transactionId = 1;</code>
+ */
+ java.lang.String getTransactionId();
+ /**
+ * <code>required string transactionId = 1;</code>
+ */
+ com.google.protobuf.ByteString
+ getTransactionIdBytes();
}
/**
* Protobuf type {@code org.opendaylight.controller.mdsal.CreateTransaction}
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 {
}
break;
}
+ case 10: {
+ bitField0_ |= 0x00000001;
+ transactionId_ = input.readBytes();
+ break;
+ }
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
return PARSER;
}
+ private int bitField0_;
+ // required string transactionId = 1;
+ public static final int TRANSACTIONID_FIELD_NUMBER = 1;
+ private java.lang.Object transactionId_;
+ /**
+ * <code>required string transactionId = 1;</code>
+ */
+ public boolean hasTransactionId() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string transactionId = 1;</code>
+ */
+ 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;
+ }
+ }
+ /**
+ * <code>required string transactionId = 1;</code>
+ */
+ 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;
+ }
+ }
+
private void initFields() {
+ transactionId_ = "";
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
+ if (!hasTransactionId()) {
+ 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, getTransactionIdBytes());
+ }
getUnknownFields().writeTo(output);
}
if (size != -1) return size;
size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(1, getTransactionIdBytes());
+ }
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
public Builder clear() {
super.clear();
+ transactionId_ = "";
+ bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
public org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages.CreateTransaction buildPartial() {
org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages.CreateTransaction result = new org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages.CreateTransaction(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.transactionId_ = transactionId_;
+ result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages.CreateTransaction other) {
if (other == org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages.CreateTransaction.getDefaultInstance()) return this;
+ if (other.hasTransactionId()) {
+ bitField0_ |= 0x00000001;
+ transactionId_ = other.transactionId_;
+ onChanged();
+ }
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
+ if (!hasTransactionId()) {
+
+ return false;
+ }
return true;
}
}
return this;
}
+ private int bitField0_;
+
+ // required string transactionId = 1;
+ private java.lang.Object transactionId_ = "";
+ /**
+ * <code>required string transactionId = 1;</code>
+ */
+ public boolean hasTransactionId() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>required string transactionId = 1;</code>
+ */
+ 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;
+ }
+ }
+ /**
+ * <code>required string transactionId = 1;</code>
+ */
+ 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;
+ }
+ }
+ /**
+ * <code>required string transactionId = 1;</code>
+ */
+ public Builder setTransactionId(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ transactionId_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required string transactionId = 1;</code>
+ */
+ public Builder clearTransactionId() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ transactionId_ = getDefaultInstance().getTransactionId();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>required string transactionId = 1;</code>
+ */
+ public Builder setTransactionIdBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ transactionId_ = value;
+ onChanged();
+ return this;
+ }
// @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.CreateTransaction)
}
public interface DeleteDataOrBuilder
extends com.google.protobuf.MessageOrBuilder {
- // required string instanceIdentifierPathArguments = 1;
+ // required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
boolean hasInstanceIdentifierPathArguments();
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- java.lang.String getInstanceIdentifierPathArguments();
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getInstanceIdentifierPathArguments();
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- com.google.protobuf.ByteString
- getInstanceIdentifierPathArgumentsBytes();
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getInstanceIdentifierPathArgumentsOrBuilder();
}
/**
* Protobuf type {@code org.opendaylight.controller.mdsal.DeleteData}
break;
}
case 10: {
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ subBuilder = instanceIdentifierPathArguments_.toBuilder();
+ }
+ instanceIdentifierPathArguments_ = input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(instanceIdentifierPathArguments_);
+ instanceIdentifierPathArguments_ = subBuilder.buildPartial();
+ }
bitField0_ |= 0x00000001;
- instanceIdentifierPathArguments_ = input.readBytes();
break;
}
}
}
private int bitField0_;
- // required string instanceIdentifierPathArguments = 1;
+ // required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;
public static final int INSTANCEIDENTIFIERPATHARGUMENTS_FIELD_NUMBER = 1;
- private java.lang.Object instanceIdentifierPathArguments_;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier instanceIdentifierPathArguments_;
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
public boolean hasInstanceIdentifierPathArguments() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- public java.lang.String getInstanceIdentifierPathArguments() {
- java.lang.Object ref = instanceIdentifierPathArguments_;
- 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()) {
- instanceIdentifierPathArguments_ = s;
- }
- return s;
- }
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getInstanceIdentifierPathArguments() {
+ return instanceIdentifierPathArguments_;
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- public com.google.protobuf.ByteString
- getInstanceIdentifierPathArgumentsBytes() {
- java.lang.Object ref = instanceIdentifierPathArguments_;
- if (ref instanceof java.lang.String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- instanceIdentifierPathArguments_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getInstanceIdentifierPathArgumentsOrBuilder() {
+ return instanceIdentifierPathArguments_;
}
private void initFields() {
- instanceIdentifierPathArguments_ = "";
+ instanceIdentifierPathArguments_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
memoizedIsInitialized = 0;
return false;
}
+ if (!getInstanceIdentifierPathArguments().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
memoizedIsInitialized = 1;
return true;
}
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
- output.writeBytes(1, getInstanceIdentifierPathArgumentsBytes());
+ output.writeMessage(1, instanceIdentifierPathArguments_);
}
getUnknownFields().writeTo(output);
}
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
- .computeBytesSize(1, getInstanceIdentifierPathArgumentsBytes());
+ .computeMessageSize(1, instanceIdentifierPathArguments_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getInstanceIdentifierPathArgumentsFieldBuilder();
}
}
private static Builder create() {
public Builder clear() {
super.clear();
- instanceIdentifierPathArguments_ = "";
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ instanceIdentifierPathArguments_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+ } else {
+ instanceIdentifierPathArgumentsBuilder_.clear();
+ }
bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
- result.instanceIdentifierPathArguments_ = instanceIdentifierPathArguments_;
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ result.instanceIdentifierPathArguments_ = instanceIdentifierPathArguments_;
+ } else {
+ result.instanceIdentifierPathArguments_ = instanceIdentifierPathArgumentsBuilder_.build();
+ }
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages.DeleteData other) {
if (other == org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages.DeleteData.getDefaultInstance()) return this;
if (other.hasInstanceIdentifierPathArguments()) {
- bitField0_ |= 0x00000001;
- instanceIdentifierPathArguments_ = other.instanceIdentifierPathArguments_;
- onChanged();
+ mergeInstanceIdentifierPathArguments(other.getInstanceIdentifierPathArguments());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
return false;
}
+ if (!getInstanceIdentifierPathArguments().isInitialized()) {
+
+ return false;
+ }
return true;
}
}
private int bitField0_;
- // required string instanceIdentifierPathArguments = 1;
- private java.lang.Object instanceIdentifierPathArguments_ = "";
+ // required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier instanceIdentifierPathArguments_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder> instanceIdentifierPathArgumentsBuilder_;
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
public boolean hasInstanceIdentifierPathArguments() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- public java.lang.String getInstanceIdentifierPathArguments() {
- java.lang.Object ref = instanceIdentifierPathArguments_;
- if (!(ref instanceof java.lang.String)) {
- java.lang.String s = ((com.google.protobuf.ByteString) ref)
- .toStringUtf8();
- instanceIdentifierPathArguments_ = s;
- return s;
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getInstanceIdentifierPathArguments() {
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ return instanceIdentifierPathArguments_;
} else {
- return (java.lang.String) ref;
+ return instanceIdentifierPathArgumentsBuilder_.getMessage();
}
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- public com.google.protobuf.ByteString
- getInstanceIdentifierPathArgumentsBytes() {
- java.lang.Object ref = instanceIdentifierPathArguments_;
- if (ref instanceof String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- instanceIdentifierPathArguments_ = b;
- return b;
+ public Builder setInstanceIdentifierPathArguments(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier value) {
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ instanceIdentifierPathArguments_ = value;
+ onChanged();
} else {
- return (com.google.protobuf.ByteString) ref;
+ instanceIdentifierPathArgumentsBuilder_.setMessage(value);
}
+ bitField0_ |= 0x00000001;
+ return this;
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
public Builder setInstanceIdentifierPathArguments(
- java.lang.String value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000001;
- instanceIdentifierPathArguments_ = value;
- onChanged();
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder builderForValue) {
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ instanceIdentifierPathArguments_ = builderForValue.build();
+ onChanged();
+ } else {
+ instanceIdentifierPathArgumentsBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
+ */
+ public Builder mergeInstanceIdentifierPathArguments(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier value) {
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) == 0x00000001) &&
+ instanceIdentifierPathArguments_ != org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance()) {
+ instanceIdentifierPathArguments_ =
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.newBuilder(instanceIdentifierPathArguments_).mergeFrom(value).buildPartial();
+ } else {
+ instanceIdentifierPathArguments_ = value;
+ }
+ onChanged();
+ } else {
+ instanceIdentifierPathArgumentsBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000001;
return this;
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
public Builder clearInstanceIdentifierPathArguments() {
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ instanceIdentifierPathArguments_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+ onChanged();
+ } else {
+ instanceIdentifierPathArgumentsBuilder_.clear();
+ }
bitField0_ = (bitField0_ & ~0x00000001);
- instanceIdentifierPathArguments_ = getDefaultInstance().getInstanceIdentifierPathArguments();
- onChanged();
return this;
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- public Builder setInstanceIdentifierPathArgumentsBytes(
- com.google.protobuf.ByteString value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000001;
- instanceIdentifierPathArguments_ = value;
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder getInstanceIdentifierPathArgumentsBuilder() {
+ bitField0_ |= 0x00000001;
onChanged();
- return this;
+ return getInstanceIdentifierPathArgumentsFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getInstanceIdentifierPathArgumentsOrBuilder() {
+ if (instanceIdentifierPathArgumentsBuilder_ != null) {
+ return instanceIdentifierPathArgumentsBuilder_.getMessageOrBuilder();
+ } else {
+ return instanceIdentifierPathArguments_;
+ }
+ }
+ /**
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>
+ getInstanceIdentifierPathArgumentsFieldBuilder() {
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ instanceIdentifierPathArgumentsBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>(
+ instanceIdentifierPathArguments_,
+ getParentForChildren(),
+ isClean());
+ instanceIdentifierPathArguments_ = null;
+ }
+ return instanceIdentifierPathArgumentsBuilder_;
}
// @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.DeleteData)
public interface ReadDataOrBuilder
extends com.google.protobuf.MessageOrBuilder {
- // required string instanceIdentifierPathArguments = 1;
+ // required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
boolean hasInstanceIdentifierPathArguments();
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- java.lang.String getInstanceIdentifierPathArguments();
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getInstanceIdentifierPathArguments();
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- com.google.protobuf.ByteString
- getInstanceIdentifierPathArgumentsBytes();
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getInstanceIdentifierPathArgumentsOrBuilder();
}
/**
* Protobuf type {@code org.opendaylight.controller.mdsal.ReadData}
break;
}
case 10: {
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ subBuilder = instanceIdentifierPathArguments_.toBuilder();
+ }
+ instanceIdentifierPathArguments_ = input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(instanceIdentifierPathArguments_);
+ instanceIdentifierPathArguments_ = subBuilder.buildPartial();
+ }
bitField0_ |= 0x00000001;
- instanceIdentifierPathArguments_ = input.readBytes();
break;
}
}
}
private int bitField0_;
- // required string instanceIdentifierPathArguments = 1;
+ // required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;
public static final int INSTANCEIDENTIFIERPATHARGUMENTS_FIELD_NUMBER = 1;
- private java.lang.Object instanceIdentifierPathArguments_;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier instanceIdentifierPathArguments_;
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
public boolean hasInstanceIdentifierPathArguments() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- public java.lang.String getInstanceIdentifierPathArguments() {
- java.lang.Object ref = instanceIdentifierPathArguments_;
- 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()) {
- instanceIdentifierPathArguments_ = s;
- }
- return s;
- }
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getInstanceIdentifierPathArguments() {
+ return instanceIdentifierPathArguments_;
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- public com.google.protobuf.ByteString
- getInstanceIdentifierPathArgumentsBytes() {
- java.lang.Object ref = instanceIdentifierPathArguments_;
- if (ref instanceof java.lang.String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- instanceIdentifierPathArguments_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getInstanceIdentifierPathArgumentsOrBuilder() {
+ return instanceIdentifierPathArguments_;
}
private void initFields() {
- instanceIdentifierPathArguments_ = "";
+ instanceIdentifierPathArguments_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
memoizedIsInitialized = 0;
return false;
}
+ if (!getInstanceIdentifierPathArguments().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
memoizedIsInitialized = 1;
return true;
}
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
- output.writeBytes(1, getInstanceIdentifierPathArgumentsBytes());
+ output.writeMessage(1, instanceIdentifierPathArguments_);
}
getUnknownFields().writeTo(output);
}
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
- .computeBytesSize(1, getInstanceIdentifierPathArgumentsBytes());
+ .computeMessageSize(1, instanceIdentifierPathArguments_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getInstanceIdentifierPathArgumentsFieldBuilder();
}
}
private static Builder create() {
public Builder clear() {
super.clear();
- instanceIdentifierPathArguments_ = "";
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ instanceIdentifierPathArguments_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+ } else {
+ instanceIdentifierPathArgumentsBuilder_.clear();
+ }
bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
- result.instanceIdentifierPathArguments_ = instanceIdentifierPathArguments_;
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ result.instanceIdentifierPathArguments_ = instanceIdentifierPathArguments_;
+ } else {
+ result.instanceIdentifierPathArguments_ = instanceIdentifierPathArgumentsBuilder_.build();
+ }
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages.ReadData other) {
if (other == org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages.ReadData.getDefaultInstance()) return this;
if (other.hasInstanceIdentifierPathArguments()) {
- bitField0_ |= 0x00000001;
- instanceIdentifierPathArguments_ = other.instanceIdentifierPathArguments_;
- onChanged();
+ mergeInstanceIdentifierPathArguments(other.getInstanceIdentifierPathArguments());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
return false;
}
+ if (!getInstanceIdentifierPathArguments().isInitialized()) {
+
+ return false;
+ }
return true;
}
}
private int bitField0_;
- // required string instanceIdentifierPathArguments = 1;
- private java.lang.Object instanceIdentifierPathArguments_ = "";
+ // required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier instanceIdentifierPathArguments_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder> instanceIdentifierPathArgumentsBuilder_;
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
public boolean hasInstanceIdentifierPathArguments() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- public java.lang.String getInstanceIdentifierPathArguments() {
- java.lang.Object ref = instanceIdentifierPathArguments_;
- if (!(ref instanceof java.lang.String)) {
- java.lang.String s = ((com.google.protobuf.ByteString) ref)
- .toStringUtf8();
- instanceIdentifierPathArguments_ = s;
- return s;
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getInstanceIdentifierPathArguments() {
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ return instanceIdentifierPathArguments_;
} else {
- return (java.lang.String) ref;
+ return instanceIdentifierPathArgumentsBuilder_.getMessage();
}
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- public com.google.protobuf.ByteString
- getInstanceIdentifierPathArgumentsBytes() {
- java.lang.Object ref = instanceIdentifierPathArguments_;
- if (ref instanceof String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- instanceIdentifierPathArguments_ = b;
- return b;
+ public Builder setInstanceIdentifierPathArguments(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier value) {
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ instanceIdentifierPathArguments_ = value;
+ onChanged();
} else {
- return (com.google.protobuf.ByteString) ref;
+ instanceIdentifierPathArgumentsBuilder_.setMessage(value);
}
+ bitField0_ |= 0x00000001;
+ return this;
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
public Builder setInstanceIdentifierPathArguments(
- java.lang.String value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000001;
- instanceIdentifierPathArguments_ = value;
- onChanged();
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder builderForValue) {
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ instanceIdentifierPathArguments_ = builderForValue.build();
+ onChanged();
+ } else {
+ instanceIdentifierPathArgumentsBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
+ */
+ public Builder mergeInstanceIdentifierPathArguments(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier value) {
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) == 0x00000001) &&
+ instanceIdentifierPathArguments_ != org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance()) {
+ instanceIdentifierPathArguments_ =
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.newBuilder(instanceIdentifierPathArguments_).mergeFrom(value).buildPartial();
+ } else {
+ instanceIdentifierPathArguments_ = value;
+ }
+ onChanged();
+ } else {
+ instanceIdentifierPathArgumentsBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000001;
return this;
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
public Builder clearInstanceIdentifierPathArguments() {
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ instanceIdentifierPathArguments_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+ onChanged();
+ } else {
+ instanceIdentifierPathArgumentsBuilder_.clear();
+ }
bitField0_ = (bitField0_ & ~0x00000001);
- instanceIdentifierPathArguments_ = getDefaultInstance().getInstanceIdentifierPathArguments();
- onChanged();
return this;
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- public Builder setInstanceIdentifierPathArgumentsBytes(
- com.google.protobuf.ByteString value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000001;
- instanceIdentifierPathArguments_ = value;
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder getInstanceIdentifierPathArgumentsBuilder() {
+ bitField0_ |= 0x00000001;
onChanged();
- return this;
+ return getInstanceIdentifierPathArgumentsFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getInstanceIdentifierPathArgumentsOrBuilder() {
+ if (instanceIdentifierPathArgumentsBuilder_ != null) {
+ return instanceIdentifierPathArgumentsBuilder_.getMessageOrBuilder();
+ } else {
+ return instanceIdentifierPathArguments_;
+ }
+ }
+ /**
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>
+ getInstanceIdentifierPathArgumentsFieldBuilder() {
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ instanceIdentifierPathArgumentsBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>(
+ instanceIdentifierPathArguments_,
+ getParentForChildren(),
+ isClean());
+ instanceIdentifierPathArguments_ = null;
+ }
+ return instanceIdentifierPathArgumentsBuilder_;
}
// @@protoc_insertion_point(builder_scope:org.opendaylight.controller.mdsal.ReadData)
public interface WriteDataOrBuilder
extends com.google.protobuf.MessageOrBuilder {
- // required string instanceIdentifierPathArguments = 1;
+ // required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
boolean hasInstanceIdentifierPathArguments();
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- java.lang.String getInstanceIdentifierPathArguments();
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getInstanceIdentifierPathArguments();
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- com.google.protobuf.ByteString
- getInstanceIdentifierPathArgumentsBytes();
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getInstanceIdentifierPathArgumentsOrBuilder();
// required .org.opendaylight.controller.mdsal.Node normalizedNode = 2;
/**
break;
}
case 10: {
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ subBuilder = instanceIdentifierPathArguments_.toBuilder();
+ }
+ instanceIdentifierPathArguments_ = input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(instanceIdentifierPathArguments_);
+ instanceIdentifierPathArguments_ = subBuilder.buildPartial();
+ }
bitField0_ |= 0x00000001;
- instanceIdentifierPathArguments_ = input.readBytes();
break;
}
case 18: {
}
private int bitField0_;
- // required string instanceIdentifierPathArguments = 1;
+ // required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;
public static final int INSTANCEIDENTIFIERPATHARGUMENTS_FIELD_NUMBER = 1;
- private java.lang.Object instanceIdentifierPathArguments_;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier instanceIdentifierPathArguments_;
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
public boolean hasInstanceIdentifierPathArguments() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- public java.lang.String getInstanceIdentifierPathArguments() {
- java.lang.Object ref = instanceIdentifierPathArguments_;
- 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()) {
- instanceIdentifierPathArguments_ = s;
- }
- return s;
- }
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getInstanceIdentifierPathArguments() {
+ return instanceIdentifierPathArguments_;
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- public com.google.protobuf.ByteString
- getInstanceIdentifierPathArgumentsBytes() {
- java.lang.Object ref = instanceIdentifierPathArguments_;
- if (ref instanceof java.lang.String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- instanceIdentifierPathArguments_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getInstanceIdentifierPathArgumentsOrBuilder() {
+ return instanceIdentifierPathArguments_;
}
// required .org.opendaylight.controller.mdsal.Node normalizedNode = 2;
}
private void initFields() {
- instanceIdentifierPathArguments_ = "";
+ instanceIdentifierPathArguments_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance();
}
private byte memoizedIsInitialized = -1;
memoizedIsInitialized = 0;
return false;
}
+ if (!getInstanceIdentifierPathArguments().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
if (!getNormalizedNode().isInitialized()) {
memoizedIsInitialized = 0;
return false;
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
- output.writeBytes(1, getInstanceIdentifierPathArgumentsBytes());
+ output.writeMessage(1, instanceIdentifierPathArguments_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeMessage(2, normalizedNode_);
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
- .computeBytesSize(1, getInstanceIdentifierPathArgumentsBytes());
+ .computeMessageSize(1, instanceIdentifierPathArguments_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getInstanceIdentifierPathArgumentsFieldBuilder();
getNormalizedNodeFieldBuilder();
}
}
public Builder clear() {
super.clear();
- instanceIdentifierPathArguments_ = "";
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ instanceIdentifierPathArguments_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+ } else {
+ instanceIdentifierPathArgumentsBuilder_.clear();
+ }
bitField0_ = (bitField0_ & ~0x00000001);
if (normalizedNodeBuilder_ == null) {
normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance();
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
- result.instanceIdentifierPathArguments_ = instanceIdentifierPathArguments_;
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ result.instanceIdentifierPathArguments_ = instanceIdentifierPathArguments_;
+ } else {
+ result.instanceIdentifierPathArguments_ = instanceIdentifierPathArgumentsBuilder_.build();
+ }
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages.WriteData other) {
if (other == org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages.WriteData.getDefaultInstance()) return this;
if (other.hasInstanceIdentifierPathArguments()) {
- bitField0_ |= 0x00000001;
- instanceIdentifierPathArguments_ = other.instanceIdentifierPathArguments_;
- onChanged();
+ mergeInstanceIdentifierPathArguments(other.getInstanceIdentifierPathArguments());
}
if (other.hasNormalizedNode()) {
mergeNormalizedNode(other.getNormalizedNode());
return false;
}
+ if (!getInstanceIdentifierPathArguments().isInitialized()) {
+
+ return false;
+ }
if (!getNormalizedNode().isInitialized()) {
return false;
}
private int bitField0_;
- // required string instanceIdentifierPathArguments = 1;
- private java.lang.Object instanceIdentifierPathArguments_ = "";
+ // required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier instanceIdentifierPathArguments_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder> instanceIdentifierPathArgumentsBuilder_;
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
public boolean hasInstanceIdentifierPathArguments() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- public java.lang.String getInstanceIdentifierPathArguments() {
- java.lang.Object ref = instanceIdentifierPathArguments_;
- if (!(ref instanceof java.lang.String)) {
- java.lang.String s = ((com.google.protobuf.ByteString) ref)
- .toStringUtf8();
- instanceIdentifierPathArguments_ = s;
- return s;
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getInstanceIdentifierPathArguments() {
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ return instanceIdentifierPathArguments_;
} else {
- return (java.lang.String) ref;
+ return instanceIdentifierPathArgumentsBuilder_.getMessage();
}
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- public com.google.protobuf.ByteString
- getInstanceIdentifierPathArgumentsBytes() {
- java.lang.Object ref = instanceIdentifierPathArguments_;
- if (ref instanceof String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- instanceIdentifierPathArguments_ = b;
- return b;
+ public Builder setInstanceIdentifierPathArguments(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier value) {
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ instanceIdentifierPathArguments_ = value;
+ onChanged();
} else {
- return (com.google.protobuf.ByteString) ref;
+ instanceIdentifierPathArgumentsBuilder_.setMessage(value);
}
+ bitField0_ |= 0x00000001;
+ return this;
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
public Builder setInstanceIdentifierPathArguments(
- java.lang.String value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000001;
- instanceIdentifierPathArguments_ = value;
- onChanged();
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder builderForValue) {
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ instanceIdentifierPathArguments_ = builderForValue.build();
+ onChanged();
+ } else {
+ instanceIdentifierPathArgumentsBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000001;
return this;
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
+ */
+ public Builder mergeInstanceIdentifierPathArguments(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier value) {
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) == 0x00000001) &&
+ instanceIdentifierPathArguments_ != org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance()) {
+ instanceIdentifierPathArguments_ =
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.newBuilder(instanceIdentifierPathArguments_).mergeFrom(value).buildPartial();
+ } else {
+ instanceIdentifierPathArguments_ = value;
+ }
+ onChanged();
+ } else {
+ instanceIdentifierPathArgumentsBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
public Builder clearInstanceIdentifierPathArguments() {
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ instanceIdentifierPathArguments_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+ onChanged();
+ } else {
+ instanceIdentifierPathArgumentsBuilder_.clear();
+ }
bitField0_ = (bitField0_ & ~0x00000001);
- instanceIdentifierPathArguments_ = getDefaultInstance().getInstanceIdentifierPathArguments();
- onChanged();
return this;
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- public Builder setInstanceIdentifierPathArgumentsBytes(
- com.google.protobuf.ByteString value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000001;
- instanceIdentifierPathArguments_ = value;
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder getInstanceIdentifierPathArgumentsBuilder() {
+ bitField0_ |= 0x00000001;
onChanged();
- return this;
+ return getInstanceIdentifierPathArgumentsFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getInstanceIdentifierPathArgumentsOrBuilder() {
+ if (instanceIdentifierPathArgumentsBuilder_ != null) {
+ return instanceIdentifierPathArgumentsBuilder_.getMessageOrBuilder();
+ } else {
+ return instanceIdentifierPathArguments_;
+ }
+ }
+ /**
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>
+ getInstanceIdentifierPathArgumentsFieldBuilder() {
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ instanceIdentifierPathArgumentsBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>(
+ instanceIdentifierPathArguments_,
+ getParentForChildren(),
+ isClean());
+ instanceIdentifierPathArguments_ = null;
+ }
+ return instanceIdentifierPathArgumentsBuilder_;
}
// required .org.opendaylight.controller.mdsal.Node normalizedNode = 2;
public interface MergeDataOrBuilder
extends com.google.protobuf.MessageOrBuilder {
- // required string instanceIdentifierPathArguments = 1;
+ // required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
boolean hasInstanceIdentifierPathArguments();
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- java.lang.String getInstanceIdentifierPathArguments();
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getInstanceIdentifierPathArguments();
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- com.google.protobuf.ByteString
- getInstanceIdentifierPathArgumentsBytes();
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getInstanceIdentifierPathArgumentsOrBuilder();
// required .org.opendaylight.controller.mdsal.Node normalizedNode = 2;
/**
break;
}
case 10: {
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ subBuilder = instanceIdentifierPathArguments_.toBuilder();
+ }
+ instanceIdentifierPathArguments_ = input.readMessage(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(instanceIdentifierPathArguments_);
+ instanceIdentifierPathArguments_ = subBuilder.buildPartial();
+ }
bitField0_ |= 0x00000001;
- instanceIdentifierPathArguments_ = input.readBytes();
break;
}
case 18: {
}
private int bitField0_;
- // required string instanceIdentifierPathArguments = 1;
+ // required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;
public static final int INSTANCEIDENTIFIERPATHARGUMENTS_FIELD_NUMBER = 1;
- private java.lang.Object instanceIdentifierPathArguments_;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier instanceIdentifierPathArguments_;
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
public boolean hasInstanceIdentifierPathArguments() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- public java.lang.String getInstanceIdentifierPathArguments() {
- java.lang.Object ref = instanceIdentifierPathArguments_;
- 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()) {
- instanceIdentifierPathArguments_ = s;
- }
- return s;
- }
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getInstanceIdentifierPathArguments() {
+ return instanceIdentifierPathArguments_;
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- public com.google.protobuf.ByteString
- getInstanceIdentifierPathArgumentsBytes() {
- java.lang.Object ref = instanceIdentifierPathArguments_;
- if (ref instanceof java.lang.String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- instanceIdentifierPathArguments_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getInstanceIdentifierPathArgumentsOrBuilder() {
+ return instanceIdentifierPathArguments_;
}
// required .org.opendaylight.controller.mdsal.Node normalizedNode = 2;
}
private void initFields() {
- instanceIdentifierPathArguments_ = "";
+ instanceIdentifierPathArguments_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance();
}
private byte memoizedIsInitialized = -1;
memoizedIsInitialized = 0;
return false;
}
+ if (!getInstanceIdentifierPathArguments().isInitialized()) {
+ memoizedIsInitialized = 0;
+ return false;
+ }
if (!getNormalizedNode().isInitialized()) {
memoizedIsInitialized = 0;
return false;
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
- output.writeBytes(1, getInstanceIdentifierPathArgumentsBytes());
+ output.writeMessage(1, instanceIdentifierPathArguments_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeMessage(2, normalizedNode_);
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
- .computeBytesSize(1, getInstanceIdentifierPathArgumentsBytes());
+ .computeMessageSize(1, instanceIdentifierPathArguments_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getInstanceIdentifierPathArgumentsFieldBuilder();
getNormalizedNodeFieldBuilder();
}
}
public Builder clear() {
super.clear();
- instanceIdentifierPathArguments_ = "";
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ instanceIdentifierPathArguments_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+ } else {
+ instanceIdentifierPathArgumentsBuilder_.clear();
+ }
bitField0_ = (bitField0_ & ~0x00000001);
if (normalizedNodeBuilder_ == null) {
normalizedNode_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.getDefaultInstance();
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
- result.instanceIdentifierPathArguments_ = instanceIdentifierPathArguments_;
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ result.instanceIdentifierPathArguments_ = instanceIdentifierPathArguments_;
+ } else {
+ result.instanceIdentifierPathArguments_ = instanceIdentifierPathArgumentsBuilder_.build();
+ }
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages.MergeData other) {
if (other == org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages.MergeData.getDefaultInstance()) return this;
if (other.hasInstanceIdentifierPathArguments()) {
- bitField0_ |= 0x00000001;
- instanceIdentifierPathArguments_ = other.instanceIdentifierPathArguments_;
- onChanged();
+ mergeInstanceIdentifierPathArguments(other.getInstanceIdentifierPathArguments());
}
if (other.hasNormalizedNode()) {
mergeNormalizedNode(other.getNormalizedNode());
return false;
}
+ if (!getInstanceIdentifierPathArguments().isInitialized()) {
+
+ return false;
+ }
if (!getNormalizedNode().isInitialized()) {
return false;
}
private int bitField0_;
- // required string instanceIdentifierPathArguments = 1;
- private java.lang.Object instanceIdentifierPathArguments_ = "";
+ // required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;
+ private org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier instanceIdentifierPathArguments_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder> instanceIdentifierPathArgumentsBuilder_;
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
public boolean hasInstanceIdentifierPathArguments() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- public java.lang.String getInstanceIdentifierPathArguments() {
- java.lang.Object ref = instanceIdentifierPathArguments_;
- if (!(ref instanceof java.lang.String)) {
- java.lang.String s = ((com.google.protobuf.ByteString) ref)
- .toStringUtf8();
- instanceIdentifierPathArguments_ = s;
- return s;
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier getInstanceIdentifierPathArguments() {
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ return instanceIdentifierPathArguments_;
} else {
- return (java.lang.String) ref;
+ return instanceIdentifierPathArgumentsBuilder_.getMessage();
}
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- public com.google.protobuf.ByteString
- getInstanceIdentifierPathArgumentsBytes() {
- java.lang.Object ref = instanceIdentifierPathArguments_;
- if (ref instanceof String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- instanceIdentifierPathArguments_ = b;
- return b;
+ public Builder setInstanceIdentifierPathArguments(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier value) {
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ instanceIdentifierPathArguments_ = value;
+ onChanged();
} else {
- return (com.google.protobuf.ByteString) ref;
+ instanceIdentifierPathArgumentsBuilder_.setMessage(value);
}
+ bitField0_ |= 0x00000001;
+ return this;
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
public Builder setInstanceIdentifierPathArguments(
- java.lang.String value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000001;
- instanceIdentifierPathArguments_ = value;
- onChanged();
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder builderForValue) {
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ instanceIdentifierPathArguments_ = builderForValue.build();
+ onChanged();
+ } else {
+ instanceIdentifierPathArgumentsBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000001;
+ return this;
+ }
+ /**
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
+ */
+ public Builder mergeInstanceIdentifierPathArguments(org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier value) {
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ if (((bitField0_ & 0x00000001) == 0x00000001) &&
+ instanceIdentifierPathArguments_ != org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance()) {
+ instanceIdentifierPathArguments_ =
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.newBuilder(instanceIdentifierPathArguments_).mergeFrom(value).buildPartial();
+ } else {
+ instanceIdentifierPathArguments_ = value;
+ }
+ onChanged();
+ } else {
+ instanceIdentifierPathArgumentsBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000001;
return this;
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
public Builder clearInstanceIdentifierPathArguments() {
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ instanceIdentifierPathArguments_ = org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.getDefaultInstance();
+ onChanged();
+ } else {
+ instanceIdentifierPathArgumentsBuilder_.clear();
+ }
bitField0_ = (bitField0_ & ~0x00000001);
- instanceIdentifierPathArguments_ = getDefaultInstance().getInstanceIdentifierPathArguments();
- onChanged();
return this;
}
/**
- * <code>required string instanceIdentifierPathArguments = 1;</code>
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
*/
- public Builder setInstanceIdentifierPathArgumentsBytes(
- com.google.protobuf.ByteString value) {
- if (value == null) {
- throw new NullPointerException();
- }
- bitField0_ |= 0x00000001;
- instanceIdentifierPathArguments_ = value;
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder getInstanceIdentifierPathArgumentsBuilder() {
+ bitField0_ |= 0x00000001;
onChanged();
- return this;
+ return getInstanceIdentifierPathArgumentsFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
+ */
+ public org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder getInstanceIdentifierPathArgumentsOrBuilder() {
+ if (instanceIdentifierPathArgumentsBuilder_ != null) {
+ return instanceIdentifierPathArgumentsBuilder_.getMessageOrBuilder();
+ } else {
+ return instanceIdentifierPathArguments_;
+ }
+ }
+ /**
+ * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>
+ getInstanceIdentifierPathArgumentsFieldBuilder() {
+ if (instanceIdentifierPathArgumentsBuilder_ == null) {
+ instanceIdentifierPathArgumentsBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>(
+ instanceIdentifierPathArguments_,
+ getParentForChildren(),
+ isClean());
+ instanceIdentifierPathArguments_ = null;
+ }
+ return instanceIdentifierPathArgumentsBuilder_;
}
// required .org.opendaylight.controller.mdsal.Node normalizedNode = 2;
java.lang.String[] descriptorData = {
"\n\026ShardTransaction.proto\022!org.opendaylig" +
"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 \002(\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 \001(\0132\'.org.opendaylight.controller" +
- ".mdsal.Node\"u\n\tWriteData\022\'\n\037instanceIden" +
- "tifierPathArguments\030\001 \002(\t\022?\n\016normalizedN" +
- "ode\030\002 \002(\0132\'.org.opendaylight.controller." +
- "mdsal.Node\"\020\n\016WriteDataReply\"u\n\tMergeDat" +
- "a\022\'\n\037instanceIdentifierPathArguments\030\001 \002" +
- "(\t\022?\n\016normalizedNode\030\002 \002(\0132\'.org.openday" +
- "light.controller.mdsal.Node\"\020\n\016MergeData" +
- "ReplyBV\n:org.opendaylight.controller.pro",
- "tobuff.messages.transactionB\030ShardTransa" +
- "ctionMessages"
+ "seTransaction\"\027\n\025CloseTransactionReply\"*" +
+ "\n\021CreateTransaction\022\025\n\rtransactionId\030\001 \002" +
+ "(\t\"M\n\026CreateTransactionReply\022\034\n\024transact" +
+ "ionActorPath\030\001 \002(\t\022\025\n\rtransactionId\030\002 \002(" +
+ "\t\"\022\n\020ReadyTransaction\"*\n\025ReadyTransactio" +
+ "nReply\022\021\n\tactorPath\030\001 \002(\t\"l\n\nDeleteData\022" +
+ "^\n\037instanceIdentifierPathArguments\030\001 \002(\013" +
+ "25.org.opendaylight.controller.mdsal.Ins",
+ "tanceIdentifier\"\021\n\017DeleteDataReply\"j\n\010Re" +
+ "adData\022^\n\037instanceIdentifierPathArgument" +
+ "s\030\001 \002(\01325.org.opendaylight.controller.md" +
+ "sal.InstanceIdentifier\"P\n\rReadDataReply\022" +
+ "?\n\016normalizedNode\030\001 \001(\0132\'.org.opendaylig" +
+ "ht.controller.mdsal.Node\"\254\001\n\tWriteData\022^" +
+ "\n\037instanceIdentifierPathArguments\030\001 \002(\0132" +
+ "5.org.opendaylight.controller.mdsal.Inst" +
+ "anceIdentifier\022?\n\016normalizedNode\030\002 \002(\0132\'" +
+ ".org.opendaylight.controller.mdsal.Node\"",
+ "\020\n\016WriteDataReply\"\254\001\n\tMergeData\022^\n\037insta" +
+ "nceIdentifierPathArguments\030\001 \002(\01325.org.o" +
+ "pendaylight.controller.mdsal.InstanceIde" +
+ "ntifier\022?\n\016normalizedNode\030\002 \002(\0132\'.org.op" +
+ "endaylight.controller.mdsal.Node\"\020\n\016Merg" +
+ "eDataReplyBV\n:org.opendaylight.controlle" +
+ "r.protobuff.messages.transactionB\030ShardT" +
+ "ransactionMessages"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
internal_static_org_opendaylight_controller_mdsal_CreateTransaction_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_org_opendaylight_controller_mdsal_CreateTransaction_descriptor,
- new java.lang.String[] { });
+ new java.lang.String[] { "TransactionId", });
internal_static_org_opendaylight_controller_mdsal_CreateTransactionReply_descriptor =
getDescriptor().getMessageTypes().get(3);
internal_static_org_opendaylight_controller_mdsal_CreateTransactionReply_fieldAccessorTable = new
message Attribute{
required string name =1;
optional string value=2;
+ optional string type=3;
+}
+
+message QName {
+ required string value=1;
+}
+
+message PathArgument {
+ required string value=1;
+ optional string type=2; //NodeIdentifier, NodeWithValue, NodeIdentifierWithPredicates
+ optional QName nodeType=3;
+ repeated Attribute attributes=4;
+
+}
+
+message InstanceIdentifier {
+ repeated PathArgument arguments=1;
}
message Node{
- required string path = 1;
+ optional string path = 1;
optional string type = 2;
repeated Attribute attributes = 3;
repeated Node child=4;
optional string value = 5;
+ optional string valueType = 6;
+ repeated string bitsValue = 7;
+ optional InstanceIdentifier instanceIdentifierValue = 8;
}
message Container{
required string parentPath =1 ;
optional Node normalizedNode=2;
-}
\ No newline at end of file
+}
+
+message NodeMapEntry{
+ required InstanceIdentifier instanceIdentifierPath =1;
+ optional Node normalizedNode=2;
+}
+
+message NodeMap{
+repeated NodeMapEntry mapEntries=1;
+}
option java_package = "org.opendaylight.controller.protobuff.messages.datachange.notification";
option java_outer_classname = "DataChangeListenerMessages";
-message DataChanged{
- repeated string instanceIdentifierPathArguments =1 ;
- required Node normalizedNode = 2;
+message DataChanged {
+ optional Node originalSubTree = 1;
+ optional Node updatedSubTree = 2;
+ optional NodeMap originalData =3;
+ optional NodeMap updatedData =4;
+ optional NodeMap createdData =5;
+ repeated InstanceIdentifier removedPaths =6;
}
+
message DataChangedReply{
-}
\ No newline at end of file
+}
package org.opendaylight.controller.mdsal;
+import "Common.proto";
+
option java_package = "org.opendaylight.controller.protobuff.messages.registration";
option java_outer_classname = "ListenerRegistrationMessages";
*/
message RegisterChangeListener{
-required string instanceIdentifierPath=1;
+required InstanceIdentifier instanceIdentifierPath=1;
required string dataChangeListenerActorPath=2;
required int32 dataChangeScope=3;
}
message Modification {
required string type=1;
- required string path=2;
+ required InstanceIdentifier path=2;
optional Node data=3;
}
}
message PrimaryFound {
+ required string primaryPath =1;
}
message PrimaryNotFound {
+ required string shardName =1;
}
}
message CreateTransaction{
-
+ required string transactionId = 1;
}
message CreateTransactionReply{
}
message DeleteData {
-required string instanceIdentifierPathArguments = 1;
+required InstanceIdentifier instanceIdentifierPathArguments = 1;
}
message DeleteDataReply{
}
message ReadData {
-required string instanceIdentifierPathArguments=1;
+required InstanceIdentifier instanceIdentifierPathArguments=1;
}
message ReadDataReply{
}
message WriteData {
- required string instanceIdentifierPathArguments = 1;
+ required InstanceIdentifier instanceIdentifierPathArguments = 1;
required Node normalizedNode =2;
}
}
message MergeData {
- required string instanceIdentifierPathArguments = 1;
+ required InstanceIdentifier instanceIdentifierPathArguments = 1;
required Node normalizedNode =2;
}
message MergeDataReply{
-}
\ No newline at end of file
+}
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.YangInstanceIdentifier;
+import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container;
+import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node;
+import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
@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";
+ 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(
public void testThatANormalizedNodeToProtoBuffNodeEncodeDecode() throws Exception {
final NormalizedNode<?, ?> documentOne = TestModel.createTestContainer();
-
final NormalizedNodeToNodeCodec normalizedNodeToNodeCodec = new NormalizedNodeToNodeCodec(schemaContext);
Container container = normalizedNodeToNodeCodec.encode(YangInstanceIdentifier.builder().build(), documentOne);
//check first level children are proper
List<Node>childrenResult = containerResult.getNormalizedNode().getChildList();
List<Node>childrenOriginal = container.getNormalizedNode().getChildList();
+
+ System.out.println("-------------------------------------------------");
+
+ System.out.println(childrenOriginal.toString());
+
+ System.out.println("-------------------------------------------------");
+
+ System.out.println(childrenResult.toString());
+
boolean bFound;
for(Node resultChild: childrenResult){
bFound = false;
Assert.assertTrue(bFound);
}
+ }
+
+ @Test
+ public void addAugmentations(){
+ String stringId = "/(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)augmented-list" +
+ "/(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)augmented-list[{(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)id=1}]";
+
+ YangInstanceIdentifier identifier = instanceIdentifierFromString(stringId);
+
+ MapEntryNode uno = TestModel.createAugmentedListEntry(1, "Uno");
+
+ NormalizedNodeToNodeCodec codec =
+ new NormalizedNodeToNodeCodec(schemaContext);
+
+ Container encode = codec
+ .encode(identifier, uno);
+
+ System.out.println(encode.getNormalizedNode());
+ codec.decode(identifier, encode.getNormalizedNode());
}
}
+++ /dev/null
-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.YangInstanceIdentifier;
-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(YangInstanceIdentifier id){
- Iterable<YangInstanceIdentifier.PathArgument> 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();
- YangInstanceIdentifier id = YangInstanceIdentifier.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 YangInstanceIdentifier.NodeIdentifier(CH2_QNAME))
- .get();
-
- YangInstanceIdentifier id = YangInstanceIdentifier.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);
-
-
-
- }
-
-}
--- /dev/null
+package org.opendaylight.controller.cluster.datastore.node.utils;
+
+import junit.framework.Assert;
+import org.junit.Test;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+
+public class NodeIdentifierFactoryTest {
+
+ @Test
+ public void validateAugmentationIdentifier(){
+ YangInstanceIdentifier.PathArgument argument = NodeIdentifierFactory
+ .getArgument(
+ "AugmentationIdentifier{childNames=[(urn:opendaylight:flow:table:statistics?revision=2013-12-15)flow-table-statistics]}");
+
+ Assert.assertTrue(argument instanceof YangInstanceIdentifier.AugmentationIdentifier);
+
+
+ }
+
+}
--- /dev/null
+package org.opendaylight.controller.cluster.datastore.util;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages;
+import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+
+public class InstanceIdentifierUtilsTest {
+
+ private static QName TEST_QNAME = QName.create("(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)test");
+ private static QName NODE_WITH_VALUE_QNAME = QName.create("(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)value");
+ private static QName NODE_WITH_PREDICATES_QNAME = QName.create("(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)pred");
+ private static QName NAME_QNAME = QName.create("(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)name");
+
+ @Test
+ public void testSerializationOfNodeIdentifier(){
+ YangInstanceIdentifier.PathArgument p1 =
+ new YangInstanceIdentifier.NodeIdentifier(TEST_QNAME);
+
+ List<YangInstanceIdentifier.PathArgument> arguments = new ArrayList<>();
+
+ arguments.add(p1);
+
+ YangInstanceIdentifier expected = YangInstanceIdentifier.create(arguments);
+
+ NormalizedNodeMessages.InstanceIdentifier instanceIdentifier =
+ InstanceIdentifierUtils.toSerializable(expected);
+
+ YangInstanceIdentifier actual =
+ InstanceIdentifierUtils.fromSerializable(instanceIdentifier);
+
+
+ Assert.assertEquals(expected.getLastPathArgument(),
+ actual.getLastPathArgument());
+
+
+ }
+
+ @Test
+ public void testSerializationOfNodeWithValue(){
+
+ withValue((short) 1);
+ withValue((long) 2);
+ withValue(3);
+ withValue(true);
+
+ }
+
+ private void withValue(Object value){
+ YangInstanceIdentifier.PathArgument p1 =
+ new YangInstanceIdentifier.NodeIdentifier(TEST_QNAME);
+
+ YangInstanceIdentifier.PathArgument p2 =
+ new YangInstanceIdentifier.NodeWithValue(NODE_WITH_VALUE_QNAME, value);
+
+
+ List<YangInstanceIdentifier.PathArgument> arguments = new ArrayList<>();
+
+ arguments.add(p1);
+ arguments.add(p2);
+
+ YangInstanceIdentifier expected = YangInstanceIdentifier.create(arguments);
+
+ NormalizedNodeMessages.InstanceIdentifier instanceIdentifier =
+ InstanceIdentifierUtils.toSerializable(expected);
+
+ YangInstanceIdentifier actual =
+ InstanceIdentifierUtils.fromSerializable(instanceIdentifier);
+
+
+ Assert.assertEquals(expected.getLastPathArgument(),
+ actual.getLastPathArgument());
+ }
+
+
+ @Test
+ public void testSerializationOfNodeIdentifierWithPredicates(){
+
+ withPredicates((short) 1);
+ withPredicates((long) 2);
+ withPredicates(3);
+ withPredicates(true);
+
+ }
+
+ private void withPredicates(Object value){
+ YangInstanceIdentifier.PathArgument p1 =
+ new YangInstanceIdentifier.NodeIdentifier(TEST_QNAME);
+
+ YangInstanceIdentifier.PathArgument p2 =
+ new YangInstanceIdentifier.NodeIdentifierWithPredicates(NODE_WITH_PREDICATES_QNAME, NAME_QNAME, value);
+
+
+ List<YangInstanceIdentifier.PathArgument> arguments = new ArrayList<>();
+
+ arguments.add(p1);
+ arguments.add(p2);
+
+ YangInstanceIdentifier expected = YangInstanceIdentifier.create(arguments);
+
+ NormalizedNodeMessages.InstanceIdentifier instanceIdentifier =
+ InstanceIdentifierUtils.toSerializable(expected);
+
+ YangInstanceIdentifier actual =
+ InstanceIdentifierUtils.fromSerializable(instanceIdentifier);
+
+
+ Assert.assertEquals(expected.getLastPathArgument(),
+ actual.getLastPathArgument());
+ }
+
+ @Test
+ public void testAugmentationIdentifier(){
+ YangInstanceIdentifier.PathArgument p1 =
+ new YangInstanceIdentifier.AugmentationIdentifier(new HashSet(Arrays.asList(TEST_QNAME)));
+
+ List<YangInstanceIdentifier.PathArgument> arguments = new ArrayList<>();
+
+ arguments.add(p1);
+
+ YangInstanceIdentifier expected = YangInstanceIdentifier.create(arguments);
+
+ NormalizedNodeMessages.InstanceIdentifier instanceIdentifier =
+ InstanceIdentifierUtils.toSerializable(expected);
+
+ YangInstanceIdentifier actual =
+ InstanceIdentifierUtils.fromSerializable(instanceIdentifier);
+
+
+ Assert.assertEquals(expected.getLastPathArgument(),
+ actual.getLastPathArgument());
+
+ }
+
+}
import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder;
import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableLeafSetEntryNodeBuilder;
import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableLeafSetNodeBuilder;
+import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableMapEntryNodeBuilder;
import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
public class TestModel {
- public static final QName TEST_QNAME = QName.create(
- "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test",
- "2014-03-13", "test");
-
- public static final QName AUG_QNAME = QName.create(
- "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:aug",
- "2014-03-13", "name");
-
- public static final QName DESC_QNAME = QName.create(TEST_QNAME, "desc");
- public static final QName OUTER_LIST_QNAME = QName.create(TEST_QNAME,
- "outer-list");
- public static final QName INNER_LIST_QNAME = QName.create(TEST_QNAME,
- "inner-list");
- public static final QName OUTER_CHOICE_QNAME = QName.create(TEST_QNAME,
- "outer-choice");
- public static final QName ID_QNAME = QName.create(TEST_QNAME, "id");
- public static final QName NAME_QNAME = QName.create(TEST_QNAME, "name");
- public static final QName VALUE_QNAME = QName.create(TEST_QNAME, "value");
- private static final String DATASTORE_TEST_YANG = "/odl-datastore-test.yang";
- private static final String DATASTORE_AUG_YANG =
- "/odl-datastore-augmentation.yang";
- private static final String DATASTORE_TEST_NOTIFICATION_YANG =
- "/odl-datastore-test-notification.yang";
-
-
- public static final YangInstanceIdentifier TEST_PATH = YangInstanceIdentifier
- .of(TEST_QNAME);
- public static final YangInstanceIdentifier DESC_PATH = YangInstanceIdentifier
- .builder(TEST_PATH).node(DESC_QNAME).build();
- public static final YangInstanceIdentifier OUTER_LIST_PATH = YangInstanceIdentifier
- .builder(TEST_PATH).node(OUTER_LIST_QNAME).build();
- public static final QName TWO_QNAME = QName.create(TEST_QNAME, "two");
- public static final QName THREE_QNAME = QName.create(TEST_QNAME, "three");
-
- private static final Integer ONE_ID = 1;
- private static final Integer TWO_ID = 2;
- private static final String TWO_ONE_NAME = "one";
- private static final String TWO_TWO_NAME = "two";
- private static final String DESC = "Hello there";
-
- // Family specific constants
- public static final QName FAMILY_QNAME =
- QName
- .create(
- "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:notification-test",
- "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,
- "grand-children");
- public static final QName CHILD_NUMBER_QNAME = QName.create(FAMILY_QNAME,
- "child-number");
- public static final QName CHILD_NAME_QNAME = QName.create(FAMILY_QNAME,
- "child-name");
- public static final QName GRAND_CHILD_NUMBER_QNAME = QName.create(
- FAMILY_QNAME, "grand-child-number");
- public static final QName GRAND_CHILD_NAME_QNAME = QName.create(FAMILY_QNAME,
- "grand-child-name");
-
- public static final YangInstanceIdentifier FAMILY_PATH = YangInstanceIdentifier
- .of(FAMILY_QNAME);
- public static final YangInstanceIdentifier FAMILY_DESC_PATH = YangInstanceIdentifier
- .builder(FAMILY_PATH).node(DESC_QNAME).build();
- public static final YangInstanceIdentifier CHILDREN_PATH = YangInstanceIdentifier
- .builder(FAMILY_PATH).node(CHILDREN_QNAME).build();
-
- private static final Integer FIRST_CHILD_ID = 1;
- private static final Integer SECOND_CHILD_ID = 2;
-
- private static final String FIRST_CHILD_NAME = "first child";
- private static final String SECOND_CHILD_NAME = "second child";
-
- private static final Integer FIRST_GRAND_CHILD_ID = 1;
- private static final Integer SECOND_GRAND_CHILD_ID = 2;
-
- private static final String FIRST_GRAND_CHILD_NAME = "first grand child";
- private static final String SECOND_GRAND_CHILD_NAME = "second grand child";
-
- // first child
- private static final YangInstanceIdentifier CHILDREN_1_PATH = YangInstanceIdentifier
- .builder(CHILDREN_PATH)
- .nodeWithKey(CHILDREN_QNAME, CHILD_NUMBER_QNAME, FIRST_CHILD_ID) //
- .build();
- private static final YangInstanceIdentifier CHILDREN_1_NAME_PATH =
- YangInstanceIdentifier.builder(CHILDREN_PATH)
- .nodeWithKey(CHILDREN_QNAME, CHILD_NAME_QNAME, FIRST_CHILD_NAME) //
- .build();
-
- private static final YangInstanceIdentifier CHILDREN_2_PATH = YangInstanceIdentifier
- .builder(CHILDREN_PATH)
- .nodeWithKey(CHILDREN_QNAME, CHILD_NUMBER_QNAME, SECOND_CHILD_ID) //
- .build();
- private static final YangInstanceIdentifier CHILDREN_2_NAME_PATH =
- YangInstanceIdentifier.builder(CHILDREN_PATH)
- .nodeWithKey(CHILDREN_QNAME, CHILD_NAME_QNAME, SECOND_CHILD_NAME) //
- .build();
-
-
- private static final YangInstanceIdentifier GRAND_CHILD_1_PATH =
- YangInstanceIdentifier.builder(CHILDREN_1_PATH)
- .node(GRAND_CHILDREN_QNAME)
- //
- .nodeWithKey(GRAND_CHILDREN_QNAME, GRAND_CHILD_NUMBER_QNAME,
- FIRST_GRAND_CHILD_ID) //
- .build();
-
- private static final YangInstanceIdentifier GRAND_CHILD_1_NAME_PATH =
- YangInstanceIdentifier.builder(CHILDREN_1_PATH)
- .node(GRAND_CHILDREN_QNAME)
- //
- .nodeWithKey(GRAND_CHILDREN_QNAME, GRAND_CHILD_NAME_QNAME,
- FIRST_GRAND_CHILD_NAME) //
- .build();
-
- private static final YangInstanceIdentifier GRAND_CHILD_2_PATH =
- YangInstanceIdentifier.builder(CHILDREN_2_PATH)
- .node(GRAND_CHILDREN_QNAME)
- //
- .nodeWithKey(GRAND_CHILDREN_QNAME, GRAND_CHILD_NUMBER_QNAME,
- SECOND_GRAND_CHILD_ID) //
- .build();
-
- private static final YangInstanceIdentifier GRAND_CHILD_2_NAME_PATH =
- YangInstanceIdentifier.builder(CHILDREN_2_PATH)
- .node(GRAND_CHILDREN_QNAME)
- //
- .nodeWithKey(GRAND_CHILDREN_QNAME, GRAND_CHILD_NAME_QNAME,
- SECOND_GRAND_CHILD_NAME) //
- .build();
-
- private static final YangInstanceIdentifier DESC_PATH_ID = YangInstanceIdentifier
- .builder(DESC_PATH).build();
- private static final YangInstanceIdentifier OUTER_LIST_1_PATH =
- YangInstanceIdentifier.builder(OUTER_LIST_PATH)
- .nodeWithKey(OUTER_LIST_QNAME, ID_QNAME, ONE_ID) //
- .build();
-
- private static final YangInstanceIdentifier OUTER_LIST_2_PATH =
- YangInstanceIdentifier.builder(OUTER_LIST_PATH)
- .nodeWithKey(OUTER_LIST_QNAME, ID_QNAME, TWO_ID) //
- .build();
-
- private static final YangInstanceIdentifier TWO_TWO_PATH = YangInstanceIdentifier
- .builder(OUTER_LIST_2_PATH).node(INNER_LIST_QNAME) //
- .nodeWithKey(INNER_LIST_QNAME, NAME_QNAME, TWO_TWO_NAME) //
- .build();
-
- private static final YangInstanceIdentifier TWO_TWO_VALUE_PATH =
- YangInstanceIdentifier.builder(TWO_TWO_PATH).node(VALUE_QNAME) //
- .build();
-
- private static final MapEntryNode BAR_NODE = mapEntryBuilder(
- OUTER_LIST_QNAME, ID_QNAME, TWO_ID) //
- .withChild(mapNodeBuilder(INNER_LIST_QNAME) //
- .withChild(mapEntry(INNER_LIST_QNAME, NAME_QNAME, TWO_ONE_NAME)) //
- .withChild(mapEntry(INNER_LIST_QNAME, NAME_QNAME, TWO_TWO_NAME)) //
- .build()) //
- .build();
-
- public static final InputStream getDatastoreTestInputStream() {
- return getInputStream(DATASTORE_TEST_YANG);
- }
-
- public static final InputStream getDatastoreAugInputStream() {
- return getInputStream(DATASTORE_AUG_YANG);
- }
-
- public static final InputStream getDatastoreTestNotificationInputStream() {
- return getInputStream(DATASTORE_TEST_NOTIFICATION_YANG);
- }
-
- private static InputStream getInputStream(final String resourceName) {
- return TestModel.class.getResourceAsStream(resourceName);
- }
-
- public static SchemaContext createTestContext() {
- List<InputStream> inputStreams = new ArrayList<>();
- inputStreams.add(getDatastoreTestInputStream());
- inputStreams.add(getDatastoreAugInputStream());
- inputStreams.add(getDatastoreTestNotificationInputStream());
-
- YangParserImpl parser = new YangParserImpl();
- Set<Module> modules = parser.parseYangModelsFromStreams(inputStreams);
- return parser.resolveSchemaContext(modules);
- }
-
- /**
- * Returns a test document
- *
- * <pre>
- * test
- * outer-list
- * id 1
- * outer-list
- * id 2
- * inner-list
- * name "one"
- * inner-list
- * name "two"
- *
- * </pre>
- *
- * @return
- */
- public static NormalizedNode<?, ?> createDocumentOne(
- SchemaContext schemaContext) {
- return ImmutableContainerNodeBuilder
- .create()
- .withNodeIdentifier(
- new YangInstanceIdentifier.NodeIdentifier(schemaContext.getQName()))
- .withChild(createTestContainer()).build();
-
- }
-
- public static ContainerNode createTestContainer() {
-
-
- final LeafSetEntryNode<Object> nike =
- ImmutableLeafSetEntryNodeBuilder
- .create()
- .withNodeIdentifier(
- new YangInstanceIdentifier.NodeWithValue(QName.create(TEST_QNAME,
- "shoe"), "nike")).withValue("nike").build();
- final LeafSetEntryNode<Object> puma =
- ImmutableLeafSetEntryNodeBuilder
- .create()
- .withNodeIdentifier(
- new YangInstanceIdentifier.NodeWithValue(QName.create(TEST_QNAME,
- "shoe"), "puma")).withValue("puma").build();
- final LeafSetNode<Object> shoes =
- ImmutableLeafSetNodeBuilder
- .create()
- .withNodeIdentifier(
- new YangInstanceIdentifier.NodeIdentifier(QName.create(TEST_QNAME,
- "shoe"))).withChild(nike).withChild(puma).build();
+ public static final QName TEST_QNAME = QName.create(
+ "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test",
+ "2014-03-13", "test");
+
+ public static final QName AUG_NAME_QNAME = QName.create(
+ "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:aug",
+ "2014-03-13", "name");
+
+ public static final QName AUG_CONT_QNAME = QName.create(
+ "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:aug",
+ "2014-03-13", "cont");
+
+
+ public static final QName DESC_QNAME = QName.create(TEST_QNAME, "desc");
+ public static final QName POINTER_QNAME =
+ QName.create(TEST_QNAME, "pointer");
+ public static final QName SOME_REF_QNAME =
+ QName.create(TEST_QNAME, "some-ref");
+ public static final QName MYIDENTITY_QNAME =
+ QName.create(TEST_QNAME, "myidentity");
+ public static final QName SWITCH_FEATURES_QNAME =
+ QName.create(TEST_QNAME, "switch-features");
+
+ public static final QName AUGMENTED_LIST_QNAME =
+ QName.create(TEST_QNAME, "augmented-list");
+
+ public static final QName OUTER_LIST_QNAME = QName.create(TEST_QNAME,
+ "outer-list");
+ public static final QName INNER_LIST_QNAME = QName.create(TEST_QNAME,
+ "inner-list");
+ public static final QName OUTER_CHOICE_QNAME = QName.create(TEST_QNAME,
+ "outer-choice");
+ public static final QName ID_QNAME = QName.create(TEST_QNAME, "id");
+ public static final QName NAME_QNAME = QName.create(TEST_QNAME, "name");
+ public static final QName VALUE_QNAME = QName.create(TEST_QNAME, "value");
+ private static final String DATASTORE_TEST_YANG =
+ "/odl-datastore-test.yang";
+ private static final String DATASTORE_AUG_YANG =
+ "/odl-datastore-augmentation.yang";
+ private static final String DATASTORE_TEST_NOTIFICATION_YANG =
+ "/odl-datastore-test-notification.yang";
+
+
+ public static final YangInstanceIdentifier TEST_PATH = YangInstanceIdentifier
+ .of(TEST_QNAME);
+ public static final YangInstanceIdentifier DESC_PATH = YangInstanceIdentifier
+ .builder(TEST_PATH).node(DESC_QNAME).build();
+ public static final YangInstanceIdentifier OUTER_LIST_PATH = YangInstanceIdentifier
+ .builder(TEST_PATH).node(OUTER_LIST_QNAME).build();
+ public static final QName TWO_QNAME = QName.create(TEST_QNAME, "two");
+ public static final QName THREE_QNAME = QName.create(TEST_QNAME, "three");
+
+ private static final Integer ONE_ID = 1;
+ private static final Integer TWO_ID = 2;
+ private static final String TWO_ONE_NAME = "one";
+ private static final String TWO_TWO_NAME = "two";
+ private static final String DESC = "Hello there";
+
+ // Family specific constants
+ public static final QName FAMILY_QNAME =
+ QName
+ .create(
+ "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:notification-test",
+ "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,
+ "grand-children");
+ public static final QName CHILD_NUMBER_QNAME = QName.create(FAMILY_QNAME,
+ "child-number");
+ public static final QName CHILD_NAME_QNAME = QName.create(FAMILY_QNAME,
+ "child-name");
+ public static final QName GRAND_CHILD_NUMBER_QNAME = QName.create(
+ FAMILY_QNAME, "grand-child-number");
+ public static final QName GRAND_CHILD_NAME_QNAME =
+ QName.create(FAMILY_QNAME,
+ "grand-child-name");
+
+ public static final YangInstanceIdentifier FAMILY_PATH = YangInstanceIdentifier
+ .of(FAMILY_QNAME);
+ public static final YangInstanceIdentifier FAMILY_DESC_PATH = YangInstanceIdentifier
+ .builder(FAMILY_PATH).node(DESC_QNAME).build();
+ public static final YangInstanceIdentifier CHILDREN_PATH = YangInstanceIdentifier
+ .builder(FAMILY_PATH).node(CHILDREN_QNAME).build();
+
+ private static final Integer FIRST_CHILD_ID = 1;
+ private static final Integer SECOND_CHILD_ID = 2;
+
+ private static final String FIRST_CHILD_NAME = "first child";
+ private static final String SECOND_CHILD_NAME = "second child";
+
+ private static final Integer FIRST_GRAND_CHILD_ID = 1;
+ private static final Integer SECOND_GRAND_CHILD_ID = 2;
+
+ private static final String FIRST_GRAND_CHILD_NAME = "first grand child";
+ private static final String SECOND_GRAND_CHILD_NAME = "second grand child";
+
+ // first child
+ private static final YangInstanceIdentifier CHILDREN_1_PATH = YangInstanceIdentifier
+ .builder(CHILDREN_PATH)
+ .nodeWithKey(CHILDREN_QNAME, CHILD_NUMBER_QNAME, FIRST_CHILD_ID) //
+ .build();
+ private static final YangInstanceIdentifier CHILDREN_1_NAME_PATH =
+ YangInstanceIdentifier.builder(CHILDREN_PATH)
+ .nodeWithKey(CHILDREN_QNAME, CHILD_NAME_QNAME, FIRST_CHILD_NAME) //
+ .build();
+
+ private static final YangInstanceIdentifier CHILDREN_2_PATH = YangInstanceIdentifier
+ .builder(CHILDREN_PATH)
+ .nodeWithKey(CHILDREN_QNAME, CHILD_NUMBER_QNAME, SECOND_CHILD_ID) //
+ .build();
+ private static final YangInstanceIdentifier CHILDREN_2_NAME_PATH =
+ YangInstanceIdentifier.builder(CHILDREN_PATH)
+ .nodeWithKey(CHILDREN_QNAME, CHILD_NAME_QNAME, SECOND_CHILD_NAME) //
+ .build();
- final LeafSetEntryNode<Object> five =
- ImmutableLeafSetEntryNodeBuilder
+ private static final YangInstanceIdentifier GRAND_CHILD_1_PATH =
+ YangInstanceIdentifier.builder(CHILDREN_1_PATH)
+ .node(GRAND_CHILDREN_QNAME)
+ //
+ .nodeWithKey(GRAND_CHILDREN_QNAME, GRAND_CHILD_NUMBER_QNAME,
+ FIRST_GRAND_CHILD_ID) //
+ .build();
+
+ private static final YangInstanceIdentifier GRAND_CHILD_1_NAME_PATH =
+ YangInstanceIdentifier.builder(CHILDREN_1_PATH)
+ .node(GRAND_CHILDREN_QNAME)
+ //
+ .nodeWithKey(GRAND_CHILDREN_QNAME, GRAND_CHILD_NAME_QNAME,
+ FIRST_GRAND_CHILD_NAME) //
+ .build();
+
+ private static final YangInstanceIdentifier GRAND_CHILD_2_PATH =
+ YangInstanceIdentifier.builder(CHILDREN_2_PATH)
+ .node(GRAND_CHILDREN_QNAME)
+ //
+ .nodeWithKey(GRAND_CHILDREN_QNAME, GRAND_CHILD_NUMBER_QNAME,
+ SECOND_GRAND_CHILD_ID) //
+ .build();
+
+ private static final YangInstanceIdentifier GRAND_CHILD_2_NAME_PATH =
+ YangInstanceIdentifier.builder(CHILDREN_2_PATH)
+ .node(GRAND_CHILDREN_QNAME)
+ //
+ .nodeWithKey(GRAND_CHILDREN_QNAME, GRAND_CHILD_NAME_QNAME,
+ SECOND_GRAND_CHILD_NAME) //
+ .build();
+
+ private static final YangInstanceIdentifier DESC_PATH_ID = YangInstanceIdentifier
+ .builder(DESC_PATH).build();
+ private static final YangInstanceIdentifier OUTER_LIST_1_PATH =
+ YangInstanceIdentifier.builder(OUTER_LIST_PATH)
+ .nodeWithKey(OUTER_LIST_QNAME, ID_QNAME, ONE_ID) //
+ .build();
+
+ private static final YangInstanceIdentifier OUTER_LIST_2_PATH =
+ YangInstanceIdentifier.builder(OUTER_LIST_PATH)
+ .nodeWithKey(OUTER_LIST_QNAME, ID_QNAME, TWO_ID) //
+ .build();
+
+ private static final YangInstanceIdentifier TWO_TWO_PATH = YangInstanceIdentifier
+ .builder(OUTER_LIST_2_PATH).node(INNER_LIST_QNAME) //
+ .nodeWithKey(INNER_LIST_QNAME, NAME_QNAME, TWO_TWO_NAME) //
+ .build();
+
+ private static final YangInstanceIdentifier TWO_TWO_VALUE_PATH =
+ YangInstanceIdentifier.builder(TWO_TWO_PATH).node(VALUE_QNAME) //
+ .build();
+
+ private static final MapEntryNode BAR_NODE = mapEntryBuilder(
+ OUTER_LIST_QNAME, ID_QNAME, TWO_ID) //
+ .withChild(mapNodeBuilder(INNER_LIST_QNAME) //
+ .withChild(mapEntry(INNER_LIST_QNAME, NAME_QNAME, TWO_ONE_NAME)) //
+ .withChild(mapEntry(INNER_LIST_QNAME, NAME_QNAME, TWO_TWO_NAME)) //
+ .build()) //
+ .build();
+
+ public static final InputStream getDatastoreTestInputStream() {
+ return getInputStream(DATASTORE_TEST_YANG);
+ }
+
+ public static final InputStream getDatastoreAugInputStream() {
+ return getInputStream(DATASTORE_AUG_YANG);
+ }
+
+ public static final InputStream getDatastoreTestNotificationInputStream() {
+ return getInputStream(DATASTORE_TEST_NOTIFICATION_YANG);
+ }
+
+ private static InputStream getInputStream(final String resourceName) {
+ return TestModel.class.getResourceAsStream(resourceName);
+ }
+
+ public static SchemaContext createTestContext() {
+ List<InputStream> inputStreams = new ArrayList<>();
+ inputStreams.add(getDatastoreTestInputStream());
+ inputStreams.add(getDatastoreAugInputStream());
+ inputStreams.add(getDatastoreTestNotificationInputStream());
+
+ YangParserImpl parser = new YangParserImpl();
+ Set<Module> modules = parser.parseYangModelsFromStreams(inputStreams);
+ return parser.resolveSchemaContext(modules);
+ }
+
+ /**
+ * Returns a test document
+ * <p/>
+ * <pre>
+ * test
+ * outer-list
+ * id 1
+ * outer-list
+ * id 2
+ * inner-list
+ * name "one"
+ * inner-list
+ * name "two"
+ *
+ * </pre>
+ *
+ * @return
+ */
+ public static NormalizedNode<?, ?> createDocumentOne(
+ SchemaContext schemaContext) {
+ return ImmutableContainerNodeBuilder
.create()
.withNodeIdentifier(
- (new YangInstanceIdentifier.NodeWithValue(QName.create(TEST_QNAME,
- "number"), 5))).withValue(5).build();
- final LeafSetEntryNode<Object> fifteen =
- ImmutableLeafSetEntryNodeBuilder
+ new YangInstanceIdentifier.NodeIdentifier(schemaContext.getQName()))
+ .withChild(createTestContainer()).build();
+
+ }
+
+ public static ContainerNode createTestContainer() {
+
+
+ // Create a list of shoes
+ // This is to test leaf list entry
+ final LeafSetEntryNode<Object> nike =
+ ImmutableLeafSetEntryNodeBuilder
+ .create()
+ .withNodeIdentifier(
+ new YangInstanceIdentifier.NodeWithValue(
+ QName.create(TEST_QNAME,
+ "shoe"), "nike")
+ ).withValue("nike").build();
+
+ final LeafSetEntryNode<Object> puma =
+ ImmutableLeafSetEntryNodeBuilder
+ .create()
+ .withNodeIdentifier(
+ new YangInstanceIdentifier.NodeWithValue(
+ QName.create(TEST_QNAME,
+ "shoe"), "puma")
+ ).withValue("puma").build();
+
+ final LeafSetNode<Object> shoes =
+ ImmutableLeafSetNodeBuilder
+ .create()
+ .withNodeIdentifier(
+ new YangInstanceIdentifier.NodeIdentifier(
+ QName.create(TEST_QNAME,
+ "shoe"))
+ ).withChild(nike).withChild(puma).build();
+
+
+ // Test a leaf-list where each entry contains an identity
+ final LeafSetEntryNode<Object> cap1 =
+ ImmutableLeafSetEntryNodeBuilder
+ .create()
+ .withNodeIdentifier(
+ new YangInstanceIdentifier.NodeWithValue(
+ QName.create(TEST_QNAME,
+ "capability"), DESC_QNAME)
+ ).withValue(DESC_QNAME).build();
+
+ final LeafSetNode<Object> capabilities =
+ ImmutableLeafSetNodeBuilder
+ .create()
+ .withNodeIdentifier(
+ new YangInstanceIdentifier.NodeIdentifier(
+ QName.create(TEST_QNAME,
+ "capability"))
+ ).withChild(cap1).build();
+
+ ContainerNode switchFeatures = ImmutableContainerNodeBuilder
.create()
- .withNodeIdentifier(
- (new YangInstanceIdentifier.NodeWithValue(QName.create(TEST_QNAME,
- "number"), 15))).withValue(15).build();
- final LeafSetNode<Object> numbers =
- ImmutableLeafSetNodeBuilder
+ .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(
+ SWITCH_FEATURES_QNAME))
+ .withChild(capabilities)
+ .build();
+
+ // Create a leaf list with numbers
+ final LeafSetEntryNode<Object> five =
+ ImmutableLeafSetEntryNodeBuilder
+ .create()
+ .withNodeIdentifier(
+ (new YangInstanceIdentifier.NodeWithValue(
+ QName.create(TEST_QNAME,
+ "number"), 5))
+ ).withValue(5).build();
+ final LeafSetEntryNode<Object> fifteen =
+ ImmutableLeafSetEntryNodeBuilder
+ .create()
+ .withNodeIdentifier(
+ (new YangInstanceIdentifier.NodeWithValue(
+ QName.create(TEST_QNAME,
+ "number"), 15))
+ ).withValue(15).build();
+ final LeafSetNode<Object> numbers =
+ ImmutableLeafSetNodeBuilder
+ .create()
+ .withNodeIdentifier(
+ new YangInstanceIdentifier.NodeIdentifier(
+ QName.create(TEST_QNAME,
+ "number"))
+ ).withChild(five).withChild(fifteen).build();
+
+
+ // Create augmentations
+ MapEntryNode mapEntry = createAugmentedListEntry(1, "First Test");
+
+
+ // Create the document
+ return ImmutableContainerNodeBuilder
.create()
.withNodeIdentifier(
- new YangInstanceIdentifier.NodeIdentifier(QName.create(TEST_QNAME,
- "number"))).withChild(five).withChild(fifteen).build();
-
-
- Set<QName> childAugmentations = new HashSet<>();
- childAugmentations.add(AUG_QNAME);
- final YangInstanceIdentifier.AugmentationIdentifier augmentationIdentifier =
- new YangInstanceIdentifier.AugmentationIdentifier(null, childAugmentations);
- final AugmentationNode augmentationNode =
- Builders.augmentationBuilder()
- .withNodeIdentifier(augmentationIdentifier)
- .withChild(ImmutableNodes.leafNode(AUG_QNAME, "First Test"))
+ new YangInstanceIdentifier.NodeIdentifier(TEST_QNAME))
+ .withChild(ImmutableNodes.leafNode(DESC_QNAME, DESC))
+ .withChild(ImmutableNodes.leafNode(POINTER_QNAME, "pointer"))
+ .withChild(ImmutableNodes.leafNode(SOME_REF_QNAME,
+ YangInstanceIdentifier.builder().build()))
+ .withChild(ImmutableNodes.leafNode(MYIDENTITY_QNAME, DESC_QNAME))
+
+ //.withChild(augmentationNode)
+ .withChild(shoes)
+ .withChild(numbers)
+ .withChild(switchFeatures)
+ .withChild(mapNodeBuilder(AUGMENTED_LIST_QNAME).withChild(mapEntry).build())
+ .withChild(
+ mapNodeBuilder(OUTER_LIST_QNAME)
+ .withChild(mapEntry(OUTER_LIST_QNAME, ID_QNAME, ONE_ID))
+ .withChild(BAR_NODE).build()
+ ).build();
+
+ }
+
+ public static MapEntryNode createAugmentedListEntry(int id, String name) {
+
+ Set<QName> childAugmentations = new HashSet<>();
+ childAugmentations.add(AUG_CONT_QNAME);
+
+ ContainerNode augCont = ImmutableContainerNodeBuilder
+ .create()
+ .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(AUG_CONT_QNAME))
+ .withChild(ImmutableNodes.leafNode(AUG_NAME_QNAME, name))
.build();
- return ImmutableContainerNodeBuilder
- .create()
- .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(TEST_QNAME))
- .withChild(ImmutableNodes.leafNode(DESC_QNAME, DESC))
- .withChild(augmentationNode)
- .withChild(shoes)
- .withChild(numbers)
- .withChild(
- mapNodeBuilder(OUTER_LIST_QNAME)
- .withChild(mapEntry(OUTER_LIST_QNAME, ID_QNAME, ONE_ID))
- .withChild(BAR_NODE).build()).build();
-
- }
-
-
- public static ContainerNode createFamily() {
- final DataContainerNodeAttrBuilder<YangInstanceIdentifier.NodeIdentifier, ContainerNode> familyContainerBuilder =
- ImmutableContainerNodeBuilder.create().withNodeIdentifier(
- new YangInstanceIdentifier.NodeIdentifier(FAMILY_QNAME));
-
- final CollectionNodeBuilder<MapEntryNode, MapNode> childrenBuilder =
- mapNodeBuilder(CHILDREN_QNAME);
-
- final DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode> firstChildBuilder =
- mapEntryBuilder(CHILDREN_QNAME, CHILD_NUMBER_QNAME, FIRST_CHILD_ID);
- final DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode> secondChildBuilder =
- mapEntryBuilder(CHILDREN_QNAME, CHILD_NUMBER_QNAME, SECOND_CHILD_ID);
-
- final DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode> firstGrandChildBuilder =
- mapEntryBuilder(GRAND_CHILDREN_QNAME, GRAND_CHILD_NUMBER_QNAME,
- FIRST_GRAND_CHILD_ID);
- final DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode> secondGrandChildBuilder =
- mapEntryBuilder(GRAND_CHILDREN_QNAME, GRAND_CHILD_NUMBER_QNAME,
- SECOND_GRAND_CHILD_ID);
-
- firstGrandChildBuilder
- .withChild(
- ImmutableNodes.leafNode(GRAND_CHILD_NUMBER_QNAME,
- FIRST_GRAND_CHILD_ID)).withChild(
- ImmutableNodes.leafNode(GRAND_CHILD_NAME_QNAME,
- FIRST_GRAND_CHILD_NAME));
-
- secondGrandChildBuilder.withChild(
- ImmutableNodes
- .leafNode(GRAND_CHILD_NUMBER_QNAME, SECOND_GRAND_CHILD_ID))
- .withChild(
- ImmutableNodes.leafNode(GRAND_CHILD_NAME_QNAME,
- SECOND_GRAND_CHILD_NAME));
- firstChildBuilder
- .withChild(ImmutableNodes.leafNode(CHILD_NUMBER_QNAME, FIRST_CHILD_ID))
- .withChild(ImmutableNodes.leafNode(CHILD_NAME_QNAME, FIRST_CHILD_NAME))
- .withChild(
- mapNodeBuilder(GRAND_CHILDREN_QNAME).withChild(
- firstGrandChildBuilder.build()).build());
+ final YangInstanceIdentifier.AugmentationIdentifier augmentationIdentifier =
+ new YangInstanceIdentifier.AugmentationIdentifier(childAugmentations);
- secondChildBuilder
- .withChild(ImmutableNodes.leafNode(CHILD_NUMBER_QNAME, SECOND_CHILD_ID))
- .withChild(ImmutableNodes.leafNode(CHILD_NAME_QNAME, SECOND_CHILD_NAME))
- .withChild(
- mapNodeBuilder(GRAND_CHILDREN_QNAME).withChild(
- firstGrandChildBuilder.build()).build());
+ final AugmentationNode augmentationNode =
+ Builders.augmentationBuilder()
+ .withNodeIdentifier(augmentationIdentifier)
+ .withChild(augCont)
+ .build();
- childrenBuilder.withChild(firstChildBuilder.build());
- childrenBuilder.withChild(secondChildBuilder.build());
-
- return familyContainerBuilder.withChild(childrenBuilder.build()).build();
- }
+ return ImmutableMapEntryNodeBuilder.create()
+ .withNodeIdentifier(
+ new YangInstanceIdentifier.NodeIdentifierWithPredicates(
+ AUGMENTED_LIST_QNAME, ID_QNAME, id))
+ .withChild(ImmutableNodes.leafNode(ID_QNAME, id))
+ .withChild(augmentationNode).build();
+ }
+
+
+ public static ContainerNode createFamily() {
+ final DataContainerNodeAttrBuilder<YangInstanceIdentifier.NodeIdentifier, ContainerNode>
+ familyContainerBuilder =
+ ImmutableContainerNodeBuilder.create().withNodeIdentifier(
+ new YangInstanceIdentifier.NodeIdentifier(FAMILY_QNAME));
+
+ final CollectionNodeBuilder<MapEntryNode, MapNode> childrenBuilder =
+ mapNodeBuilder(CHILDREN_QNAME);
+
+ final DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode>
+ firstChildBuilder =
+ mapEntryBuilder(CHILDREN_QNAME, CHILD_NUMBER_QNAME, FIRST_CHILD_ID);
+ final DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode>
+ secondChildBuilder =
+ mapEntryBuilder(CHILDREN_QNAME, CHILD_NUMBER_QNAME,
+ SECOND_CHILD_ID);
+
+ final DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode>
+ firstGrandChildBuilder =
+ mapEntryBuilder(GRAND_CHILDREN_QNAME, GRAND_CHILD_NUMBER_QNAME,
+ FIRST_GRAND_CHILD_ID);
+ final DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode>
+ secondGrandChildBuilder =
+ mapEntryBuilder(GRAND_CHILDREN_QNAME, GRAND_CHILD_NUMBER_QNAME,
+ SECOND_GRAND_CHILD_ID);
+
+ firstGrandChildBuilder
+ .withChild(
+ ImmutableNodes.leafNode(GRAND_CHILD_NUMBER_QNAME,
+ FIRST_GRAND_CHILD_ID)
+ ).withChild(
+ ImmutableNodes.leafNode(GRAND_CHILD_NAME_QNAME,
+ FIRST_GRAND_CHILD_NAME)
+ );
+
+ secondGrandChildBuilder.withChild(
+ ImmutableNodes
+ .leafNode(GRAND_CHILD_NUMBER_QNAME, SECOND_GRAND_CHILD_ID)
+ )
+ .withChild(
+ ImmutableNodes.leafNode(GRAND_CHILD_NAME_QNAME,
+ SECOND_GRAND_CHILD_NAME)
+ );
+
+ firstChildBuilder
+ .withChild(
+ ImmutableNodes.leafNode(CHILD_NUMBER_QNAME, FIRST_CHILD_ID))
+ .withChild(
+ ImmutableNodes.leafNode(CHILD_NAME_QNAME, FIRST_CHILD_NAME))
+ .withChild(
+ mapNodeBuilder(GRAND_CHILDREN_QNAME).withChild(
+ firstGrandChildBuilder.build()).build()
+ );
+
+
+ secondChildBuilder
+ .withChild(
+ ImmutableNodes.leafNode(CHILD_NUMBER_QNAME, SECOND_CHILD_ID))
+ .withChild(
+ ImmutableNodes.leafNode(CHILD_NAME_QNAME, SECOND_CHILD_NAME))
+ .withChild(
+ mapNodeBuilder(GRAND_CHILDREN_QNAME).withChild(
+ firstGrandChildBuilder.build()).build()
+ );
+
+ childrenBuilder.withChild(firstChildBuilder.build());
+ childrenBuilder.withChild(secondChildBuilder.build());
+
+ return familyContainerBuilder.withChild(childrenBuilder.build())
+ .build();
+ }
}
}
- augment "/test:test" {
- leaf name {
- type string;
+ augment "/test:test/test:augmented-list" {
+ container cont {
+ leaf name {
+ type string;
+ }
}
}
-}
\ No newline at end of file
+}
description "Initial revision.";
}
+ identity feature-capability {
+ }
+
container test {
leaf desc {
type string;
type uint8;
}
+ leaf pointer {
+ type leafref {
+ path "/network-topology/topology/node/termination-point/tp-id";
+ }
+ }
+
+ leaf some-ref {
+ type instance-identifier;
+ }
+
+ leaf myidentity {
+ type identityref {
+ base feature-capability;
+ }
+ }
+
+ container switch-features {
+ leaf-list capability {
+ type identityref {
+ base feature-capability;
+ }
+
+ }
+ }
+
+ list augmented-list {
+ key id;
+
+ leaf id {
+ type uint8;
+ }
+ }
+
+
}
-}
\ No newline at end of file
+}
+
/*
* Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
*
import com.google.common.base.Optional;
import com.google.common.collect.Lists;
-import java.util.List;
import jline.console.completer.Completer;
import org.opendaylight.controller.netconf.cli.io.BaseConsoleContext;
import org.opendaylight.controller.netconf.cli.io.ConsoleContext;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
+import java.util.List;
+
class LeafListEntryReader extends BasicDataHolderReader<LeafListSchemaNode> implements
GenericListEntryReader<LeafListSchemaNode> {