2 * Copyright (c) 2014 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
8 package org.opendaylight.controller.sal.dom.broker.impl;
10 import org.opendaylight.controller.md.sal.common.api.data.DataModification;
11 import org.opendaylight.controller.md.sal.common.api.data.DataCommitHandler.DataCommitTransaction;
12 import org.opendaylight.yangtools.yang.common.RpcResult;
13 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
16 public class HashMapDataStoreTransaction implements
17 DataCommitTransaction<YangInstanceIdentifier, CompositeNode> {
18 private final DataModification<YangInstanceIdentifier, CompositeNode> modification;
19 private final HashMapDataStore datastore;
21 HashMapDataStoreTransaction(
22 final DataModification<YangInstanceIdentifier, CompositeNode> modify,
23 final HashMapDataStore store) {
24 modification = modify;
29 public RpcResult<Void> finish() throws IllegalStateException {
30 return datastore.finish(this);
34 public DataModification<YangInstanceIdentifier, CompositeNode> getModification() {
35 return this.modification;
39 public RpcResult<Void> rollback() throws IllegalStateException {
40 return datastore.rollback(this);