Package org.onosproject.core
Class DefaultApplication
- java.lang.Object
-
- org.onosproject.core.DefaultApplication
-
- All Implemented Interfaces:
Application
public final class DefaultApplication extends java.lang.Object implements Application
Default implementation of network control/management application descriptor.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultApplication.Builder
Default application builder.
-
Constructor Summary
Constructors Constructor Description DefaultApplication(ApplicationId appId, Version version, java.lang.String title, java.lang.String description, java.lang.String origin, java.lang.String category, java.lang.String url, java.lang.String readme, byte[] icon, ApplicationRole role, java.util.Set<Permission> permissions, java.util.Optional<java.net.URI> featuresRepo, java.util.List<java.lang.String> features, java.util.List<java.lang.String> requiredApps, java.net.URL imageUrl)
Creates a new application descriptor using the supplied data.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DefaultApplication.Builder
builder()
Returns a default application builder.static DefaultApplication.Builder
builder(ApplicationDescription appDesc)
Creates a new builder as a copy of an existing application description.static DefaultApplication.Builder
builder(Application application)
Creates a new builder as a copy of an existing application.static DefaultApplication.Builder
builder(DefaultApplication.Builder builder)
Creates a new builder as a copy of an existing builder.java.lang.String
category()
Returns category of the application.java.lang.String
description()
Returns description of the application.boolean
equals(java.lang.Object obj)
java.util.List<java.lang.String>
features()
Returns the list of features comprising the application.java.util.Optional<java.net.URI>
featuresRepo()
Returns the feature repository URI.int
hashCode()
byte[]
icon()
Returns icon of the application.ApplicationId
id()
Returns the application name id.java.net.URL
imageUrl()
Returns binary image URL.java.lang.String
origin()
Returns the name of the application origin, group or company.java.util.Set<Permission>
permissions()
Returns the permissions requested by the application.java.lang.String
readme()
Returns readme of the application.java.util.List<java.lang.String>
requiredApps()
Returns list of required application names.ApplicationRole
role()
Returns the role of the application.java.lang.String
title()
Returns the title of the application.java.lang.String
toString()
java.lang.String
url()
Returns url of the application.Version
version()
Returns the application version.
-
-
-
Constructor Detail
-
DefaultApplication
public DefaultApplication(ApplicationId appId, Version version, java.lang.String title, java.lang.String description, java.lang.String origin, java.lang.String category, java.lang.String url, java.lang.String readme, byte[] icon, ApplicationRole role, java.util.Set<Permission> permissions, java.util.Optional<java.net.URI> featuresRepo, java.util.List<java.lang.String> features, java.util.List<java.lang.String> requiredApps, java.net.URL imageUrl)
Creates a new application descriptor using the supplied data.- Parameters:
appId
- application identifierversion
- application versiontitle
- application titledescription
- application descriptionorigin
- origin companycategory
- application categoryurl
- application URLreadme
- application readmeicon
- application iconrole
- application rolepermissions
- requested permissionsfeaturesRepo
- optional features repo URIfeatures
- application featuresrequiredApps
- list of required application namesimageUrl
- url of oar file
-
-
Method Detail
-
id
public ApplicationId id()
Description copied from interface:Application
Returns the application name id.- Specified by:
id
in interfaceApplication
- Returns:
- application identifier
-
version
public Version version()
Description copied from interface:Application
Returns the application version.- Specified by:
version
in interfaceApplication
- Returns:
- application version
-
title
public java.lang.String title()
Description copied from interface:Application
Returns the title of the application. This should be a short, human-readable string, as opposed to the unique identifier returned byApplication.id()
.- Specified by:
title
in interfaceApplication
- Returns:
- application title text
-
description
public java.lang.String description()
Description copied from interface:Application
Returns description of the application.- Specified by:
description
in interfaceApplication
- Returns:
- application description text
-
category
public java.lang.String category()
Description copied from interface:Application
Returns category of the application. The application developer can choose one of the category from the following examples to easily discern the high-level purpose of the application. (Security, Traffic Steering, Monitoring, Drivers, Provider, Utility)- Specified by:
category
in interfaceApplication
- Returns:
- application category text
-
url
public java.lang.String url()
Description copied from interface:Application
Returns url of the application.- Specified by:
url
in interfaceApplication
- Returns:
- application url
-
readme
public java.lang.String readme()
Description copied from interface:Application
Returns readme of the application.- Specified by:
readme
in interfaceApplication
- Returns:
- application readme
-
icon
public byte[] icon()
Description copied from interface:Application
Returns icon of the application.- Specified by:
icon
in interfaceApplication
- Returns:
- application icon
-
origin
public java.lang.String origin()
Description copied from interface:Application
Returns the name of the application origin, group or company.- Specified by:
origin
in interfaceApplication
- Returns:
- application origin
-
role
public ApplicationRole role()
Description copied from interface:Application
Returns the role of the application.- Specified by:
role
in interfaceApplication
- Returns:
- application role
-
permissions
public java.util.Set<Permission> permissions()
Description copied from interface:Application
Returns the permissions requested by the application.- Specified by:
permissions
in interfaceApplication
- Returns:
- requested permissions
-
featuresRepo
public java.util.Optional<java.net.URI> featuresRepo()
Description copied from interface:Application
Returns the feature repository URI. Null value signifies that the application did not provide its own features repository.- Specified by:
featuresRepo
in interfaceApplication
- Returns:
- optional feature repo URL
-
features
public java.util.List<java.lang.String> features()
Description copied from interface:Application
Returns the list of features comprising the application. At least one feature must be given.- Specified by:
features
in interfaceApplication
- Returns:
- application features
-
requiredApps
public java.util.List<java.lang.String> requiredApps()
Description copied from interface:Application
Returns list of required application names.- Specified by:
requiredApps
in interfaceApplication
- Returns:
- list of application names
-
imageUrl
public java.net.URL imageUrl()
Description copied from interface:Application
Returns binary image URL.- Specified by:
imageUrl
in interfaceApplication
- Returns:
- URL of binary image
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
builder
public static DefaultApplication.Builder builder()
Returns a default application builder.- Returns:
- builder
-
builder
public static DefaultApplication.Builder builder(DefaultApplication.Builder builder)
Creates a new builder as a copy of an existing builder.- Parameters:
builder
- existing builder to copy- Returns:
- new builder
-
builder
public static DefaultApplication.Builder builder(Application application)
Creates a new builder as a copy of an existing application.- Parameters:
application
- existing application to copy- Returns:
- new builder
-
builder
public static DefaultApplication.Builder builder(ApplicationDescription appDesc)
Creates a new builder as a copy of an existing application description.- Parameters:
appDesc
- existing application description- Returns:
- new builder
-
-