2 * Copyright (c) 2014 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.connector.api;
10 import java.util.concurrent.Future;
11 import org.opendaylight.yangtools.concepts.Immutable;
13 public interface BindingAwareRpcRouter extends RpcRouter<String, String, String, byte[]> {
16 Future<org.opendaylight.controller.sal.connector.api.RpcRouter.RpcReply<byte[]>> sendRpc(
17 RpcRequest<String, String, String, byte[]> input);
19 class BindingAwareRequest implements RpcRequest<String, String, String, byte[]>, Immutable {
21 private final BindingAwareRouteIdentifier routingInformation;
22 private final byte[] payload;
24 public BindingAwareRequest(BindingAwareRouteIdentifier routingInformation, byte[] payload) {
25 this.routingInformation = routingInformation;
26 this.payload = payload;
30 public BindingAwareRouteIdentifier getRoutingInformation() {
31 return this.routingInformation;
35 public byte[] getPayload() {
40 class BindingAwareRouteIdentifier implements RouteIdentifier<String, String, String>, Immutable {
42 private final String type;
43 private final String route;
44 private final String content;
46 public BindingAwareRouteIdentifier(String type, String route, String content) {
49 this.content = content;
53 * Java class name of Rpc Context.
56 public String getContext() {
61 * String representation of route e.g. node-id
65 public String getRoute() {
70 * Java class name of Rpc Type e.g org.opendaylight.AddFlowInput.
73 public String getType() {
78 public int hashCode() {
81 result = prime * result + (content == null ? 0 : content.hashCode());
82 result = prime * result + (route == null ? 0 : route.hashCode());
83 result = prime * result + (type == null ? 0 : type.hashCode());
88 public boolean equals(Object obj) {
95 if (getClass() != obj.getClass()) {
98 BindingAwareRouteIdentifier other = (BindingAwareRouteIdentifier) obj;
99 if (content == null) {
100 if (other.content != null) {
103 } else if (!content.equals(other.content)) {
107 if (other.route != null) {
110 } else if (!route.equals(other.route)) {
114 if (other.type != null) {
117 } else if (!type.equals(other.type)) {