Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 1 | /* |
| 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 | */ |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 16 | package org.onlab.onos.core; |
| 17 | |
Thomas Vachuska | 6acd3bb | 2014-11-09 23:44:22 -0800 | [diff] [blame] | 18 | import org.onlab.onos.net.provider.ProviderId; |
| 19 | |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 20 | import java.util.Set; |
tom | 53efab5 | 2014-10-07 17:43:48 -0700 | [diff] [blame] | 21 | |
| 22 | /** |
| 23 | * Service for interacting with the core system of the controller. |
| 24 | */ |
| 25 | public interface CoreService { |
| 26 | |
Thomas Vachuska | 6acd3bb | 2014-11-09 23:44:22 -0800 | [diff] [blame] | 27 | public static final ProviderId CORE_PROVIDER_ID = |
| 28 | new ProviderId("core", "org.onlab.onos.core"); |
| 29 | |
tom | 53efab5 | 2014-10-07 17:43:48 -0700 | [diff] [blame] | 30 | /** |
| 31 | * Returns the product version. |
| 32 | * |
| 33 | * @return product version |
| 34 | */ |
| 35 | Version version(); |
| 36 | |
alshabib | 92c65ad | 2014-10-08 21:56:05 -0700 | [diff] [blame] | 37 | /** |
Thomas Vachuska | e0f804a | 2014-10-27 23:40:48 -0700 | [diff] [blame] | 38 | * 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 | /** |
alshabib | 92c65ad | 2014-10-08 21:56:05 -0700 | [diff] [blame] | 52 | * Registers a new application by its name, which is expected |
| 53 | * to follow the reverse DNS convention, e.g. |
| 54 | * {@code org.flying.circus.app} |
| 55 | * |
| 56 | * @param identifier string identifier |
| 57 | * @return the application id |
| 58 | */ |
| 59 | ApplicationId registerApplication(String identifier); |
| 60 | |
tom | 53efab5 | 2014-10-07 17:43:48 -0700 | [diff] [blame] | 61 | } |