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.protocol_plugin.openflow.core.internal;
12 import org.opendaylight.controller.protocol_plugin.openflow.core.ISwitch;
13 import org.openflow.protocol.OFMessage;
15 public class SwitchEvent {
17 public static enum SwitchEventType {
18 SWITCH_ADD, SWITCH_DELETE, SWITCH_ERROR, SWITCH_MESSAGE,
21 private SwitchEventType eventType;
23 private OFMessage msg;
25 public SwitchEvent(SwitchEventType type, ISwitch sw, OFMessage msg) {
26 this.eventType = type;
31 public SwitchEventType getEventType() {
32 return this.eventType;
35 public ISwitch getSwitch() {
39 public OFMessage getMsg() {
44 public String toString() {
46 switch (this.eventType) {
60 s = "?" + this.eventType.ordinal() + "?";
62 return "Switch Event: " + s;