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;
12 import org.opendaylight.yangtools.concepts.Immutable;
14 public interface BindingAwareRpcRouter extends RpcRouter<String, String, String, byte[]> {
17 public Future<org.opendaylight.controller.sal.connector.api.RpcRouter.RpcReply<byte[]>> sendRpc(
18 RpcRequest<String, String, String, byte[]> input);
20 class BindingAwareRequest implements RpcRequest<String, String, String, byte[]>, Immutable {
22 private final BindingAwareRouteIdentifier routingInformation;
23 private final byte[] payload;
25 public BindingAwareRequest(BindingAwareRouteIdentifier routingInformation, byte[] payload) {
27 this.routingInformation = routingInformation;
28 this.payload = payload;
31 public BindingAwareRouteIdentifier getRoutingInformation() {
32 return this.routingInformation;
36 public byte[] getPayload() {
41 class BindingAwareRouteIdentifier implements RouteIdentifier<String, String, String>, Immutable {
43 private final String type;
44 private final String route;
45 private final String content;
47 public BindingAwareRouteIdentifier(String type, String route, String content) {
51 this.content = content;
55 * Java class name of Rpc Context
60 public String getContext() {
65 * String representation of route e.g. node-id
69 public String getRoute() {
74 * Java class name of Rpc Type e.g org.opendaylight.AddFlowInput
78 public String getType() {
83 public int hashCode() {
86 result = prime * result + ((content == null) ? 0 : content.hashCode());
87 result = prime * result + ((route == null) ? 0 : route.hashCode());
88 result = prime * result + ((type == null) ? 0 : type.hashCode());
93 public boolean equals(Object obj) {
98 if (getClass() != obj.getClass())
100 BindingAwareRouteIdentifier other = (BindingAwareRouteIdentifier) obj;
101 if (content == null) {
102 if (other.content != null)
104 } else if (!content.equals(other.content))
107 if (other.route != null)
109 } else if (!route.equals(other.route))
112 if (other.type != null)
114 } else if (!type.equals(other.type))