Package org.onosproject.segmentrouting
Class PolicyHandler
- java.lang.Object
-
- org.onosproject.segmentrouting.PolicyHandler
-
public class PolicyHandler extends Object
Segment Routing Policy Handler.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPolicyHandler.ResultResult of policy creation.
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Loggerlog
-
Constructor Summary
Constructors Constructor Description PolicyHandler(org.onosproject.core.ApplicationId appId, DeviceConfiguration deviceConfiguration, org.onosproject.net.flowobjective.FlowObjectiveService flowObjectiveService, TunnelHandler tunnelHandler, org.onosproject.store.service.EventuallyConsistentMap<String,Policy> policyStore)Constructs policy handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PolicyHandler.ResultcreatePolicy(Policy policy)Creates a policy using the policy information given.List<Policy>getPolicies()Returns the policies.PolicyHandler.ResultremovePolicy(Policy policyInfo)Removes the policy given.
-
-
-
Constructor Detail
-
PolicyHandler
public PolicyHandler(org.onosproject.core.ApplicationId appId, DeviceConfiguration deviceConfiguration, org.onosproject.net.flowobjective.FlowObjectiveService flowObjectiveService, TunnelHandler tunnelHandler, org.onosproject.store.service.EventuallyConsistentMap<String,Policy> policyStore)Constructs policy handler.- Parameters:
appId- segment routing application IDdeviceConfiguration- DeviceConfiguration referenceflowObjectiveService- FlowObjectiveService referencetunnelHandler- tunnel handler referencepolicyStore- policy store
-
-
Method Detail
-
createPolicy
public PolicyHandler.Result createPolicy(Policy policy)
Creates a policy using the policy information given.- Parameters:
policy- policy reference to create- Returns:
- ID_EXISTS if the same policy ID exists, POLICY_EXISTS if the same policy exists, TUNNEL_NOT_FOUND if the tunnel does not exists, UNSUPPORTED_TYPE if the policy type is not supported, SUCCESS if the policy is created successfully
-
removePolicy
public PolicyHandler.Result removePolicy(Policy policyInfo)
Removes the policy given.- Parameters:
policyInfo- policy information to remove- Returns:
- POLICY_NOT_FOUND if the policy to remove does not exists, SUCCESS if it is removed successfully
-
-