Merge "Remove He-design inventory manager"
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / lifecycle / LifecycleService.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.openflowplugin.api.openflow.lifecycle;
10
11 import javax.annotation.Nonnull;
12 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService;
13 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
14 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
15 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceRemovedHandler;
16
17 /**
18  * Service for starting or stopping all services in plugin in cluster.
19  */
20 public interface LifecycleService extends ClusterSingletonService, AutoCloseable {
21
22     /**
23      * This method registers lifecycle service to the given provider.
24      * @param singletonServiceProvider      from md-sal binding
25      * @param deviceContext                 device
26      */
27     void registerService(@Nonnull ClusterSingletonServiceProvider singletonServiceProvider,
28                          @Nonnull DeviceContext deviceContext);
29
30     /**
31      * This method registers device removed handler what will be executed when device should be removed.
32      * @param deviceRemovedHandler device removed handler
33      */
34     void registerDeviceRemovedHandler(@Nonnull DeviceRemovedHandler deviceRemovedHandler);
35
36     /**
37      * Make device SLAVE.
38      * @param deviceContext provide device context which can't be stored in lifecycle service.
39      */
40     void makeDeviceSlave(DeviceContext deviceContext);
41
42     @Override
43     void close();
44 }