blob: f51ee58a7d50631085c90b98b95f9218d7f7537e [file] [log] [blame]
package net.onrc.onos.ofcontroller.networkgraph;
/**
* Self-contained Port object for event
*
* TODO: We probably want common base class/interface for Self-Contained Event Object
*
*/
public class PortEvent {
public static class SwitchPort {
public final Long dpid;
public final Long number;
public SwitchPort(Long dpid, Long number) {
this.dpid = dpid;
this.number = number;
}
public Long getDpid() {
return dpid;
}
public Long getNumber() {
return number;
}
@Override
public String toString() {
return "(" + Long.toHexString(dpid) + "@" + number + ")";
}
}
private final SwitchPort id;
// TODO Add Hardware Address
// TODO Add Description
public PortEvent(Long dpid, Long number) {
this.id = new SwitchPort(dpid, number);
}
public Long getDpid() {
return id.dpid;
}
public Long getNumber() {
return id.number;
}
@Override
public String toString() {
return "[PortEvent 0x" + Long.toHexString(id.dpid) + "@" + id.number + "]";
}
}