Use ByteBuf.readRetainedSlice()
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / mastership / MastershipChangeServiceManager.java
1 /*
2  * Copyright (c) 2017 Pantheon Technologies s.r.o. 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 package org.opendaylight.openflowplugin.api.openflow.mastership;
9
10 import org.eclipse.jdt.annotation.NonNull;
11 import org.opendaylight.openflowplugin.api.openflow.lifecycle.OwnershipChangeListener;
12 import org.opendaylight.yangtools.concepts.Registration;
13
14 /**
15  * Provider to register mastership change listener.
16  * Provider to set mastership reconciliation framework.
17  * @since 0.5.0 Nitrogen
18  */
19 public interface MastershipChangeServiceManager extends OwnershipChangeListener {
20     /**
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
26      */
27     @NonNull
28     Registration register(@NonNull MastershipChangeService service);
29
30     /**
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
36      */
37     Registration reconciliationFrameworkRegistration(@NonNull ReconciliationFrameworkEvent mastershipRFRegistration)
38         throws MastershipChangeException;
39 }