c881ae2e4e929b3f51763fa73b49de065619a56a
[controller.git] / opendaylight / netconf / mdsal-netconf-connector / src / main / java / org / opendaylight / controller / netconf / mdsal / connector / OperationProvider.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.mdsal.connector;
10
11 import com.google.common.collect.Sets;
12 import java.util.Set;
13 import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
14 import org.opendaylight.controller.netconf.mapping.api.NetconfOperation;
15 import org.opendaylight.controller.netconf.mdsal.connector.ops.Commit;
16 import org.opendaylight.controller.netconf.mdsal.connector.ops.DiscardChanges;
17 import org.opendaylight.controller.netconf.mdsal.connector.ops.EditConfig;
18 import org.opendaylight.controller.netconf.mdsal.connector.ops.Lock;
19 import org.opendaylight.controller.netconf.mdsal.connector.ops.Unlock;
20 import org.opendaylight.controller.netconf.mdsal.connector.ops.get.Get;
21 import org.opendaylight.controller.netconf.mdsal.connector.ops.get.GetConfig;
22
23 final class OperationProvider {
24
25     private final String netconfSessionIdForReporting;
26     private final CurrentSchemaContext schemaContext;
27     private final DOMDataBroker dataBroker;
28     private final TransactionProvider transactionProvider;
29
30     public OperationProvider(final String netconfSessionIdForReporting, final CurrentSchemaContext schemaContext, final DOMDataBroker dataBroker) {
31         this.netconfSessionIdForReporting = netconfSessionIdForReporting;
32         this.schemaContext = schemaContext;
33         this.dataBroker = dataBroker;
34         this.transactionProvider = new TransactionProvider(dataBroker, netconfSessionIdForReporting);
35
36     }
37
38     Set<NetconfOperation> getOperations() {
39         return Sets.<NetconfOperation>newHashSet(
40                 new Commit(netconfSessionIdForReporting, transactionProvider),
41                 new DiscardChanges(netconfSessionIdForReporting, transactionProvider),
42                 new EditConfig(netconfSessionIdForReporting, schemaContext, transactionProvider),
43                 new Get(netconfSessionIdForReporting, schemaContext, transactionProvider),
44                 new GetConfig(netconfSessionIdForReporting, schemaContext, transactionProvider),
45                 new Lock(netconfSessionIdForReporting),
46                 new Unlock(netconfSessionIdForReporting)
47         );
48     }
49
50 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.