2 * Copyright (c) 2015 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.device;
11 import com.google.common.util.concurrent.ListenableFuture;
12 import org.opendaylight.openflowplugin.api.openflow.OFPManager;
13 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceConnectedHandler;
14 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceDisconnectedHandler;
15 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceInitializationPhaseHandler;
16 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceLifecycleSupervisor;
17 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceTerminationPhaseHandler;
18 import org.opendaylight.openflowplugin.api.openflow.translator.TranslatorLibrarian;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.role.service.rev150727.OfpRole;
22 * This interface is responsible for instantiating DeviceContext and
23 * registering transaction chain for each DeviceContext. Each device
24 * has its own device context managed by this manager.
26 public interface DeviceManager extends DeviceConnectedHandler, DeviceDisconnectedHandler, DeviceLifecycleSupervisor,
27 DeviceInitializationPhaseHandler, DeviceTerminationPhaseHandler, TranslatorLibrarian, AutoCloseable, OFPManager {
31 * invoked after all services injected
36 * Method has to activate (MASTER) or deactivate (SLAVE) TransactionChainManager.
37 * TransactionChainManager represents possibility to write or delete Node subtree data
38 * for actual Controller Cluster Node. We are able to have an active TxManager only if
39 * newRole is {@link OfpRole#BECOMESLAVE}.
40 * Parameters are used as marker to be sure it is change to SLAVE from MASTER or from
41 * MASTER to SLAVE and the last parameter "cleanDataStore" is used for validation only.
43 * @param deviceInfo which device
44 * @param role - NewRole expect to be {@link OfpRole#BECOMESLAVE} or {@link OfpRole#BECOMEMASTER}
45 * @return RoleChangeTxChainManager future for activation/deactivation
47 ListenableFuture<Void> onClusterRoleChange(final DeviceInfo deviceInfo, final OfpRole role);
50 * Register device synchronize listeners
51 * @param deviceSynchronizeListener are notified if device is synchronized or not
53 void registerDeviceSynchronizeListeners(final DeviceSynchronizeListener deviceSynchronizeListener);
56 * Notify all registered listeners about synchronized status
57 * @param deviceInfo which device
58 * @param deviceSynchronized true if device is synchronized
60 void notifyDeviceSynchronizeListeners(final DeviceInfo deviceInfo, final boolean deviceSynchronized);
63 * Register device valid listeners
64 * @param deviceValidListener are notified if device is valid or not
66 void registerDeviceValidListeners(final DeviceValidListener deviceValidListener);
69 * Notify all registered listeners about valid status
70 * @param deviceInfo which device
71 * @param deviceValid true if device is valid
73 void notifyDeviceValidListeners(final DeviceInfo deviceInfo, final boolean deviceValid);