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 edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
11 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 @SuppressFBWarnings("EI_EXPOSE_REP2")
21 class BindingAwareRequest implements RpcRequest<String, String, String, byte[]>, Immutable {
23 private final BindingAwareRouteIdentifier routingInformation;
24 private final byte[] payload;
26 public BindingAwareRequest(BindingAwareRouteIdentifier routingInformation, byte[] payload) {
27 this.routingInformation = routingInformation;
28 this.payload = payload;
32 public BindingAwareRouteIdentifier getRoutingInformation() {
33 return this.routingInformation;
37 @SuppressFBWarnings("EI_EXPOSE_REP")
38 public byte[] getPayload() {
43 class BindingAwareRouteIdentifier implements RouteIdentifier<String, String, String>, Immutable {
45 private final String type;
46 private final String route;
47 private final String content;
49 public BindingAwareRouteIdentifier(String type, String route, String content) {
52 this.content = content;
56 * Java class name of Rpc Context.
59 public String getContext() {
64 * String representation of route e.g. node-id
68 public String getRoute() {
73 * 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) {
98 if (getClass() != obj.getClass()) {
101 BindingAwareRouteIdentifier other = (BindingAwareRouteIdentifier) obj;
102 if (content == null) {
103 if (other.content != null) {
106 } else if (!content.equals(other.content)) {
110 if (other.route != null) {
113 } else if (!route.equals(other.route)) {
117 if (other.type != null) {
120 } else if (!type.equals(other.type)) {