Jonathan Hart
Committed by Gerrit Code Review

Skeleton of the vRouter application

Change-Id: I471561808f7d1bf3b51ab72b9731d7bf3ec410e7
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
64 <module>drivermatrix</module> 64 <module>drivermatrix</module>
65 <module>cpman</module> 65 <module>cpman</module>
66 <module>events</module> 66 <module>events</module>
67 + <module>vrouter</module>
67 </modules> 68 </modules>
68 69
69 <properties> 70 <properties>
...@@ -108,4 +109,3 @@ ...@@ -108,4 +109,3 @@
108 </build> 109 </build>
109 110
110 </project> 111 </project>
111 -
......
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!--
3 + ~ Copyright 2016 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 +<app name="org.onosproject.vrouter" origin="ON.Lab" version="${project.version}"
18 + featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
19 + features="${project.artifactId}">
20 + <description>${project.description}</description>
21 + <artifact>mvn:${project.groupId}/${project.artifactId}/${project.version}</artifact>
22 + <artifact>mvn:${project.groupId}/onos-app-routing-api/${project.version}</artifact>
23 + <artifact>mvn:${project.groupId}/onos-app-routing/${project.version}</artifact>
24 +</app>
1 +<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 +<!--
3 + ~ Copyright 2016 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 +<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${project.version}">
18 + <feature name="onos-app-vrouter" version="${project.version}"
19 + description="${project.description}">
20 + <feature>onos-api</feature>
21 + <bundle>mvn:${project.groupId}/onos-app-vrouter/${project.version}</bundle>
22 + <bundle>mvn:${project.groupId}/onos-app-routing-api/${project.version}</bundle>
23 + <bundle>mvn:${project.groupId}/onos-app-routing/${project.version}</bundle>
24 + </feature>
25 +</features>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!--
3 + ~ Copyright 2016 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/xsd/maven-4.0.0.xsd">
20 + <modelVersion>4.0.0</modelVersion>
21 + <parent>
22 + <artifactId>onos-apps</artifactId>
23 + <groupId>org.onosproject</groupId>
24 + <version>1.5.0-SNAPSHOT</version>
25 + </parent>
26 +
27 + <groupId>org.onosproject</groupId>
28 + <artifactId>onos-app-vrouter</artifactId>
29 + <version>1.5.0-SNAPSHOT</version>
30 + <packaging>bundle</packaging>
31 +
32 + <description>Virtual router (vRouter) application</description>
33 + <url>http://onosproject.org</url>
34 +
35 + <properties>
36 + <onos.version>1.5.0-SNAPSHOT</onos.version>
37 + <onos.app.name>org.onosproject.vrouter</onos.app.name>
38 + <onos.app.origin>ON.Lab</onos.app.origin>
39 + </properties>
40 +
41 + <dependencies>
42 + <dependency>
43 + <groupId>org.onosproject</groupId>
44 + <artifactId>onos-api</artifactId>
45 + <version>${onos.version}</version>
46 + </dependency>
47 +
48 + <dependency>
49 + <groupId>org.onosproject</groupId>
50 + <artifactId>onlab-osgi</artifactId>
51 + <version>${onos.version}</version>
52 + </dependency>
53 +
54 + <dependency>
55 + <groupId>org.onosproject</groupId>
56 + <artifactId>onos-incubator-api</artifactId>
57 + </dependency>
58 +
59 + <dependency>
60 + <groupId>org.onosproject</groupId>
61 + <artifactId>onlab-junit</artifactId>
62 + <scope>test</scope>
63 + </dependency>
64 +
65 + <dependency>
66 + <groupId>org.onosproject</groupId>
67 + <artifactId>onos-api</artifactId>
68 + <version>${onos.version}</version>
69 + <scope>test</scope>
70 + <classifier>tests</classifier>
71 + </dependency>
72 +
73 + <dependency>
74 + <groupId>org.apache.felix</groupId>
75 + <artifactId>org.apache.felix.scr.annotations</artifactId>
76 + <version>1.9.8</version>
77 + <scope>provided</scope>
78 + </dependency>
79 + </dependencies>
80 +
81 +</project>
1 +/*
2 + * Copyright 2014 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.vrouter;
17 +
18 +import com.google.common.collect.ImmutableList;
19 +import org.apache.felix.scr.annotations.Activate;
20 +import org.apache.felix.scr.annotations.Component;
21 +import org.apache.felix.scr.annotations.Deactivate;
22 +import org.apache.felix.scr.annotations.Reference;
23 +import org.apache.felix.scr.annotations.ReferenceCardinality;
24 +import org.onosproject.core.ApplicationId;
25 +import org.onosproject.core.CoreService;
26 +import org.onosproject.incubator.component.ComponentService;
27 +import org.slf4j.Logger;
28 +import org.slf4j.LoggerFactory;
29 +
30 +import java.util.List;
31 +
32 +/**
33 + * Virtual router (vRouter) application.
34 + */
35 +@Component(immediate = true)
36 +public class Vrouter {
37 +
38 + private final Logger log = LoggerFactory.getLogger(getClass());
39 +
40 + private static final String APP_NAME = "org.onosproject.vrouter";
41 +
42 + @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
43 + protected CoreService coreService;
44 +
45 + @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
46 + protected ComponentService componentService;
47 +
48 + private ApplicationId appId;
49 +
50 + private final List<String> components = ImmutableList.<String>builder()
51 + .add("org.onosproject.routing.fpm.FpmManager")
52 + .add("org.onosproject.routing.impl.Router")
53 + .add("org.onosproject.routing.impl.SingleSwitchFibInstaller")
54 + .build();
55 +
56 + @Activate
57 + protected void activate() {
58 + appId = coreService.registerApplication(APP_NAME);
59 +
60 + components.forEach(name -> componentService.activate(appId, name));
61 +
62 + log.info("Started");
63 + }
64 +
65 + @Deactivate
66 + protected void deactivate() {
67 + log.info("Stopped");
68 + }
69 +
70 +}
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 + * Virtual Router (vRouter) application.
19 + */
20 +package org.onosproject.vrouter;