a8d4d0d4623bfcc58214179baa1ba9c199bff2e6
[groupbasedpolicy.git] / renderers / ofoverlay / src / main / java / org / opendaylight / groupbasedpolicy / renderer / ofoverlay / sf / Classifier.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.flow.types.rev131026.flow.MatchBuilder;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ClassifierDefinitionId;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.subject.feature.definitions.ClassifierDefinition;
17
18 /**
19  * Represent a classifier definition, and provide tools for generating flow
20  * rules based on the classifier
21  * @author readams
22  */
23 public abstract class Classifier {
24     /**
25      * Get the classifier definition for this classifier
26      * @return the {@link ClassifierDefinition} for this classifier
27      */
28     public abstract ClassifierDefinitionId getId();
29
30     /**
31      * Get the classifier definition for this classifier
32      * @return the {@link ClassifierDefinition} for this classifier
33      */
34     public abstract ClassifierDefinition getClassDef();
35     
36     /**
37      * Construct a set of matches that will apply to the traffic.  Augment
38      * the existing list of matches or add new matches.  It's important
39      * that the order of the returned list be consistent however
40      * @param matches The existing matches
41      * @param params the parameters for the classifier instance
42      * @return the updated list of matches (may be a different length)
43      */
44     public abstract List<MatchBuilder> updateMatch(List<MatchBuilder> matches,
45                                                    Map<String, Object> params);
46 }