Clean up (DOM)DataTreeIdentifier methods
[mdsal.git] / dom / mdsal-dom-api / src / main / java / org / opendaylight / mdsal / dom / api / DOMRpcAvailabilityListener.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.mdsal.dom.api;
9
10 import java.util.Collection;
11 import org.eclipse.jdt.annotation.NonNull;
12
13 /**
14  * A  listene} used to track RPC implementations becoming (un)available to a {@link DOMRpcService}.
15  */
16 public interface DOMRpcAvailabilityListener {
17     /**
18      * Method invoked whenever an RPC type becomes available.
19      *
20      * @param rpcs RPC types newly available
21      */
22     void onRpcAvailable(@NonNull Collection<DOMRpcIdentifier> rpcs);
23
24     /**
25      * Method invoked whenever an RPC type becomes unavailable.
26      *
27      * @param rpcs RPC types which became unavailable
28      */
29     void onRpcUnavailable(@NonNull Collection<DOMRpcIdentifier> rpcs);
30
31     /**
32      * Implementation filtering method. This method is useful for forwarding RPC implementations,
33      * which need to ensure they do not re-announce their own implementations. Without this method
34      * a forwarder which registers an implementation would be notified of its own implementation,
35      * potentially re-exporting it as local -- hence creating a forwarding loop.
36      *
37      * @param impl RPC implementation being registered
38      * @return False if the implementation should not be reported, defaults to true.
39      */
40     default boolean acceptsImplementation(final DOMRpcImplementation impl) {
41         return true;
42     }
43 }