Bug 5617: policy enforcer refactor
[groupbasedpolicy.git] / renderers / ofoverlay / src / main / java / org / opendaylight / groupbasedpolicy / renderer / ofoverlay / sf / Action.java
old mode 100644 (file)
new mode 100755 (executable)
index f87d266..7ed357a
@@ -11,22 +11,23 @@ package org.opendaylight.groupbasedpolicy.renderer.ofoverlay.sf;
 import java.util.List;
 import java.util.Map;
 
+import org.opendaylight.groupbasedpolicy.api.Validator;
 import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.OfContext;
-import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.PolicyManager.FlowMap;
-import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.flow.PolicyEnforcer.NetworkElements;
-import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.flow.PolicyEnforcer.PolicyPair;
-import org.opendaylight.groupbasedpolicy.resolver.ActionInstanceValidator;
+import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.OfWriter;
+import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.mapper.policyenforcer.NetworkElements;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ActionDefinitionId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.HasDirection.Direction;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.subject.feature.definitions.ActionDefinition;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.subject.feature.instances.ActionInstance;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.renderer.capabilities.supported.action.definition.SupportedParameterValues;
 
 /**
  * Represent an action definition, and provide tools for generating
  * flow instructions based on the action
  * @author tbachman
  */
-public abstract class Action implements ActionInstanceValidator{
+public abstract class Action implements Validator<ActionInstance> {
     /**
      * Get the action definition for this action
      * @return the {@link ActionDefinition} for this action
@@ -39,21 +40,32 @@ public abstract class Action implements ActionInstanceValidator{
      */
     public abstract ActionDefinition getActionDef();
 
+    /**
+     * The result represents supported parameters for the action by renderer
+     *
+     * @return list of supported parameters by the action
+     */
+    public abstract List<SupportedParameterValues> getSupportedParameterValues();
+
     /**
      * Construct a set of actions that will apply to the traffic.  Augment
      * the existing list of actions or add new actions.  It's important
      * that the order of the returned list be consistent however
+     *
      * @param actions The existing actions
      * @param params the parameters for the action instance
-     * @param direction
+     * @param order the order of the list of actions
+     * @param netElements the network elements
+     * @param ofWriter the {@link OfWriter}
+     * @param ctx the OfContext
+     * @param direction the direction of traffic
      * @return the updated list of actions (may be a different length)
      */
     public abstract List<ActionBuilder> updateAction(List<ActionBuilder> actions,
                                                      Map<String, Object> params,
                                                      Integer order,
                                                      NetworkElements netElements,
-                                                     PolicyPair policyPair,
-                                                     FlowMap flowMap,
+                                                     OfWriter ofWriter,
                                                      OfContext ctx,
                                                      Direction direction);
 }