Decouple config and netconf subsystems.
[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.facade.xml.ConfigSubsystemFacade;
13 import org.opendaylight.controller.netconf.mapping.api.NetconfOperation;
14 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationService;
15
16 public class NetconfOperationServiceImpl implements NetconfOperationService {
17
18     private final NetconfOperationProvider operationProvider;
19     private ConfigSubsystemFacade configSubsystemFacade;
20
21     public NetconfOperationServiceImpl(final ConfigSubsystemFacade configSubsystemFacade,
22             final String netconfSessionIdForReporting) {
23         this.configSubsystemFacade = configSubsystemFacade;
24         operationProvider = new NetconfOperationProvider(configSubsystemFacade, netconfSessionIdForReporting);
25     }
26
27     @Override
28     public Set<NetconfOperation> getNetconfOperations() {
29         return operationProvider.getOperations();
30     }
31
32     @Override
33     public void close() {
34         configSubsystemFacade.close();
35     }
36
37 }