2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.openflowplugin.api.openflow.lifecycle;
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;
18 * Service for starting or stopping all services in plugin in cluster.
20 public interface LifecycleService extends ClusterSingletonService, AutoCloseable {
23 * This method registers lifecycle service to the given provider.
24 * @param singletonServiceProvider from md-sal binding
25 * @param deviceContext device
27 void registerService(@Nonnull ClusterSingletonServiceProvider singletonServiceProvider,
28 @Nonnull DeviceContext deviceContext);
31 * This method registers device removed handler what will be executed when device should be removed.
32 * @param deviceRemovedHandler device removed handler
34 void registerDeviceRemovedHandler(@Nonnull DeviceRemovedHandler deviceRemovedHandler);
38 * @param deviceContext provide device context which can't be stored in lifecycle service.
40 void makeDeviceSlave(DeviceContext deviceContext);