blob: 6937647711806c979e31446e6021276146a3728a [file] [log] [blame]
Ray Milkey278e75b2017-04-05 14:11:06 -07001/*
2 * Copyright 2017-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.net.flow;
18
19import java.util.concurrent.TimeUnit;
20
21import org.onosproject.core.GroupId;
22import org.onosproject.net.DeviceId;
23
24import static java.util.concurrent.TimeUnit.SECONDS;
25import static org.junit.Assert.*;
26
27/**
28 * Adapter for the flow entry interface.
29 */
30public class FlowEntryAdapter implements FlowEntry {
31 @Override
32 public FlowEntryState state() {
33 return FlowEntryState.ADDED;
34 }
35
36 @Override
37 public long life() {
38 return life(SECONDS);
39 }
40
41 @Override
42 public FlowLiveType liveType() {
43 return null;
44 }
45
46 @Override
47 public long life(TimeUnit timeUnit) {
48 return SECONDS.convert(0, timeUnit);
49 }
50
51 @Override
52 public long packets() {
53 return 0;
54 }
55
56 @Override
57 public long bytes() {
58 return 0;
59 }
60
61 @Override
62 public long lastSeen() {
63 return 0;
64 }
65
66 @Override
67 public int errType() {
68 return 0;
69 }
70
71 @Override
72 public int errCode() {
73 return 0;
74 }
75
76 @Override
77 public FlowId id() {
78 return FlowId.valueOf(0);
79 }
80
81 @Override
82 public GroupId groupId() {
83 return new GroupId(3);
84 }
85
86 @Override
87 public short appId() {
88 return 1;
89 }
90
91 @Override
92 public int priority() {
93 return 0;
94 }
95
96 @Override
97 public DeviceId deviceId() {
98 return null;
99 }
100
101 @Override
102 public TrafficSelector selector() {
103 return null;
104 }
105
106 @Override
107 public TrafficTreatment treatment() {
108 return null;
109 }
110
111 @Override
112 public int timeout() {
113 return 0;
114 }
115
116 @Override
117 public int hardTimeout() {
118 return 0;
119 }
120
121 @Override
122 public FlowRule.FlowRemoveReason reason() {
123 return FlowRule.FlowRemoveReason.NO_REASON;
124 }
125
126 @Override
127 public boolean isPermanent() {
128 return false;
129 }
130
131 @Override
132 public int tableId() {
133 return 0;
134 }
135
136 @Override
137 public boolean exactMatch(FlowRule rule) {
138 return false;
139 }
140
141 @Override
142 public FlowRuleExtPayLoad payLoad() {
143 return null;
144 }
145
146}