Clean up mdsal-netconf-notification
[netconf.git] / netconf / mdsal-netconf-notification / src / main / java / org / opendaylight / netconf / mdsal / notification / impl / NetconfNotificationOperationService.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 package org.opendaylight.netconf.mdsal.notification.impl;
9
10 import java.util.Set;
11 import org.opendaylight.netconf.mapping.api.NetconfOperation;
12 import org.opendaylight.netconf.mapping.api.NetconfOperationService;
13 import org.opendaylight.netconf.notifications.NetconfNotificationRegistry;
14
15 public final class NetconfNotificationOperationService implements NetconfOperationService {
16     private final CreateSubscription createSubscription;
17
18     public NetconfNotificationOperationService(final String netconfSessionIdForReporting,
19             final NetconfNotificationRegistry netconfNotificationRegistry) {
20         createSubscription = new CreateSubscription(netconfSessionIdForReporting, netconfNotificationRegistry);
21     }
22
23     @Override
24     public Set<NetconfOperation> getNetconfOperations() {
25         return Set.of(createSubscription);
26     }
27
28     @SuppressWarnings("checkstyle:IllegalCatch")
29     @Override
30     public void close() {
31         createSubscription.close();
32     }
33 }