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.mastership;
10 import org.eclipse.jdt.annotation.NonNull;
11 import org.opendaylight.openflowplugin.api.openflow.lifecycle.OwnershipChangeListener;
12 import org.opendaylight.yangtools.concepts.Registration;
15 * Provider to register mastership change listener.
16 * Provider to set mastership reconciliation framework.
17 * @since 0.5.0 Nitrogen
19 public interface MastershipChangeServiceManager extends OwnershipChangeListener {
21 * Register of mastership change listener. Returned registration need to be closed by client.
22 * It doesn't contain event for reconciliation framework event.
23 * @param service implementation of {@link MastershipChangeService}
24 * @return registration
25 * @see ReconciliationFrameworkEvent
28 Registration register(@NonNull MastershipChangeService service);
31 * Setter for reconciliation framework event listener. It can be registered only once.
32 * Another registrations will throw an exception
33 * @param mastershipRFRegistration reconciliation framework
34 * @return registration object, which can be closed to unregister
35 * @throws MastershipChangeException if already reconciliation framework registered
37 Registration reconciliationFrameworkRegistration(@NonNull ReconciliationFrameworkEvent mastershipRFRegistration)
38 throws MastershipChangeException;