c7ee7727dd69c8f56982f38d30627d56af059251
[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.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ActionDefinitionId;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.subject.feature.definitions.ActionDefinition;
17
18 /**
19  * Represent an action definition, and provide tools for generating
20  * flow instructions based on the action
21  * @author tbachman
22  */
23 public abstract class Action {
24     /**
25      * Get the action definition for this action
26      * @return the {@link ActionDefinition} for this action
27      */
28     public abstract ActionDefinitionId getId();
29
30     /**
31      * Get the action definition for this action
32      * @return the {@link ActionDefinition} for this action
33      */
34     public abstract ActionDefinition getActionDef();
35
36     /**
37      * Construct a set of actions that will apply to the traffic.  Augment
38      * the existing list of actions or add new actions.  It's important
39      * that the order of the returned list be consistent however
40      * @param actions The existing actions
41      * @param params the parameters for the action instance
42      * @return the updated list of actions (may be a different length)
43      */
44     public abstract List<ActionBuilder> updateAction(List<ActionBuilder> actions,
45                                                      Map<String, Object> params,
46                                                      Integer i);
47 }