blob: 6c623686826931326b4d94816cc9f84928c298de [file] [log] [blame]
Thomas Vachuskae0f804a2014-10-27 23:40:48 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2014-present Open Networking Laboratory
Thomas Vachuskae0f804a2014-10-27 23:40:48 -07003 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07004 * 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 Vachuskae0f804a2014-10-27 23:40:48 -07007 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07008 * 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 Vachuskae0f804a2014-10-27 23:40:48 -070015 */
Brian O'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.core;
Thomas Vachuska02aeb032015-01-06 22:36:30 -080017// FIXME: Move to org.onosproject.app package
Thomas Vachuskae0f804a2014-10-27 23:40:48 -070018
19import java.util.Set;
20
21/**
22 * Manages application IDs.
23 */
24public interface ApplicationIdStore {
25
26 /**
27 * Returns the set of currently registered application identifiers.
28 *
29 * @return set of application ids
30 */
31 Set<ApplicationId> getAppIds();
32
33 /**
34 * Returns an existing application id from a given id.
Thomas Vachuska02aeb032015-01-06 22:36:30 -080035 *
Thomas Vachuskae0f804a2014-10-27 23:40:48 -070036 * @param id the short value of the id
Thomas Vachuska02aeb032015-01-06 22:36:30 -080037 * @return an application id; null if no such app registered
Thomas Vachuskae0f804a2014-10-27 23:40:48 -070038 */
39 ApplicationId getAppId(Short id);
40
41 /**
Thomas Vachuska02aeb032015-01-06 22:36:30 -080042 * Returns registered application id from the given name.
43 *
44 * @param name application name
45 * @return an application id; null if no such app registered
46 */
47 ApplicationId getAppId(String name);
48
49 /**
Thomas Vachuskae0f804a2014-10-27 23:40:48 -070050 * Registers a new application by its name, which is expected
51 * to follow the reverse DNS convention, e.g.
52 * {@code org.flying.circus.app}
53 *
54 * @param identifier string identifier
55 * @return the application id
56 */
57 ApplicationId registerApplication(String identifier);
58
59}