Implement SFC integration
[groupbasedpolicy.git] / renderers / ofoverlay / src / main / java / org / opendaylight / groupbasedpolicy / renderer / ofoverlay / sf / AllowAction.java
index 87bad604888f811f93ca0cac4de2231550e0464e..4b75328bd45637447335ed8fb0a80ee52be52def 100644 (file)
@@ -13,12 +13,16 @@ import static org.opendaylight.groupbasedpolicy.renderer.ofoverlay.flow.FlowUtil
 import java.util.List;
 import java.util.Map;
 
+import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.OfContext;
+import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.flow.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.common.rev140421.ActionName;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.Description;
 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.subject.feature.definitions.ActionDefinitionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.subject.feature.instances.ActionInstance;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg7;
 
 
@@ -26,19 +30,18 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev14
  * Allow action
  */
 public class AllowAction extends Action {
-    public static final ActionDefinitionId ID =
-            new ActionDefinitionId("f942e8fd-e957-42b7-bd18-f73d11266d17");
-    protected static final String TYPE = "type";
-    protected static final ActionDefinition DEF =
-            new ActionDefinitionBuilder()
-                .setId(ID)
-                .setName(new ActionName("allow"))
-                .setDescription(new Description("Allow the specified traffic to pass"))
-                .build();
+
+    protected static final ActionDefinitionId ID = new ActionDefinitionId("f942e8fd-e957-42b7-bd18-f73d11266d17");
+    /**
+     * Access control - allow action-definition
+     */
+    public static final ActionDefinition DEFINITION = new ActionDefinitionBuilder().setId(ID)
+        .setName(new ActionName("allow"))
+        .setDescription(new Description("Allow the specified traffic to pass"))
+        .build();
 
     // How allow is implemented in the PolicyEnforcer table
-       private final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action allow = 
-                       nxOutputRegAction(NxmNxReg7.class);
+    private final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action allow = nxOutputRegAction(NxmNxReg7.class);
 
     @Override
     public ActionDefinitionId getId() {
@@ -47,13 +50,14 @@ public class AllowAction extends Action {
 
     @Override
     public ActionDefinition getActionDef() {
-        return DEF;
+        return DEFINITION;
     }
 
     @Override
     public List<ActionBuilder> updateAction(List<ActionBuilder> actions,
                                             Map<String, Object> params,
-                                            Integer order) {
+                                            Integer order,
+                                            NetworkElements netElements) {
         /*
          * Allow action doesn't use parameters
          * TODO: check to make sure ActionBuilder w/allow isn't already present
@@ -65,4 +69,10 @@ public class AllowAction extends Action {
         return actions;
     }
 
+    @Override
+    public boolean isValid(ActionInstance actionInstance) {
+        // TODO Auto-generated method stub
+        return true;
+    }
+
 }