Bug 6714 - Use singleton service in clustered netconf topology
[netconf.git] / netconf / abstract-topology / src / main / java / org / opendaylight / netconf / topology / RemoteNodeListener.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
9 package org.opendaylight.netconf.topology;
10
11 import com.google.common.annotations.Beta;
12 import org.opendaylight.netconf.topology.util.messages.NormalizedNodeMessage;
13 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
14 import scala.concurrent.Future;
15
16 /**
17  * Interface that provides methods of calling node events on a remote actor.
18  * Use these when you want to call node events asynchronously similar to akka ask()
19  */
20 @Beta
21 public interface RemoteNodeListener {
22
23     /**
24      * This is called when a remote node is informing you that a new configuration was recieved.
25      * @param message - serializable message to send
26      * @return response from the remote node
27      */
28     Future<NormalizedNodeMessage> onRemoteNodeCreated(NormalizedNodeMessage message);
29
30     /**
31      * This is called when a remote node is informing you that a configuration was updated.
32      * @param message - serializable message to send
33      * @return response from the remote node
34      */
35     Future<NormalizedNodeMessage> onRemoteNodeUpdated(NormalizedNodeMessage message);
36
37     /**
38      * This is called when a remote node is informing you that a new configuration was deleted.
39      * @param nodeId - id of the node which was deleted
40      * @return void future success if delete succeed, failure otherwise
41      */
42     Future<Void> onRemoteNodeDeleted(NodeId nodeId);
43
44     /**
45      * Called when a remote node is requesting a node's status, after a status change notification(f.ex sessionUp, sessionDown)
46      * on lower level
47      * @param nodeId - id of the node which status we want to retrieve
48      * @return status for the node requested
49      */
50     Future<NormalizedNodeMessage> remoteGetCurrentStatusForNode(NodeId nodeId);
51 }