f87d2668b3e70ac66b6b726e84d97d88efc76a20
[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.PolicyManager.FlowMap;
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
24 /**
25  * Represent an action definition, and provide tools for generating
26  * flow instructions based on the action
27  * @author tbachman
28  */
29 public abstract class Action implements ActionInstanceValidator{
30     /**
31      * Get the action definition for this action
32      * @return the {@link ActionDefinition} for this action
33      */
34     public abstract ActionDefinitionId getId();
35
36     /**
37      * Get the action definition for this action
38      * @return the {@link ActionDefinition} for this action
39      */
40     public abstract ActionDefinition getActionDef();
41
42     /**
43      * Construct a set of actions that will apply to the traffic.  Augment
44      * the existing list of actions or add new actions.  It's important
45      * that the order of the returned list be consistent however
46      * @param actions The existing actions
47      * @param params the parameters for the action instance
48      * @param direction
49      * @return the updated list of actions (may be a different length)
50      */
51     public abstract List<ActionBuilder> updateAction(List<ActionBuilder> actions,
52                                                      Map<String, Object> params,
53                                                      Integer order,
54                                                      NetworkElements netElements,
55                                                      PolicyPair policyPair,
56                                                      FlowMap flowMap,
57                                                      OfContext ctx,
58                                                      Direction direction);
59 }