本文整理汇总了Java中org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTree.getSubtreeCodec方法的典型用法代码示例。如果您正苦于以下问题:Java BindingCodecTree.getSubtreeCodec方法的具体用法?Java BindingCodecTree.getSubtreeCodec怎么用?Java BindingCodecTree.getSubtreeCodec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTree
的用法示例。
在下文中一共展示了BindingCodecTree.getSubtreeCodec方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TableContext
import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTree; //导入方法依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
TableContext(final RIBSupport tableSupport, final YangInstanceIdentifier tableId, final BindingCodecTree tree) {
this.tableSupport = requireNonNull(tableSupport);
this.tableId = requireNonNull(tableId);
final BindingCodecTreeNode tableCodecContext = tree.getSubtreeCodec(tableId);
final BindingCodecTreeNode<? extends Route> routeListCodec = tableCodecContext
.streamChild(Routes.class)
.streamChild(this.tableSupport.routesCaseClass())
.streamChild(this.tableSupport.routesContainerClass())
.streamChild(this.tableSupport.routesListClass());
this.attributesCodec = routeListCodec.streamChild(Attributes.class)
.createCachingCodec(this.tableSupport.cacheableAttributeObjects());
this.reachNlriCodec = tree.getSubtreeCodec(MP_REACH_NLRI_II)
.createCachingCodec(this.tableSupport.cacheableNlriObjects());
this.unreachNlriCodec = tree.getSubtreeCodec(MP_UNREACH_NLRI_II)
.createCachingCodec(this.tableSupport.cacheableNlriObjects());
}
示例2: BmpRouterPeerImpl
import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTree; //导入方法依赖的package包/类
private BmpRouterPeerImpl(final DOMTransactionChain domTxChain, final YangInstanceIdentifier peersYangIId,
final PeerId peerId, final RIBExtensionConsumerContext extensions, final PeerUpNotification peerUp,
final BindingCodecTree tree) {
this.domTxChain = requireNonNull(domTxChain);
this.peerId = peerId;
this.peerYangIId = YangInstanceIdentifier.builder(peersYangIId).nodeWithKey(Peer.QNAME, PEER_ID_QNAME,
this.peerId.getValue()).build();
this.sentOpenCodec = tree.getSubtreeCodec(SENT_OPEN_IID);
this.receivedOpenCodec = tree.getSubtreeCodec(RECEIVED_OPEN_IID);
final Set<TablesKey> peerTables = setPeerTables(peerUp.getReceivedOpen());
final DOMDataWriteTransaction wTx = this.domTxChain.newWriteOnlyTransaction();
wTx.put(LogicalDatastoreType.OPERATIONAL, this.peerYangIId, createPeerEntry(peerUp));
wTx.submit();
this.prePolicyWriter = BmpRibInWriter.create(this.peerYangIId.node(PrePolicyRib.QNAME).node(BMP_TABLES_QNAME),
this.domTxChain, extensions, peerTables, tree);
this.postPolicyWriter = BmpRibInWriter.create(this.peerYangIId.node(PostPolicyRib.QNAME).node(BMP_TABLES_QNAME),
this.domTxChain, extensions, peerTables, tree);
}
示例3: onCodecTreeUpdated
import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTree; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void onCodecTreeUpdated(final BindingCodecTree tree) {
@SuppressWarnings("rawtypes")
final BindingCodecTreeNode tableCodecContext = tree.getSubtreeCodec(TABLE_BASE_II);
final BindingCodecTreeNode<? extends Route> routeListCodec = tableCodecContext
.streamChild(Routes.class)
.streamChild(this.ribSupport.routesCaseClass())
.streamChild(this.ribSupport.routesContainerClass())
.streamChild(this.ribSupport.routesListClass());
this.attributesCodec = routeListCodec.streamChild(Attributes.class).createCachingCodec(this.cacheableAttributes);
this.reachNlriCodec = tree.getSubtreeCodec(MP_REACH_NLRI_II).createCachingCodec(this.ribSupport.cacheableNlriObjects());
this.unreachNlriCodec = tree.getSubtreeCodec(MP_UNREACH_NLRI_II).createCachingCodec(this.ribSupport.cacheableNlriObjects());
}
示例4: getSubtreeCodec
import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTree; //导入方法依赖的package包/类
@Nonnull
public Map.Entry<InstanceIdentifier<?>, BindingCodecTreeNode<?>>
getSubtreeCodec(final YangInstanceIdentifier domIdentifier) {
final BindingCodecTree currentCodecTree = this.codecRegistry.getCodecContext();
final InstanceIdentifier<?> bindingPath = this.codecRegistry.fromYangInstanceIdentifier(domIdentifier);
Preconditions.checkArgument(bindingPath != null);
/**
* If we are able to deserialize YANG instance identifier, getSubtreeCodec must
* return non-null value.
*/
final BindingCodecTreeNode<?> codecContext = currentCodecTree.getSubtreeCodec(bindingPath);
return new SimpleEntry<>(bindingPath, codecContext);
}