本文整理汇总了Java中org.opendaylight.controller.md.sal.dom.broker.spi.rpc.RpcRoutingStrategy类的典型用法代码示例。如果您正苦于以下问题:Java RpcRoutingStrategy类的具体用法?Java RpcRoutingStrategy怎么用?Java RpcRoutingStrategy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RpcRoutingStrategy类属于org.opendaylight.controller.md.sal.dom.broker.spi.rpc包,在下文中一共展示了RpcRoutingStrategy类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decomposeRpcService
import org.opendaylight.controller.md.sal.dom.broker.spi.rpc.RpcRoutingStrategy; //导入依赖的package包/类
static Collection<SchemaPath> decomposeRpcService(final Class<RpcService> service,
final SchemaContext schemaContext, final Predicate<RpcRoutingStrategy> filter) {
final QNameModule moduleName = BindingReflections.getQNameModule(service);
final Module module = schemaContext.findModuleByNamespaceAndRevision(moduleName.getNamespace(),
moduleName.getRevision());
LOG.debug("Resolved service {} to module {}", service, module);
final Collection<RpcDefinition> rpcs = module.getRpcs();
final Collection<SchemaPath> ret = new ArrayList<>(rpcs.size());
for (RpcDefinition rpc : rpcs) {
final RpcRoutingStrategy strategy = RpcRoutingStrategy.from(rpc);
if (filter.test(strategy)) {
ret.add(rpc.getPath());
}
}
return ret;
}
示例2: createRpcEntry
import org.opendaylight.controller.md.sal.dom.broker.spi.rpc.RpcRoutingStrategy; //导入依赖的package包/类
private static AbstractDOMRpcRoutingTableEntry createRpcEntry(final SchemaContext context, final SchemaPath key,
final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> implementations) {
final RpcDefinition rpcDef = findRpcDefinition(context, key);
if (rpcDef == null) {
return new UnknownDOMRpcRoutingTableEntry(key, implementations);
}
final RpcRoutingStrategy strategy = RpcRoutingStrategy.from(rpcDef);
if (strategy.isContextBasedRouted()) {
return new RoutedDOMRpcRoutingTableEntry(rpcDef, YangInstanceIdentifier.of(strategy.getLeaf()),
implementations);
}
return new GlobalDOMRpcRoutingTableEntry(rpcDef, implementations);
}
示例3: registerFallback
import org.opendaylight.controller.md.sal.dom.broker.spi.rpc.RpcRoutingStrategy; //导入依赖的package包/类
private void registerFallback(final Class<RpcService> interfaceClass) {
final Collection<SchemaPath> paths = RpcUtil.decomposeRpcService(interfaceClass,
schemaService.getGlobalContext(), RpcRoutingStrategy::isContextBasedRouted);
if (paths.isEmpty()) {
LOG.warn("{}: interface {} has no actions defined", ACTION_PROVIDER, interfaceClass);
return;
}
final Set<DOMRpcIdentifier> rpcs = ImmutableSet.copyOf(Collections2.transform(paths, DOMRpcIdentifier::create));
reg = rpcProviderService.registerRpcImplementation((rpc, input) -> {
return Futures.immediateFailedCheckedFuture(new DOMRpcImplementationNotAvailableException(
"Action %s has no instance matching %s", rpc, input));
}, rpcs);
LOG.debug("Registered provider for {}", interfaceName);
}
示例4: createStrategy
import org.opendaylight.controller.md.sal.dom.broker.spi.rpc.RpcRoutingStrategy; //导入依赖的package包/类
private RpcInvocationStrategy createStrategy(final Method method, final RpcDefinition schema) {
final RpcRoutingStrategy strategy = RpcRoutingStrategy.from(schema);
if (strategy.isContextBasedRouted()) {
return new RoutedStrategy(schema.getPath(), method, strategy.getLeaf());
}
return new NonRoutedStrategy(schema.getPath());
}
示例5: rpcFilter
import org.opendaylight.controller.md.sal.dom.broker.spi.rpc.RpcRoutingStrategy; //导入依赖的package包/类
@Override
Predicate<RpcRoutingStrategy> rpcFilter() {
return s -> !s.isContextBasedRouted();
}
示例6: rpcFilter
import org.opendaylight.controller.md.sal.dom.broker.spi.rpc.RpcRoutingStrategy; //导入依赖的package包/类
@Override
Predicate<RpcRoutingStrategy> rpcFilter() {
return RpcRoutingStrategy::isContextBasedRouted;
}
示例7: rpcFilter
import org.opendaylight.controller.md.sal.dom.broker.spi.rpc.RpcRoutingStrategy; //导入依赖的package包/类
abstract Predicate<RpcRoutingStrategy> rpcFilter();