59755020b0fffd3c632a81f36ee94361262f99fe
[controller.git] / opendaylight / md-sal / sal-inmemory-datastore / src / main / java / org / opendaylight / controller / md / sal / dom / store / impl / InMemoryDOMDataStore.java
1 /*
2  * Copyright (c) 2014 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 package org.opendaylight.controller.md.sal.dom.store.impl;
9
10 import java.util.concurrent.ExecutorService;
11 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
12 import org.opendaylight.controller.sal.core.compat.DOMStoreAdapter;
13 import org.opendaylight.yangtools.concepts.Identifiable;
14 import org.opendaylight.yangtools.util.concurrent.QueuedNotificationManager;
15 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
16 import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
17
18 /**
19  * In-memory DOM Data Store providing Controller MD-SAL APIs on top of MD-SAL's
20  * {@link org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore}.
21  *
22  * @deprecated Please use {@link org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore} instead.
23  */
24 @Deprecated
25 public class InMemoryDOMDataStore
26         extends DOMStoreAdapter<org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore>
27         implements Identifiable<String>, SchemaContextListener, AutoCloseable {
28     private final org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore delegate;
29
30     public InMemoryDOMDataStore(final String name, final ExecutorService dataChangeListenerExecutor) {
31         this(name, LogicalDatastoreType.OPERATIONAL, dataChangeListenerExecutor,
32             InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_CHANGE_LISTENER_QUEUE_SIZE, false);
33     }
34
35     public InMemoryDOMDataStore(final String name, final LogicalDatastoreType type,
36             final ExecutorService dataChangeListenerExecutor,
37             final int maxDataChangeListenerQueueSize, final boolean debugTransactions) {
38         delegate = new org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore(name, type.toMdsal(),
39             dataChangeListenerExecutor, maxDataChangeListenerQueueSize, debugTransactions);
40     }
41
42     @Override
43     protected org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore delegate() {
44         return delegate;
45     }
46
47     public void setCloseable(final AutoCloseable closeable) {
48         delegate.setCloseable(closeable);
49     }
50
51     public QueuedNotificationManager<?, ?> getDataChangeListenerNotificationManager() {
52         return delegate.getDataChangeListenerNotificationManager();
53     }
54
55     @Override
56     public final String getIdentifier() {
57         return delegate.getIdentifier();
58     }
59
60     @Override
61     public void onGlobalContextUpdated(final SchemaContext ctx) {
62         delegate.onGlobalContextUpdated(ctx);
63     }
64
65     @Override
66     public void close() {
67         delegate.close();
68     }
69
70     public final boolean getDebugTransactions() {
71         return delegate.getDebugTransactions();
72     }
73 }