Thomas Vachuska | 02aeb03 | 2015-01-06 22:36:30 -0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
Thomas Vachuska | 02aeb03 | 2015-01-06 22:36:30 -0800 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package org.onosproject.core; |
| 17 | |
Changhoon Yoon | b856b81 | 2015-08-10 03:47:19 +0900 | [diff] [blame] | 18 | import org.onosproject.security.Permission; |
| 19 | |
Thomas Vachuska | 02aeb03 | 2015-01-06 22:36:30 -0800 | [diff] [blame] | 20 | import java.net.URI; |
Thomas Vachuska | ebf5e54 | 2015-02-03 19:38:13 -0800 | [diff] [blame] | 21 | import java.util.List; |
Thomas Vachuska | 02aeb03 | 2015-01-06 22:36:30 -0800 | [diff] [blame] | 22 | import java.util.Optional; |
| 23 | import java.util.Set; |
Arnav Jain | efb57e5 | 2019-07-09 14:24:10 -0700 | [diff] [blame] | 24 | import java.net.URL; |
Thomas Vachuska | 02aeb03 | 2015-01-06 22:36:30 -0800 | [diff] [blame] | 25 | |
| 26 | /** |
| 27 | * Abstraction of a network control/management application. |
| 28 | */ |
| 29 | public interface Application { |
| 30 | |
| 31 | /** |
| 32 | * Returns the application name id. |
| 33 | * |
| 34 | * @return application identifier |
| 35 | */ |
| 36 | ApplicationId id(); |
| 37 | |
| 38 | /** |
| 39 | * Returns the application version. |
| 40 | * |
| 41 | * @return application version |
| 42 | */ |
| 43 | Version version(); |
| 44 | |
| 45 | /** |
Simon Hunt | afae2f7 | 2016-03-04 21:18:23 -0800 | [diff] [blame] | 46 | * Returns the title of the application. |
| 47 | * This should be a short, human-readable string, as opposed |
| 48 | * to the unique identifier returned by {@link #id()}. |
| 49 | * |
| 50 | * @return application title text |
| 51 | */ |
| 52 | String title(); |
| 53 | |
| 54 | /** |
Thomas Vachuska | 02aeb03 | 2015-01-06 22:36:30 -0800 | [diff] [blame] | 55 | * Returns description of the application. |
| 56 | * |
| 57 | * @return application description text |
| 58 | */ |
| 59 | String description(); |
| 60 | |
| 61 | /** |
Jian Li | c35415d | 2016-01-14 17:22:31 -0800 | [diff] [blame] | 62 | * Returns category of the application. |
| 63 | * |
Jian Li | fd46e1d | 2016-03-08 09:18:53 -0800 | [diff] [blame] | 64 | * The application developer can choose one of the category from the |
| 65 | * following examples to easily discern the high-level purpose of the application. |
| 66 | * (Security, Traffic Steering, Monitoring, Drivers, Provider, Utility) |
| 67 | * |
Jian Li | c35415d | 2016-01-14 17:22:31 -0800 | [diff] [blame] | 68 | * @return application category text |
| 69 | */ |
| 70 | String category(); |
| 71 | |
| 72 | /** |
| 73 | * Returns url of the application. |
| 74 | * |
| 75 | * @return application url |
| 76 | */ |
| 77 | String url(); |
| 78 | |
| 79 | /** |
| 80 | * Returns readme of the application. |
| 81 | * |
| 82 | * @return application readme |
| 83 | */ |
| 84 | String readme(); |
| 85 | |
| 86 | /** |
| 87 | * Returns icon of the application. |
| 88 | * |
| 89 | * @return application icon |
| 90 | */ |
| 91 | byte[] icon(); |
| 92 | |
| 93 | /** |
Thomas Vachuska | 02aeb03 | 2015-01-06 22:36:30 -0800 | [diff] [blame] | 94 | * Returns the name of the application origin, group or company. |
| 95 | * |
| 96 | * @return application origin |
| 97 | */ |
| 98 | String origin(); |
| 99 | |
| 100 | /** |
Changhoon Yoon | bdeb88a | 2015-05-12 20:35:31 +0900 | [diff] [blame] | 101 | * Returns the role of the application. |
| 102 | * |
| 103 | * @return application role |
| 104 | */ |
| 105 | ApplicationRole role(); |
| 106 | |
| 107 | /** |
Thomas Vachuska | 02aeb03 | 2015-01-06 22:36:30 -0800 | [diff] [blame] | 108 | * Returns the permissions requested by the application. |
| 109 | * |
| 110 | * @return requested permissions |
| 111 | */ |
| 112 | Set<Permission> permissions(); |
| 113 | |
| 114 | /** |
| 115 | * Returns the feature repository URI. Null value signifies that the |
| 116 | * application did not provide its own features repository. |
| 117 | * |
| 118 | * @return optional feature repo URL |
| 119 | */ |
| 120 | Optional<URI> featuresRepo(); |
| 121 | |
| 122 | /** |
Thomas Vachuska | ebf5e54 | 2015-02-03 19:38:13 -0800 | [diff] [blame] | 123 | * Returns the list of features comprising the application. At least one |
Thomas Vachuska | 02aeb03 | 2015-01-06 22:36:30 -0800 | [diff] [blame] | 124 | * feature must be given. |
| 125 | * |
| 126 | * @return application features |
| 127 | */ |
Thomas Vachuska | ebf5e54 | 2015-02-03 19:38:13 -0800 | [diff] [blame] | 128 | List<String> features(); |
Thomas Vachuska | 761f004 | 2015-11-11 19:10:17 -0800 | [diff] [blame] | 129 | |
| 130 | /** |
| 131 | * Returns list of required application names. |
| 132 | * |
| 133 | * @return list of application names |
| 134 | */ |
| 135 | List<String> requiredApps(); |
Arnav Jain | efb57e5 | 2019-07-09 14:24:10 -0700 | [diff] [blame] | 136 | |
| 137 | /** |
| 138 | * Returns binary image URL. |
| 139 | * |
| 140 | * @return URL of binary image |
| 141 | */ |
| 142 | URL imageUrl(); |
| 143 | } |