3 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
5 * This program and the accompanying materials are made available under the
6 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7 * and is available at http://www.eclipse.org/legal/epl-v10.html
10 package org.opendaylight.controller.forwardingrulesmanager;
12 import org.apache.commons.lang3.builder.EqualsBuilder;
13 import org.apache.commons.lang3.builder.HashCodeBuilder;
14 import org.opendaylight.controller.sal.core.ContainerFlow;
15 import org.opendaylight.controller.sal.core.Node;
18 * The flow database object representing the flow entry to install on
19 * the network node. It contains the original flow entry FRM was
20 * requested to install, the container flow with which that entry had
21 * to be merged and the resultant merged flow entry, which is the
22 * one that was eventually installed on the network node
24 * Note: If the container flow is null, the install entry will be a clone
25 * of the original entry
28 public class FlowEntryInstall {
29 private FlowEntry original;
30 private ContainerFlow cFlow;
31 private FlowEntry install;
32 transient private boolean deletePending;
34 public FlowEntryInstall(FlowEntry original, ContainerFlow cFlow) {
35 this.original = original;
37 this.install = (cFlow == null) ? original.clone() : original
39 deletePending = false;
43 public int hashCode() {
44 return HashCodeBuilder.reflectionHashCode(this);
48 public boolean equals(Object obj) {
49 return EqualsBuilder.reflectionEquals(this, obj);
52 public String getFlowName() {
53 return original.getFlowName();
56 public String getGroupName() {
57 return original.getGroupName();
60 public Node getNode() {
61 return original.getNode();
64 public boolean equalsByNodeAndName(Node node, String flowName) {
65 return original.equalsByNodeAndName(node, flowName);
68 public FlowEntry getOriginal() {
72 public ContainerFlow getContainerFlow() {
76 public FlowEntry getInstall() {
80 public boolean isDeletePending() {
84 public void toBeDeleted() {
85 this.deletePending = true;
89 public String toString() {
90 return "[Install = " + install + " Original: " + original + " cFlow: "