Thomas Vachuska | 02aeb03 | 2015-01-06 22:36:30 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Open Networking Laboratory |
| 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; |
| 24 | |
| 25 | /** |
| 26 | * Abstraction of a network control/management application. |
| 27 | */ |
| 28 | public interface Application { |
| 29 | |
| 30 | /** |
| 31 | * Returns the application name id. |
| 32 | * |
| 33 | * @return application identifier |
| 34 | */ |
| 35 | ApplicationId id(); |
| 36 | |
| 37 | /** |
| 38 | * Returns the application version. |
| 39 | * |
| 40 | * @return application version |
| 41 | */ |
| 42 | Version version(); |
| 43 | |
| 44 | /** |
Simon Hunt | afae2f7 | 2016-03-04 21:18:23 -0800 | [diff] [blame] | 45 | * Returns the title of the application. |
| 46 | * This should be a short, human-readable string, as opposed |
| 47 | * to the unique identifier returned by {@link #id()}. |
| 48 | * |
| 49 | * @return application title text |
| 50 | */ |
| 51 | String title(); |
| 52 | |
| 53 | /** |
Thomas Vachuska | 02aeb03 | 2015-01-06 22:36:30 -0800 | [diff] [blame] | 54 | * Returns description of the application. |
| 55 | * |
| 56 | * @return application description text |
| 57 | */ |
| 58 | String description(); |
| 59 | |
| 60 | /** |
Jian Li | c35415d | 2016-01-14 17:22:31 -0800 | [diff] [blame] | 61 | * Returns category of the application. |
| 62 | * |
Jian Li | fd46e1d | 2016-03-08 09:18:53 -0800 | [diff] [blame] | 63 | * The application developer can choose one of the category from the |
| 64 | * following examples to easily discern the high-level purpose of the application. |
| 65 | * (Security, Traffic Steering, Monitoring, Drivers, Provider, Utility) |
| 66 | * |
Jian Li | c35415d | 2016-01-14 17:22:31 -0800 | [diff] [blame] | 67 | * @return application category text |
| 68 | */ |
| 69 | String category(); |
| 70 | |
| 71 | /** |
| 72 | * Returns url of the application. |
| 73 | * |
| 74 | * @return application url |
| 75 | */ |
| 76 | String url(); |
| 77 | |
| 78 | /** |
| 79 | * Returns readme of the application. |
| 80 | * |
| 81 | * @return application readme |
| 82 | */ |
| 83 | String readme(); |
| 84 | |
| 85 | /** |
| 86 | * Returns icon of the application. |
| 87 | * |
| 88 | * @return application icon |
| 89 | */ |
| 90 | byte[] icon(); |
| 91 | |
| 92 | /** |
Thomas Vachuska | 02aeb03 | 2015-01-06 22:36:30 -0800 | [diff] [blame] | 93 | * Returns the name of the application origin, group or company. |
| 94 | * |
| 95 | * @return application origin |
| 96 | */ |
| 97 | String origin(); |
| 98 | |
| 99 | /** |
Changhoon Yoon | bdeb88a | 2015-05-12 20:35:31 +0900 | [diff] [blame] | 100 | * Returns the role of the application. |
| 101 | * |
| 102 | * @return application role |
| 103 | */ |
| 104 | ApplicationRole role(); |
| 105 | |
| 106 | /** |
Thomas Vachuska | 02aeb03 | 2015-01-06 22:36:30 -0800 | [diff] [blame] | 107 | * Returns the permissions requested by the application. |
| 108 | * |
| 109 | * @return requested permissions |
| 110 | */ |
| 111 | Set<Permission> permissions(); |
| 112 | |
| 113 | /** |
| 114 | * Returns the feature repository URI. Null value signifies that the |
| 115 | * application did not provide its own features repository. |
| 116 | * |
| 117 | * @return optional feature repo URL |
| 118 | */ |
| 119 | Optional<URI> featuresRepo(); |
| 120 | |
| 121 | /** |
Thomas Vachuska | ebf5e54 | 2015-02-03 19:38:13 -0800 | [diff] [blame] | 122 | * Returns the list of features comprising the application. At least one |
Thomas Vachuska | 02aeb03 | 2015-01-06 22:36:30 -0800 | [diff] [blame] | 123 | * feature must be given. |
| 124 | * |
| 125 | * @return application features |
| 126 | */ |
Thomas Vachuska | ebf5e54 | 2015-02-03 19:38:13 -0800 | [diff] [blame] | 127 | List<String> features(); |
Thomas Vachuska | 761f004 | 2015-11-11 19:10:17 -0800 | [diff] [blame] | 128 | |
| 129 | /** |
| 130 | * Returns list of required application names. |
| 131 | * |
| 132 | * @return list of application names |
| 133 | */ |
| 134 | List<String> requiredApps(); |
Thomas Vachuska | 02aeb03 | 2015-01-06 22:36:30 -0800 | [diff] [blame] | 135 | } |