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
9 package org.opendaylight.controller.netconf.mdsal.connector;
11 import com.google.common.base.Preconditions;
12 import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
13 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceFactory;
14 import org.opendaylight.controller.sal.core.api.model.SchemaService;
16 public class MdsalNetconfOperationServiceFactory implements NetconfOperationServiceFactory, AutoCloseable {
18 private final DOMDataBroker dataBroker;
19 private final CurrentSchemaContext currentSchemaContext;
21 public MdsalNetconfOperationServiceFactory(final SchemaService schemaService, final DOMDataBroker domDataBroker) {
22 this.currentSchemaContext = new CurrentSchemaContext(Preconditions.checkNotNull(schemaService));
23 this.dataBroker = Preconditions.checkNotNull(domDataBroker);
27 public MdsalNetconfOperationService createService(final String netconfSessionIdForReporting) {
28 return new MdsalNetconfOperationService(currentSchemaContext, netconfSessionIdForReporting, dataBroker);
32 public void close() throws Exception {
33 currentSchemaContext.close();