blob: 7366df578ca3231c3d94231b0775000e4785bec8 [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
2 * Copyright 2014 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 */
Brian O'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.core;
Thomas Vachuskae0f804a2014-10-27 23:40:48 -070017
Brian O'Connorabafb502014-12-02 22:26:20 -080018import org.onosproject.net.provider.ProviderId;
Thomas Vachuska6acd3bb2014-11-09 23:44:22 -080019
Thomas Vachuskae0f804a2014-10-27 23:40:48 -070020import java.util.Set;
tom53efab52014-10-07 17:43:48 -070021
22/**
23 * Service for interacting with the core system of the controller.
24 */
25public interface CoreService {
26
Thomas Vachuska6acd3bb2014-11-09 23:44:22 -080027 public static final ProviderId CORE_PROVIDER_ID =
Brian O'Connorabafb502014-12-02 22:26:20 -080028 new ProviderId("core", "org.onosproject.core");
Thomas Vachuska6acd3bb2014-11-09 23:44:22 -080029
tom53efab52014-10-07 17:43:48 -070030 /**
31 * Returns the product version.
32 *
33 * @return product version
34 */
35 Version version();
36
alshabib92c65ad2014-10-08 21:56:05 -070037 /**
Thomas Vachuskae0f804a2014-10-27 23:40:48 -070038 * Returns the set of currently registered application identifiers.
39 *
40 * @return set of application ids
41 */
42 Set<ApplicationId> getAppIds();
43
44 /**
45 * Returns an existing application id from a given id.
46 * @param id the short value of the id
47 * @return an application id
48 */
49 ApplicationId getAppId(Short id);
50
51 /**
Ray Milkey02479862015-02-17 17:02:19 -080052 * Returns an existing application id from a given id.
53 * @param name the name portion of the ID to look up
54 * @return an application id
55 */
56 ApplicationId getAppId(String name);
57
58 /**
alshabib92c65ad2014-10-08 21:56:05 -070059 * Registers a new application by its name, which is expected
60 * to follow the reverse DNS convention, e.g.
61 * {@code org.flying.circus.app}
62 *
63 * @param identifier string identifier
64 * @return the application id
65 */
66 ApplicationId registerApplication(String identifier);
67
Brian O'Connor520c0522014-11-23 23:50:47 -080068 /**
69 * Returns an id generator for a given topic.
70 *
71 * @param topic topic identified
72 * @return the id generator
73 */
74 IdGenerator getIdGenerator(String topic);
75
tom53efab52014-10-07 17:43:48 -070076}