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
10 * Class used by the FRM to distribute the forwarding rules programming in the
11 * cluster and to collect back the results of the programming
13 package org.opendaylight.controller.forwardingrulesmanager.implementation.data;
15 import java.io.Serializable;
16 import java.net.InetAddress;
18 import org.opendaylight.controller.forwardingrulesmanager.FlowEntryInstall;
19 import org.opendaylight.controller.sal.core.UpdateType;
22 * Class used by the FRM to distribute the forwarding rules programming in the
23 * cluster and to collect back the results of the programming
25 public final class FlowEntryDistributionOrder implements Serializable {
29 private static final long serialVersionUID = 416280377113255147L;
30 private final FlowEntryInstall entry;
31 private final UpdateType upType;
32 private final InetAddress requestorController;
37 public FlowEntryInstall getEntry() {
44 public UpdateType getUpType() {
49 * @return the requestorController
51 public InetAddress getRequestorController() {
52 return requestorController;
57 * FlowEntryInstall key value
59 * UpdateType key value
60 * @param requestorController
61 * identifier of the controller that initiated the request
64 public FlowEntryDistributionOrder(FlowEntryInstall entry, UpdateType upType, InetAddress requestorController) {
68 this.requestorController = requestorController;
74 * @see java.lang.Object#hashCode()
77 public int hashCode() {
80 result = (prime * result) + ((entry == null) ? 0 : entry.hashCode());
81 result = (prime * result) + ((requestorController == null) ? 0 : requestorController.hashCode());
82 result = (prime * result) + ((upType == null) ? 0 : upType.calculateConsistentHashCode());
89 * @see java.lang.Object#equals(java.lang.Object)
92 public boolean equals(Object obj) {
99 if (!(obj instanceof FlowEntryDistributionOrder)) {
102 FlowEntryDistributionOrder other = (FlowEntryDistributionOrder) obj;
104 if (other.entry != null) {
107 } else if (!entry.equals(other.entry)) {
110 if (requestorController == null) {
111 if (other.requestorController != null) {
114 } else if (!requestorController.equals(other.requestorController)) {
117 if (upType != other.upType) {
126 * @see java.lang.Object#toString()
129 public String toString() {
130 StringBuilder builder = new StringBuilder();
131 builder.append("FlowEntryDistributionOrder [");
133 builder.append("entry=")
137 if (upType != null) {
138 builder.append("upType=")
142 if (requestorController != null) {
143 builder.append("requestorController=")
144 .append(requestorController);
147 return builder.toString();