2 * Copyright (c) 2015 Cisco Systems, Inc. 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.controller.md.sal.dom.api;
10 import java.util.Collection;
11 import java.util.EventListener;
12 import javax.annotation.Nonnull;
15 * An {@link EventListener} used to track RPC implementations becoming (un)available
16 * to a {@link DOMRpcService}.
18 public interface DOMRpcAvailabilityListener extends EventListener {
20 * Method invoked whenever an RPC type becomes available.
22 * @param rpcs RPC types newly available
24 void onRpcAvailable(@Nonnull Collection<DOMRpcIdentifier> rpcs);
27 * Method invoked whenever an RPC type becomes unavailable.
29 * @param rpcs RPC types which became unavailable
31 void onRpcUnavailable(@Nonnull Collection<DOMRpcIdentifier> rpcs);
34 * Implementation filtering method. This method is useful for forwarding RPC implementations,
35 * which need to ensure they do not re-announce their own implementations. Without this method
36 * a forwarder which registers an implementation would be notified of its own implementation,
37 * potentially re-exporting it as local -- hence creating a forwarding loop.
39 * @param impl RPC implementation being registered
40 * @return False if the implementation should not be reported, defaults to true.
42 default boolean acceptsImplementation(final DOMRpcImplementation impl) {