Ray Milkey | 278e75b | 2017-04-05 14:11:06 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2017-present Open Networking Foundation |
Ray Milkey | 278e75b | 2017-04-05 14:11:06 -0700 | [diff] [blame] | 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 | |
| 17 | package org.onosproject.net.flow; |
| 18 | |
| 19 | import java.util.concurrent.TimeUnit; |
| 20 | |
| 21 | import org.onosproject.core.GroupId; |
| 22 | import org.onosproject.net.DeviceId; |
| 23 | |
| 24 | import static java.util.concurrent.TimeUnit.SECONDS; |
| 25 | import static org.junit.Assert.*; |
| 26 | |
| 27 | /** |
| 28 | * Adapter for the flow entry interface. |
| 29 | */ |
| 30 | public 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 |
Carmelo Cascone | 4160574 | 2017-06-19 15:46:44 +0900 | [diff] [blame] | 137 | public TableId table() { |
| 138 | return DEFAULT_TABLE; |
| 139 | } |
| 140 | |
| 141 | @Override |
Ray Milkey | 278e75b | 2017-04-05 14:11:06 -0700 | [diff] [blame] | 142 | public boolean exactMatch(FlowRule rule) { |
| 143 | return false; |
| 144 | } |
| 145 | |
| 146 | @Override |
| 147 | public FlowRuleExtPayLoad payLoad() { |
| 148 | return null; |
| 149 | } |
| 150 | |
| 151 | } |