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