Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2014-present Open Networking Foundation |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 3 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 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 |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 7 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 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. |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 15 | */ |
sangyun-han | 6d33e80 | 2016-08-05 13:36:33 +0900 | [diff] [blame] | 16 | package org.onosproject.app; |
| 17 | |
| 18 | import org.onosproject.core.ApplicationId; |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 19 | |
| 20 | import java.util.Set; |
| 21 | |
| 22 | /** |
| 23 | * Manages application IDs. |
| 24 | */ |
| 25 | public interface ApplicationIdStore { |
| 26 | |
| 27 | /** |
| 28 | * Returns the set of currently registered application identifiers. |
| 29 | * |
| 30 | * @return set of application ids |
| 31 | */ |
| 32 | Set<ApplicationId> getAppIds(); |
| 33 | |
| 34 | /** |
| 35 | * Returns an existing application id from a given id. |
Thomas Vachuska | 02aeb03 | 2015-01-06 22:36:30 -0800 | [diff] [blame] | 36 | * |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 37 | * @param id the short value of the id |
Thomas Vachuska | 02aeb03 | 2015-01-06 22:36:30 -0800 | [diff] [blame] | 38 | * @return an application id; null if no such app registered |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 39 | */ |
| 40 | ApplicationId getAppId(Short id); |
| 41 | |
| 42 | /** |
Thomas Vachuska | 02aeb03 | 2015-01-06 22:36:30 -0800 | [diff] [blame] | 43 | * Returns registered application id from the given name. |
| 44 | * |
| 45 | * @param name application name |
| 46 | * @return an application id; null if no such app registered |
| 47 | */ |
| 48 | ApplicationId getAppId(String name); |
| 49 | |
| 50 | /** |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 51 | * Registers a new application by its name, which is expected |
| 52 | * to follow the reverse DNS convention, e.g. |
| 53 | * {@code org.flying.circus.app} |
| 54 | * |
| 55 | * @param identifier string identifier |
| 56 | * @return the application id |
| 57 | */ |
| 58 | ApplicationId registerApplication(String identifier); |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 59 | } |