Rename messagebus-netconf packages to org.opendaylight.netconf
[netconf.git] / opendaylight / netconf / netconf-api / src / main / java / org / opendaylight / 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.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      * @param listener Monitoring listener
29      * @return listener registration
30      */
31     AutoCloseable registerListener(MonitoringListener listener);
32
33     interface MonitoringListener {
34
35         // TODO more granular updates would make sense
36         void onStateChanged(NetconfState state);
37     }
38 }