Revert "Corrections to getRegisteredApplications and CLI implementation"
ApplicationService is not available. For example, when using the ONOS CLI:
onos> apps -s -a
Service org.onosproject.app.ApplicationService not found
The issue seems to be a circular dependency, as ApplicationManager depends on CoreService, but CoreManager depends on ApplicationService.
Reverting for now.
This reverts commit 35ef3d3000f8b19608531dfd06f8e78482c45b32.
Change-Id: I298c3c7844df7f2395e092fbb89a8e9264883094
diff --git a/core/api/src/main/java/org/onosproject/core/Application.java b/core/api/src/main/java/org/onosproject/core/Application.java
index 84279dc..b898cb6 100644
--- a/core/api/src/main/java/org/onosproject/core/Application.java
+++ b/core/api/src/main/java/org/onosproject/core/Application.java
@@ -21,7 +21,6 @@
import java.util.List;
import java.util.Optional;
import java.util.Set;
-import java.net.URL;
/**
* Abstraction of a network control/management application.
@@ -133,11 +132,4 @@
* @return list of application names
*/
List<String> requiredApps();
-
- /**
- * Returns binary image URL.
- *
- * @return URL of binary image
- */
- URL imageUrl();
-}
\ No newline at end of file
+}
diff --git a/core/api/src/main/java/org/onosproject/core/DefaultApplication.java b/core/api/src/main/java/org/onosproject/core/DefaultApplication.java
index 793ab70..2df2f8f 100644
--- a/core/api/src/main/java/org/onosproject/core/DefaultApplication.java
+++ b/core/api/src/main/java/org/onosproject/core/DefaultApplication.java
@@ -26,7 +26,6 @@
import java.util.Optional;
import java.util.List;
import java.util.Objects;
-import java.net.URL;
import static com.google.common.base.MoreObjects.toStringHelper;
import static com.google.common.base.Preconditions.checkArgument;
@@ -51,7 +50,7 @@
private final Optional<URI> featuresRepo;
private final List<String> features;
private final List<String> requiredApps;
- private final URL imageUrl;
+
/**
* Default constructor is hidden to prevent calls to new.
*/
@@ -70,7 +69,6 @@
featuresRepo = Optional.empty();
features = ImmutableList.of();
requiredApps = ImmutableList.of();
- imageUrl = null;
}
/**
@@ -90,14 +88,13 @@
* @param featuresRepo optional features repo URI
* @param features application features
* @param requiredApps list of required application names
- * @param imageUrl url of oar file
*/
- public DefaultApplication(ApplicationId appId, Version version, String title,
+ private DefaultApplication(ApplicationId appId, Version version, String title,
String description, String origin, String category,
String url, String readme, byte[] icon,
ApplicationRole role, Set<Permission> permissions,
Optional<URI> featuresRepo, List<String> features,
- List<String> requiredApps, URL imageUrl) {
+ List<String> requiredApps) {
this.appId = appId;
this.version = version;
this.title = title;
@@ -112,8 +109,8 @@
this.featuresRepo = featuresRepo;
this.features = ImmutableList.copyOf(features);
this.requiredApps = ImmutableList.copyOf(requiredApps);
- this.imageUrl = imageUrl;
}
+
@Override
public ApplicationId id() {
return appId;
@@ -185,11 +182,6 @@
}
@Override
- public URL imageUrl() {
- return imageUrl;
- }
-
- @Override
public int hashCode() {
return Objects.hash(appId, version, title, description, origin, category, url,
readme, role, permissions, featuresRepo, features, requiredApps);
@@ -238,7 +230,6 @@
.add("featuresRepo", featuresRepo)
.add("features", features)
.add("requiredApps", requiredApps)
- .add("imageURL", imageUrl)
.toString();
}
@@ -286,6 +277,7 @@
* Default application builder.
*/
public static final class Builder {
+
private ApplicationId appId;
private Version version;
private String title;
@@ -293,14 +285,13 @@
private String category;
private String url;
private String readme;
- private byte[] icon = new byte[0];
+ private byte[] icon;
private String origin;
- private ApplicationRole role = ApplicationRole.ADMIN;
- private Set<Permission> permissions = ImmutableSet.of();
- private Optional<URI> featuresRepo = Optional.empty();
- private List<String> features = ImmutableList.of();
- private List<String> requiredApps = ImmutableList.of();
- private URL imageUrl;
+ private ApplicationRole role;
+ private Set<Permission> permissions;
+ private Optional<URI> featuresRepo;
+ private List<String> features;
+ private List<String> requiredApps;
/**
* Default constructor for the builder.
@@ -527,17 +518,6 @@
}
/**
- * Adds a Binary Image URL.
- *
- * @param imageUrl url of oar file
- * @return builder
- */
- public Builder withImageUrl(URL imageUrl) {
- this.imageUrl = imageUrl;
- return this;
- }
-
- /**
* Builds a default application object from the gathered parameters.
*
* @return new default application
@@ -562,7 +542,7 @@
url, readme, icon,
role, permissions,
featuresRepo, features,
- requiredApps, imageUrl);
+ requiredApps);
}
}
-}
\ No newline at end of file
+}