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.apache.commons.lang3.builder.EqualsBuilder;
12 import org.apache.commons.lang3.builder.HashCodeBuilder;
13 import org.opendaylight.controller.sal.core.ContainerFlow;
14 import org.opendaylight.controller.sal.core.Node;
17 * The flow database object representing the flow entry to install on the
18 * network node. It contains the original flow entry FRM was requested to
19 * install, the container flow with which that entry had to be merged and the
20 * resultant merged flow entry, which is the one that was eventually installed
23 * Note: If the container flow is null, the install entry will be a clone of the
27 public class FlowEntryInstall {
28 private FlowEntry original;
29 private ContainerFlow cFlow;
30 private FlowEntry install;
31 transient private boolean deletePending;
33 public FlowEntryInstall(FlowEntry original, ContainerFlow cFlow) {
34 this.original = original;
36 this.install = (cFlow == null) ? original.clone() : original
38 deletePending = false;
42 public int hashCode() {
43 return HashCodeBuilder.reflectionHashCode(this);
47 public boolean equals(Object obj) {
48 return EqualsBuilder.reflectionEquals(this, obj);
51 public String getFlowName() {
52 return original.getFlowName();
55 public String getGroupName() {
56 return original.getGroupName();
59 public Node getNode() {
60 return original.getNode();
63 public boolean equalsByNodeAndName(Node node, String flowName) {
64 return original.equalsByNodeAndName(node, flowName);
67 public FlowEntry getOriginal() {
71 public ContainerFlow getContainerFlow() {
75 public FlowEntry getInstall() {
79 public boolean isDeletePending() {
83 public void toBeDeleted() {
84 this.deletePending = true;
88 public String toString() {
89 return "[Install = " + install + " Original: " + original + " cFlow: "