X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openstack%2Fnet-virt%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fovsdb%2Fopenstack%2Fnetvirt%2FNodeCacheManagerEvent.java;h=5c2bb38d0588903a10eea46ff037dbe57bcb08ae;hb=2ebaf23050854274b6af934d434fb9d2fdb37ee6;hp=e471be2d1025f32cca52fa236be134511d794cf9;hpb=8e14a9956d2d914a82f0fa3ab0a6666556cf05a2;p=ovsdb.git diff --git a/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/NodeCacheManagerEvent.java b/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/NodeCacheManagerEvent.java index e471be2d1..5c2bb38d0 100644 --- a/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/NodeCacheManagerEvent.java +++ b/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/NodeCacheManagerEvent.java @@ -1,33 +1,39 @@ /* - * 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 + "]"; } @@ -35,7 +41,7 @@ public class NodeCacheManagerEvent extends AbstractEvent { 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; } @@ -54,11 +60,11 @@ public class NodeCacheManagerEvent extends AbstractEvent { 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;