Merge "BUG-2635 Netconf monitoring for md-sal netconf northbound"
[controller.git] / opendaylight / netconf / netconf-api / src / main / java / org / opendaylight / controller / netconf / api / monitoring / NetconfMonitoringService.java
1 /*
2  * Copyright (c) 2013 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.controller.netconf.api.monitoring;
9
10 import com.google.common.base.Optional;
11 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.NetconfState;
12 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.Capabilities;
13 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.Schemas;
14 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.Sessions;
15
16 public interface NetconfMonitoringService extends CapabilityListener, SessionListener {
17
18     Sessions getSessions();
19
20     Schemas getSchemas();
21
22     String getSchemaForCapability(String moduleName, Optional<String> revision);
23
24     Capabilities getCapabilities();
25
26     /**
27      * Allows push based state information transfer. After the listener is registered, current state is pushed to the listener.
28      */
29     AutoCloseable registerListener(MonitoringListener listener);
30
31     interface MonitoringListener {
32
33         // TODO more granular updates would make sense
34         void onStateChanged(NetconfState state);
35     }
36 }