blob: 28e93a7abfca1b1503a72f990f7929870aa8a338 [file] [log] [blame]
Carmelo Cascone0831efb2016-05-31 14:50:19 -07001/*
2 * Copyright 2016-present Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.drivers.bmv2;
18
19import org.onosproject.bmv2.api.runtime.Bmv2ExtensionSelector;
20import org.onosproject.net.behaviour.ExtensionSelectorResolver;
21import org.onosproject.net.driver.AbstractHandlerBehaviour;
22import org.onosproject.net.flow.criteria.ExtensionSelector;
23import org.onosproject.net.flow.criteria.ExtensionSelectorType;
24
25import java.util.Collections;
26
27import static org.onosproject.net.flow.criteria.ExtensionSelectorType.ExtensionSelectorTypes.BMV2_MATCH_PARAMS;
28
29/**
30 * Implementation of the extension selector resolver behaviour for BMv2.
31 */
32public class Bmv2ExtensionSelectorResolver extends AbstractHandlerBehaviour implements ExtensionSelectorResolver {
33
34 @Override
35 public ExtensionSelector getExtensionSelector(ExtensionSelectorType type) {
36 if (type.equals(BMV2_MATCH_PARAMS.type())) {
37 return new Bmv2ExtensionSelector(Collections.emptyMap());
38 }
39
40 return null;
41 }
42}