2 * Copyright (c) 2013 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.netconf.api.monitoring;
10 import java.util.Collection;
11 import java.util.Optional;
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 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.netconf.state.sessions.Session;
17 public interface NetconfMonitoringService {
19 Sessions getSessions();
22 * Returns session monitoring service session listener, which is used to notify monitoring service about state of
25 * @return session listener
27 SessionListener getSessionListener();
31 String getSchemaForCapability(String moduleName, Optional<String> revision);
33 Capabilities getCapabilities();
36 * Allows push based capabilities information transfer. After the listener is registered, current state is pushed
39 * @param listener Monitoring listener
40 * @return listener registration
42 AutoCloseable registerCapabilitiesListener(CapabilitiesListener listener);
45 * Allows push based sessions information transfer.
47 * @param listener Monitoring listener
48 * @return listener registration
50 AutoCloseable registerSessionsListener(SessionsListener listener);
52 interface CapabilitiesListener {
55 * Callback used to notify about a change in used capabilities.
57 * @param capabilities resulting capabilities
59 void onCapabilitiesChanged(Capabilities capabilities);
62 * Callback used to notify about a change in used schemas.
64 * @param schemas resulting schemas
66 void onSchemasChanged(Schemas schemas);
69 interface SessionsListener {
71 * Callback used to notify about netconf session start.
73 * @param session started session
75 void onSessionStarted(Session session);
78 * Callback used to notify about netconf session end.
80 * @param session ended session
82 void onSessionEnded(Session session);
85 * Callback used to notify about activity in netconf session, like
86 * rpc or notification. It is triggered at regular time interval. Session parameter
87 * contains only sessions which state was changed.
89 * @param sessions updated sessions
91 void onSessionsUpdated(Collection<Session> sessions);