c78f5c36f97fc45a25d267d9e9844d9cae031677
[groupbasedpolicy.git] / renderers / ofoverlay / src / main / java / org / opendaylight / groupbasedpolicy / renderer / ofoverlay / sf / Action.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.groupbasedpolicy.renderer.ofoverlay.sf;
10
11 import java.util.List;
12 import java.util.Map;
13
14 import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.OfContext;
15 import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.OfWriter;
16 import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.flow.PolicyEnforcer.NetworkElements;
17 import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.flow.PolicyEnforcer.PolicyPair;
18 import org.opendaylight.groupbasedpolicy.resolver.ActionInstanceValidator;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ActionDefinitionId;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.HasDirection.Direction;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.subject.feature.definitions.ActionDefinition;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.renderer.capabilities.supported.action.definition.SupportedParameterValues;
24
25 /**
26  * Represent an action definition, and provide tools for generating
27  * flow instructions based on the action
28  * @author tbachman
29  */
30 public abstract class Action implements ActionInstanceValidator{
31     /**
32      * Get the action definition for this action
33      * @return the {@link ActionDefinition} for this action
34      */
35     public abstract ActionDefinitionId getId();
36
37     /**
38      * Get the action definition for this action
39      * @return the {@link ActionDefinition} for this action
40      */
41     public abstract ActionDefinition getActionDef();
42
43     /**
44      * The result represents supported parameters for the action by renderer
45      * 
46      * @return list of supported parameters by the action
47      */
48     public abstract List<SupportedParameterValues> getSupportedParameterValues();
49
50     /**
51      * Construct a set of actions that will apply to the traffic.  Augment
52      * the existing list of actions or add new actions.  It's important
53      * that the order of the returned list be consistent however
54      *
55      * @param actions The existing actions
56      * @param params the parameters for the action instance
57      * @param order the order of the list of actions
58      * @param netElements the network elements
59      * @param policyPair the {@link PolicyPair}
60      * @param ofWriter the {@link OfWriter}
61      * @param ctx the OfContext
62      * @param direction the direction of traffic
63      * @return the updated list of actions (may be a different length)
64      */
65     public abstract List<ActionBuilder> updateAction(List<ActionBuilder> actions,
66                                                      Map<String, Object> params,
67                                                      Integer order,
68                                                      NetworkElements netElements,
69                                                      PolicyPair policyPair,
70                                                      OfWriter ofWriter,
71                                                      OfContext ctx,
72                                                      Direction direction);
73 }