2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.sal.binding.spi;
10 import org.opendaylight.yangtools.yang.binding.BaseIdentity;
11 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
12 import org.opendaylight.yangtools.yang.binding.RpcService;
15 * RpcRouter is responsible for selecting RpcService based on provided routing
16 * context identifier {@link RpcRoutingTable#getContextIdentifier()} and path in
17 * overal data tree (@link {@link InstanceIdentifier}.
20 * @author Tony Tkacik <ttkacik@cisco.com>
23 * Type of RpcService for which router provides routing information
24 * and route selection.
26 public interface RpcRouter<T extends RpcService> {
29 * Returns a type of RpcService which is served by this instance of router.
31 * @return type of RpcService which is served by this instance of router.
33 Class<T> getRpcServiceType();
36 * Returns a routing table for particular route context
39 * @return Routing Table for particular route context.
41 <C extends BaseIdentity> RpcRoutingTable<C, T> getRoutingTable(Class<C> routeContext);
44 * Returns an instance of RpcService which is responsible for processing
50 * Instance Identifier which is used as a selector of instance.
51 * @return instance of RpcService which is responsible for processing
54 T getService(Class<? extends BaseIdentity> context, InstanceIdentifier<?> path);
57 * Returns a default fallback instance of RpcService which is responsible
58 * for handling all unknown imports.
60 * @return default instance responsible for processing RPCs.
62 T getDefaultService();
67 void setDefaultService();