Merge "BUG 2676 : Introduce API for accessing akka dispatchers"
[controller.git] / opendaylight / netconf / config-netconf-connector / src / main / java / org / opendaylight / controller / netconf / confignetconfconnector / osgi / NetconfOperationServiceImpl.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
9 package org.opendaylight.controller.netconf.confignetconfconnector.osgi;
10
11 import java.util.Set;
12 import org.opendaylight.controller.config.util.ConfigRegistryJMXClient;
13 import org.opendaylight.controller.netconf.confignetconfconnector.transactions.TransactionProvider;
14 import org.opendaylight.controller.netconf.mapping.api.NetconfOperation;
15 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationService;
16
17 /**
18  * Manages life cycle of {@link YangStoreContext}.
19  */
20 public class NetconfOperationServiceImpl implements NetconfOperationService {
21
22     private final NetconfOperationProvider operationProvider;
23     private final TransactionProvider transactionProvider;
24
25     public NetconfOperationServiceImpl(final YangStoreService yangStoreService, final ConfigRegistryJMXClient jmxClient,
26             final String netconfSessionIdForReporting) {
27
28         transactionProvider = new TransactionProvider(jmxClient, netconfSessionIdForReporting);
29         operationProvider = new NetconfOperationProvider(yangStoreService, jmxClient, transactionProvider,
30                 netconfSessionIdForReporting);
31     }
32
33     @Override
34     public Set<NetconfOperation> getNetconfOperations() {
35         return operationProvider.getOperations();
36     }
37
38     @Override
39     public void close() {
40         transactionProvider.close();
41     }
42
43 }