use of org.onosproject.net.behaviour.protection.ProtectedTransportEndpointDescription in project onos by opennetworkinglab.
the class OplinkSwitchProtection method getProtectionEndpointConfigs.
@Override
public CompletableFuture<Map<ConnectPoint, ProtectedTransportEndpointDescription>> getProtectionEndpointConfigs() {
ConnectPoint cp = new ConnectPoint(data().deviceId(), PortNumber.portNumber(VIRTUAL_PORT));
Map<ConnectPoint, ProtectedTransportEndpointDescription> protectedGroups = new HashMap<>();
CompletableFuture result = new CompletableFuture<Map<ConnectPoint, ProtectedTransportEndpointDescription>>();
protectedGroups.put(cp, getProtectedTransportEndpointDescription());
result.complete(protectedGroups);
return result;
}
use of org.onosproject.net.behaviour.protection.ProtectedTransportEndpointDescription in project onos by opennetworkinglab.
the class TestProtectionEndpointIntentCommand method doExecute.
@Override
protected void doExecute() {
fingerprint = Optional.ofNullable(fingerprint).orElse(DEFAULT_FINGERPRINT);
intentService = get(IntentService.class);
deviceService = get(DeviceService.class);
DeviceId did = DeviceId.deviceId(deviceIdStr);
DeviceId peer = DeviceId.deviceId(peerStr);
ProtectedTransportEndpointDescription description;
List<TransportEndpointDescription> paths = new ArrayList<>();
paths.add(TransportEndpointDescription.builder().withOutput(output(did, portNumber1Str, vlan1Str)).build());
paths.add(TransportEndpointDescription.builder().withOutput(output(did, portNumber2Str, vlan2Str)).build());
description = ProtectedTransportEndpointDescription.of(paths, peer, fingerprint);
ProtectionEndpointIntent intent;
intent = ProtectionEndpointIntent.builder().key(Key.of(fingerprint, appId())).appId(appId()).deviceId(did).description(description).build();
print("Submitting: %s", intent);
intentService.submit(intent);
}
use of org.onosproject.net.behaviour.protection.ProtectedTransportEndpointDescription in project onos by opennetworkinglab.
the class ProtectionEndpointIntentInstallerTest method createProtectionIntents.
/**
* Creates protection endpoint Intents by givent output point.
*
* @param output the output point
* @return the protection endpoint Intents
*/
private List<Intent> createProtectionIntents(ConnectPoint output) {
FilteredConnectPoint filteredOutput = new FilteredConnectPoint(output);
TransportEndpointDescription path = TransportEndpointDescription.builder().withOutput(filteredOutput).withEnabled(true).build();
List<TransportEndpointDescription> paths = ImmutableList.of(path);
ProtectedTransportEndpointDescription description = ProtectedTransportEndpointDescription.of(paths, CP2.deviceId(), FINGERPRINT);
ProtectionEndpointIntent intent = ProtectionEndpointIntent.builder().appId(APP_ID).description(description).deviceId(CP1.deviceId()).key(KEY1).resourceGroup(RG1).build();
return ImmutableList.of(intent);
}
Aggregations