org.onosproject.net.behaviour.protection.ProtectionConfigBehaviour Maven / Gradle / Ivy
/*
* Copyright 2016-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.net.behaviour.protection;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import org.onosproject.net.ConnectPoint;
import org.onosproject.net.driver.HandlerBehaviour;
import com.google.common.annotations.Beta;
/**
* Behaviour for configuring Device triggered protection mechanism.
*
* Protected transport entity model
*
* {@literal
* - ProtectedTransportEndpoint
* +- TransportEndpoint - working transport entity/path
* |
* +- TransportEndpoint - standby transport entity/path
* ⋮
* }
*
* ProtectedTransportEndpoint is the entity representing the transport entity endpoint.
* Traffic flowing into the protected transport endpoint will flow
* through one of it's underlying TransportEndpoint, (=active transport entity).
*
* After successful creation of ProtectedPathEndpoint, implementation is expected
* to advertise virtual Port corresponding to the ProtectedPathEndpoint created.
*/
@Beta
public interface ProtectionConfigBehaviour extends HandlerBehaviour {
/**
* Annotation key for virtual Port.
*/
static String FINGERPRINT = "protection:fingerprint";
// Implementation is expected to
// - Create logical entity representing protection group
// - Expose (virtual) Port via Device Subsystem
// - implementation of FlowRuleProvider and similar should translate
// request forwarding from/to virtual port to corresponding configuration
// stitching protection group.
/**
* Creates protected path endpoint.
*
* @param configuration {@link ProtectedTransportEndpointDescription}
* @return {@link ConnectPoint} for the virtual Port added on success,
* or exceptionally return {@link ProtectionException} as cause on error.
*/
CompletableFuture
createProtectionEndpoint(ProtectedTransportEndpointDescription configuration);
/**
* Updates protected path endpoint configuration.
*
* @param identifier {@link ConnectPoint} for the virtual Port representing
* protected path endpoint
* @param configuration {@link ProtectedTransportEndpointDescription}
* @return {@code identifier} on success,
* or exceptionally return {@link ProtectionException} as cause on error.
*/
CompletableFuture
updateProtectionEndpoint(ConnectPoint identifier,
ProtectedTransportEndpointDescription configuration);
/**
* Deletes protected path endpoint.
*
* @param identifier {@link ConnectPoint} for the virtual Port representing
* protected path endpoint
* @return true if successfully removed, false otherwise.
*/
// TODO Should we return Boolean or instead return Void and fail exceptionally?
CompletableFuture
deleteProtectionEndpoint(ConnectPoint identifier);
/**
* Retrieves {@link ProtectedTransportEndpointDescription}s on the Device.
*
* @return {@link ProtectedTransportEndpointDescription}s on the Device
*/
CompletableFuture
© 2015 - 2025 Weber Informatics LLC | Privacy Policy