blob: 6584c187ec8a39a3b458a1c69b40ac21f2b41308 [file] [log] [blame]
Daniele Moro8d630f12021-06-15 20:53:22 +02001/*
2 * Copyright 2021-present Open Networking Foundation
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.pipelines.fabric.impl.behaviour.upf;
18
19import org.onosproject.net.pi.model.PiActionId;
20import org.onosproject.net.pi.model.PiActionModel;
21import org.onosproject.net.pi.model.PiActionProfileModel;
22import org.onosproject.net.pi.model.PiCounterModel;
23import org.onosproject.net.pi.model.PiMatchFieldId;
24import org.onosproject.net.pi.model.PiMatchFieldModel;
25import org.onosproject.net.pi.model.PiMeterModel;
26import org.onosproject.net.pi.model.PiTableId;
27import org.onosproject.net.pi.model.PiTableModel;
28import org.onosproject.net.pi.model.PiTableType;
29
30import java.util.Collection;
31import java.util.Optional;
32
33public class MockTableModel implements PiTableModel {
34 PiTableId id;
35 int size;
36
37 public MockTableModel(PiTableId id, int size) {
38 this.id = id;
39 this.size = size;
40 }
41
42 @Override
43 public PiTableId id() {
44 return this.id;
45 }
46
47 @Override
48 public PiTableType tableType() {
49 return null;
50 }
51
52 @Override
53 public PiActionProfileModel actionProfile() {
54 return null;
55 }
56
57 @Override
58 public long maxSize() {
59 return size;
60 }
61
62 @Override
63 public Collection<PiCounterModel> counters() {
64 return null;
65 }
66
67 @Override
68 public Collection<PiMeterModel> meters() {
69 return null;
70 }
71
72 @Override
73 public boolean supportsAging() {
74 return false;
75 }
76
77 @Override
78 public Collection<PiMatchFieldModel> matchFields() {
79 return null;
80 }
81
82 @Override
83 public Collection<PiActionModel> actions() {
84 return null;
85 }
86
87 @Override
88 public Optional<PiActionModel> constDefaultAction() {
89 return Optional.empty();
90 }
91
92 @Override
93 public boolean isConstantTable() {
94 return false;
95 }
96
97 @Override
98 public Optional<PiActionModel> action(PiActionId actionId) {
99 return Optional.empty();
100 }
101
102 @Override
103 public Optional<PiMatchFieldModel> matchField(PiMatchFieldId matchFieldId) {
104 return Optional.empty();
105 }
106}