cebed4c8a39fcc035cc1b3a0b98fb7249454c2b3
[ccsdk/features.git] /
1 /*******************************************************************************
2  * ============LICENSE_START========================================================================
3  * ONAP : ccsdk feature sdnr wt
4  * =================================================================================================
5  * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
6  * =================================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
8  * in compliance with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software distributed under the License
13  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
14  * or implied. See the License for the specific language governing permissions and limitations under
15  * the License.
16  * ============LICENSE_END==========================================================================
17  ******************************************************************************/
18
19 package org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice;
20
21 import java.util.EventListener;
22 import java.util.Optional;
23 import org.eclipse.jdt.annotation.NonNull;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
25 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
26
27 /**
28  *  Indicate if device is connected or not.
29  *  A NetconfNode (Mountpoint) is providing the status.
30  *  If this is Master and connected, this function is calles.
31  */
32
33 public interface NetconfNodeConnectListener extends EventListener, AutoCloseable {
34
35     /**
36      * Called if device state changes to "connected" for a netconf master node.
37      * @param acessor containing <br>
38      *   - nNodeId name of mount point<br>
39      *   - netconfNode with related information<br>
40      *   - mountPoint of the node<br>
41      *    -netconfNodeDataBroker to access connected netconf device
42      */
43     public void onEnterConnected(@NonNull NetconfAccessor acessor );
44     /**
45      * Notify of device state change to "not connected" mount point supervision for
46      * master mountpoint HINT: This callback could be called multiple times also the
47      * onEnterConnected state was not called.
48      *
49      * @param nNodeId             name of mount point
50      * @param optionalNetconfNode with new status or if removed not present
51      */
52     public void onLeaveConnected(@NonNull NodeId nNodeId, @NonNull Optional<NetconfNode> optionalNetconfNode);
53
54 }