Simon Hunt
Committed by Gerrit Code Review

Apps-- added onos.app.title property to applications.

Change-Id: Id845390ee0bee5b871c0ce9f47b2ce98fbcf26b9
Showing 63 changed files with 192 additions and 55 deletions
......@@ -40,6 +40,7 @@
<properties>
<onos.app.name>org.onosproject.acl</onos.app.name>
<onos.app.origin>DLUT</onos.app.origin>
<onos.app.title>ONOS ACL App</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>ONOS ACL application.</onos.app.readme>
......
......@@ -34,6 +34,7 @@
<properties>
<onos.app.name>org.onosproject.cip</onos.app.name>
<onos.app.category>default</onos.app.category>
<onos.app.title>Cluster IP Alias App</onos.app.title>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>Cluster IP alias application.</onos.app.readme>
</properties>
......
......@@ -32,6 +32,7 @@
<properties>
<onos.app.name>org.onosproject.cordfabric</onos.app.name>
<onos.app.title>CORD Fabric App</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>Simple fabric application for CORD.</onos.app.readme>
......
......@@ -33,6 +33,7 @@
<properties>
<onos.app.name>org.onosproject.cordvtn</onos.app.name>
<onos.app.title>CORD Virtual Tenant Network</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>Virtual tenant network service for CORD.</onos.app.readme>
......
......@@ -33,9 +33,10 @@
<properties>
<onos.app.name>org.onosproject.drivermatrix</onos.app.name>
<onos.app.title>Driver Behaviour Support Matrix</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>Driver behavior support matrix.</onos.app.readme>
<onos.app.readme>Driver behaviour support matrix.</onos.app.readme>
</properties>
</project>
......
......@@ -32,6 +32,7 @@
<properties>
<onos.app.name>org.onosproject.events</onos.app.name>
<onos.app.title>ONOS Event History App</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>ONOS event history display application.</onos.app.readme>
......
......@@ -33,6 +33,7 @@
<properties>
<onos.app.name>org.onosproject.flowanalyzer</onos.app.name>
<onos.app.title>Flow Space Analyzer</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>Simple flow space analyzer.</onos.app.readme>
......
......@@ -33,6 +33,7 @@
<properties>
<onos.app.name>org.onosproject.fwd</onos.app.name>
<onos.app.title>Reactive Forwarding App</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>Reactive forwarding application using flow subsystem.</onos.app.readme>
......
......@@ -33,6 +33,7 @@
<properties>
<onos.app.name>org.onosproject.igmp</onos.app.name>
<onos.app.title>IGMP App</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>IGMP implementation.</onos.app.readme>
......
......@@ -30,6 +30,7 @@
<properties>
<onos.app.name>org.onosproject.iptopology-api</onos.app.name>
<onos.app.title>IP Layer Topology API</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>IP layer topology API.</onos.app.readme>
......
......@@ -33,9 +33,11 @@
<properties>
<onos.app.name>org.onosproject.metrics</onos.app.name>
<onos.app.title>Performance Metrics App</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>Performance metrics collection application.
<onos.app.readme>
Performance metrics collection application.
</onos.app.readme>
</properties>
......
......@@ -33,9 +33,11 @@
<properties>
<onos.app.name>org.onosproject.mfwd</onos.app.name>
<onos.app.title>Multicast Forwarding App</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>Multicast forwarding application.
<onos.app.readme>
Multicast forwarding application.
</onos.app.readme>
</properties>
......
......@@ -33,6 +33,7 @@
<properties>
<onos.app.name>org.onosproject.mlb</onos.app.name>
<onos.app.title>Mastership Load Balancer App</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>Application that balances mastership among nodes.
......
......@@ -33,9 +33,11 @@
<properties>
<onos.app.name>org.onosproject.mobility</onos.app.name>
<onos.app.title>Host Mobility App</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>Host mobility application.
<onos.app.readme>
Host mobility application.
</onos.app.readme>
</properties>
......
......@@ -32,6 +32,7 @@
<properties>
<onos.app.name>org.onosproject.openstackinterface</onos.app.name>
<onos.app.title>Openstack Interface App</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>Openstack Interface Application.</onos.app.readme>
......
......@@ -31,6 +31,7 @@
<properties>
<onos.app.name>org.onosproject.openstacknetworking</onos.app.name>
<onos.app.title>Openstack Networking App</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>Openstack Networking Application.</onos.app.readme>
......
......@@ -34,6 +34,7 @@
<properties>
<onos.app.name>org.onosproject.openstacknode</onos.app.name>
<onos.app.title>SONA Openstack Node Bootstrap App</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>SONA Openstack Node Bootstrap Application</onos.app.readme>
......
......@@ -33,6 +33,7 @@
<properties>
<onos.app.name>org.onosproject.optical</onos.app.name>
<onos.app.title>Packet/Optical Use-Case App</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>Packet/Optical use-case application.
......
......@@ -33,10 +33,13 @@
<properties>
<onos.app.name>org.onosproject.pathpainter</onos.app.name>
<onos.app.title>Path Visualization App</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>https://wiki.onosproject.org/display/ONOS/Path+Painter+Application+GUI</onos.app.url>
<onos.app.title>
Path visualization application
</onos.app.title>
<onos.app.readme>
Path visualization application.
Allows the user to visualize different types of paths between
network entities such as switches and hosts.
Selectable path types are shortest, disjoint and geographical.
......
......@@ -30,6 +30,7 @@
<properties>
<onos.app.name>org.onosproject.pcep-api</onos.app.name>
<onos.app.title>PCEP Protocol API</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>PCEP protocol API.</onos.app.readme>
......
......@@ -33,6 +33,7 @@
<properties>
<onos.app.name>org.onosproject.pim</onos.app.name>
<onos.app.title>Protocol Independent Multicast Emulation</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>Protocol independent multicast emulation.</onos.app.readme>
......
......@@ -33,6 +33,7 @@
<properties>
<onos.app.name>org.onosproject.proxyarp</onos.app.name>
<onos.app.title>Proxy ARP/NDP App</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>Proxy ARP/NDP application.</onos.app.readme>
......
......@@ -33,6 +33,7 @@
<properties>
<onos.app.name>org.onosproject.reactive.routing</onos.app.name>
<onos.app.title>SDN-IP Reactive Routing App</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>SDN-IP reactive routing application.</onos.app.readme>
......
......@@ -32,6 +32,7 @@
<properties>
<onos.app.name>org.onosproject.routing-api</onos.app.name>
<onos.app.title>Routing API</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>API for routing applications.</onos.app.readme>
......
......@@ -32,9 +32,10 @@
<properties>
<onos.app.name>org.onosproject.routing</onos.app.name>
<onos.app.title>SDN-IP Routing App</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>SDN-IP reactive routing application.</onos.app.readme>
<onos.app.readme>SDN-IP routing application.</onos.app.readme>
</properties>
<dependencies>
......
......@@ -32,6 +32,7 @@
<properties>
<onos.app.name>org.onosproject.segmentrouting</onos.app.name>
<onos.app.title>Segment Routing App</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>Segment routing application.</onos.app.readme>
......
......@@ -33,6 +33,7 @@
<properties>
<onos.app.name>org.onosproject.demo</onos.app.name>
<onos.app.title>Flow Throughput Demo</onos.app.title>
<onos.app.category>test</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>Flow throughput test application.</onos.app.readme>
......
......@@ -34,6 +34,7 @@
<properties>
<onos.app.name>org.onosproject.distributedprimitives</onos.app.name>
<onos.app.title>Distributed Primitives Test App</onos.app.title>
<onos.app.category>test</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>ONOS app to test distributed primitives.</onos.app.readme>
......
......@@ -34,6 +34,7 @@
<properties>
<onos.app.name>org.onosproject.election</onos.app.name>
<onos.app.title>Master Election Test App</onos.app.title>
<onos.app.category>test</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>Master election test application.</onos.app.readme>
......
......@@ -33,6 +33,7 @@
<properties>
<onos.app.name>org.onosproject.intentperf</onos.app.name>
<onos.app.title>Intent Performance Test App</onos.app.title>
<onos.app.category>test</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>intent performance test application.</onos.app.readme>
......
......@@ -34,6 +34,7 @@
<properties>
<onos.app.name>org.onosproject.loadtest</onos.app.name>
<onos.app.title>Distributed Load Test App</onos.app.title>
<onos.app.category>test</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>Distributed consensus load test application.</onos.app.readme>
......
......@@ -33,6 +33,7 @@
<properties>
<onos.app.name>org.onosproject.messagingperf</onos.app.name>
<onos.app.title>Messaging Performance Test App</onos.app.title>
<onos.app.category>test</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>Messaging performance test application.</onos.app.readme>
......
......@@ -33,6 +33,7 @@
<properties>
<onos.app.name>org.onosproject.virtualbng</onos.app.name>
<onos.app.title>Virtual Broadband Gateway App</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>Virtual broadband gateway application.</onos.app.readme>
......
......@@ -33,6 +33,7 @@
<properties>
<onos.app.name>org.onosproject.xosintegration</onos.app.name>
<onos.app.title>ONOS XOS Integration App</onos.app.title>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
<onos.app.readme>ONOS XOS integration application.</onos.app.readme>
......
......@@ -51,6 +51,13 @@ public interface ApplicationDescription {
String origin();
/**
* Returns title of the application.
*
* @return application title text
*/
String title();
/**
* Returns description of the application.
*
* @return application description text
......
......@@ -35,6 +35,7 @@ public class DefaultApplicationDescription implements ApplicationDescription {
private final String name;
private final Version version;
private final String title;
private final String description;
private final String origin;
private final String category;
......@@ -52,6 +53,7 @@ public class DefaultApplicationDescription implements ApplicationDescription {
*
* @param name application name
* @param version application version
* @param title application title
* @param description application description
* @param origin origin company
* @param category application category
......@@ -64,7 +66,7 @@ public class DefaultApplicationDescription implements ApplicationDescription {
* @param features application features
* @param requiredApps list of required application names
*/
public DefaultApplicationDescription(String name, Version version,
public DefaultApplicationDescription(String name, Version version, String title,
String description, String origin, String category,
String url, String readme, byte[] icon,
ApplicationRole role, Set<Permission> permissions,
......@@ -72,6 +74,7 @@ public class DefaultApplicationDescription implements ApplicationDescription {
List<String> requiredApps) {
this.name = checkNotNull(name, "Name cannot be null");
this.version = checkNotNull(version, "Version cannot be null");
this.title = checkNotNull(title, "Title cannot be null");
this.description = checkNotNull(description, "Description cannot be null");
this.origin = checkNotNull(origin, "Origin cannot be null");
this.category = checkNotNull(category, "Category cannot be null");
......@@ -97,6 +100,11 @@ public class DefaultApplicationDescription implements ApplicationDescription {
}
@Override
public String title() {
return title;
}
@Override
public String description() {
return description;
}
......@@ -157,6 +165,7 @@ public class DefaultApplicationDescription implements ApplicationDescription {
.add("name", name)
.add("version", version)
.add("description", description)
.add("title", title)
.add("origin", origin)
.add("category", category)
.add("url", url)
......
......@@ -42,6 +42,15 @@ public interface Application {
Version version();
/**
* Returns the title of the application.
* This should be a short, human-readable string, as opposed
* to the unique identifier returned by {@link #id()}.
*
* @return application title text
*/
String title();
/**
* Returns description of the application.
*
* @return application description text
......
......@@ -36,6 +36,7 @@ public class DefaultApplication implements Application {
private final ApplicationId appId;
private final Version version;
private final String title;
private final String description;
private final String category;
private final String url;
......@@ -53,6 +54,7 @@ public class DefaultApplication implements Application {
*
* @param appId application identifier
* @param version application version
* @param title application title
* @param description application description
* @param origin origin company
* @param category application category
......@@ -65,7 +67,7 @@ public class DefaultApplication implements Application {
* @param features application features
* @param requiredApps list of required application names
*/
public DefaultApplication(ApplicationId appId, Version version,
public DefaultApplication(ApplicationId appId, Version version, String title,
String description, String origin, String category,
String url, String readme, byte[] icon,
ApplicationRole role, Set<Permission> permissions,
......@@ -73,6 +75,7 @@ public class DefaultApplication implements Application {
List<String> requiredApps) {
this.appId = checkNotNull(appId, "ID cannot be null");
this.version = checkNotNull(version, "Version cannot be null");
this.title = checkNotNull(title, "Title cannot be null");
this.description = checkNotNull(description, "Description cannot be null");
this.origin = checkNotNull(origin, "Origin cannot be null");
this.category = checkNotNull(category, "Category cannot be null");
......@@ -104,6 +107,11 @@ public class DefaultApplication implements Application {
}
@Override
public String title() {
return title;
}
@Override
public String description() {
return description;
}
......@@ -160,7 +168,7 @@ public class DefaultApplication implements Application {
@Override
public int hashCode() {
return Objects.hash(appId, version, description, origin, category, url,
return Objects.hash(appId, version, title, description, origin, category, url,
readme, role, permissions, featuresRepo, features, requiredApps);
}
......@@ -173,8 +181,12 @@ public class DefaultApplication implements Application {
return false;
}
final DefaultApplication other = (DefaultApplication) obj;
// TODO: review -- do ALL the fields need to be included?
// It is debatable whether fields like description, url, and readme,
// need to be included in the notion of equivalence.
return Objects.equals(this.appId, other.appId) &&
Objects.equals(this.version, other.version) &&
Objects.equals(this.title, other.title) &&
Objects.equals(this.description, other.description) &&
Objects.equals(this.origin, other.origin) &&
Objects.equals(this.category, other.category) &&
......@@ -192,6 +204,7 @@ public class DefaultApplication implements Application {
return toStringHelper(this)
.add("appId", appId)
.add("version", version)
.add("title", title)
.add("description", description)
.add("origin", origin)
.add("category", category)
......
......@@ -32,7 +32,7 @@ import static org.onosproject.core.DefaultApplicationTest.APP_ID;
public class ApplicationEventTest extends AbstractEventTest {
private Application createApp() {
return new DefaultApplication(APP_ID, VER, DESC, ORIGIN, CATEGORY,
return new DefaultApplication(APP_ID, VER, TITLE, DESC, ORIGIN, CATEGORY,
URL, README, ICON, ROLE, PERMS,
Optional.of(FURL), FEATURES, APPS);
}
......
......@@ -38,6 +38,7 @@ public class DefaultApplicationDescriptionTest {
public static final String APP_NAME = "org.foo.app";
public static final Version VER = Version.version(1, 2, "a", null);
public static final String TITLE = "Awesome App";
public static final String DESC = "Awesome application from Circus, Inc.";
public static final String ORIGIN = "Circus";
public static final String CATEGORY = "other";
......@@ -55,11 +56,12 @@ public class DefaultApplicationDescriptionTest {
@Test
public void basics() {
ApplicationDescription app =
new DefaultApplicationDescription(APP_NAME, VER, DESC, ORIGIN,
new DefaultApplicationDescription(APP_NAME, VER, TITLE, DESC, ORIGIN,
CATEGORY, URL, README, ICON,
ROLE, PERMS, FURL, FEATURES, APPS);
assertEquals("incorrect id", APP_NAME, app.name());
assertEquals("incorrect version", VER, app.version());
assertEquals("incorrect title", TITLE, app.title());
assertEquals("incorrect description", DESC, app.description());
assertEquals("incorrect origin", ORIGIN, app.origin());
assertEquals("incorrect category", CATEGORY, app.category());
......
......@@ -43,7 +43,7 @@ public class DefaultApplicationTest {
@Test
public void basics() {
Application app = new DefaultApplication(APP_ID, VER, DESC, ORIGIN,
Application app = new DefaultApplication(APP_ID, VER, TITLE, DESC, ORIGIN,
CATEGORY, URL, README, ICON, ROLE,
PERMS, Optional.of(FURL), FEATURES, APPS);
assertEquals("incorrect id", APP_ID, app.id());
......@@ -64,16 +64,16 @@ public class DefaultApplicationTest {
@Test
public void testEquality() {
Application a1 = new DefaultApplication(APP_ID, VER, DESC, ORIGIN,
Application a1 = new DefaultApplication(APP_ID, VER, TITLE, DESC, ORIGIN,
CATEGORY, URL, README, ICON, ROLE,
PERMS, Optional.of(FURL), FEATURES, APPS);
Application a2 = new DefaultApplication(APP_ID, VER, DESC, ORIGIN,
Application a2 = new DefaultApplication(APP_ID, VER, TITLE, DESC, ORIGIN,
CATEGORY, URL, README, ICON, ROLE,
PERMS, Optional.of(FURL), FEATURES, APPS);
Application a3 = new DefaultApplication(APP_ID, VER, DESC, ORIGIN,
Application a3 = new DefaultApplication(APP_ID, VER, TITLE, DESC, ORIGIN,
CATEGORY, URL, README, ICON, ROLE,
PERMS, Optional.empty(), FEATURES, APPS);
Application a4 = new DefaultApplication(APP_ID, VER, DESC, ORIGIN + "asd",
Application a4 = new DefaultApplication(APP_ID, VER, TITLE, DESC, ORIGIN + "asd",
CATEGORY, URL, README, ICON, ROLE,
PERMS, Optional.of(FURL), FEATURES, APPS);
new EqualsTester().addEqualityGroup(a1, a2)
......@@ -87,7 +87,7 @@ public class DefaultApplicationTest {
public void immutableIcon() {
byte[] iconSourceData = ICON_ORIG.clone();
Application app = new DefaultApplication(APP_ID, VER, DESC, ORIGIN,
Application app = new DefaultApplication(APP_ID, VER, TITLE, DESC, ORIGIN,
CATEGORY, URL, README, iconSourceData, ROLE,
PERMS, Optional.of(FURL), FEATURES, APPS);
......@@ -128,7 +128,7 @@ public class DefaultApplicationTest {
// Set<Permission> p = PERMS_ORIG;
Set<Permission> p = PERMS_UNSAFE;
Application app = new DefaultApplication(APP_ID, VER, DESC, ORIGIN,
Application app = new DefaultApplication(APP_ID, VER, TITLE, DESC, ORIGIN,
CATEGORY, URL, README, ICON, ROLE,
p, Optional.of(FURL), FEATURES, APPS);
......@@ -170,7 +170,7 @@ public class DefaultApplicationTest {
// List<String> f = FEATURES_ORIG;
List<String> f = FEATURES_UNSAFE;
Application app = new DefaultApplication(APP_ID, VER, DESC, ORIGIN,
Application app = new DefaultApplication(APP_ID, VER, TITLE, DESC, ORIGIN,
CATEGORY, URL, README, ICON, ROLE,
PERMS, Optional.of(FURL), f, APPS);
......@@ -190,7 +190,7 @@ public class DefaultApplicationTest {
// List<String> ra = REQ_APPS_ORIG;
List<String> ra = REQ_APPS_UNSAFE;
Application app = new DefaultApplication(APP_ID, VER, DESC, ORIGIN,
Application app = new DefaultApplication(APP_ID, VER, TITLE, DESC, ORIGIN,
CATEGORY, URL, README, ICON, ROLE,
PERMS, Optional.of(FURL), FEATURES, ra);
......@@ -206,7 +206,7 @@ public class DefaultApplicationTest {
@Test
public void nullIcon() {
Application app = new DefaultApplication(APP_ID, VER, DESC, ORIGIN,
Application app = new DefaultApplication(APP_ID, VER, TITLE, DESC, ORIGIN,
CATEGORY, URL, README, null, ROLE,
PERMS, Optional.of(FURL), FEATURES, APPS);
byte[] icon = app.icon();
......
......@@ -88,6 +88,7 @@ public class ApplicationArchive
private static final String CATEGORY = "[@category]";
private static final String URL = "[@url]";
private static final String TITLE = "[@title]";
private static final String ROLE = "security.role";
private static final String APP_PERMISSIONS = "security.permissions.app-perm";
......@@ -294,6 +295,11 @@ public class ApplicationArchive
String name = cfg.getString(NAME);
Version version = Version.version(cfg.getString(VERSION));
String origin = cfg.getString(ORIGIN);
String title = cfg.getString(TITLE);
// FIXME: title should be set as attribute to APP, but fallback for now...
title = title == null ? name : title;
String category = cfg.getString(CATEGORY, UTILITY);
String url = cfg.getString(URL);
byte[] icon = getApplicationIcon(name);
......@@ -313,7 +319,7 @@ public class ApplicationArchive
// put short description to description field
String desc = compactDescription(readme);
return new DefaultApplicationDescription(name, version, desc, origin,
return new DefaultApplicationDescription(name, version, title, desc, origin,
category, url, readme, icon,
role, perms, featuresRepo,
features, requiredApps);
......
......@@ -65,6 +65,7 @@ public class ApplicationArchiveTest {
assertEquals("incorrect url", URL, app.url());
assertEquals("incorrect readme", README, app.readme());
assertEquals("incorrect title", TITLE, app.title());
assertEquals("incorrect description", DESC, app.description());
assertEquals("incorrect features URI", FURL, app.featuresRepo().get());
assertEquals("incorrect permissions", PERMS, app.permissions());
......
......@@ -49,14 +49,18 @@ import static org.slf4j.LoggerFactory.getLogger;
*/
@Component(immediate = true)
@Service
public class SimpleApplicationStore extends ApplicationArchive implements ApplicationStore {
public class SimpleApplicationStore extends ApplicationArchive
implements ApplicationStore {
private final Logger log = getLogger(getClass());
// App inventory & states
private final ConcurrentMap<ApplicationId, DefaultApplication> apps = new ConcurrentHashMap<>();
private final ConcurrentMap<ApplicationId, ApplicationState> states = new ConcurrentHashMap<>();
private final ConcurrentMap<ApplicationId, Set<Permission>> permissions = new ConcurrentHashMap<>();
private final ConcurrentMap<ApplicationId, DefaultApplication> apps =
new ConcurrentHashMap<>();
private final ConcurrentMap<ApplicationId, ApplicationState> states =
new ConcurrentHashMap<>();
private final ConcurrentMap<ApplicationId, Set<Permission>> permissions =
new ConcurrentHashMap<>();
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected ApplicationIdStore idStore;
......@@ -72,12 +76,19 @@ public class SimpleApplicationStore extends ApplicationArchive implements Applic
ApplicationId appId = idStore.registerApplication(name);
ApplicationDescription appDesc = getApplicationDescription(name);
DefaultApplication app =
new DefaultApplication(appId, appDesc.version(),
appDesc.description(), appDesc.origin(),
appDesc.category(), appDesc.url(),
appDesc.readme(), appDesc.icon(),
appDesc.role(), appDesc.permissions(),
appDesc.featuresRepo(), appDesc.features(),
new DefaultApplication(appId,
appDesc.version(),
appDesc.title(),
appDesc.description(),
appDesc.origin(),
appDesc.category(),
appDesc.url(),
appDesc.readme(),
appDesc.icon(),
appDesc.role(),
appDesc.permissions(),
appDesc.featuresRepo(),
appDesc.features(),
appDesc.requiredApps());
apps.put(appId, app);
states.put(appId, isActive(name) ? INSTALLED : ACTIVE);
......@@ -118,11 +129,19 @@ public class SimpleApplicationStore extends ApplicationArchive implements Applic
ApplicationDescription appDesc = saveApplication(appDescStream);
ApplicationId appId = idStore.registerApplication(appDesc.name());
DefaultApplication app =
new DefaultApplication(appId, appDesc.version(), appDesc.description(),
appDesc.origin(), appDesc.category(), appDesc.url(),
appDesc.readme(), appDesc.icon(),
appDesc.role(), appDesc.permissions(),
appDesc.featuresRepo(), appDesc.features(),
new DefaultApplication(appId,
appDesc.version(),
appDesc.title(),
appDesc.description(),
appDesc.origin(),
appDesc.category(),
appDesc.url(),
appDesc.readme(),
appDesc.icon(),
appDesc.role(),
appDesc.permissions(),
appDesc.featuresRepo(),
appDesc.features(),
appDesc.requiredApps());
apps.put(appId, app);
states.put(appId, INSTALLED);
......
......@@ -13,8 +13,10 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<app name="org.foo.app" origin="Circus" version="1.2.a" category="other"
url="http://www.onosproject.org" featuresRepo="mvn:org.foo-features/1.2a/xml/features"
<app name="org.foo.app" origin="Circus" version="1.2.a"
title="Awesome App" category="other"
url="http://www.onosproject.org"
featuresRepo="mvn:org.foo-features/1.2a/xml/features"
features="foo,bar">
<description>Awesome application from Circus, Inc.</description>
<security>
......
......@@ -138,7 +138,7 @@ public class ApplicationManagerTest {
@Override
public Application create(InputStream appDescStream) {
app = new DefaultApplication(APP_ID, VER, DESC, ORIGIN, CATEGORY,
app = new DefaultApplication(APP_ID, VER, TITLE, DESC, ORIGIN, CATEGORY,
URL, README, ICON, ROLE, PERMS,
Optional.of(FURL), FEATURES, ImmutableList.of());
state = INSTALLED;
......
......@@ -507,10 +507,19 @@ public class GossipApplicationStore extends ApplicationArchive
*/
private Application registerApp(ApplicationDescription appDesc) {
ApplicationId appId = idStore.registerApplication(appDesc.name());
return new DefaultApplication(appId, appDesc.version(), appDesc.description(),
appDesc.origin(), appDesc.category(), appDesc.url(),
appDesc.readme(), appDesc.icon(), appDesc.role(),
appDesc.permissions(), appDesc.featuresRepo(),
appDesc.features(), appDesc.requiredApps());
return new DefaultApplication(appId,
appDesc.version(),
appDesc.title(),
appDesc.description(),
appDesc.origin(),
appDesc.category(),
appDesc.url(),
appDesc.readme(),
appDesc.icon(),
appDesc.role(),
appDesc.permissions(),
appDesc.featuresRepo(),
appDesc.features(),
appDesc.requiredApps());
}
}
......
......@@ -31,6 +31,7 @@
<properties>
<onos.app.name>org.onosproject.hostprovider</onos.app.name>
<onos.app.title>Host Location Provider</onos.app.title>
<onos.app.origin>ON.Lab</onos.app.origin>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
......
......@@ -32,6 +32,7 @@
<properties>
<onos.app.name>org.onosproject.lldpprovider</onos.app.name>
<onos.app.title>LLDP Link Provider</onos.app.title>
<onos.app.origin>ON.Lab</onos.app.origin>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
......
......@@ -34,6 +34,7 @@
<properties>
<onos.app.name>org.onosproject.netcfghostprovider</onos.app.name>
<onos.app.title>Network Config host Provider</onos.app.title>
<onos.app.origin>ON.Lab</onos.app.origin>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
......
......@@ -34,6 +34,7 @@
<properties>
<onos.app.name>org.onosproject.netcfglinksprovider</onos.app.name>
<onos.app.title>Network Config Link Provider</onos.app.title>
<onos.app.origin>ON.Lab</onos.app.origin>
</properties>
......
......@@ -33,6 +33,7 @@
<properties>
<onos.app.name>org.onosproject.null</onos.app.name>
<onos.app.title>Null Southbound Provider</onos.app.title>
<onos.app.origin>ON.Lab</onos.app.origin>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
......
......@@ -31,6 +31,7 @@
<properties>
<onos.app.name>org.onosproject.openflow</onos.app.name>
<onos.app.title>OpenFlow Southbound Meta App</onos.app.title>
<onos.app.requires>
org.onosproject.openflow-base,
org.onosproject.hostprovider,
......
......@@ -31,6 +31,7 @@
<properties>
<onos.app.name>org.onosproject.ovsdb</onos.app.name>
<onos.app.title>OVSDB Southbound Meta App</onos.app.title>
<onos.app.requires>
org.onosproject.ovsdb-base,
org.onosproject.ovsdbhostprovider
......
......@@ -35,6 +35,7 @@
<onos.version>1.5.0-SNAPSHOT</onos.version>
<!-- Uncomment to generate ONOS app from this module.
<onos.app.name>org.foo.app</onos.app.name>
<onos.app.title>Foo App</onos.app.title>
<onos.app.origin>Foo, Inc.</onos.app.origin>
<onos.app.category>default</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
......
......@@ -35,6 +35,7 @@
<onos.version>1.5.0-SNAPSHOT</onos.version>
<!-- Uncomment to generate ONOS app from this module.
<onos.app.name>org.foo.app</onos.app.name>
<onos.app.title>Foo App</onos.app.title>
<onos.app.origin>Foo, Inc.</onos.app.origin>
<onos.app.category>UI</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
......
......@@ -36,6 +36,7 @@
<onos.version>1.5.0-SNAPSHOT</onos.version>
<!-- Uncomment to generate ONOS app from this module.
<onos.app.name>org.foo.app</onos.app.name>
<onos.app.title>Foo App</onos.app.title>
<onos.app.origin>Foo, Inc.</onos.app.origin>
<onos.app.category>UI</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
......
......@@ -36,6 +36,7 @@
<onos.version>1.5.0-SNAPSHOT</onos.version>
<!-- Uncomment to generate ONOS app from this module.
<onos.app.name>org.foo.app</onos.app.name>
<onos.app.title>Foo App</onos.app.title>
<onos.app.origin>Foo, Inc.</onos.app.origin>
<onos.app.category>UI</onos.app.category>
<onos.app.url>http://onosproject.org</onos.app.url>
......
......@@ -74,6 +74,7 @@ public class OnosAppMojo extends AbstractMojo {
private static final String ONOS_APP_CATEGORY = "onos.app.category";
private static final String ONOS_APP_URL = "onos.app.url";
private static final String ONOS_APP_TITLE = "onos.app.title";
private static final String ONOS_APP_README = "onos.app.readme";
private static final String JAR = "jar";
......@@ -99,6 +100,7 @@ public class OnosAppMojo extends AbstractMojo {
private String requiredApps;
private String category;
private String url;
private String title;
private String readme;
private String version = DEFAULT_VERSION;
private String featuresRepo = DEFAULT_FEATURES_REPO;
......@@ -189,6 +191,10 @@ public class OnosAppMojo extends AbstractMojo {
url = (String) project.getProperties().get(ONOS_APP_URL);
url = url != null ? url : DEFAULT_URL;
// if title does not exist, fall back to the name
title = (String) project.getProperties().get(ONOS_APP_TITLE);
title = title != null ? title : name;
// if readme does not exist, we simply fallback to use description
readme = (String) project.getProperties().get(ONOS_APP_README);
readme = readme != null ? readme : projectDescription;
......@@ -387,6 +393,7 @@ public class OnosAppMojo extends AbstractMojo {
.replaceAll("\\$\\{onos.app.origin\\}", origin)
.replaceAll("\\$\\{onos.app.requires\\}", requiredApps)
.replaceAll("\\$\\{onos.app.category\\}", category)
.replaceAll("\\$\\{onos.app.title\\}", title)
.replaceAll("\\$\\{onos.app.url\\}", url)
.replaceAll("\\$\\{project.groupId\\}", projectGroupId)
.replaceAll("\\$\\{project.artifactId\\}", projectArtifactId)
......
......@@ -15,7 +15,7 @@
~ limitations under the License.
-->
<app name="${onos.app.name}" origin="${onos.app.origin}" version="${project.version}"
category="${onos.app.category}" url="${onos.app.url}"
title="${onos.app.title}" category="${onos.app.category}" url="${onos.app.url}"
featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
features="${project.artifactId}" apps="${onos.app.requires}">
<description>${project.description}</description>
......
......@@ -84,26 +84,26 @@ public class ApplicationsResourceTest extends ResourceTest {
private static final Version VER = Version.version(1, 2, "a", null);
private Application app1 =
new DefaultApplication(id1, VER,
"app1", "origin1", "category1", "url1",
new DefaultApplication(id1, VER, "title1",
"desc1", "origin1", "category1", "url1",
"readme1", new byte[0], ApplicationRole.ADMIN,
ImmutableSet.of(), Optional.of(FURL),
ImmutableList.of("My Feature"), ImmutableList.of());
private Application app2 =
new DefaultApplication(id2, VER,
"app2", "origin2", "category2", "url2",
new DefaultApplication(id2, VER, "title2",
"desc2", "origin2", "category2", "url2",
"readme2", new byte[0], ApplicationRole.ADMIN,
ImmutableSet.of(), Optional.of(FURL),
ImmutableList.of("My Feature"), ImmutableList.of());
private Application app3 =
new DefaultApplication(id3, VER,
"app3", "origin3", "category3", "url3",
new DefaultApplication(id3, VER, "title3",
"desc3", "origin3", "category3", "url3",
"readme3", new byte[0], ApplicationRole.ADMIN,
ImmutableSet.of(), Optional.of(FURL),
ImmutableList.of("My Feature"), ImmutableList.of());
private Application app4 =
new DefaultApplication(id4, VER,
"app4", "origin4", "category4", "url4",
new DefaultApplication(id4, VER, "title4",
"desc4", "origin4", "category4", "url4",
"readme4", new byte[0], ApplicationRole.ADMIN,
ImmutableSet.of(), Optional.of(FURL),
ImmutableList.of("My Feature"), ImmutableList.of());
......
......@@ -54,6 +54,7 @@ public class ApplicationViewMessageHandler extends UiMessageHandler {
private static final String VERSION = "version";
private static final String CATEGORY = "category";
private static final String ORIGIN = "origin";
private static final String TITLE = "title";
private static final String DESC = "desc";
private static final String URL = "url";
private static final String README = "readme";
......@@ -66,7 +67,7 @@ public class ApplicationViewMessageHandler extends UiMessageHandler {
private static final String ICON_ID_INACTIVE = "appInactive";
private static final String[] COL_IDS = {
STATE, STATE_IID, ID, ICON, VERSION, CATEGORY, ORIGIN, DESC,
STATE, STATE_IID, ID, ICON, VERSION, CATEGORY, ORIGIN, TITLE, DESC,
URL, README, ROLE, REQUIRED_APPS, FEATURES, PERMISSIONS
};
......@@ -118,6 +119,7 @@ public class ApplicationViewMessageHandler extends UiMessageHandler {
.cell(VERSION, app.version())
.cell(CATEGORY, app.category())
.cell(ORIGIN, app.origin())
.cell(TITLE, app.title())
.cell(DESC, app.description())
.cell(URL, app.url());
}
......@@ -168,6 +170,7 @@ public class ApplicationViewMessageHandler extends UiMessageHandler {
data.put(VERSION, app.version().toString());
data.put(ROLE, app.role().toString());
data.put(CATEGORY, app.category());
data.put(TITLE, app.title());
data.put(ORIGIN, app.origin());
data.put(README, app.readme());
data.put(DESC, app.description());
......