Thomas Vachuska

Converting builtin applications to be delivered in a self-contained manner via OAR files.

Change-Id: I5b7c6939aacc263248868fac2e0f69124c5f3609
Showing 62 changed files with 605 additions and 590 deletions
...@@ -14,7 +14,11 @@ ...@@ -14,7 +14,11 @@
14 ~ See the License for the specific language governing permissions and 14 ~ See the License for the specific language governing permissions and
15 ~ limitations under the License. 15 ~ limitations under the License.
16 --> 16 -->
17 -<app name="org.onosproject.bgprouter" origin="ON.Lab" version="1.2.0" 17 +<app name="org.onosproject.bgprouter" origin="ON.Lab" version="${feature.version}"
18 - features="onos-app-bgprouter"> 18 + featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
19 - <description>BGP router application</description> 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>
20 </app> 24 </app>
......
1 +<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
1 <!-- 2 <!--
2 - ~ Copyright 2014 Open Networking Laboratory 3 + ~ Copyright 2015 Open Networking Laboratory
3 ~ 4 ~
4 ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 ~ 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 not use this file except in compliance with the License.
...@@ -13,15 +14,15 @@ ...@@ -13,15 +14,15 @@
13 ~ See the License for the specific language governing permissions and 14 ~ See the License for the specific language governing permissions and
14 ~ limitations under the License. 15 ~ limitations under the License.
15 --> 16 -->
16 -<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"> 17 +<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${feature.version}">
17 - 18 + <repository>mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features</repository>
18 - <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0"> 19 + <feature name="${project.artifactId}" version="${feature.version}"
19 - <command> 20 + description="${project.description}">
20 - <action class="org.onosproject.metrics.topology.cli.TopologyEventsListCommand"/> 21 + <feature>onos-api</feature>
21 - </command> 22 + <feature>onos-app-proxyarp</feature>
22 - <command> 23 + <feature>onos-app-config</feature>
23 - <action class="org.onosproject.metrics.topology.cli.TopologyEventsMetricsCommand"/> 24 + <bundle>mvn:${project.groupId}/onos-app-bgprouter/${project.version}</bundle>
24 - </command> 25 + <bundle>mvn:${project.groupId}/onos-app-routing-api/${project.version}</bundle>
25 - </command-bundle> 26 + <bundle>mvn:${project.groupId}/onos-app-routing/${project.version}</bundle>
26 - 27 + </feature>
27 -</blueprint> 28 +</features>
......
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
14 ~ See the License for the specific language governing permissions and 14 ~ See the License for the specific language governing permissions and
15 ~ limitations under the License. 15 ~ limitations under the License.
16 --> 16 -->
17 -<app name="org.onosproject.config" origin="ON.Lab" version="1.2.0" 17 +<app name="org.onosproject.config" origin="ON.Lab" version="${feature.version}"
18 - features="onos-app-config"> 18 + featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
19 - <description>Network configuration application</description> 19 + features="${project.artifactId}">
20 + <description>${project.description}</description>
21 + <artifact>mvn:${project.groupId}/${project.artifactId}/${project.version}</artifact>
20 </app> 22 </app>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
29 <artifactId>onos-app-config</artifactId> 29 <artifactId>onos-app-config</artifactId>
30 <packaging>bundle</packaging> 30 <packaging>bundle</packaging>
31 31
32 - <description>ONOS simple network configuration reader</description> 32 + <description>Network configuration application</description>
33 33
34 <dependencies> 34 <dependencies>
35 <dependency> 35 <dependency>
......
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
14 ~ See the License for the specific language governing permissions and 14 ~ See the License for the specific language governing permissions and
15 ~ limitations under the License. 15 ~ limitations under the License.
16 --> 16 -->
17 -<app name="org.onosproject.fwd" origin="ON.Lab" version="1.2.0" 17 +<app name="org.onosproject.fwd" origin="ON.Lab" version="${feature.version}"
18 - features="onos-app-fwd"> 18 + featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
19 - <description>Reactive forwarding application using flow subsystem</description> 19 + features="${project.artifactId}">
20 + <description>${project.description}</description>
21 + <artifact>mvn:${project.groupId}/${project.artifactId}/${project.version}</artifact>
20 </app> 22 </app>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
29 <artifactId>onos-app-fwd</artifactId> 29 <artifactId>onos-app-fwd</artifactId>
30 <packaging>bundle</packaging> 30 <packaging>bundle</packaging>
31 31
32 - <description>ONOS simple reactive forwarding app</description> 32 + <description>Reactive forwarding application using flow subsystem</description>
33 33
34 <dependencies> 34 <dependencies>
35 <dependency> 35 <dependency>
......
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
14 ~ See the License for the specific language governing permissions and 14 ~ See the License for the specific language governing permissions and
15 ~ limitations under the License. 15 ~ limitations under the License.
16 --> 16 -->
17 -<app name="org.onosproject.metrics" origin="ON.Lab" version="1.2.0" 17 +<app name="org.onosproject.metrics" origin="ON.Lab" version="${feature.version}"
18 - features="onos-app-metrics"> 18 + featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
19 - <description>Performance metrics collection</description> 19 + features="${project.artifactId}">
20 + <description>${project.description}</description>
21 + <artifact>mvn:${project.groupId}/${project.artifactId}/${project.version}</artifact>
20 </app> 22 </app>
......
...@@ -17,40 +17,49 @@ ...@@ -17,40 +17,49 @@
17 <project xmlns="http://maven.apache.org/POM/4.0.0" 17 <project xmlns="http://maven.apache.org/POM/4.0.0"
18 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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"> 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> 20 + <modelVersion>4.0.0</modelVersion>
21 - 21 +
22 - <parent> 22 + <parent>
23 - <groupId>org.onosproject</groupId> 23 + <groupId>org.onosproject</groupId>
24 - <artifactId>onos-apps</artifactId> 24 + <artifactId>onos-apps</artifactId>
25 - <version>1.2.0-SNAPSHOT</version> 25 + <version>1.2.0-SNAPSHOT</version>
26 - <relativePath>../pom.xml</relativePath> 26 + <relativePath>../pom.xml</relativePath>
27 - </parent> 27 + </parent>
28 - 28 +
29 - <artifactId>onos-app-metrics</artifactId> 29 + <artifactId>onos-app-metrics</artifactId>
30 - <packaging>pom</packaging> 30 + <packaging>bundle</packaging>
31 - 31 +
32 - <description>ONOS metrics applications</description> 32 + <description>Performance metrics collection</description>
33 - 33 +
34 - <modules> 34 + <dependencies>
35 - <module>intent</module> 35 + <dependency>
36 - <module>topology</module> 36 + <groupId>org.onosproject</groupId>
37 - </modules> 37 + <artifactId>onlab-misc</artifactId>
38 - 38 + </dependency>
39 - <dependencies> 39 +
40 - <dependency> 40 + <dependency>
41 - <groupId>org.onosproject</groupId> 41 + <groupId>org.onosproject</groupId>
42 - <artifactId>onlab-misc</artifactId> 42 + <artifactId>onos-cli</artifactId>
43 - </dependency> 43 + <version>${project.version}</version>
44 - 44 + </dependency>
45 - <dependency> 45 + <dependency>
46 - <groupId>com.fasterxml.jackson.core</groupId> 46 + <groupId>org.osgi</groupId>
47 - <artifactId>jackson-databind</artifactId> 47 + <artifactId>org.osgi.core</artifactId>
48 - </dependency> 48 + </dependency>
49 - <dependency> 49 +
50 - <groupId>com.fasterxml.jackson.core</groupId> 50 + <dependency>
51 - <artifactId>jackson-annotations</artifactId> 51 + <groupId>org.apache.karaf.shell</groupId>
52 - </dependency> 52 + <artifactId>org.apache.karaf.shell.console</artifactId>
53 - 53 + </dependency>
54 - </dependencies> 54 +
55 + <dependency>
56 + <groupId>com.fasterxml.jackson.core</groupId>
57 + <artifactId>jackson-databind</artifactId>
58 + </dependency>
59 + <dependency>
60 + <groupId>com.fasterxml.jackson.core</groupId>
61 + <artifactId>jackson-annotations</artifactId>
62 + </dependency>
63 + </dependencies>
55 64
56 </project> 65 </project>
......
...@@ -14,14 +14,19 @@ ...@@ -14,14 +14,19 @@
14 ~ limitations under the License. 14 ~ limitations under the License.
15 --> 15 -->
16 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"> 16 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
17 + <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
18 + <command>
19 + <action class="org.onosproject.metrics.intent.cli.IntentEventsListCommand"/>
20 + </command>
21 + <command>
22 + <action class="org.onosproject.metrics.intent.cli.IntentEventsMetricsCommand"/>
23 + </command>
17 24
18 - <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0"> 25 + <command>
19 - <command> 26 + <action class="org.onosproject.metrics.topology.cli.TopologyEventsListCommand"/>
20 - <action class="org.onosproject.metrics.intent.cli.IntentEventsListCommand"/> 27 + </command>
21 - </command> 28 + <command>
22 - <command> 29 + <action class="org.onosproject.metrics.topology.cli.TopologyEventsMetricsCommand"/>
23 - <action class="org.onosproject.metrics.intent.cli.IntentEventsMetricsCommand"/> 30 + </command>
24 - </command> 31 + </command-bundle>
25 - </command-bundle>
26 -
27 </blueprint> 32 </blueprint>
......
1 -<?xml version="1.0" encoding="UTF-8"?>
2 -<!--
3 - ~ Copyright 2014 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-app-metrics</artifactId>
25 - <version>1.2.0-SNAPSHOT</version>
26 - <relativePath>../pom.xml</relativePath>
27 - </parent>
28 -
29 - <artifactId>onos-app-metrics-topology</artifactId>
30 - <packaging>bundle</packaging>
31 -
32 - <description>ONOS topology metrics application</description>
33 -
34 - <dependencies>
35 - <dependency>
36 - <groupId>org.onosproject</groupId>
37 - <artifactId>onos-cli</artifactId>
38 - <version>${project.version}</version>
39 - </dependency>
40 - <dependency>
41 - <groupId>org.osgi</groupId>
42 - <artifactId>org.osgi.core</artifactId>
43 - </dependency>
44 -
45 - <dependency>
46 - <groupId>org.apache.karaf.shell</groupId>
47 - <artifactId>org.apache.karaf.shell.console</artifactId>
48 - </dependency>
49 - </dependencies>
50 -
51 -</project>
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
14 ~ See the License for the specific language governing permissions and 14 ~ See the License for the specific language governing permissions and
15 ~ limitations under the License. 15 ~ limitations under the License.
16 --> 16 -->
17 -<app name="org.onosproject.mobility" origin="ON.Lab" version="1.2.0" 17 +<app name="org.onosproject.mobility" origin="ON.Lab" version="${feature.version}"
18 - features="onos-app-mobility"> 18 + featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
19 - <description>Host mobility application</description> 19 + features="${project.artifactId}">
20 + <description>${project.description}</description>
21 + <artifact>mvn:${project.groupId}/${project.artifactId}/${project.version}</artifact>
20 </app> 22 </app>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
29 <artifactId>onos-app-mobility</artifactId> 29 <artifactId>onos-app-mobility</artifactId>
30 <packaging>bundle</packaging> 30 <packaging>bundle</packaging>
31 31
32 - <description>ONOS simple Mobility app</description> 32 + <description>Host mobility application</description>
33 33
34 <dependencies> 34 <dependencies>
35 <dependency> 35 <dependency>
......
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
14 ~ See the License for the specific language governing permissions and 14 ~ See the License for the specific language governing permissions and
15 ~ limitations under the License. 15 ~ limitations under the License.
16 --> 16 -->
17 -<app name="org.onosproject.optical" origin="ON.Lab" version="1.2.0" 17 +<app name="org.onosproject.optical" origin="ON.Lab" version="${feature.version}"
18 - features="onos-app-optical"> 18 + featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
19 - <description>Packet/Optical use-case application</description> 19 + features="${project.artifactId}">
20 + <description>${project.description}</description>
21 + <artifact>mvn:${project.groupId}/${project.artifactId}/${project.version}</artifact>
20 </app> 22 </app>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
29 <artifactId>onos-app-optical</artifactId> 29 <artifactId>onos-app-optical</artifactId>
30 <packaging>bundle</packaging> 30 <packaging>bundle</packaging>
31 31
32 - <description>ONOS application for packet/optical deployments</description> 32 + <description>Packet/Optical use-case application</description>
33 33
34 <dependencies> 34 <dependencies>
35 35
......
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
14 ~ See the License for the specific language governing permissions and 14 ~ See the License for the specific language governing permissions and
15 ~ limitations under the License. 15 ~ limitations under the License.
16 --> 16 -->
17 -<app name="org.onosproject.proxyarp" origin="ON.Lab" version="1.2.0" 17 +<app name="org.onosproject.proxyarp" origin="ON.Lab" version="${feature.version}"
18 - features="onos-app-proxyarp"> 18 + featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
19 - <description>Proxy ARP/NDP application</description> 19 + features="${project.artifactId}">
20 + <description>${project.description}</description>
21 + <artifact>mvn:${project.groupId}/${project.artifactId}/${project.version}</artifact>
20 </app> 22 </app>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
29 <artifactId>onos-app-proxyarp</artifactId> 29 <artifactId>onos-app-proxyarp</artifactId>
30 <packaging>bundle</packaging> 30 <packaging>bundle</packaging>
31 31
32 - <description>ONOS simple proxy arp module</description> 32 + <description>Proxy ARP/NDP application</description>
33 33
34 <dependencies> 34 <dependencies>
35 <dependency> 35 <dependency>
......
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
14 ~ See the License for the specific language governing permissions and 14 ~ See the License for the specific language governing permissions and
15 ~ limitations under the License. 15 ~ limitations under the License.
16 --> 16 -->
17 -<app name="org.onosproject.reactive.routing" origin="ON.Lab" version="1.2.0" 17 +<app name="org.onosproject.routing" origin="ON.Lab" version="${feature.version}"
18 - features="onos-app-reactive-routing"> 18 + featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
19 - <description> ONOS SDN/IP reactive routing </description> 19 + features="${project.artifactId}">
20 + <description>${project.description}</description>
21 + <artifact>mvn:${project.groupId}/${project.artifactId}/${project.version}</artifact>
20 </app> 22 </app>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -14,38 +14,34 @@ ...@@ -14,38 +14,34 @@
14 ~ See the License for the specific language governing permissions and 14 ~ See the License for the specific language governing permissions and
15 ~ limitations under the License. 15 ~ limitations under the License.
16 --> 16 -->
17 -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 17 +<project xmlns="http://maven.apache.org/POM/4.0.0"
18 - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 18 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19 - <modelVersion>4.0.0</modelVersion> 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>
20 21
21 - <artifactId>onos-app-reactive-routing</artifactId> 22 + <artifactId>onos-app-reactive-routing</artifactId>
22 - <packaging>bundle</packaging> 23 + <packaging>bundle</packaging>
23 - <description> SDN-IP reactive routing </description> 24 + <description>SDN-IP reactive routing application</description>
24 25
25 - <parent> 26 + <parent>
26 - <groupId>org.onosproject</groupId> 27 + <groupId>org.onosproject</groupId>
27 - <artifactId>onos-apps</artifactId> 28 + <artifactId>onos-apps</artifactId>
28 - <version>1.2.0-SNAPSHOT</version> 29 + <version>1.2.0-SNAPSHOT</version>
29 - <relativePath>../pom.xml</relativePath> 30 + <relativePath>../pom.xml</relativePath>
30 - </parent> 31 + </parent>
31 32
32 - <dependencies> 33 + <dependencies>
33 - <dependency> 34 + <dependency>
34 - <groupId>org.onosproject</groupId> 35 + <groupId>org.onosproject</groupId>
35 - <artifactId>onos-app-routing-api</artifactId> 36 + <artifactId>onos-app-routing-api</artifactId>
36 - <version>${project.version}</version> 37 + <version>${project.version}</version>
37 - </dependency> 38 + </dependency>
38 39
39 - <dependency> 40 + <dependency>
40 - <groupId>org.onosproject</groupId> 41 + <groupId>org.onosproject</groupId>
41 - <artifactId>onos-app-routing</artifactId> 42 + <artifactId>onos-app-routing</artifactId>
42 - <version>${project.version}</version> 43 + <version>${project.version}</version>
43 - </dependency> 44 + </dependency>
44 - 45 + </dependencies>
45 - <dependency>
46 - <groupId>org.onosproject</groupId>
47 - <artifactId>onos-api</artifactId>
48 - </dependency>
49 - </dependencies>
50 46
51 </project> 47 </project>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -14,7 +14,11 @@ ...@@ -14,7 +14,11 @@
14 ~ See the License for the specific language governing permissions and 14 ~ See the License for the specific language governing permissions and
15 ~ limitations under the License. 15 ~ limitations under the License.
16 --> 16 -->
17 -<app name="org.onosproject.sdnip" origin="ON.Lab" version="1.2.0" 17 +<app name="org.onosproject.sdnip" origin="ON.Lab" version="${feature.version}"
18 - features="onos-app-sdnip"> 18 + featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
19 - <description>SDN/IP use-case application</description> 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>
20 </app> 24 </app>
......
1 +<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
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 +<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${feature.version}">
18 + <repository>mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features</repository>
19 + <feature name="onos-app-sdnip" version="${feature.version}"
20 + description="${project.description}">
21 + <feature>onos-api</feature>
22 + <feature>onos-app-proxyarp</feature>
23 + <feature>onos-app-config</feature>
24 + <bundle>mvn:${project.groupId}/onos-app-sdnip/${project.version}</bundle>
25 + <bundle>mvn:${project.groupId}/onos-app-bgprouter/${project.version}</bundle>
26 + <bundle>mvn:${project.groupId}/onos-app-routing-api/${project.version}</bundle>
27 + <bundle>mvn:${project.groupId}/onos-app-routing/${project.version}</bundle>
28 + </feature>
29 +</features>
...@@ -17,78 +17,78 @@ ...@@ -17,78 +17,78 @@
17 <project xmlns="http://maven.apache.org/POM/4.0.0" 17 <project xmlns="http://maven.apache.org/POM/4.0.0"
18 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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"> 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> 20 + <modelVersion>4.0.0</modelVersion>
21 21
22 - <parent> 22 + <parent>
23 - <groupId>org.onosproject</groupId> 23 + <groupId>org.onosproject</groupId>
24 - <artifactId>onos-apps</artifactId> 24 + <artifactId>onos-apps</artifactId>
25 - <version>1.2.0-SNAPSHOT</version> 25 + <version>1.2.0-SNAPSHOT</version>
26 - <relativePath>../pom.xml</relativePath> 26 + <relativePath>../pom.xml</relativePath>
27 - </parent> 27 + </parent>
28 28
29 - <artifactId>onos-app-sdnip</artifactId> 29 + <artifactId>onos-app-sdnip</artifactId>
30 - <packaging>bundle</packaging> 30 + <packaging>bundle</packaging>
31 31
32 - <description>SDN-IP peering application</description> 32 + <description>SDN-IP peering application</description>
33 33
34 - <dependencies> 34 + <dependencies>
35 - <dependency> 35 + <dependency>
36 - <groupId>com.google.guava</groupId> 36 + <groupId>com.google.guava</groupId>
37 - <artifactId>guava</artifactId> 37 + <artifactId>guava</artifactId>
38 - </dependency> 38 + </dependency>
39 39
40 - <dependency> 40 + <dependency>
41 - <groupId>org.onosproject</groupId> 41 + <groupId>org.onosproject</groupId>
42 - <artifactId>onlab-misc</artifactId> 42 + <artifactId>onlab-misc</artifactId>
43 - </dependency> 43 + </dependency>
44 44
45 - <dependency> 45 + <dependency>
46 - <groupId>org.onosproject</groupId> 46 + <groupId>org.onosproject</groupId>
47 - <artifactId>onlab-junit</artifactId> 47 + <artifactId>onlab-junit</artifactId>
48 - <scope>test</scope> 48 + <scope>test</scope>
49 - </dependency> 49 + </dependency>
50 50
51 - <dependency> 51 + <dependency>
52 - <groupId>org.onosproject</groupId> 52 + <groupId>org.onosproject</groupId>
53 - <artifactId>onos-api</artifactId> 53 + <artifactId>onos-api</artifactId>
54 - <version>${project.version}</version> 54 + <version>${project.version}</version>
55 - <scope>test</scope> 55 + <scope>test</scope>
56 - <classifier>tests</classifier> 56 + <classifier>tests</classifier>
57 - </dependency> 57 + </dependency>
58 58
59 - <dependency> 59 + <dependency>
60 - <groupId>org.onosproject</groupId> 60 + <groupId>org.onosproject</groupId>
61 - <artifactId>onos-app-routing-api</artifactId> 61 + <artifactId>onos-app-routing</artifactId>
62 - <version>${project.version}</version> 62 + <version>${project.version}</version>
63 - </dependency> 63 + </dependency>
64 64
65 - <dependency> 65 + <dependency>
66 - <groupId>org.onosproject</groupId> 66 + <groupId>org.onosproject</groupId>
67 - <artifactId>onos-cli</artifactId> 67 + <artifactId>onos-cli</artifactId>
68 - <version>${project.version}</version> 68 + <version>${project.version}</version>
69 - </dependency> 69 + </dependency>
70 70
71 - <dependency> 71 + <dependency>
72 - <groupId>org.onosproject</groupId> 72 + <groupId>org.onosproject</groupId>
73 - <artifactId>onos-app-config</artifactId> 73 + <artifactId>onos-app-config</artifactId>
74 - <version>${project.version}</version> 74 + <version>${project.version}</version>
75 - </dependency> 75 + </dependency>
76 76
77 - <dependency> 77 + <dependency>
78 - <groupId>org.apache.karaf.shell</groupId> 78 + <groupId>org.apache.karaf.shell</groupId>
79 - <artifactId>org.apache.karaf.shell.console</artifactId> 79 + <artifactId>org.apache.karaf.shell.console</artifactId>
80 - </dependency> 80 + </dependency>
81 81
82 - <dependency> 82 + <dependency>
83 - <groupId>org.osgi</groupId> 83 + <groupId>org.osgi</groupId>
84 - <artifactId>org.osgi.core</artifactId> 84 + <artifactId>org.osgi.core</artifactId>
85 - </dependency> 85 + </dependency>
86 86
87 - <dependency> 87 + <dependency>
88 - <groupId>org.easymock</groupId> 88 + <groupId>org.easymock</groupId>
89 - <artifactId>easymock</artifactId> 89 + <artifactId>easymock</artifactId>
90 - <scope>test</scope> 90 + <scope>test</scope>
91 - </dependency> 91 + </dependency>
92 - </dependencies> 92 + </dependencies>
93 93
94 </project> 94 </project>
......
...@@ -14,7 +14,10 @@ ...@@ -14,7 +14,10 @@
14 ~ See the License for the specific language governing permissions and 14 ~ See the License for the specific language governing permissions and
15 ~ limitations under the License. 15 ~ limitations under the License.
16 --> 16 -->
17 -<app name="org.onosproject.intentperf" origin="ON.Lab" version="1.2.0"
18 - features="onos-app-intent-perf">
19 - <description>Intent performance test application</description>
20 -</app>
...\ No newline at end of file ...\ No newline at end of file
17 +<app name="org.onosproject.segmentrouting" origin="ON.Lab" version="${feature.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 +</app>
23 +
......
...@@ -13,26 +13,21 @@ ...@@ -13,26 +13,21 @@
13 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 ~ See the License for the specific language governing permissions and 14 ~ See the License for the specific language governing permissions and
15 ~ limitations under the License. 15 ~ limitations under the License.
16 - --><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 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">
17 <modelVersion>4.0.0</modelVersion> 20 <modelVersion>4.0.0</modelVersion>
18 <parent> 21 <parent>
19 - <artifactId>onos-apps</artifactId> 22 + <artifactId>onos-apps</artifactId>
20 - <groupId>org.onosproject</groupId> 23 + <groupId>org.onosproject</groupId>
21 - <version>1.2.0-SNAPSHOT</version> 24 + <version>1.2.0-SNAPSHOT</version>
22 - </parent> 25 + <relativePath>../pom.xml</relativePath>
26 + </parent>
23 27
24 <artifactId>onos-app-segmentrouting</artifactId> 28 <artifactId>onos-app-segmentrouting</artifactId>
25 <packaging>bundle</packaging> 29 <packaging>bundle</packaging>
26 30
27 - <description>ONOS OSGi bundle archetype</description> 31 + <description>Segment routing application</description>
28 - <url>http://onosproject.org</url>
29 -
30 - <dependencies>
31 - <dependency>
32 - <groupId>org.onosproject</groupId>
33 - <artifactId>onos-app-grouphandler</artifactId>
34 - <version>1.2.0-SNAPSHOT</version>
35 - </dependency>
36 - </dependencies>
37 32
38 </project> 33 </project>
......
...@@ -14,7 +14,10 @@ ...@@ -14,7 +14,10 @@
14 ~ See the License for the specific language governing permissions and 14 ~ See the License for the specific language governing permissions and
15 ~ limitations under the License. 15 ~ limitations under the License.
16 --> 16 -->
17 -<app name="org.onosproject.demo" origin="ON.Lab" version="1.2.0" 17 +<app name="org.onosproject.demo" origin="ON.Lab" version="${feature.version}"
18 - features="onos-app-demo"> 18 + featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
19 - <description>Flow throughput test application</description> 19 + features="${project.artifactId}">
20 + <description>${project.description}</description>
21 + <artifact>mvn:${project.groupId}/${project.artifactId}/${project.version}</artifact>
20 </app> 22 </app>
23 +
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
29 <artifactId>onos-app-demo</artifactId> 29 <artifactId>onos-app-demo</artifactId>
30 <packaging>bundle</packaging> 30 <packaging>bundle</packaging>
31 31
32 - <description>ONOS demo app bundle</description> 32 + <description>Flow throughput test application</description>
33 33
34 <properties> 34 <properties>
35 <web.context>/onos/demo</web.context> 35 <web.context>/onos/demo</web.context>
......
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
14 ~ See the License for the specific language governing permissions and 14 ~ See the License for the specific language governing permissions and
15 ~ limitations under the License. 15 ~ limitations under the License.
16 --> 16 -->
17 -<app name="org.onosproject.election" origin="ON.Lab" version="1.2.0" 17 +<app name="org.onosproject.election" origin="ON.Lab" version="${feature.version}"
18 - features="onos-app-election"> 18 + featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
19 - <description>Master election test application</description> 19 + features="${project.artifactId}">
20 + <description>${project.description}</description>
21 + <artifact>mvn:${project.groupId}/${project.artifactId}/${project.version}</artifact>
20 </app> 22 </app>
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
30 <artifactId>onos-app-election</artifactId> 30 <artifactId>onos-app-election</artifactId>
31 <packaging>bundle</packaging> 31 <packaging>bundle</packaging>
32 32
33 - <description>ONOS app leadership election test</description> 33 + <description>Master election test application</description>
34 34
35 <dependencies> 35 <dependencies>
36 36
......
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
14 ~ See the License for the specific language governing permissions and 14 ~ See the License for the specific language governing permissions and
15 ~ limitations under the License. 15 ~ limitations under the License.
16 --> 16 -->
17 -<app name="org.onosproject.openflow" origin="ON.Lab" version="1.2.0" 17 +<app name="org.onosproject.intentperf" origin="ON.Lab" version="${feature.version}"
18 - features="onos-openflow"> 18 + featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
19 - <description>OpenFlow protocol southbound providers</description> 19 + features="${project.artifactId}">
20 + <description>${project.description}</description>
21 + <artifact>mvn:${project.groupId}/${project.artifactId}/${project.version}</artifact>
20 </app> 22 </app>
......
...@@ -29,15 +29,10 @@ ...@@ -29,15 +29,10 @@
29 <artifactId>onos-app-intent-perf</artifactId> 29 <artifactId>onos-app-intent-perf</artifactId>
30 <packaging>bundle</packaging> 30 <packaging>bundle</packaging>
31 31
32 - <description>ONOS intent perf app bundle</description> 32 + <description>Intent performance test application</description>
33 33
34 <dependencies> 34 <dependencies>
35 <dependency> 35 <dependency>
36 - <groupId>org.apache.karaf.shell</groupId>
37 - <artifactId>org.apache.karaf.shell.console</artifactId>
38 - </dependency>
39 -
40 - <dependency>
41 <groupId>org.onosproject</groupId> 36 <groupId>org.onosproject</groupId>
42 <artifactId>onos-cli</artifactId> 37 <artifactId>onos-cli</artifactId>
43 <version>${project.version}</version> 38 <version>${project.version}</version>
...@@ -46,6 +41,10 @@ ...@@ -46,6 +41,10 @@
46 <groupId>org.osgi</groupId> 41 <groupId>org.osgi</groupId>
47 <artifactId>org.osgi.compendium</artifactId> 42 <artifactId>org.osgi.compendium</artifactId>
48 </dependency> 43 </dependency>
44 + <dependency>
45 + <groupId>org.apache.karaf.shell</groupId>
46 + <artifactId>org.apache.karaf.shell.console</artifactId>
47 + </dependency>
49 <!-- Required for javadoc generation --> 48 <!-- Required for javadoc generation -->
50 <dependency> 49 <dependency>
51 <groupId>org.osgi</groupId> 50 <groupId>org.osgi</groupId>
...@@ -53,24 +52,4 @@ ...@@ -53,24 +52,4 @@
53 </dependency> 52 </dependency>
54 </dependencies> 53 </dependencies>
55 54
56 - <build>
57 - <plugins>
58 - <plugin>
59 - <groupId>org.apache.maven.plugins</groupId>
60 - <artifactId>maven-assembly-plugin</artifactId>
61 - <version>2.5.3</version>
62 - <configuration>
63 - <descriptor>src/assembly/bin.xml</descriptor>
64 - </configuration>
65 - <executions>
66 - <execution>
67 - <phase>package</phase>
68 - <goals>
69 - <goal>single</goal>
70 - </goals>
71 - </execution>
72 - </executions>
73 - </plugin>
74 - </plugins>
75 - </build>
76 </project> 55 </project>
......
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 -<assembly
18 - xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
19 - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20 - xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
21 - <formats>
22 - <format>zip</format>
23 - </formats>
24 - <id>onos</id>
25 - <includeBaseDirectory>false</includeBaseDirectory>
26 - <files>
27 - <file>
28 - <source>src/assembly/app.xml</source>
29 - <destName>app.xml</destName>
30 - </file>
31 - <file>
32 - <source>target/${project.artifactId}-${project.version}.jar</source>
33 - <destName>m2/org/onosproject/${project.artifactId}/${project.version}/${project.artifactId}-${project.version}.jar</destName>
34 - </file>
35 - </files>
36 -</assembly>
...\ No newline at end of file ...\ No newline at end of file
...@@ -18,17 +18,17 @@ package org.onosproject.cli; ...@@ -18,17 +18,17 @@ package org.onosproject.cli;
18 import com.fasterxml.jackson.databind.ObjectMapper; 18 import com.fasterxml.jackson.databind.ObjectMapper;
19 import com.fasterxml.jackson.databind.node.ObjectNode; 19 import com.fasterxml.jackson.databind.node.ObjectNode;
20 import org.apache.karaf.shell.commands.Option; 20 import org.apache.karaf.shell.commands.Option;
21 -import org.apache.karaf.shell.console.OsgiCommandSupport; 21 +import org.apache.karaf.shell.console.AbstractAction;
22 +import org.onlab.osgi.DefaultServiceDirectory;
23 +import org.onlab.osgi.ServiceNotFoundException;
22 import org.onosproject.core.ApplicationId; 24 import org.onosproject.core.ApplicationId;
23 import org.onosproject.core.CoreService; 25 import org.onosproject.core.CoreService;
24 import org.onosproject.net.Annotations; 26 import org.onosproject.net.Annotations;
25 -import org.onlab.osgi.DefaultServiceDirectory;
26 -import org.onlab.osgi.ServiceNotFoundException;
27 27
28 /** 28 /**
29 * Base abstraction of Karaf shell commands. 29 * Base abstraction of Karaf shell commands.
30 */ 30 */
31 -public abstract class AbstractShellCommand extends OsgiCommandSupport { 31 +public abstract class AbstractShellCommand extends AbstractAction {
32 32
33 @Option(name = "-j", aliases = "--json", description = "Output JSON", 33 @Option(name = "-j", aliases = "--json", description = "Output JSON",
34 required = false, multiValued = false) 34 required = false, multiValued = false)
......
...@@ -21,6 +21,9 @@ import org.onosproject.app.ApplicationAdminService; ...@@ -21,6 +21,9 @@ import org.onosproject.app.ApplicationAdminService;
21 import org.onosproject.cli.AbstractShellCommand; 21 import org.onosproject.cli.AbstractShellCommand;
22 import org.onosproject.core.ApplicationId; 22 import org.onosproject.core.ApplicationId;
23 23
24 +import java.io.IOException;
25 +import java.net.URL;
26 +
24 /** 27 /**
25 * Manages application inventory. 28 * Manages application inventory.
26 */ 29 */
...@@ -34,11 +37,11 @@ public class ApplicationCommand extends AbstractShellCommand { ...@@ -34,11 +37,11 @@ public class ApplicationCommand extends AbstractShellCommand {
34 static final String DEACTIVATE = "deactivate"; 37 static final String DEACTIVATE = "deactivate";
35 38
36 @Argument(index = 0, name = "command", 39 @Argument(index = 0, name = "command",
37 - description = "Command name (activate|deactivate|uninstall)", 40 + description = "Command name (install|activate|deactivate|uninstall)",
38 required = true, multiValued = false) 41 required = true, multiValued = false)
39 String command = null; 42 String command = null;
40 43
41 - @Argument(index = 1, name = "names", description = "Application name(s)", 44 + @Argument(index = 1, name = "names", description = "Application name(s) or URL(s)",
42 required = true, multiValued = true) 45 required = true, multiValued = true)
43 String[] names = null; 46 String[] names = null;
44 47
...@@ -46,27 +49,55 @@ public class ApplicationCommand extends AbstractShellCommand { ...@@ -46,27 +49,55 @@ public class ApplicationCommand extends AbstractShellCommand {
46 protected void execute() { 49 protected void execute() {
47 ApplicationAdminService service = get(ApplicationAdminService.class); 50 ApplicationAdminService service = get(ApplicationAdminService.class);
48 if (command.equals(INSTALL)) { 51 if (command.equals(INSTALL)) {
49 - print("Not supported via CLI yet."); 52 + for (String name : names) {
53 + if (!installApp(service, name)) {
54 + return;
55 + }
56 + }
50 57
51 } else { 58 } else {
52 for (String name : names) { 59 for (String name : names) {
53 - ApplicationId appId = service.getId(name); 60 + if (!manageApp(service, name)) {
54 - if (appId == null) {
55 - print("No such application: %s", name);
56 return; 61 return;
57 } 62 }
63 + }
64 + }
65 + }
58 66
59 - if (command.equals(UNINSTALL)) { 67 + // Installs the application from input of the specified URL
60 - service.uninstall(appId); 68 + private boolean installApp(ApplicationAdminService service, String url) {
61 - } else if (command.equals(ACTIVATE)) { 69 + try {
62 - service.activate(appId); 70 + if (url.equals("-")) {
63 - } else if (command.equals(DEACTIVATE)) { 71 + service.install(System.in);
64 - service.deactivate(appId); 72 + } else {
65 - } else { 73 + service.install(new URL(url).openStream());
66 - print("Unsupported command: %s", command);
67 - }
68 } 74 }
75 + } catch (IOException e) {
76 + error("Unable to get URL: %s", url);
77 + return false;
78 + }
79 + return true;
80 + }
81 +
82 + // Manages the specified application.
83 + private boolean manageApp(ApplicationAdminService service, String name) {
84 + ApplicationId appId = service.getId(name);
85 + if (appId == null) {
86 + print("No such application: %s", name);
87 + return false;
88 + }
89 +
90 + if (command.equals(UNINSTALL)) {
91 + service.uninstall(appId);
92 + } else if (command.equals(ACTIVATE)) {
93 + service.activate(appId);
94 + } else if (command.equals(DEACTIVATE)) {
95 + service.deactivate(appId);
96 + } else {
97 + print("Unsupported command: %s", command);
98 + return false;
69 } 99 }
100 + return true;
70 } 101 }
71 102
72 } 103 }
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
15 */ 15 */
16 package org.onosproject.cli.app; 16 package org.onosproject.cli.app;
17 17
18 -import com.google.common.collect.Sets;
19 import org.apache.karaf.shell.console.completer.ArgumentCompleter; 18 import org.apache.karaf.shell.console.completer.ArgumentCompleter;
20 import org.apache.karaf.shell.console.completer.StringsCompleter; 19 import org.apache.karaf.shell.console.completer.StringsCompleter;
21 import org.onosproject.app.ApplicationService; 20 import org.onosproject.app.ApplicationService;
...@@ -23,11 +22,8 @@ import org.onosproject.app.ApplicationState; ...@@ -23,11 +22,8 @@ import org.onosproject.app.ApplicationState;
23 import org.onosproject.cli.AbstractCompleter; 22 import org.onosproject.cli.AbstractCompleter;
24 import org.onosproject.core.Application; 23 import org.onosproject.core.Application;
25 24
26 -import java.util.Arrays;
27 -import java.util.Collections;
28 import java.util.Iterator; 25 import java.util.Iterator;
29 import java.util.List; 26 import java.util.List;
30 -import java.util.Set;
31 import java.util.SortedSet; 27 import java.util.SortedSet;
32 28
33 import static org.onosproject.app.ApplicationState.ACTIVE; 29 import static org.onosproject.app.ApplicationState.ACTIVE;
...@@ -48,13 +44,14 @@ public class ApplicationNameCompleter extends AbstractCompleter { ...@@ -48,13 +44,14 @@ public class ApplicationNameCompleter extends AbstractCompleter {
48 String cmd = list.getArguments()[1]; 44 String cmd = list.getArguments()[1];
49 45
50 // Grab apps already on the command (to prevent tab-completed duplicates) 46 // Grab apps already on the command (to prevent tab-completed duplicates)
51 - final Set previousApps; 47 + // FIXME: This does not work.
52 - if (list.getArguments().length > 2) { 48 +// final Set previousApps;
53 - previousApps = Sets.newHashSet( 49 +// if (list.getArguments().length > 2) {
54 - Arrays.copyOfRange(list.getArguments(), 2, list.getArguments().length)); 50 +// previousApps = Sets.newHashSet(
55 - } else { 51 +// Arrays.copyOfRange(list.getArguments(), 2, list.getArguments().length));
56 - previousApps = Collections.emptySet(); 52 +// } else {
57 - } 53 +// previousApps = Collections.emptySet();
54 +// }
58 55
59 // Fetch our service and feed it's offerings to the string completer 56 // Fetch our service and feed it's offerings to the string completer
60 ApplicationService service = get(ApplicationService.class); 57 ApplicationService service = get(ApplicationService.class);
...@@ -63,9 +60,9 @@ public class ApplicationNameCompleter extends AbstractCompleter { ...@@ -63,9 +60,9 @@ public class ApplicationNameCompleter extends AbstractCompleter {
63 while (it.hasNext()) { 60 while (it.hasNext()) {
64 Application app = it.next(); 61 Application app = it.next();
65 ApplicationState state = service.getState(app.id()); 62 ApplicationState state = service.getState(app.id());
66 - if (previousApps.contains(app.id().name())) { 63 +// if (previousApps.contains(app.id().name())) {
67 - continue; 64 +// continue;
68 - } 65 +// }
69 if (cmd.equals("uninstall") || 66 if (cmd.equals("uninstall") ||
70 (cmd.equals("activate") && state == INSTALLED) || 67 (cmd.equals("activate") && state == INSTALLED) ||
71 (cmd.equals("deactivate") && state == ACTIVE)) { 68 (cmd.equals("deactivate") && state == ACTIVE)) {
......
...@@ -58,6 +58,8 @@ import static com.google.common.io.Files.write; ...@@ -58,6 +58,8 @@ import static com.google.common.io.Files.write;
58 public class ApplicationArchive 58 public class ApplicationArchive
59 extends AbstractStore<ApplicationEvent, ApplicationStoreDelegate> { 59 extends AbstractStore<ApplicationEvent, ApplicationStoreDelegate> {
60 60
61 + private static Logger log = LoggerFactory.getLogger(ApplicationArchive.class);
62 +
61 // Magic strings to search for at the beginning of the archive stream 63 // Magic strings to search for at the beginning of the archive stream
62 private static final String XML_MAGIC = "<?xml "; 64 private static final String XML_MAGIC = "<?xml ";
63 65
...@@ -72,7 +74,7 @@ public class ApplicationArchive ...@@ -72,7 +74,7 @@ public class ApplicationArchive
72 private static final String FEATURES = "[@features]"; 74 private static final String FEATURES = "[@features]";
73 private static final String DESCRIPTION = "description"; 75 private static final String DESCRIPTION = "description";
74 76
75 - private static Logger log = LoggerFactory.getLogger(ApplicationArchive.class); 77 + private static final String OAR = ".oar";
76 private static final String APP_XML = "app.xml"; 78 private static final String APP_XML = "app.xml";
77 private static final String M2_PREFIX = "m2"; 79 private static final String M2_PREFIX = "m2";
78 80
...@@ -222,7 +224,7 @@ public class ApplicationArchive ...@@ -222,7 +224,7 @@ public class ApplicationArchive
222 */ 224 */
223 public synchronized InputStream getApplicationInputStream(String appName) { 225 public synchronized InputStream getApplicationInputStream(String appName) {
224 try { 226 try {
225 - File appFile = appFile(appName, appName + ".zip"); 227 + File appFile = appFile(appName, appName + OAR);
226 return new FileInputStream(appFile.exists() ? appFile : appFile(appName, APP_XML)); 228 return new FileInputStream(appFile.exists() ? appFile : appFile(appName, APP_XML));
227 } catch (FileNotFoundException e) { 229 } catch (FileNotFoundException e) {
228 throw new ApplicationException("Application " + appName + " not found"); 230 throw new ApplicationException("Application " + appName + " not found");
...@@ -304,7 +306,7 @@ public class ApplicationArchive ...@@ -304,7 +306,7 @@ public class ApplicationArchive
304 // Saves the specified ZIP stream into a file under app-specific directory. 306 // Saves the specified ZIP stream into a file under app-specific directory.
305 private void saveApplication(InputStream stream, ApplicationDescription desc) 307 private void saveApplication(InputStream stream, ApplicationDescription desc)
306 throws IOException { 308 throws IOException {
307 - Files.write(toByteArray(stream), appFile(desc.name(), desc.name() + ".zip")); 309 + Files.write(toByteArray(stream), appFile(desc.name(), desc.name() + OAR));
308 } 310 }
309 311
310 // Installs application artifacts into M2 repository. 312 // Installs application artifacts into M2 repository.
......
...@@ -97,14 +97,6 @@ ...@@ -97,14 +97,6 @@
97 <bundle>mvn:org.onosproject/onlab-netty/@ONOS-VERSION</bundle> 97 <bundle>mvn:org.onosproject/onlab-netty/@ONOS-VERSION</bundle>
98 </feature> 98 </feature>
99 99
100 - <feature name="onos-core-trivial" version="@FEATURE-VERSION"
101 - description="ONOS core components">
102 - <feature>onos-api</feature>
103 - <bundle>mvn:org.onosproject/onos-core-net/@ONOS-VERSION</bundle>
104 - <bundle>mvn:org.onosproject/onos-core-common/@ONOS-VERSION</bundle>
105 - <bundle>mvn:org.onosproject/onos-core-trivial/@ONOS-VERSION</bundle>
106 - </feature>
107 -
108 <feature name="onos-rest" version="@FEATURE-VERSION" 100 <feature name="onos-rest" version="@FEATURE-VERSION"
109 description="ONOS REST API components"> 101 description="ONOS REST API components">
110 <feature>onos-api</feature> 102 <feature>onos-api</feature>
...@@ -128,11 +120,7 @@ ...@@ -128,11 +120,7 @@
128 <bundle>mvn:org.onosproject/onos-cli/@ONOS-VERSION</bundle> 120 <bundle>mvn:org.onosproject/onos-cli/@ONOS-VERSION</bundle>
129 </feature> 121 </feature>
130 122
131 - <feature name="onos-null" version="@FEATURE-VERSION" 123 + <!-- ONOS OpenFlow provider app features -->
132 - description="ONOS Null providers">
133 - <feature>onos-api</feature>
134 - <bundle>mvn:org.onosproject/onos-null-provider/@ONOS-VERSION</bundle>
135 - </feature>
136 124
137 <feature name="onos-openflow" version="@FEATURE-VERSION" 125 <feature name="onos-openflow" version="@FEATURE-VERSION"
138 description="ONOS OpenFlow API, Controller &amp; Providers"> 126 description="ONOS OpenFlow API, Controller &amp; Providers">
...@@ -151,146 +139,14 @@ ...@@ -151,146 +139,14 @@
151 <bundle>mvn:org.onosproject/onos-of-provider-group/@ONOS-VERSION</bundle> 139 <bundle>mvn:org.onosproject/onos-of-provider-group/@ONOS-VERSION</bundle>
152 </feature> 140 </feature>
153 141
154 - <!-- ONOS built-in app features --> 142 + <!-- Deprecated! For standalone testing only. -->
155 -
156 - <feature name="onos-app-fwd" version="@FEATURE-VERSION"
157 - description="ONOS sample forwarding application">
158 - <feature>onos-api</feature>
159 - <bundle>mvn:org.onosproject/onos-app-fwd/@ONOS-VERSION</bundle>
160 - </feature>
161 -
162 - <feature name="onos-app-mobility" version="@FEATURE-VERSION"
163 - description="ONOS sample mobility application">
164 - <feature>onos-api</feature>
165 - <bundle>mvn:org.onosproject/onos-app-mobility/@ONOS-VERSION</bundle>
166 - </feature>
167 -
168 - <feature name="onos-app-proxyarp" version="@FEATURE-VERSION"
169 - description="ONOS sample proxyarp application">
170 - <feature>onos-api</feature>
171 - <bundle>mvn:org.onosproject/onos-app-proxyarp/@ONOS-VERSION</bundle>
172 - </feature>
173 -
174 - <feature name="onos-app-config" version="@FEATURE-VERSION"
175 - description="ONOS network config reader">
176 - <feature>onos-api</feature>
177 - <bundle>mvn:org.onosproject/onos-app-config/@ONOS-VERSION</bundle>
178 - </feature>
179 -
180 - <feature name="onos-app-optical" version="@FEATURE-VERSION"
181 - description="ONOS optical network config">
182 - <feature>onos-api</feature>
183 - <bundle>mvn:org.onosproject/onos-app-optical/@ONOS-VERSION</bundle>
184 - </feature>
185 -
186 - <feature name="onos-app-reactive-routing" version="@FEATURE-VERSION"
187 - description="ONOS SDN/IP reactive routing">
188 - <feature>onos-app-sdnip</feature>
189 - <bundle>mvn:org.onosproject/onos-app-reactive-routing/@ONOS-VERSION</bundle>
190 - </feature>
191 -
192 - <feature name="onos-app-sdnip" version="@FEATURE-VERSION"
193 - description="SDN-IP peering application">
194 - <feature>onos-api</feature>
195 - <feature>onos-app-proxyarp</feature>
196 - <feature>onos-app-config</feature>
197 - <bundle>mvn:org.onosproject/onos-app-sdnip/@ONOS-VERSION</bundle>
198 - <bundle>mvn:org.onosproject/onos-app-routing-api/@ONOS-VERSION</bundle>
199 - <bundle>mvn:org.onosproject/onos-app-routing/@ONOS-VERSION</bundle>
200 - </feature>
201 143
202 - <feature name="onos-app-bgprouter" version="@FEATURE-VERSION" 144 + <feature name="onos-core-trivial" version="@FEATURE-VERSION"
203 - description="BGP router application"> 145 + description="ONOS core components">
204 - <feature>onos-api</feature>
205 - <feature>onos-app-proxyarp</feature>
206 - <feature>onos-app-config</feature>
207 - <bundle>mvn:org.onosproject/onos-app-bgprouter/@ONOS-VERSION</bundle>
208 - <bundle>mvn:org.onosproject/onos-app-routing-api/@ONOS-VERSION</bundle>
209 - <bundle>mvn:org.onosproject/onos-app-routing/@ONOS-VERSION</bundle>
210 - </feature>
211 -
212 - <feature name="onos-app-metrics" version="@FEATURE-VERSION"
213 - description="ONOS metrics applications">
214 - <feature>onos-app-metrics-intent</feature>
215 - <feature>onos-app-metrics-topology</feature>
216 - </feature>
217 -
218 - <feature name="onos-app-metrics-intent" version="@FEATURE-VERSION"
219 - description="ONOS intent metrics application">
220 - <feature>onos-api</feature>
221 - <bundle>mvn:org.onosproject/onos-app-metrics-intent/@ONOS-VERSION</bundle>
222 - </feature>
223 -
224 - <feature name="onos-app-metrics-topology" version="@FEATURE-VERSION"
225 - description="ONOS topology metrics application">
226 - <feature>onos-api</feature>
227 - <bundle>mvn:org.onosproject/onos-app-metrics-topology/@ONOS-VERSION</bundle>
228 - </feature>
229 -
230 -
231 - <!-- ONOS test app features -->
232 -
233 - <feature name="onos-app-intent-perf" version="@FEATURE-VERSION"
234 - description="ONOS intent perf applications">
235 - <feature>onos-api</feature>
236 - <bundle>mvn:org.onosproject/onos-app-intent-perf/@ONOS-VERSION</bundle>
237 - </feature>
238 -
239 - <feature name="onos-app-election" version="@FEATURE-VERSION"
240 - description="ONOS app leadership election test">
241 - <feature>onos-api</feature>
242 - <bundle>mvn:org.onosproject/onos-app-election/@ONOS-VERSION</bundle>
243 - </feature>
244 -
245 - <feature name="onos-app-demo" version="@FEATURE-VERSION"
246 - description="ONOS demo applications">
247 - <feature>onos-api</feature>
248 - <bundle>mvn:org.onosproject/onlab-misc/@ONOS-VERSION</bundle>
249 - <bundle>mvn:org.onosproject/onos-app-demo/@ONOS-VERSION</bundle>
250 - </feature>
251 -
252 -
253 - <!-- ONOS sample app features: to be moved to a different repo -->
254 -
255 - <feature name="onos-app-tvue" version="@FEATURE-VERSION"
256 - description="ONOS sample topology viewer application">
257 - <feature>onos-api</feature>
258 - <feature>onos-thirdparty-web</feature>
259 - <bundle>mvn:org.onosproject/onlab-rest/@ONOS-VERSION</bundle>
260 - <bundle>mvn:org.onosproject/onos-app-tvue/@ONOS-VERSION</bundle>
261 - </feature>
262 -
263 - <feature name="onos-app-ifwd" version="@FEATURE-VERSION"
264 - description="ONOS sample forwarding application using intents">
265 - <feature>onos-api</feature>
266 - <bundle>mvn:org.onosproject/onos-app-ifwd/@ONOS-VERSION</bundle>
267 - </feature>
268 -
269 - <feature name="onos-app-database-perf" version="@FEATURE-VERSION"
270 - description="ONOS partitioned database perf application">
271 - <feature>onos-api</feature>
272 - <bundle>mvn:org.onosproject/onos-app-database-perf/@ONOS-VERSION</bundle>
273 - </feature>
274 -
275 - <feature name="onos-app-calendar" version="@FEATURE-VERSION"
276 - description="REST interface for scheduling intents from an external calendar">
277 - <feature>onos-api</feature>
278 - <feature>onos-thirdparty-web</feature>
279 - <bundle>mvn:org.onosproject/onos-app-calendar/@ONOS-VERSION</bundle>
280 - </feature>
281 -
282 - <feature name="onos-app-grouphandler" version="@FEATURE-VERSION"
283 - description="Group Handler Sample App">
284 - <feature>onos-api</feature>
285 - <bundle>mvn:org.onosproject/onos-app-grouphandler/@ONOS-VERSION</bundle>
286 - </feature>
287 -
288 - <feature name="onos-app-segmentrouting" version="@FEATURE-VERSION"
289 - description="Segment routing application">
290 <feature>onos-api</feature> 146 <feature>onos-api</feature>
291 - <bundle>mvn:org.onosproject/onos-app-segmentrouting/@ONOS-VERSION</bundle> 147 + <bundle>mvn:org.onosproject/onos-core-net/@ONOS-VERSION</bundle>
292 - <bundle>mvn:org.onosproject/onos-app-grouphandler/@ONOS-VERSION</bundle> 148 + <bundle>mvn:org.onosproject/onos-core-common/@ONOS-VERSION</bundle>
149 + <bundle>mvn:org.onosproject/onos-core-trivial/@ONOS-VERSION</bundle>
293 </feature> 150 </feature>
294 151
295 -
296 </features> 152 </features>
......
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
14 ~ See the License for the specific language governing permissions and 14 ~ See the License for the specific language governing permissions and
15 ~ limitations under the License. 15 ~ limitations under the License.
16 --> 16 -->
17 -<app name="org.onosproject.null" origin="ON.Lab" version="1.2.0" 17 +<app name="org.onosproject.null" origin="ON.Lab" version="${feature.version}"
18 - features="onos-null"> 18 + featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
19 - <description>Null southbound providers for testing</description> 19 + features="${project.artifactId}">
20 + <description>${project.description}</description>
21 + <artifact>mvn:${project.groupId}/${project.artifactId}/${project.version}</artifact>
20 </app> 22 </app>
......
...@@ -136,8 +136,8 @@ class NullPacketProvider extends NullProviders.AbstractNullProvider ...@@ -136,8 +136,8 @@ class NullPacketProvider extends NullProviders.AbstractNullProvider
136 136
137 @Override 137 @Override
138 public void run(Timeout to) { 138 public void run(Timeout to) {
139 - if (!devices.isEmpty()) { 139 + if (!devices.isEmpty() && !to.isCancelled()) {
140 - sendEvent(devices.get(currentDevice)); 140 + sendEvent(devices.get(Math.max(currentDevice, devices.size())));
141 currentDevice = (currentDevice + 1) % devices.size(); 141 currentDevice = (currentDevice + 1) % devices.size();
142 timeout = timer.newTimeout(to.getTask(), delay, TimeUnit.MILLISECONDS); 142 timeout = timer.newTimeout(to.getTask(), delay, TimeUnit.MILLISECONDS);
143 } 143 }
......
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 +<app name="org.onosproject.openflow" origin="ON.Lab" version="${feature.version}"
18 + features="onos-openflow">
19 + <description>OpenFlow protocol southbound providers</description>
20 +
21 + <artifact>mvn:${project.groupId}/onos-of-api/${project.version}</artifact>
22 + <artifact>mvn:${project.groupId}/onos-of-drivers/${project.version}</artifact>
23 + <artifact>mvn:${project.groupId}/onos-of-ctl/${project.version}</artifact>
24 + <artifact>mvn:${project.groupId}/onos-drivers/${project.version}</artifact>
25 +
26 + <artifact>mvn:${project.groupId}/onos-lldp-provider/${project.version}</artifact>
27 + <artifact>mvn:${project.groupId}/onos-host-provider/${project.version}</artifact>
28 + <artifact>mvn:${project.groupId}/onos-of-provider-device/${project.version}</artifact>
29 + <artifact>mvn:${project.groupId}/onos-of-provider-packet/${project.version}</artifact>
30 + <artifact>mvn:${project.groupId}/onos-of-provider-flow/${project.version}</artifact>
31 + <artifact>mvn:${project.groupId}/onos-of-provider-group/${project.version}</artifact>
32 +</app>
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- 2 <!--
3 - ~ Copyright 2014 Open Networking Laboratory 3 + ~ Copyright 2015 Open Networking Laboratory
4 ~ 4 ~
5 ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 ~ Licensed under the Apache License, Version 2.0 (the "License");
6 ~ you may not use this file except in compliance with the License. 6 ~ you may not use this file except in compliance with the License.
...@@ -17,35 +17,70 @@ ...@@ -17,35 +17,70 @@
17 <project xmlns="http://maven.apache.org/POM/4.0.0" 17 <project xmlns="http://maven.apache.org/POM/4.0.0"
18 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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"> 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> 20 + <modelVersion>4.0.0</modelVersion>
21 21
22 - <parent> 22 + <parent>
23 - <groupId>org.onosproject</groupId> 23 + <groupId>org.onosproject</groupId>
24 - <artifactId>onos-app-metrics</artifactId> 24 + <artifactId>onos-of-providers</artifactId>
25 - <version>1.2.0-SNAPSHOT</version> 25 + <version>1.2.0-SNAPSHOT</version>
26 - <relativePath>../pom.xml</relativePath> 26 + <relativePath>../pom.xml</relativePath>
27 - </parent> 27 + </parent>
28 28
29 - <artifactId>onos-app-metrics-intent</artifactId> 29 + <artifactId>onos-of-providers-app</artifactId>
30 - <packaging>bundle</packaging> 30 + <packaging>pom</packaging>
31 31
32 - <description>ONOS intent metrics application</description> 32 + <description>ONOS OpenFlow providers app</description>
33 33
34 - <dependencies> 34 + <dependencies>
35 - <dependency> 35 + <dependency>
36 - <groupId>org.onosproject</groupId> 36 + <groupId>org.onosproject</groupId>
37 - <artifactId>onos-cli</artifactId> 37 + <artifactId>onos-of-api</artifactId>
38 - <version>${project.version}</version> 38 + </dependency>
39 - </dependency> 39 + <dependency>
40 - <dependency> 40 + <groupId>org.onosproject</groupId>
41 - <groupId>org.osgi</groupId> 41 + <artifactId>onos-of-drivers</artifactId>
42 - <artifactId>org.osgi.core</artifactId> 42 + <version>${project.version}</version>
43 - </dependency> 43 + </dependency>
44 - 44 + <dependency>
45 - <dependency> 45 + <groupId>org.onosproject</groupId>
46 - <groupId>org.apache.karaf.shell</groupId> 46 + <artifactId>onos-of-ctl</artifactId>
47 - <artifactId>org.apache.karaf.shell.console</artifactId> 47 + <version>${project.version}</version>
48 - </dependency> 48 + </dependency>
49 - </dependencies> 49 + <dependency>
50 + <groupId>org.onosproject</groupId>
51 + <artifactId>onos-drivers</artifactId>
52 + <version>${project.version}</version>
53 + </dependency>
54 + <dependency>
55 + <groupId>org.onosproject</groupId>
56 + <artifactId>onos-of-provider-device</artifactId>
57 + <version>${project.version}</version>
58 + </dependency>
59 + <dependency>
60 + <groupId>org.onosproject</groupId>
61 + <artifactId>onos-of-provider-packet</artifactId>
62 + <version>${project.version}</version>
63 + </dependency>
64 + <dependency>
65 + <groupId>org.onosproject</groupId>
66 + <artifactId>onos-of-provider-flow</artifactId>
67 + <version>${project.version}</version>
68 + </dependency>
69 + <dependency>
70 + <groupId>org.onosproject</groupId>
71 + <artifactId>onos-of-provider-group</artifactId>
72 + <version>${project.version}</version>
73 + </dependency>
74 + <dependency>
75 + <groupId>org.onosproject</groupId>
76 + <artifactId>onos-lldp-provider</artifactId>
77 + <version>${project.version}</version>
78 + </dependency>
79 + <dependency>
80 + <groupId>org.onosproject</groupId>
81 + <artifactId>onos-host-provider</artifactId>
82 + <version>${project.version}</version>
83 + </dependency>
84 + </dependencies>
50 85
51 </project> 86 </project>
......
...@@ -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>app</module>
39 </modules> 40 </modules>
40 41
41 <dependencies> 42 <dependencies>
......
...@@ -28,8 +28,8 @@ fi ...@@ -28,8 +28,8 @@ fi
28 echo "Apache Karaf bits $KARAF_ZIP or $KARAF_TAR not found" && exit 1 28 echo "Apache Karaf bits $KARAF_ZIP or $KARAF_TAR not found" && exit 1
29 29
30 # Unroll the Apache Karaf bits, prune them and make ONOS top-level directories. 30 # Unroll the Apache Karaf bits, prune them and make ONOS top-level directories.
31 -[ -f $KARAF_ZIP ] && unzip -q $KARAF_ZIP && rm -rf $KARAF_DIST/demos 31 +[ -f $KARAF_ZIP ] && unzip -q $KARAF_ZIP && rm -rf $ONOS_STAGE/$KARAF_DIST/demos
32 -[ -f $KARAF_TAR ] && tar zxf $KARAF_TAR && rm -rf $KARAF_DIST/demos 32 +[ -f $KARAF_TAR ] && tar zxf $KARAF_TAR && rm -rf $ONOS_STAGE/$KARAF_DIST/demos
33 mkdir bin 33 mkdir bin
34 34
35 # Stage the ONOS admin scripts and patch in Karaf service wrapper extras 35 # Stage the ONOS admin scripts and patch in Karaf service wrapper extras
...@@ -38,14 +38,7 @@ cp -r $ONOS_ROOT/tools/package/debian $ONOS_STAGE/debian ...@@ -38,14 +38,7 @@ cp -r $ONOS_ROOT/tools/package/debian $ONOS_STAGE/debian
38 cp -r $ONOS_ROOT/tools/package/etc/* $ONOS_STAGE/$KARAF_DIST/etc 38 cp -r $ONOS_ROOT/tools/package/etc/* $ONOS_STAGE/$KARAF_DIST/etc
39 39
40 # Stage all builtin ONOS apps for factory install 40 # Stage all builtin ONOS apps for factory install
41 -mkdir $ONOS_STAGE/apps 41 +onos-stage-apps $ONOS_STAGE/apps $ONOS_STAGE/$KARAF_DIST/system
42 -find $ONOS_ROOT -name 'app.xml' | egrep -v '/src/test/|/target/|org\.foo\.' | \
43 - xargs grep 'name=' | sed 's/<app name="//g;s/".*//g' | while read line; do
44 - appxml=${line%:*}
45 - app=${line#*:}
46 - mkdir $ONOS_STAGE/apps/$app
47 - cp $appxml $ONOS_STAGE/apps/$app/app.xml
48 - done
49 42
50 # Patch-in proper Karaf version into the startup script 43 # Patch-in proper Karaf version into the startup script
51 sed "s/\$KARAF_VERSION/$KARAF_VERSION/g" \ 44 sed "s/\$KARAF_VERSION/$KARAF_VERSION/g" \
...@@ -54,14 +47,13 @@ sed "s/\$KARAF_VERSION/$KARAF_VERSION/g" \ ...@@ -54,14 +47,13 @@ sed "s/\$KARAF_VERSION/$KARAF_VERSION/g" \
54 $ONOS_ROOT/tools/package/bin/onos > bin/onos 47 $ONOS_ROOT/tools/package/bin/onos > bin/onos
55 48
56 # Stage the ONOS bundles, but only those that match the version 49 # Stage the ONOS bundles, but only those that match the version
57 -mkdir -p $KARAF_DIST/system/org/onosproject 50 +mkdir -p $ONOS_STAGE/$KARAF_DIST/system/org/onosproject
58 -# cp -r $M2_REPO/org/onosproject/ $KARAF_DIST/system/org/
59 find $M2_REPO/org/onosproject/ -type d -name $ONOS_POM_VERSION | while read line; do 51 find $M2_REPO/org/onosproject/ -type d -name $ONOS_POM_VERSION | while read line; do
60 path=${line#*/onosproject/} 52 path=${line#*/onosproject/}
61 artifact=${path%/$ONOS_POM_VERSION} 53 artifact=${path%/$ONOS_POM_VERSION}
62 - mkdir -p $KARAF_DIST/system/org/onosproject/$artifact 54 + mkdir -p $ONOS_STAGE/$KARAF_DIST/system/org/onosproject/$artifact
63 cp -r $M2_REPO/org/onosproject/$artifact/$ONOS_POM_VERSION \ 55 cp -r $M2_REPO/org/onosproject/$artifact/$ONOS_POM_VERSION \
64 - $KARAF_DIST/system/org/onosproject/$artifact/$ONOS_POM_VERSION 56 + $ONOS_STAGE/$KARAF_DIST/system/org/onosproject/$artifact/$ONOS_POM_VERSION
65 done 57 done
66 58
67 # ONOS Patching ---------------------------------------------------------------- 59 # ONOS Patching ----------------------------------------------------------------
...@@ -84,6 +76,7 @@ echo $ONOS_VERSION > $ONOS_STAGE/VERSION ...@@ -84,6 +76,7 @@ echo $ONOS_VERSION > $ONOS_STAGE/VERSION
84 76
85 # Now package up the ONOS tar file 77 # Now package up the ONOS tar file
86 cd $ONOS_STAGE_ROOT 78 cd $ONOS_STAGE_ROOT
79 +rm -f $ONOS_TAR $ONOS_ZIP
87 COPYFILE_DISABLE=1 tar zcf $ONOS_TAR $ONOS_BITS 80 COPYFILE_DISABLE=1 tar zcf $ONOS_TAR $ONOS_BITS
88 which zip >/dev/null && zip -rq $ONOS_ZIP $ONOS_BITS 81 which zip >/dev/null && zip -rq $ONOS_ZIP $ONOS_BITS
89 ls -l $ONOS_TAR $ONOS_ZIP 2>/dev/null 82 ls -l $ONOS_TAR $ONOS_ZIP 2>/dev/null
......
...@@ -56,7 +56,7 @@ fi ...@@ -56,7 +56,7 @@ fi
56 56
57 if ! grep -q ",onos-api," $KARAF_ROOT/etc/org.apache.karaf.features.cfg; then 57 if ! grep -q ",onos-api," $KARAF_ROOT/etc/org.apache.karaf.features.cfg; then
58 # Patch the Apache Karaf distribution file to load default ONOS boot features 58 # Patch the Apache Karaf distribution file to load default ONOS boot features
59 - export BOOT_FEATURES="webconsole,onos-api,onos-core,onos-cli,onos-rest,onos-gui,onos-openflow" 59 + export BOOT_FEATURES="webconsole,onos-api,onos-core,onos-cli,onos-rest,onos-gui"
60 echo "Adding ONOS boot features $BOOT_FEATURES..." 60 echo "Adding ONOS boot features $BOOT_FEATURES..."
61 perl -pi.old -e "s|^(featuresBoot=.*)|\1,$BOOT_FEATURES|" \ 61 perl -pi.old -e "s|^(featuresBoot=.*)|\1,$BOOT_FEATURES|" \
62 $KARAF_ROOT/etc/org.apache.karaf.features.cfg 62 $KARAF_ROOT/etc/org.apache.karaf.features.cfg
...@@ -89,19 +89,11 @@ cp $ONOS_ROOT/tools/package/etc/hazelcast.xml $KARAF_ROOT/etc/hazelcast.xml ...@@ -89,19 +89,11 @@ cp $ONOS_ROOT/tools/package/etc/hazelcast.xml $KARAF_ROOT/etc/hazelcast.xml
89 perl -pi.old -e "s/192.168.56/$SUBNET/" $KARAF_ROOT/etc/hazelcast.xml 89 perl -pi.old -e "s/192.168.56/$SUBNET/" $KARAF_ROOT/etc/hazelcast.xml
90 perl -pi.old -e "s/ <name>onos</ <name>$IP</" $KARAF_ROOT/etc/hazelcast.xml 90 perl -pi.old -e "s/ <name>onos</ <name>$IP</" $KARAF_ROOT/etc/hazelcast.xml
91 91
92 -
93 echo "Staging builtin apps..." 92 echo "Staging builtin apps..."
94 rm -fr $STAGE/apps 93 rm -fr $STAGE/apps
95 -mkdir -p $STAGE/apps 94 +onos-stage-apps $STAGE/apps $KARAF_ROOT/system
96 -find $ONOS_ROOT -name 'app.xml' | egrep -v '/src/test/|/target/|org\.foo\.' | \
97 - xargs grep 'name=' | sed 's/<app name="//g;s/".*//g' | while read line; do
98 - appxml=${line%:*}
99 - app=${line#*:}
100 - mkdir $STAGE/apps/$app
101 - cp $appxml $STAGE/apps/$app/app.xml
102 - done
103 95
104 echo "Customizing apps to be auto-activated..." 96 echo "Customizing apps to be auto-activated..."
105 -for app in $(echo $ONOS_APPS | tr ',' ' '); do 97 +for app in $(echo ${ONOS_APPS:-openflow} | tr ',' ' '); do
106 touch $STAGE/apps/org.onosproject.$app/active 98 touch $STAGE/apps/org.onosproject.$app/active
107 done 99 done
......
1 +#!/bin/bash
2 +# -----------------------------------------------------------------------------
3 +# Stages builtin ONOS apps into the specified directory for packaging.
4 +# -----------------------------------------------------------------------------
5 +
6 +[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7 +. $ONOS_ROOT/tools/build/envDefaults
8 +
9 +export APPS=${1:-/tmp/apps}
10 +export KARAF_M2=${2:-/tmp/karaf/system}
11 +export AUX=$APPS/aux
12 +
13 +# Bail on any errors
14 +set -e
15 +
16 +mkdir -p $APPS $KARAF_M2
17 +rm -fr $AUX
18 +
19 +find $M2_REPO/org/onosproject/ -name "*.oar" -path "*/${ONOS_POM_VERSION}/*" | while read line; do
20 + mkdir -p $AUX && cd $AUX
21 + cp $line $AUX
22 + jar -xf $AUX/*.oar
23 + name=$(grep "name=" $AUX/app.xml | sed 's/<app name="//g;s/".*//g')
24 + mkdir -p $APPS/$name
25 + cp $AUX/app.xml $APPS/$name/app.xml
26 + cp $AUX/*.oar $APPS/$name/$name.oar
27 + cp -rf $AUX/m2/* $KARAF_M2
28 + rm -fr $AUX
29 +done
...@@ -77,6 +77,7 @@ ...@@ -77,6 +77,7 @@
77 org.slf4j, 77 org.slf4j,
78 org.osgi.framework, 78 org.osgi.framework,
79 javax.ws.rs,javax.ws.rs.core,javax.ws.rs.ext, 79 javax.ws.rs,javax.ws.rs.core,javax.ws.rs.ext,
80 + javax.servlet.*,
80 com.sun.jersey.api, 81 com.sun.jersey.api,
81 com.sun.jersey.spi.container.servlet, 82 com.sun.jersey.spi.container.servlet,
82 com.sun.jersey.server.impl.container.servlet, 83 com.sun.jersey.server.impl.container.servlet,
......
...@@ -18,9 +18,11 @@ package org.onosproject.ui.impl; ...@@ -18,9 +18,11 @@ package org.onosproject.ui.impl;
18 import com.fasterxml.jackson.databind.node.ArrayNode; 18 import com.fasterxml.jackson.databind.node.ArrayNode;
19 import com.fasterxml.jackson.databind.node.ObjectNode; 19 import com.fasterxml.jackson.databind.node.ObjectNode;
20 import com.google.common.collect.ImmutableSet; 20 import com.google.common.collect.ImmutableSet;
21 +import org.onosproject.app.ApplicationAdminService;
21 import org.onosproject.app.ApplicationService; 22 import org.onosproject.app.ApplicationService;
22 import org.onosproject.app.ApplicationState; 23 import org.onosproject.app.ApplicationState;
23 import org.onosproject.core.Application; 24 import org.onosproject.core.Application;
25 +import org.onosproject.core.ApplicationId;
24 26
25 import java.util.Arrays; 27 import java.util.Arrays;
26 import java.util.List; 28 import java.util.List;
...@@ -37,11 +39,20 @@ public class ApplicationViewMessageHandler extends AbstractTabularViewMessageHan ...@@ -37,11 +39,20 @@ public class ApplicationViewMessageHandler extends AbstractTabularViewMessageHan
37 * Creates a new message handler for the application messages. 39 * Creates a new message handler for the application messages.
38 */ 40 */
39 protected ApplicationViewMessageHandler() { 41 protected ApplicationViewMessageHandler() {
40 - super(ImmutableSet.of("appDataRequest")); 42 + super(ImmutableSet.of("appDataRequest", "appManagementRequest"));
41 } 43 }
42 44
43 @Override 45 @Override
44 public void process(ObjectNode message) { 46 public void process(ObjectNode message) {
47 + String type = string(message, "event", "unknown");
48 + if (type.equals("appDataRequest")) {
49 + sendAppList(message);
50 + } else if (type.equals("appManagementRequest")) {
51 + processManagementCommand(message);
52 + }
53 + }
54 +
55 + private void sendAppList(ObjectNode message) {
45 ObjectNode payload = payload(message); 56 ObjectNode payload = payload(message);
46 String sortCol = string(payload, "sortCol", "id"); 57 String sortCol = string(payload, "sortCol", "id");
47 String sortDir = string(payload, "sortDir", "asc"); 58 String sortDir = string(payload, "sortDir", "asc");
...@@ -58,6 +69,24 @@ public class ApplicationViewMessageHandler extends AbstractTabularViewMessageHan ...@@ -58,6 +69,24 @@ public class ApplicationViewMessageHandler extends AbstractTabularViewMessageHan
58 connection().sendMessage("appDataResponse", 0, rootNode); 69 connection().sendMessage("appDataResponse", 0, rootNode);
59 } 70 }
60 71
72 + private void processManagementCommand(ObjectNode message) {
73 + ObjectNode payload = payload(message);
74 + String action = string(payload, "action");
75 + String name = string(payload, "name");
76 + if (action != null && name != null) {
77 + ApplicationAdminService service = get(ApplicationAdminService.class);
78 + ApplicationId appId = service.getId(name);
79 + if (action.equals("activate")) {
80 + service.activate(appId);
81 + } else if (action.equals("deactivate")) {
82 + service.deactivate(appId);
83 + } else if (action.equals("uninstall")) {
84 + service.uninstall(appId);
85 + }
86 + sendAppList(message);
87 + }
88 + }
89 +
61 private TableRow[] generateTableRows(ApplicationService service) { 90 private TableRow[] generateTableRows(ApplicationService service) {
62 List<TableRow> list = service.getApplications().stream() 91 List<TableRow> list = service.getApplications().stream()
63 .map(application -> new ApplicationTableRow(service, application)) 92 .map(application -> new ApplicationTableRow(service, application))
......
...@@ -628,7 +628,9 @@ public class TopologyViewMessageHandler extends TopologyViewMessageHandlerBase { ...@@ -628,7 +628,9 @@ public class TopologyViewMessageHandler extends TopologyViewMessageHandlerBase {
628 public void event(MastershipEvent event) { 628 public void event(MastershipEvent event) {
629 sendAllInstances("updateInstance"); 629 sendAllInstances("updateInstance");
630 Device device = deviceService.getDevice(event.subject()); 630 Device device = deviceService.getDevice(event.subject());
631 - sendMessage(deviceMessage(new DeviceEvent(DEVICE_UPDATED, device))); 631 + if (device != null) {
632 + sendMessage(deviceMessage(new DeviceEvent(DEVICE_UPDATED, device)));
633 + }
632 } 634 }
633 } 635 }
634 636
......
...@@ -160,7 +160,6 @@ ...@@ -160,7 +160,6 @@
160 <url-pattern>/websock/*</url-pattern> 160 <url-pattern>/websock/*</url-pattern>
161 </servlet-mapping> 161 </servlet-mapping>
162 162
163 -
164 <servlet> 163 <servlet>
165 <servlet-name>Legacy Web Socket Service</servlet-name> 164 <servlet-name>Legacy Web Socket Service</servlet-name>
166 <servlet-class>org.onosproject.ui.impl.GuiWebSocketServlet</servlet-class> 165 <servlet-class>org.onosproject.ui.impl.GuiWebSocketServlet</servlet-class>
......
...@@ -37,25 +37,45 @@ div.ctrl-btns div { ...@@ -37,25 +37,45 @@ div.ctrl-btns div {
37 cursor: pointer; 37 cursor: pointer;
38 } 38 }
39 39
40 -.light .ctrl-btns g.icon use { 40 +
41 - fill: #fff; 41 +/* Inactive */
42 +.light .ctrl-btns div g.icon rect,
43 +.light .ctrl-btns div:hover g.icon rect {
44 + fill: #eee;
45 +}
46 +.dark .ctrl-btns div g.icon rect,
47 +.dark .ctrl-btns div:hover g.icon rect {
48 + fill: #222;
42 } 49 }
43 -.dark .ctrl-btns g.icon use { 50 +
51 +.light .ctrl-btns div g.icon use {
52 + fill: #ddd;
53 +}
54 +.dark .ctrl-btns div g.icon use {
44 fill: #333; 55 fill: #333;
45 } 56 }
46 57
47 -.light .ctrl-btns g.icon rect { 58 +/* Active hover */
48 - fill: #bbb; 59 +.light .ctrl-btns div.active:hover g.icon rect {
60 + fill: #800;
49 } 61 }
50 -.dark .ctrl-btns g.icon rect { 62 +
51 - fill: #444; 63 +.dark .ctrl-btns div.active:hover g.icon rect {
64 + fill: #CE5650;
52 } 65 }
53 66
54 -/* Inactive */ 67 +/* Active */
55 -.light .ctrl-btns .disabled g.icon rect { 68 +.light .ctrl-btns div.active g.icon use {
69 + fill: #fff;
70 +}
71 +.dark .ctrl-btns div.active g.icon use {
56 fill: #eee; 72 fill: #eee;
57 } 73 }
58 -.dark .ctrl-btns .disabled g.icon rect { 74 +
59 - fill: #111; 75 +.light .ctrl-btns div.active g.icon rect {
76 + fill: #bbb;
77 +}
78 +.dark .ctrl-btns div.active g.icon rect {
79 + fill: #444;
60 } 80 }
61 81
......
...@@ -3,11 +3,16 @@ ...@@ -3,11 +3,16 @@
3 <div class="tabular-header"> 3 <div class="tabular-header">
4 <h2>Applications ({{ctrl.tableData.length}} total)</h2> 4 <h2>Applications ({{ctrl.tableData.length}} total)</h2>
5 <div class="ctrl-btns"> 5 <div class="ctrl-btns">
6 - <div icon icon-size="36" icon-id="plus"></div> 6 + <div id="app-install" icon icon-size="36" icon-id="plus" class="active"></div>
7 - <div icon icon-size="36" icon-id="minus" class="disabled"></div> 7 + <div id="app-activate" icon icon-size="36" icon-id="play"></div>
8 - <div icon icon-size="36" icon-id="play" class="disabled"></div> 8 + <div id="app-deactivate" icon icon-size="36" icon-id="stop"></div>
9 - <div icon icon-size="36" icon-id="stop" class="disabled"></div> 9 + <div id="app-uninstall" icon icon-size="36" icon-id="minus"></div>
10 </div> 10 </div>
11 +
12 + <form id="app-form" method="POST" action="/onos/v1/applications/upload" enctype="multipart/form-data" style="display:none">
13 + <input type="file" id="file" accept=".oar">
14 + <button type="submit" id="app-upload">Upload</button>
15 + </form>
11 </div> 16 </div>
12 17
13 <table class="summary-list" 18 <table class="summary-list"
...@@ -20,7 +25,7 @@ ...@@ -20,7 +25,7 @@
20 <th colId="id" sortable>App ID </th> 25 <th colId="id" sortable>App ID </th>
21 <th colId="version" sortable>Version </th> 26 <th colId="version" sortable>Version </th>
22 <th colId="origin" sortable>Origin </th> 27 <th colId="origin" sortable>Origin </th>
23 - <th colId="desc" col-width="400px">Description </th> 28 + <th colId="desc" col-width="640px">Description </th>
24 </tr> 29 </tr>
25 </thead> 30 </thead>
26 31
......
1 /* 1 /*
2 * Copyright 2015 Open Networking Laboratory 2 * Copyright 2015 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.
6 * You may obtain a copy of the License at 6 * You may obtain a copy of the License at
7 * 7 *
8 * http://www.apache.org/licenses/LICENSE-2.0 8 * http://www.apache.org/licenses/LICENSE-2.0
9 * 9 *
10 * Unless required by applicable law or agreed to in writing, software 10 * Unless required by applicable law or agreed to in writing, software
11 - * distributed under the License is distributed on an "AS IS" BASIS, 11 + * distributed under the License is distributed on an 'AS IS' BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
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.
...@@ -21,19 +21,49 @@ ...@@ -21,19 +21,49 @@
21 (function () { 21 (function () {
22 'use strict'; 22 'use strict';
23 23
24 - var selRow; 24 + var selRow, selection;
25 25
26 angular.module('ovApp', []) 26 angular.module('ovApp', [])
27 .controller('OvAppCtrl', 27 .controller('OvAppCtrl',
28 - ['$log', '$scope', 'TableBuilderService', 28 + ['$log', '$scope', 'TableBuilderService', 'WebSocketService',
29 29
30 - function ($log, $scope, tbs) { 30 + function ($log, $scope, tbs, wss) {
31 function selCb($event, row) { 31 function selCb($event, row) {
32 selRow = angular.element($event.currentTarget); 32 selRow = angular.element($event.currentTarget);
33 - // adjust which toolbar buttons are selected 33 + selection = row;
34 $log.debug('Got a click on:', row); 34 $log.debug('Got a click on:', row);
35 + // adjust which toolbar buttons are selected
36 + d3.select('#app-activate').classed('active', row && row.state === 'INSTALLED');
37 + d3.select('#app-deactivate').classed('active', row && row.state === 'ACTIVE');
38 + d3.select('#app-uninstall').classed('active', row);
35 } 39 }
36 40
41 + d3.select('#app-install').on('click', function () {
42 + $log.debug('Initiating install');
43 + var evt = document.createEvent("HTMLEvents");
44 + evt.initEvent("click", true, true);
45 + document.getElementById('file').dispatchEvent(evt);
46 + });
47 +
48 + function appAction(action) {
49 + if (selection) {
50 + $log.debug('Initiating uninstall of', selection);
51 + wss.sendEvent('appManagementRequest', {action: action, name: selection.id});
52 + }
53 + }
54 +
55 + d3.select('#file').on('change', function () {
56 + var file = document.getElementById('file').value.replace('C:\\fakepath\\', '');
57 + $log.info('Handling file', file);
58 + var evt = document.createEvent("HTMLEvents");
59 + evt.initEvent("click", true, true);
60 + document.getElementById('app-upload').dispatchEvent(evt);
61 + });
62 +
63 + d3.select('#app-uninstall').on('click', function () { appAction('uninstall'); });
64 + d3.select('#app-activate').on('click', function () { appAction('activate'); });
65 + d3.select('#app-deactivate').on('click', function () { appAction('deactivate'); });
66 +
37 tbs.buildTable({ 67 tbs.buildTable({
38 self: this, 68 self: this,
39 scope: $scope, 69 scope: $scope,
......