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;
12 import org.opendaylight.yangtools.yang.binding.BaseIdentity;
13 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
14 import org.opendaylight.yangtools.yang.binding.RpcImplementation;
15 import org.opendaylight.yangtools.yang.binding.RpcService;
18 * RpcRouter is responsible for selecting RpcService based on provided routing
19 * context identifier {@link RpcRoutingTable#getContextIdentifier()} and path in
20 * overal data tree (@link {@link InstanceIdentifier}.
23 * @author Tony Tkacik <ttkacik@cisco.com>
26 * Type of RpcService for which router provides routing information
27 * and route selection.
29 public interface RpcRouter<T extends RpcService> extends RpcImplementation{
32 * Returns a type of RpcService which is served by this instance of router.
34 * @return type of RpcService which is served by this instance of router.
36 Class<T> getServiceType();
40 * Returns a instance of T which is associated with this router instance
41 * and routes messages based on routing tables.
43 * @return type of RpcService which is served by this instance of router.
45 T getInvocationProxy();
48 * Returns a routing table for particular route context
51 * @return Routing Table for particular route context.
53 <C extends BaseIdentity> RpcRoutingTable<C, T> getRoutingTable(Class<C> routeContext);
56 * Returns an instance of RpcService which is responsible for processing
62 * Instance Identifier which is used as a selector of instance.
63 * @return instance of RpcService which is responsible for processing
66 T getService(Class<? extends BaseIdentity> context, InstanceIdentifier<?> path);
69 * Returns a default fallback instance of RpcService which is responsible
70 * for handling all unknown imports.
72 * @return default instance responsible for processing RPCs.
74 T getDefaultService();
79 void setDefaultService(T service);
81 Set<Class<? extends BaseIdentity>> getContexts();