Committed by
Gerrit Code Review
Initial skeleton of OpenFlow meter provider
Change-Id: Ifa0992f5c60f2ca65b97bdd553dc41cd7a55430c
Showing
6 changed files
with
149 additions
and
0 deletions
1 | +/* | ||
2 | + * Copyright 2015 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 | +package org.onosproject.net.meter; | ||
17 | + | ||
18 | +import org.onosproject.net.provider.Provider; | ||
19 | + | ||
20 | +/** | ||
21 | + * Abstraction of a Meter provider. | ||
22 | + */ | ||
23 | +public interface MeterProvider extends Provider { | ||
24 | +} |
providers/openflow/meter/pom.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!-- | ||
3 | + ~ Copyright 2015 Open Networking Laboratory | ||
4 | + ~ | ||
5 | + ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | + ~ you may not use this file except in compliance with the License. | ||
7 | + ~ You may obtain a copy of the License at | ||
8 | + ~ | ||
9 | + ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | + ~ | ||
11 | + ~ Unless required by applicable law or agreed to in writing, software | ||
12 | + ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | + ~ See the License for the specific language governing permissions and | ||
15 | + ~ limitations under the License. | ||
16 | + --> | ||
17 | +<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
18 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
19 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
20 | + <modelVersion>4.0.0</modelVersion> | ||
21 | + | ||
22 | + <parent> | ||
23 | + <groupId>org.onosproject</groupId> | ||
24 | + <artifactId>onos-of-providers</artifactId> | ||
25 | + <version>1.3.0-SNAPSHOT</version> | ||
26 | + <relativePath>../pom.xml</relativePath> | ||
27 | + </parent> | ||
28 | + | ||
29 | + <artifactId>onos-of-provider-meter</artifactId> | ||
30 | + <packaging>bundle</packaging> | ||
31 | + | ||
32 | + <description>ONOS OpenFlow protocol meter provider</description> | ||
33 | + | ||
34 | +</project> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +/* | ||
2 | + * Copyright 2015 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.provider.of.meter.impl; | ||
18 | + | ||
19 | +import org.apache.felix.scr.annotations.Component; | ||
20 | +import org.apache.felix.scr.annotations.Reference; | ||
21 | +import org.apache.felix.scr.annotations.ReferenceCardinality; | ||
22 | +import org.onosproject.net.meter.MeterProvider; | ||
23 | +import org.onosproject.net.provider.AbstractProvider; | ||
24 | +import org.onosproject.net.provider.ProviderId; | ||
25 | +import org.onosproject.openflow.controller.OpenFlowController; | ||
26 | +import org.slf4j.Logger; | ||
27 | + | ||
28 | +import static org.slf4j.LoggerFactory.getLogger; | ||
29 | + | ||
30 | +/** | ||
31 | + * Provider which uses an OpenFlow controller to handle meters. | ||
32 | + */ | ||
33 | +@Component(immediate = true) | ||
34 | +public class OpenFlowMeterProvider extends AbstractProvider implements MeterProvider { | ||
35 | + | ||
36 | + private final Logger log = getLogger(getClass()); | ||
37 | + | ||
38 | + @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | ||
39 | + protected OpenFlowController controller; | ||
40 | + | ||
41 | + | ||
42 | + /** | ||
43 | + * Creates a OpenFlow meter provider. | ||
44 | + */ | ||
45 | + public OpenFlowMeterProvider() { | ||
46 | + super(new ProviderId("of", "org.onosproject.provider.meter")); | ||
47 | + } | ||
48 | +} |
providers/openflow/meter/src/main/java/org/onosproject/provider/of/meter/impl/package-info.java
0 → 100644
1 | +/* | ||
2 | + * Copyright 2015 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 | + * Provider that uses OpenFlow controller as a means of device metering management. | ||
19 | + */ | ||
20 | +package org.onosproject.provider.of.meter.impl; | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +/* | ||
2 | + * Copyright 2015 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 | +package org.onosproject.provider.of.meter.impl; | ||
17 | + | ||
18 | + | ||
19 | +public class OpenFlowMeterProviderTest { | ||
20 | + | ||
21 | + | ||
22 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -36,6 +36,7 @@ | ... | @@ -36,6 +36,7 @@ |
36 | <module>packet</module> | 36 | <module>packet</module> |
37 | <module>flow</module> | 37 | <module>flow</module> |
38 | <module>group</module> | 38 | <module>group</module> |
39 | + <module>meter</module> | ||
39 | <module>app</module> | 40 | <module>app</module> |
40 | </modules> | 41 | </modules> |
41 | 42 | ... | ... |
-
Please register or login to post a comment