blob: a8e294ed4345bdd5255f2d5a8e5627bd2fa5ddfd [file] [log] [blame]
tomc1a38d32014-08-25 23:01:32 -07001package org.onlab.onos.net.provider;
tom0eb04ca2014-08-25 14:34:51 -07002
3/**
4 * Broker used for registering/unregistering information providers with the core.
5 *
tom64b7aac2014-08-26 00:18:21 -07006 * @param <P> type of the information provider
tom0eb04ca2014-08-25 14:34:51 -07007 * @param <S> type of the provider service
8 */
tom64b7aac2014-08-26 00:18:21 -07009public interface ProviderBroker<P extends Provider, S extends ProviderService<P>> {
tom0eb04ca2014-08-25 14:34:51 -070010
11 /**
12 * Registers the supplied provider with the core.
13 *
14 * @param provider provider to be registered
15 * @return provider service for injecting information into core
16 */
tom64b7aac2014-08-26 00:18:21 -070017 S register(P provider);
tom0eb04ca2014-08-25 14:34:51 -070018
19 /**
20 * Unregisters the supplied provider. As a result the previously issued
tom64b7aac2014-08-26 00:18:21 -070021 * provider service will be invalidated and any subsequent invocations
22 * of its methods may throw {@link java.lang.IllegalStateException}.
tom0eb04ca2014-08-25 14:34:51 -070023 *
24 * @param provider provider to be unregistered
25 */
tom64b7aac2014-08-26 00:18:21 -070026 void unregister(P provider);
tom0eb04ca2014-08-25 14:34:51 -070027
28}