use of org.onosproject.net.LinkKey in project onos by opennetworkinglab.
the class SimpleLinkStoreTest method testNonDurableToDurable.
@Test
public void testNonDurableToDurable() {
final ConnectPoint d1P1 = new ConnectPoint(DID1, P1);
final ConnectPoint d2P2 = new ConnectPoint(DID2, P2);
LinkKey linkId1 = LinkKey.linkKey(d1P1, d2P2);
putLink(linkId1, DIRECT, A1);
assertFalse("should not be durable", linkStore.getLink(d1P1, d2P2).isExpected());
putLink(linkId1, DIRECT, DA1);
assertTrue("should be durable", linkStore.getLink(d1P1, d2P2).isExpected());
}
use of org.onosproject.net.LinkKey in project onos by opennetworkinglab.
the class OplinkOpticalProtectionSwitchConfig method addLink.
private void addLink(DeviceId peerId) {
if (peerId == null) {
log.warn("PeerID is null for device {}", data().deviceId());
return;
}
LinkKey link = linkKey(new ConnectPoint(peerId, PORT_VIRTUAL), new ConnectPoint(data().deviceId(), PORT_VIRTUAL));
handler().get(NetworkConfigService.class).addConfig(link, BasicLinkConfig.class).type(Link.Type.VIRTUAL).apply();
}
use of org.onosproject.net.LinkKey in project onos by opennetworkinglab.
the class OplinkOpticalProtectionSwitchConfig method removeLink.
private void removeLink(DeviceId peerId) {
if (peerId == null) {
log.warn("PeerID is null for device {}", data().deviceId());
return;
}
LinkKey link = linkKey(new ConnectPoint(peerId, PORT_VIRTUAL), new ConnectPoint(data().deviceId(), PORT_VIRTUAL));
handler().get(NetworkConfigService.class).removeConfig(link, BasicLinkConfig.class);
}
use of org.onosproject.net.LinkKey in project onos by opennetworkinglab.
the class OplinkSwitchProtection method removeLinkToPeer.
private void removeLinkToPeer(DeviceId peerId) {
if (peerId == null) {
log.warn("PeerID is null for device {}", data().deviceId());
return;
}
ConnectPoint dstCp = new ConnectPoint(data().deviceId(), PortNumber.portNumber(VIRTUAL_PORT));
ConnectPoint srcCp = new ConnectPoint(peerId, PortNumber.portNumber(VIRTUAL_PORT));
LinkKey link = linkKey(srcCp, dstCp);
handler().get(NetworkConfigService.class).removeConfig(link, BasicLinkConfig.class);
}
use of org.onosproject.net.LinkKey in project onos by opennetworkinglab.
the class OplinkSwitchProtection method addLinkToPeer.
private void addLinkToPeer(DeviceId peerId) {
if (peerId == null) {
log.warn("PeerID is null for device {}", data().deviceId());
return;
}
ConnectPoint dstCp = new ConnectPoint(data().deviceId(), PortNumber.portNumber(VIRTUAL_PORT));
ConnectPoint srcCp = new ConnectPoint(peerId, PortNumber.portNumber(VIRTUAL_PORT));
LinkKey link = linkKey(srcCp, dstCp);
BasicLinkConfig cfg = handler().get(NetworkConfigService.class).addConfig(link, BasicLinkConfig.class);
cfg.type(Link.Type.VIRTUAL);
cfg.apply();
}
Aggregations