Bug 4957 Fix RoleChangeLifecyle (init, close, life)
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / role / RoleChangeListener.java
1 /**
2  * Copyright (c) 2015 Cisco Systems, Inc. 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.role;
9
10 import org.opendaylight.controller.md.sal.common.api.clustering.Entity;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.role.service.rev150727.OfpRole;
12
13 /**
14  * Created by kramesha on 9/19/15.
15  */
16 public interface RoleChangeListener extends AutoCloseable {
17     /**
18      * Gets called by the EntityOwnershipCandidate after role change received from EntityOwnershipService
19      * @param oldRole
20      * @param newRole
21      */
22     void onRoleChanged(OfpRole oldRole, OfpRole newRole);
23
24     Entity getEntity();
25
26     void onDeviceDisconnectedFromCluster();
27
28 }