MDSAL-API Migration
[genius.git] / cloudscaler / api / src / main / java / org / opendaylight / genius / cloudscaler / api / TombstonedNodeManager.java
1 /*
2  * Copyright (c) 2019 Ericsson India Global Services Pvt Ltd. 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.genius.cloudscaler.api;
9
10 import java.util.List;
11 import java.util.function.Function;
12 import org.opendaylight.mdsal.common.api.ReadFailedException;
13 import org.opendaylight.yangtools.yang.common.Uint64;
14
15 public interface TombstonedNodeManager {
16
17     /**
18      * Tells if the supplied dpn is getting scaled in or not.
19      * @param dpnId dpn id
20      * @return true if the supllied dpn is getting scaled in
21      * @throws ReadFailedException throws read failed exception
22      */
23     boolean isDpnTombstoned(Uint64 dpnId) throws ReadFailedException;
24
25     /**
26      * Add the listener callback which will be invoked upon recovery of scaled in dpn.
27      * @param callback callback to be invoked on recovery
28      */
29     void addOnRecoveryCallback(Function<Uint64, Void> callback);
30
31     /**
32      * Filters the list of dpns which are not scaled in.
33      * @param dpns the input list of dpns
34      * @return filtered list of dpns which are not scaled in
35      * @throws ReadFailedException throws read failed exception
36      */
37     List<Uint64> filterTombStoned(List<Uint64> dpns) throws ReadFailedException;
38 }