2 * Copyright (c) 2017 Pantheon Technologies s.r.o. 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
8 package org.opendaylight.openflowplugin.api.openflow.lifecycle;
10 import javax.annotation.Nonnull;
12 import com.google.common.util.concurrent.ListenableFuture;
13 import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.rf.state.rev170713.ResultState;
17 * Internal OFP interface used by mastership service.
18 * @see ContextChainHolder
19 * @since 0.5.0 Nitrogen
21 public interface OwnershipChangeListener extends ReconciliationFrameworkRegistrar {
24 * This event is called when device is fully mastered. All condition have to been done successful.
26 * <li>Transaction chain created</li>
27 * <li> RPC services started </li>
28 * <li> Initial statistics gathering. </li>
29 * <li> Initial DS submit. </li>
30 * <li> Flow registry filled. - <b>this step is not mandatory</b></li>
32 * @param deviceInfo connected switch identification
34 void becomeMaster(@Nonnull DeviceInfo deviceInfo);
37 * Should be called when device is disconnected or going to be slaved.
38 * @param deviceInfo connected switch identification
40 void becomeSlaveOrDisconnect(@Nonnull DeviceInfo deviceInfo);
43 * Should be called when device is being mastered as in {@link #becomeMaster(DeviceInfo)}.
44 * <p> But before: Initial DS submit</p>
45 * <b>This is special call designed only for reconciliation framework.</b>
46 * @see #becomeMaster(DeviceInfo)
47 * @see #isReconciliationFrameworkRegistered()
48 * @param deviceInfo connected switch identification
49 * @return future to be able handle device after reconciliation
51 ListenableFuture<ResultState> becomeMasterBeforeSubmittedDS(@Nonnull DeviceInfo deviceInfo);
54 * Set the device mastership checker.
55 * @param masterChecker {@link MasterChecker}
57 void setMasterChecker(@Nonnull MasterChecker masterChecker);