Claudine Chiu | 70222ad | 2016-11-17 22:29:20 -0500 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package org.onosproject.incubator.net.virtual.impl; |
| 18 | |
| 19 | import org.onosproject.core.ApplicationId; |
| 20 | import org.onosproject.event.AbstractListenerManager; |
| 21 | import org.onosproject.incubator.net.virtual.VirtualNetwork; |
| 22 | import org.onosproject.incubator.net.virtual.VirtualNetworkService; |
| 23 | import org.onosproject.incubator.net.virtual.VnetService; |
| 24 | import org.onosproject.net.DeviceId; |
| 25 | import org.onosproject.net.flow.FlowEntry; |
| 26 | import org.onosproject.net.flow.FlowRule; |
| 27 | import org.onosproject.net.flow.FlowRuleEvent; |
| 28 | import org.onosproject.net.flow.FlowRuleListener; |
| 29 | import org.onosproject.net.flow.FlowRuleOperations; |
| 30 | import org.onosproject.net.flow.FlowRuleService; |
| 31 | import org.onosproject.net.flow.TableStatisticsEntry; |
| 32 | |
| 33 | import static com.google.common.base.Preconditions.checkNotNull; |
| 34 | |
| 35 | /** |
| 36 | * Flow rule service implementation built on the virtual network service. |
| 37 | */ |
| 38 | public class VirtualNetworkFlowRuleManager extends AbstractListenerManager<FlowRuleEvent, FlowRuleListener> |
| 39 | implements FlowRuleService, VnetService { |
| 40 | |
| 41 | private static final String NETWORK_NULL = "Network ID cannot be null"; |
| 42 | private final VirtualNetwork network; |
| 43 | private final VirtualNetworkService manager; |
| 44 | |
| 45 | /** |
| 46 | * Creates a new VirtualNetworkFlowRuleService object. |
| 47 | * |
| 48 | * @param virtualNetworkManager virtual network manager service |
| 49 | * @param network virtual network |
| 50 | */ |
| 51 | public VirtualNetworkFlowRuleManager(VirtualNetworkService virtualNetworkManager, VirtualNetwork network) { |
| 52 | checkNotNull(network, NETWORK_NULL); |
| 53 | this.network = network; |
| 54 | this.manager = virtualNetworkManager; |
| 55 | } |
| 56 | |
| 57 | @Override |
| 58 | public int getFlowRuleCount() { |
| 59 | return 0; |
| 60 | } |
| 61 | |
| 62 | @Override |
| 63 | public Iterable<FlowEntry> getFlowEntries(DeviceId deviceId) { |
| 64 | return null; |
| 65 | } |
| 66 | |
| 67 | @Override |
| 68 | public void applyFlowRules(FlowRule... flowRules) { |
| 69 | |
| 70 | } |
| 71 | |
| 72 | @Override |
| 73 | public void purgeFlowRules(DeviceId deviceId) { |
| 74 | |
| 75 | } |
| 76 | |
| 77 | @Override |
| 78 | public void removeFlowRules(FlowRule... flowRules) { |
| 79 | |
| 80 | } |
| 81 | |
| 82 | @Override |
| 83 | public void removeFlowRulesById(ApplicationId appId) { |
| 84 | |
| 85 | } |
| 86 | |
| 87 | @Override |
| 88 | public Iterable<FlowRule> getFlowRulesById(ApplicationId id) { |
| 89 | return null; |
| 90 | } |
| 91 | |
| 92 | @Override |
| 93 | public Iterable<FlowEntry> getFlowEntriesById(ApplicationId id) { |
| 94 | return null; |
| 95 | } |
| 96 | |
| 97 | @Override |
| 98 | public Iterable<FlowRule> getFlowRulesByGroupId(ApplicationId appId, short groupId) { |
| 99 | return null; |
| 100 | } |
| 101 | |
| 102 | @Override |
| 103 | public void apply(FlowRuleOperations ops) { |
| 104 | |
| 105 | } |
| 106 | |
| 107 | @Override |
| 108 | public Iterable<TableStatisticsEntry> getFlowTableStatistics(DeviceId deviceId) { |
| 109 | return null; |
| 110 | } |
| 111 | |
| 112 | @Override |
| 113 | public VirtualNetwork network() { |
| 114 | return network; |
| 115 | } |
| 116 | } |