Thomas Vachuska

Fixing OF flow and group provider run-time dependency.

Change-Id: I25fa3c72ab01500c39fc90198abc4c383a9512a2
...@@ -64,6 +64,8 @@ import org.onosproject.net.flow.criteria.UdpPortCriterion; ...@@ -64,6 +64,8 @@ import org.onosproject.net.flow.criteria.UdpPortCriterion;
64 import org.onosproject.net.flow.criteria.VlanIdCriterion; 64 import org.onosproject.net.flow.criteria.VlanIdCriterion;
65 import org.onosproject.net.flow.criteria.VlanPcpCriterion; 65 import org.onosproject.net.flow.criteria.VlanPcpCriterion;
66 import org.onosproject.openflow.controller.ExtensionSelectorInterpreter; 66 import org.onosproject.openflow.controller.ExtensionSelectorInterpreter;
67 +import org.onosproject.provider.of.flow.util.NoMappingFoundException;
68 +import org.onosproject.provider.of.flow.util.OpenFlowValueMapper;
67 import org.projectfloodlight.openflow.protocol.OFFactory; 69 import org.projectfloodlight.openflow.protocol.OFFactory;
68 import org.projectfloodlight.openflow.protocol.OFFlowMod; 70 import org.projectfloodlight.openflow.protocol.OFFlowMod;
69 import org.projectfloodlight.openflow.protocol.match.Match; 71 import org.projectfloodlight.openflow.protocol.match.Match;
......
...@@ -54,6 +54,8 @@ import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModIPv6Fl ...@@ -54,6 +54,8 @@ import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModIPv6Fl
54 import org.onosproject.net.flow.instructions.L4ModificationInstruction; 54 import org.onosproject.net.flow.instructions.L4ModificationInstruction;
55 import org.onosproject.net.flow.instructions.L4ModificationInstruction.ModTransportPortInstruction; 55 import org.onosproject.net.flow.instructions.L4ModificationInstruction.ModTransportPortInstruction;
56 import org.onosproject.openflow.controller.ExtensionTreatmentInterpreter; 56 import org.onosproject.openflow.controller.ExtensionTreatmentInterpreter;
57 +import org.onosproject.provider.of.flow.util.NoMappingFoundException;
58 +import org.onosproject.provider.of.flow.util.OpenFlowValueMapper;
57 import org.projectfloodlight.openflow.protocol.OFFactory; 59 import org.projectfloodlight.openflow.protocol.OFFactory;
58 import org.projectfloodlight.openflow.protocol.OFFlowAdd; 60 import org.projectfloodlight.openflow.protocol.OFFlowAdd;
59 import org.projectfloodlight.openflow.protocol.OFFlowDeleteStrict; 61 import org.projectfloodlight.openflow.protocol.OFFlowDeleteStrict;
......
...@@ -53,6 +53,7 @@ import org.onosproject.openflow.controller.OpenFlowSwitch; ...@@ -53,6 +53,7 @@ import org.onosproject.openflow.controller.OpenFlowSwitch;
53 import org.onosproject.openflow.controller.OpenFlowSwitchListener; 53 import org.onosproject.openflow.controller.OpenFlowSwitchListener;
54 import org.onosproject.openflow.controller.RoleState; 54 import org.onosproject.openflow.controller.RoleState;
55 import org.onosproject.openflow.controller.ThirdPartyMessage; 55 import org.onosproject.openflow.controller.ThirdPartyMessage;
56 +import org.onosproject.provider.of.flow.util.FlowEntryBuilder;
56 import org.osgi.service.component.ComponentContext; 57 import org.osgi.service.component.ComponentContext;
57 import org.projectfloodlight.openflow.protocol.OFBadRequestCode; 58 import org.projectfloodlight.openflow.protocol.OFBadRequestCode;
58 import org.projectfloodlight.openflow.protocol.OFBarrierRequest; 59 import org.projectfloodlight.openflow.protocol.OFBarrierRequest;
......
1 /* 1 /*
2 - * Copyright 2014-2015 Open Networking Laboratory 2 + * Copyright 2016 Open Networking Laboratory
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.onosproject.provider.of.flow.impl; 16 +package org.onosproject.provider.of.flow.util;
17 17
18 import com.google.common.collect.Lists; 18 import com.google.common.collect.Lists;
19 import org.onlab.packet.EthType; 19 import org.onlab.packet.EthType;
...@@ -101,10 +101,10 @@ import static org.onosproject.net.flow.criteria.Criteria.matchOduSignalId; ...@@ -101,10 +101,10 @@ import static org.onosproject.net.flow.criteria.Criteria.matchOduSignalId;
101 import static org.onosproject.net.flow.criteria.Criteria.matchOduSignalType; 101 import static org.onosproject.net.flow.criteria.Criteria.matchOduSignalType;
102 import static org.onosproject.net.flow.instructions.Instructions.modL0Lambda; 102 import static org.onosproject.net.flow.instructions.Instructions.modL0Lambda;
103 import static org.onosproject.net.flow.instructions.Instructions.modL1OduSignalId; 103 import static org.onosproject.net.flow.instructions.Instructions.modL1OduSignalId;
104 -import static org.onosproject.provider.of.flow.impl.OpenFlowValueMapper.lookupChannelSpacing; 104 +import static org.onosproject.provider.of.flow.util.OpenFlowValueMapper.lookupChannelSpacing;
105 -import static org.onosproject.provider.of.flow.impl.OpenFlowValueMapper.lookupGridType; 105 +import static org.onosproject.provider.of.flow.util.OpenFlowValueMapper.lookupGridType;
106 -import static org.onosproject.provider.of.flow.impl.OpenFlowValueMapper.lookupOchSignalType; 106 +import static org.onosproject.provider.of.flow.util.OpenFlowValueMapper.lookupOchSignalType;
107 -import static org.onosproject.provider.of.flow.impl.OpenFlowValueMapper.lookupOduSignalType; 107 +import static org.onosproject.provider.of.flow.util.OpenFlowValueMapper.lookupOduSignalType;
108 108
109 public class FlowEntryBuilder { 109 public class FlowEntryBuilder {
110 private static final Logger log = LoggerFactory.getLogger(FlowEntryBuilder.class); 110 private static final Logger log = LoggerFactory.getLogger(FlowEntryBuilder.class);
......
1 /* 1 /*
2 - * Copyright 2015 Open Networking Laboratory 2 + * Copyright 2016 Open Networking Laboratory
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.onosproject.provider.of.flow.impl; 16 +package org.onosproject.provider.of.flow.util;
17 17
18 /** 18 /**
19 * Thrown to indicate that no mapping for the input value is found. 19 * Thrown to indicate that no mapping for the input value is found.
......
1 /* 1 /*
2 - * Copyright 2015 Open Networking Laboratory 2 + * Copyright 2016 Open Networking Laboratory
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.onosproject.provider.of.flow.impl; 16 +package org.onosproject.provider.of.flow.util;
17 17
18 import com.google.common.collect.BiMap; 18 import com.google.common.collect.BiMap;
19 import com.google.common.collect.EnumHashBiMap; 19 import com.google.common.collect.EnumHashBiMap;
...@@ -25,7 +25,7 @@ import org.onosproject.net.OduSignalType; ...@@ -25,7 +25,7 @@ import org.onosproject.net.OduSignalType;
25 /** 25 /**
26 * Collection of helper methods to convert protocol agnostic models to values used in OpenFlow spec. 26 * Collection of helper methods to convert protocol agnostic models to values used in OpenFlow spec.
27 */ 27 */
28 -final class OpenFlowValueMapper { 28 +public final class OpenFlowValueMapper {
29 29
30 // prohibit instantiation 30 // prohibit instantiation
31 private OpenFlowValueMapper() {} 31 private OpenFlowValueMapper() {}
...@@ -94,7 +94,7 @@ final class OpenFlowValueMapper { ...@@ -94,7 +94,7 @@ final class OpenFlowValueMapper {
94 * @return the byte value corresponding to the specified grid type 94 * @return the byte value corresponding to the specified grid type
95 * @throws NoMappingFoundException if the specified grid type is not found 95 * @throws NoMappingFoundException if the specified grid type is not found
96 */ 96 */
97 - static byte lookupGridType(GridType type) { 97 + public static byte lookupGridType(GridType type) {
98 return lookup(GRID_TYPES, type, Byte.class); 98 return lookup(GRID_TYPES, type, Byte.class);
99 } 99 }
100 100
...@@ -106,7 +106,7 @@ final class OpenFlowValueMapper { ...@@ -106,7 +106,7 @@ final class OpenFlowValueMapper {
106 * @param type byte value as grid type defined the spec 106 * @param type byte value as grid type defined the spec
107 * @return the corresponding GridType instance 107 * @return the corresponding GridType instance
108 */ 108 */
109 - static GridType lookupGridType(byte type) { 109 + public static GridType lookupGridType(byte type) {
110 return lookup(GRID_TYPES.inverse(), type, GridType.class); 110 return lookup(GRID_TYPES.inverse(), type, GridType.class);
111 } 111 }
112 112
...@@ -119,7 +119,7 @@ final class OpenFlowValueMapper { ...@@ -119,7 +119,7 @@ final class OpenFlowValueMapper {
119 * @return byte value corresponding to the specified channel spacing 119 * @return byte value corresponding to the specified channel spacing
120 * @throws NoMappingFoundException if the specified channel spacing is not found 120 * @throws NoMappingFoundException if the specified channel spacing is not found
121 */ 121 */
122 - static byte lookupChannelSpacing(ChannelSpacing spacing) { 122 + public static byte lookupChannelSpacing(ChannelSpacing spacing) {
123 return lookup(CHANNEL_SPACING, spacing, Byte.class); 123 return lookup(CHANNEL_SPACING, spacing, Byte.class);
124 } 124 }
125 125
...@@ -132,7 +132,7 @@ final class OpenFlowValueMapper { ...@@ -132,7 +132,7 @@ final class OpenFlowValueMapper {
132 * @return the corresponding ChannelSpacing instance 132 * @return the corresponding ChannelSpacing instance
133 * @throws NoMappingFoundException if the specified channel spacing is not found 133 * @throws NoMappingFoundException if the specified channel spacing is not found
134 */ 134 */
135 - static ChannelSpacing lookupChannelSpacing(byte spacing) { 135 + public static ChannelSpacing lookupChannelSpacing(byte spacing) {
136 return lookup(CHANNEL_SPACING.inverse(), spacing, ChannelSpacing.class); 136 return lookup(CHANNEL_SPACING.inverse(), spacing, ChannelSpacing.class);
137 } 137 }
138 138
...@@ -145,7 +145,7 @@ final class OpenFlowValueMapper { ...@@ -145,7 +145,7 @@ final class OpenFlowValueMapper {
145 * @return byte value corresponding to the specified OCh signal type 145 * @return byte value corresponding to the specified OCh signal type
146 * @throws NoMappingFoundException if the specified Och signal type is not found 146 * @throws NoMappingFoundException if the specified Och signal type is not found
147 */ 147 */
148 - static byte lookupOchSignalType(OchSignalType signalType) { 148 + public static byte lookupOchSignalType(OchSignalType signalType) {
149 return lookup(OCH_SIGNAL_TYPES, signalType, Byte.class); 149 return lookup(OCH_SIGNAL_TYPES, signalType, Byte.class);
150 } 150 }
151 151
...@@ -158,7 +158,7 @@ final class OpenFlowValueMapper { ...@@ -158,7 +158,7 @@ final class OpenFlowValueMapper {
158 * @return the corresponding OchSignalType instance 158 * @return the corresponding OchSignalType instance
159 * @throws NoMappingFoundException if the specified Och signal type is not found 159 * @throws NoMappingFoundException if the specified Och signal type is not found
160 */ 160 */
161 - static OchSignalType lookupOchSignalType(byte signalType) { 161 + public static OchSignalType lookupOchSignalType(byte signalType) {
162 return lookup(OCH_SIGNAL_TYPES.inverse(), signalType, OchSignalType.class); 162 return lookup(OCH_SIGNAL_TYPES.inverse(), signalType, OchSignalType.class);
163 } 163 }
164 164
...@@ -171,7 +171,7 @@ final class OpenFlowValueMapper { ...@@ -171,7 +171,7 @@ final class OpenFlowValueMapper {
171 * @return byte value corresponding to the specified ODU signal type 171 * @return byte value corresponding to the specified ODU signal type
172 * @throws NoMappingFoundException if the specified ODU signal type is not found 172 * @throws NoMappingFoundException if the specified ODU signal type is not found
173 */ 173 */
174 - static byte lookupOduSignalType(OduSignalType signalType) { 174 + public static byte lookupOduSignalType(OduSignalType signalType) {
175 return lookup(ODU_SIGNAL_TYPES, signalType, Byte.class); 175 return lookup(ODU_SIGNAL_TYPES, signalType, Byte.class);
176 } 176 }
177 177
...@@ -184,7 +184,7 @@ final class OpenFlowValueMapper { ...@@ -184,7 +184,7 @@ final class OpenFlowValueMapper {
184 * @return the corresponding OchSignalType instance 184 * @return the corresponding OchSignalType instance
185 * @throws NoMappingFoundException if the specified ODU signal type is not found 185 * @throws NoMappingFoundException if the specified ODU signal type is not found
186 */ 186 */
187 - static OduSignalType lookupOduSignalType(byte signalType) { 187 + public static OduSignalType lookupOduSignalType(byte signalType) {
188 return lookup(ODU_SIGNAL_TYPES.inverse(), signalType, OduSignalType.class); 188 return lookup(ODU_SIGNAL_TYPES.inverse(), signalType, OduSignalType.class);
189 } 189 }
190 } 190 }
......
1 +/*
2 + * Copyright 2016 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 +/**
18 + * Shared utilities for OF flow rule and group providers.
19 + */
20 +package org.onosproject.provider.of.flow.util;
...\ No newline at end of file ...\ No newline at end of file
...@@ -31,7 +31,7 @@ import org.onosproject.net.group.DefaultGroupBucket; ...@@ -31,7 +31,7 @@ import org.onosproject.net.group.DefaultGroupBucket;
31 import org.onosproject.net.group.GroupBucket; 31 import org.onosproject.net.group.GroupBucket;
32 import org.onosproject.net.group.GroupBuckets; 32 import org.onosproject.net.group.GroupBuckets;
33 import org.onosproject.openflow.controller.Dpid; 33 import org.onosproject.openflow.controller.Dpid;
34 -import org.onosproject.provider.of.flow.impl.FlowEntryBuilder; 34 +import org.onosproject.provider.of.flow.util.FlowEntryBuilder;
35 import org.projectfloodlight.openflow.protocol.OFBucket; 35 import org.projectfloodlight.openflow.protocol.OFBucket;
36 import org.projectfloodlight.openflow.protocol.OFGroupType; 36 import org.projectfloodlight.openflow.protocol.OFGroupType;
37 import org.projectfloodlight.openflow.protocol.action.OFAction; 37 import org.projectfloodlight.openflow.protocol.action.OFAction;
...@@ -41,7 +41,7 @@ import java.util.List; ...@@ -41,7 +41,7 @@ import java.util.List;
41 41
42 import static org.slf4j.LoggerFactory.getLogger; 42 import static org.slf4j.LoggerFactory.getLogger;
43 43
44 -/* 44 +/**
45 * Builder for GroupBucketEntry. 45 * Builder for GroupBucketEntry.
46 */ 46 */
47 public class GroupBucketEntryBuilder { 47 public class GroupBucketEntryBuilder {
......