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;
26 public SwitchEvent(SwitchEventType type, ISwitch sw, OFMessage msg, int priority) {
27 this.eventType = type;
30 this.priority = priority;
33 public SwitchEventType getEventType() {
34 return this.eventType;
37 public ISwitch getSwitch() {
41 public OFMessage getMsg() {
45 public int getPriority() {
49 public void setPriority(int priority) {
50 this.priority = priority;
54 public String toString() {
56 switch (this.eventType) {
70 s = "?" + this.eventType.ordinal() + "?";
72 return "Switch Event: " + s;