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
9 package org.opendaylight.controller.forwardingrulesmanager;
11 import org.opendaylight.controller.sal.core.ContainerFlow;
12 import org.opendaylight.controller.sal.core.Node;
15 * The flow database object representing the flow entry to install on the
16 * network node. It contains the original flow entry FRM was requested to
17 * install, the container flow with which that entry had to be merged and the
18 * resultant merged flow entry, which is the one that was eventually installed
21 * Note: If the container flow is null, the install entry will be a clone of the
25 public class FlowEntryInstall {
26 private FlowEntry original;
27 private ContainerFlow cFlow;
28 private FlowEntry install;
29 transient private long requestId; // async request id
30 transient private boolean deletePending;
32 public FlowEntryInstall(FlowEntry original, ContainerFlow cFlow) {
33 this.original = original;
35 this.install = (cFlow == null) ? original.clone() : original
37 deletePending = false;
42 public int hashCode() {
45 result = prime * result + ((cFlow == null) ? 0 : cFlow.hashCode());
46 result = prime * result + ((install == null) ? 0 : install.hashCode());
47 result = prime * result
48 + ((original == null) ? 0 : original.hashCode());
53 public boolean equals(Object obj) {
58 if (getClass() != obj.getClass())
60 FlowEntryInstall other = (FlowEntryInstall) obj;
62 if (other.cFlow != null)
64 } else if (!cFlow.equals(other.cFlow))
66 if (install == null) {
67 if (other.install != null)
69 } else if (!install.equals(other.install))
71 if (original == null) {
72 if (other.original != null)
74 } else if (!original.equals(other.original))
79 public String getFlowName() {
80 return original.getFlowName();
83 public String getGroupName() {
84 return original.getGroupName();
87 public Node getNode() {
88 return original.getNode();
91 public boolean equalsByNodeAndName(Node node, String flowName) {
92 return original.equalsByNodeAndName(node, flowName);
95 public FlowEntry getOriginal() {
99 public ContainerFlow getContainerFlow() {
103 public FlowEntry getInstall() {
107 public boolean isDeletePending() {
108 return deletePending;
111 public void toBeDeleted() {
112 this.deletePending = true;
115 public void setRequestId(long rid) {
116 this.requestId = rid;
119 public long getRequestId() {
124 public String toString() {
125 return "[Install = " + install + " Original = " + original + " cFlow = "
126 + cFlow + " rid = " + requestId + "]";