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 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) {
26 this.routingInformation = routingInformation;
27 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
58 public String getContext() {
63 * String representation of route e.g. node-id
67 public String getRoute() {
72 * Java class name of Rpc Type e.g org.opendaylight.AddFlowInput
76 public String getType() {
81 public int hashCode() {
84 result = prime * result + ((content == null) ? 0 : content.hashCode());
85 result = prime * result + ((route == null) ? 0 : route.hashCode());
86 result = prime * result + ((type == null) ? 0 : type.hashCode());
91 public boolean equals(Object obj) {
96 if (getClass() != obj.getClass())
98 BindingAwareRouteIdentifier other = (BindingAwareRouteIdentifier) obj;
99 if (content == null) {
100 if (other.content != null)
102 } else if (!content.equals(other.content))
105 if (other.route != null)
107 } else if (!route.equals(other.route))
110 if (other.type != null)
112 } else if (!type.equals(other.type))