Search in sources :

Example 6 with ProtectedTransportEndpointDescription

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;
}
Also used : CompletableFuture(java.util.concurrent.CompletableFuture) ProtectedTransportEndpointDescription(org.onosproject.net.behaviour.protection.ProtectedTransportEndpointDescription) HashMap(java.util.HashMap) ConnectPoint(org.onosproject.net.ConnectPoint) FilteredConnectPoint(org.onosproject.net.FilteredConnectPoint)

Example 7 with ProtectedTransportEndpointDescription

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);
}
Also used : IntentService(org.onosproject.net.intent.IntentService) ProtectedTransportEndpointDescription(org.onosproject.net.behaviour.protection.ProtectedTransportEndpointDescription) TransportEndpointDescription(org.onosproject.net.behaviour.protection.TransportEndpointDescription) ProtectedTransportEndpointDescription(org.onosproject.net.behaviour.protection.ProtectedTransportEndpointDescription) DeviceId(org.onosproject.net.DeviceId) DeviceService(org.onosproject.net.device.DeviceService) ArrayList(java.util.ArrayList) ProtectionEndpointIntent(org.onosproject.net.intent.ProtectionEndpointIntent)

Example 8 with ProtectedTransportEndpointDescription

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);
}
Also used : ProtectedTransportEndpointDescription(org.onosproject.net.behaviour.protection.ProtectedTransportEndpointDescription) TransportEndpointDescription(org.onosproject.net.behaviour.protection.TransportEndpointDescription) ProtectedTransportEndpointDescription(org.onosproject.net.behaviour.protection.ProtectedTransportEndpointDescription) ProtectionEndpointIntent(org.onosproject.net.intent.ProtectionEndpointIntent) FilteredConnectPoint(org.onosproject.net.FilteredConnectPoint)

Aggregations

ProtectedTransportEndpointDescription (org.onosproject.net.behaviour.protection.ProtectedTransportEndpointDescription)8 ConnectPoint (org.onosproject.net.ConnectPoint)6 FilteredConnectPoint (org.onosproject.net.FilteredConnectPoint)4 ProtectionConfigBehaviour (org.onosproject.net.behaviour.protection.ProtectionConfigBehaviour)3 TransportEndpointDescription (org.onosproject.net.behaviour.protection.TransportEndpointDescription)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 ProtectionEndpointIntent (org.onosproject.net.intent.ProtectionEndpointIntent)2 CompletableFuture (java.util.concurrent.CompletableFuture)1 DeviceId (org.onosproject.net.DeviceId)1 DeviceService (org.onosproject.net.device.DeviceService)1 IntentService (org.onosproject.net.intent.IntentService)1