Implementing VPP Renderer registration
[groupbasedpolicy.git] / renderers / vpp / src / main / java / org / opendaylight / groupbasedpolicy / renderer / vpp / 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.vpp.sf;
10
11 import java.util.List;
12 import java.util.Map;
13
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ClassifierDefinitionId;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.subject.feature.definitions.ClassifierDefinition;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.subject.feature.instance.ParameterValue;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.renderer.capabilities.supported.classifier.definition.SupportedParameterValues;
18
19 /**
20  * Represent a classifier definition.
21  */
22 public abstract class Classifier {
23
24     protected final Classifier parent;
25
26     public static final EtherTypeClassifier ETHER_TYPE_CL = new EtherTypeClassifier(null);
27     public static final IpProtoClassifier IP_PROTO_CL = new IpProtoClassifier(ETHER_TYPE_CL);
28
29     protected Classifier(Classifier parent) {
30         this.parent = parent;
31     }
32
33     /**
34      * Get the classifier definition id for this classifier.
35      *
36      * @return the {@link ClassifierDefinitionId} for this classifier
37      */
38     public abstract ClassifierDefinitionId getId();
39
40     /**
41      * Get the classifier definition for this classifier.
42      *
43      * @return the {@link ClassifierDefinition} for this classifier
44      */
45     public abstract ClassifierDefinition getClassifierDefinition();
46
47     /**
48      * Get parent for this classifier.
49      *
50      * @return parent classifier, see {@link Classifier}
51      */
52     public final Classifier getParent() {
53         return parent;
54     }
55
56     /**
57      * The result represents supported parameters for the classifier by renderer.
58      *
59      * @return list of supported parameters by the classifier
60      */
61     public abstract List<SupportedParameterValues> getSupportedParameterValues();
62
63     /**
64      * Checks presence of required {@code params} in order to decide if classifier can update
65      * {@code matches} properly.
66      *
67      * @param params inserted parameters, not null
68      * @throws IllegalArgumentException when any of required {@code params} is not present
69      */
70     protected abstract void checkPresenceOfRequiredParams(Map<String, ParameterValue> params);
71
72 }