/*
- * Copyright (C) 2015 Red Hat, Inc.
+ * Copyright (c) 2015 Red Hat, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Authors : Flavio Fernandes
*/
package org.opendaylight.ovsdb.openstack.netvirt;
import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
+/**
+ * @author Flavio Fernandes (ffernand@redhat.com)
+ * @author Sam Hague (shague@redhat.com)
+ */
public class NodeCacheManagerEvent extends AbstractEvent {
+ private Node node;
- private String nodeIdentifier;
-
- public NodeCacheManagerEvent(String nodeIdentifier, Action action) {
+ public NodeCacheManagerEvent(Node node, Action action) {
super(HandlerType.NODE, action);
- this.nodeIdentifier = nodeIdentifier;
+ this.node = node;
+ }
+
+ public Node getNode() {
+ return node;
}
public String getNodeIdentifier() {
- return nodeIdentifier;
+ return node.getNodeId().getValue();
}
@Override
public String toString() {
return "NodeCacheManagerEvent [action=" + super.getAction()
- + ", nodeIdentifier=" + nodeIdentifier
+ + ", node=" + node
+ "]";
}
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
- result = prime * result + ((nodeIdentifier == null) ? 0 : nodeIdentifier.hashCode());
+ result = prime * result + ((node == null) ? 0 : node.hashCode());
return result;
}
return false;
}
NodeCacheManagerEvent other = (NodeCacheManagerEvent) obj;
- if (nodeIdentifier == null) {
- if (other.nodeIdentifier != null) {
+ if (node == null) {
+ if (other.node != null) {
return false;
}
- } else if (!nodeIdentifier.equals(other.nodeIdentifier)) {
+ } else if (!node.equals(other.node)) {
return false;
}
return true;