/* * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.controller.sal.core.spi.data; /** * Factory for DOM Store Transactions * *

* Factory provides method to construct read-only, read-write and write-only * transactions, which may be used to retrieve and modify stored information in * Underlying {@link DOMStore} or {@link DOMStoreTransactionChain}. * *

* See DOMStore, DOMStoreTransactionChain for concrete variations of this factory. * *

* Note: This interface is used only to define common functionality * between {@link DOMStore} and {@link DOMStoreTransactionChain}, which * further specify behaviour of returned transactions. * */ public interface DOMStoreTransactionFactory { /** * Creates a read only transaction. * *

* Creates a new read-only transaction, which provides read access to * snapshot of current state. * * @see DOMStoreReadTransaction for more information. * @return new {@link DOMStoreReadTransaction} * @throws IllegalStateException * If state of factory prevents allocating new transaction. * */ DOMStoreReadTransaction newReadOnlyTransaction(); /** * Creates write only transaction. * * @see DOMStoreWriteTransaction for more information. * @return new {@link DOMStoreWriteTransaction} * @throws IllegalStateException If state of factory prevents allocating new transaction. */ DOMStoreWriteTransaction newWriteOnlyTransaction(); /** * Creates Read-Write transaction. * * @see DOMStoreReadWriteTransaction for more information. * @return new {@link DOMStoreWriteTransaction} * @throws IllegalStateException If state of factory prevents allocating new transaction. */ DOMStoreReadWriteTransaction newReadWriteTransaction(); }