Class PolicyHandler


  • public class PolicyHandler
    extends Object
    Segment Routing Policy Handler.
    • Field Detail

      • log

        protected final org.slf4j.Logger log
    • 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 ID
        deviceConfiguration - DeviceConfiguration reference
        flowObjectiveService - FlowObjectiveService reference
        tunnelHandler - tunnel handler reference
        policyStore - policy store
    • Method Detail

      • getPolicies

        public List<Policy> getPolicies()
        Returns the policies.
        Returns:
        policy list
      • 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