X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fblueprint%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fblueprint%2Fext%2FRpcUtil.java;fp=opendaylight%2Fblueprint%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fblueprint%2Fext%2FRpcUtil.java;h=0000000000000000000000000000000000000000;hp=0d17e38b1ab0a789a8ff573c8c292b5b85c0ee20;hb=77387f3590ca4c42c3ddce52131d5c00d2a3992d;hpb=38a901672a5bc7c5658a7627f8f5aa14dfedd80d;ds=sidebyside diff --git a/opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/RpcUtil.java b/opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/RpcUtil.java deleted file mode 100644 index 0d17e38b1a..0000000000 --- a/opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/ext/RpcUtil.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2017 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.blueprint.ext; - -import java.util.List; -import java.util.function.Predicate; -import java.util.stream.Collectors; -import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections; -import org.opendaylight.mdsal.dom.spi.ContentRoutedRpcContext; -import org.opendaylight.yangtools.yang.binding.RpcService; -import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; -import org.opendaylight.yangtools.yang.model.api.stmt.RpcEffectiveStatement; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Utility methods for dealing with various aspects of RPCs and actions. - */ -final class RpcUtil { - private static final Logger LOG = LoggerFactory.getLogger(RpcUtil.class); - - private RpcUtil() { - // Hidden on purpose - } - - static List decomposeRpcService(final Class service, - final EffectiveModelContext schemaContext, final Predicate filter) { - final var moduleName = BindingReflections.getQNameModule(service); - final var module = schemaContext.findModuleStatement(moduleName) - .orElseThrow(() -> new IllegalArgumentException("Module not found in SchemaContext: " + moduleName - + "; service: " + service)); - LOG.debug("Resolved service {} to module {}", service, module); - - return module.streamEffectiveSubstatements(RpcEffectiveStatement.class) - .filter(rpc -> filter.test(ContentRoutedRpcContext.forRpc(rpc))) - .map(RpcEffectiveStatement::argument) - .collect(Collectors.toList()); - } -}