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 long requestId; // async request id
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;
44 public int hashCode() {
45 return HashCodeBuilder.reflectionHashCode(this);
49 public boolean equals(Object obj) {
50 return EqualsBuilder.reflectionEquals(this, obj);
53 public String getFlowName() {
54 return original.getFlowName();
57 public String getGroupName() {
58 return original.getGroupName();
61 public Node getNode() {
62 return original.getNode();
65 public boolean equalsByNodeAndName(Node node, String flowName) {
66 return original.equalsByNodeAndName(node, flowName);
69 public FlowEntry getOriginal() {
73 public ContainerFlow getContainerFlow() {
77 public FlowEntry getInstall() {
81 public boolean isDeletePending() {
85 public void toBeDeleted() {
86 this.deletePending = true;
89 public void setRequestId(long rid) {
93 public long getRequestId() {
98 public String toString() {
99 return "[Install = " + install + " Original = " + original + " cFlow = "
100 + cFlow + " rid = " + requestId + "]";