blob: f96e0b07f009334840bd75b946dd575ed44acdc8 [file] [log] [blame]
package net.onrc.onos.apps.bgproute;
import java.net.InetAddress;
import java.util.Collections;
import java.util.List;
/*
* A path is always assumed to be from all other interfaces (external-facing
* switchports) to the destination interface.
*/
public class Path {
private final Interface dstInterface;
private final InetAddress dstIpAddress;
private int numUsers; // initialized to 0
private List<PushedFlowMod> flowMods; // initialized to null
private boolean permanent; // initialized to false
public Path(Interface dstInterface, InetAddress dstIpAddress) {
this.dstInterface = dstInterface;
this.dstIpAddress = dstIpAddress;
}
public Interface getDstInterface() {
return dstInterface;
}
public InetAddress getDstIpAddress() {
return dstIpAddress;
}
public void incrementUsers() {
numUsers++;
}
public void decrementUsers() {
numUsers--;
}
public int getUsers() {
return numUsers;
}
public List<PushedFlowMod> getFlowMods() {
return Collections.unmodifiableList(flowMods);
}
public void setFlowMods(List<PushedFlowMod> flowMods) {
this.flowMods = flowMods;
}
public boolean isPermanent() {
return permanent;
}
public void setPermanent() {
permanent = true;
}
}