本文整理汇总了Java中org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument类的典型用法代码示例。如果您正苦于以下问题:Java PathArgument类的具体用法?Java PathArgument怎么用?Java PathArgument使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PathArgument类属于org.opendaylight.yangtools.yang.binding.InstanceIdentifier包,在下文中一共展示了PathArgument类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: logDataTreeChangeEvent
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument; //导入依赖的package包/类
private static synchronized void logDataTreeChangeEvent(final int eventNum,
final Collection<DataTreeModification<TestExec>> changes) {
LOG.debug("DsbenchmarkListener-onDataTreeChanged: Event {}", eventNum);
for (DataTreeModification<TestExec> change : changes) {
final DataObjectModification<TestExec> rootNode = change.getRootNode();
final ModificationType modType = rootNode.getModificationType();
final PathArgument changeId = rootNode.getIdentifier();
final Collection<DataObjectModification<? extends DataObject>> modifications =
rootNode.getModifiedChildren();
LOG.debug(" changeId {}, modType {}, mods: {}", changeId, modType, modifications.size());
for (DataObjectModification<? extends DataObject> mod : modifications) {
LOG.debug(" mod-getDataAfter: {}", mod.getDataAfter());
}
}
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:19,代码来源:DsbenchmarkListener.java
示例2: jsonStringFromConfigureOutput
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument; //导入依赖的package包/类
/**
* Convert ConfigureOutput object to JSON String
* @param object - ConfigureOutput object
* @return - JSON string of ConfigureOutput
*/
public final String jsonStringFromConfigureOutput(DataObject object) {
final Writer writer = new StringWriter();
JsonWriter jsonWriter = JsonWriterFactory.createJsonWriter(writer);
final NormalizedNodeStreamWriter domWriter = JSONNormalizedNodeStreamWriter.createExclusiveWriter(JSONCodecFactory.create(context), CONFIGURE_OUTPUT_PATH, CONFIGURE_OUTPUT_PATH.getLastComponent().getNamespace(), jsonWriter);
RestconfNormalizedNodeWriter restConfWriter = null;
try {
jsonWriter.beginObject();
restConfWriter = (RestconfNormalizedNodeWriter) RestconfDelegatingNormalizedNodeWriter.forStreamWriter(domWriter);
jsonWriter.name("output");
for (DataContainerChild<? extends org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument, ?> child : codecRegistry.toNormalizedNodeRpcData((DataContainer)object).getValue()) {
try {
restConfWriter.write(child);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e2){
e2.printStackTrace();
}
}
jsonWriter.endObject();
restConfWriter.flush();
jsonWriter.flush();
} catch (IOException e1) {
e1.printStackTrace();
}
return writer.toString();
}
开发者ID:opendaylight,项目名称:fpc,代码行数:33,代码来源:FpcCodecUtils.java
示例3: getModifiedChild
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument; //导入依赖的package包/类
@Override
public DataObjectModification<? extends DataObject> getModifiedChild(final PathArgument arg) {
final List<YangInstanceIdentifier.PathArgument> domArgumentList = new ArrayList<>();
final BindingCodecTreeNode<?> childCodec = codec.bindingPathArgumentChild(arg, domArgumentList);
final Iterator<YangInstanceIdentifier.PathArgument> toEnter = domArgumentList.iterator();
DataTreeCandidateNode current = domData;
while (toEnter.hasNext() && current != null) {
current = current.getModifiedChild(toEnter.next());
}
if (current != null) {
return create(childCodec, current);
}
return null;
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:15,代码来源:LazyDataObjectModification.java
示例4: matches
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument; //导入依赖的package包/类
@Override
public boolean matches(Object nodeIId) {
if (! (nodeIId instanceof InstanceIdentifier<?>)) {
return false;
}
boolean result = false;
try {
InstanceIdentifier<Node> actualNodeIId = (InstanceIdentifier<Node>) nodeIId;
List<PathArgument> expectedNodeIIdPath = this.expectedNodeIId.getPath();
List<PathArgument> actualNodeIIdPath = actualNodeIId.getPath();
if (expectedNodeIIdPath.size() != actualNodeIIdPath.size()) {
return false;
}
for (int i = 0; i < expectedNodeIIdPath.size(); i++) {
if (expectedNodeIIdPath.get(i).compareTo(actualNodeIIdPath.get(i)) != 0) {
result = false;
break;
}
}
} catch (ClassCastException e) {
return false;
}
return result;
}
开发者ID:opendaylight,项目名称:netvirt,代码行数:30,代码来源:NodeIIdMatcher.java
示例5: jsonStringFromDataObject
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument; //导入依赖的package包/类
/**
* Converts a {@link DataObject} to a JSON representation in a string using the relevant YANG
* schema if it is present. This defaults to using a {@link org.opendaylight.yangtools.yang.model.api.SchemaContextListener} if running an
* OSGi environment or {@link BindingReflections#loadModuleInfos()} if run while not in an OSGi
* environment or if the schema isn't available via {@link org.opendaylight.yangtools.yang.model.api.SchemaContextListener}.
*
* @param path {@literal InstanceIdentifier<?>}
* @param object DataObject
* @param pretty boolean
* @return String
*/
public final String jsonStringFromDataObject(final InstanceIdentifier<?> path, final DataObject object, final boolean pretty) {
final SchemaPath scPath = SchemaPath.create(FluentIterable.from(path.getPathArguments()).transform(new Function<PathArgument, QName>() {
@Override
public QName apply(final PathArgument input) {
return BindingReflections.findQName(input.getType());
}
}), true);
final Writer writer = new StringWriter();
final NormalizedNodeStreamWriter domWriter;
if(pretty) {
domWriter = JSONNormalizedNodeStreamWriter.createExclusiveWriter(JSONCodecFactory.create(this.context), scPath.getParent(), scPath.getLastComponent().getNamespace(), JsonWriterFactory.createJsonWriter(writer,2));
} else {
domWriter = JSONNormalizedNodeStreamWriter.createExclusiveWriter(JSONCodecFactory.create(this.context), scPath.getParent(), scPath.getLastComponent().getNamespace(), JsonWriterFactory.createJsonWriter(writer));
}
final BindingStreamEventWriter bindingWriter = this.codecRegistry.newWriter(path, domWriter);
try {
this.codecRegistry.getSerializer(path.getTargetType()).serialize(object, bindingWriter);
} catch (final IOException e) {
throw new IllegalStateException(e);
}
return writer.toString();
}
开发者ID:opendaylight,项目名称:ttp,代码行数:38,代码来源:TTPUtils.java
示例6: handleChangedNode
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument; //导入依赖的package包/类
private void handleChangedNode(final DataObjectModification<?> changedNode, final InstanceIdentifier<?> iid,
final Set<InstanceIdentifier<ReportedLsp>> lsps, final Set<InstanceIdentifier<Node>> nodes,
final Map<InstanceIdentifier<?>, DataObject> original, final Map<InstanceIdentifier<?>, DataObject> updated,
final Map<InstanceIdentifier<?>, DataObject> created) {
// Categorize reported identifiers
categorizeIdentifier(iid, lsps, nodes);
// Get the subtrees
switch (changedNode.getModificationType()) {
case DELETE:
original.put(iid, changedNode.getDataBefore());
break;
case SUBTREE_MODIFIED:
original.put(iid, changedNode.getDataBefore());
updated.put(iid, changedNode.getDataAfter());
break;
case WRITE:
created.put(iid, changedNode.getDataAfter());
break;
default:
throw new IllegalArgumentException("Unhandled modification type " + changedNode.getModificationType());
}
for (DataObjectModification<? extends DataObject> child : changedNode.getModifiedChildren()) {
final List<PathArgument> pathArguments = new ArrayList<>();
for (PathArgument pathArgument : iid.getPathArguments()) {
pathArguments.add(pathArgument);
}
pathArguments.add(child.getIdentifier());
final InstanceIdentifier<?> childIID = InstanceIdentifier.create(pathArguments);
handleChangedNode(child, childIID, lsps, nodes, original, updated, created);
}
}
开发者ID:opendaylight,项目名称:bgpcep,代码行数:35,代码来源:NodeChangedListener.java
示例7: getIdentifier
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument; //导入依赖的package包/类
@Override
public PathArgument getIdentifier() {
return identifier;
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:5,代码来源:LazyDataObjectModification.java
示例8: verifyModification
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument; //导入依赖的package包/类
private void verifyModification(final DataObjectModification<? extends DataObject> barWrite, final PathArgument pathArg,
final ModificationType eventType) {
assertEquals(pathArg.getType(), barWrite.getDataType());
assertEquals(eventType,barWrite.getModificationType());
assertEquals(pathArg, barWrite.getIdentifier());
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:7,代码来源:DataTreeChangeListenerTest.java
示例9: getModifiedChild
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument; //导入依赖的package包/类
/**
* Returns a child modification if a node identified by {@code childArgument} was modified by
* this modification.
*
* @param childArgument Path Argument of child node
* @return Modification of child identified by {@code childArgument} if {@code childArgument}
* was modified, null otherwise.
* @throws IllegalArgumentException If supplied path argument is not valid child according to
* generated model.
*
*/
@Nullable DataObjectModification<? extends DataObject> getModifiedChild(PathArgument childArgument);
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:13,代码来源:DataObjectModification.java
示例10: getIdentifier
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument; //导入依赖的package包/类
@Override
PathArgument getIdentifier();
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:3,代码来源:DataObjectModification.java
注:本文中的org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论