Proxy over MDSAL-provided IMDS
[controller.git] / opendaylight / md-sal / sal-inmemory-datastore / src / main / java / org / opendaylight / controller / md / sal / dom / store / impl / InMemoryDOMDataStoreConfigProperties.java
1 /*
2  * Copyright (c) 2014 Brocade Communications 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 /**
11  * Holds configuration properties when creating an {@link InMemoryDOMDataStore} instance via the
12  * {@link InMemoryDOMDataStoreFactory}.
13  *
14  * @author Thomas Pantelis
15  * @see InMemoryDOMDataStoreFactory
16  *
17  * @deprecated Use {@link org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStoreConfigProperties} instead.
18  */
19 @Deprecated
20 public final class InMemoryDOMDataStoreConfigProperties {
21
22     public static final int DEFAULT_MAX_DATA_CHANGE_EXECUTOR_QUEUE_SIZE = 1000;
23     public static final int DEFAULT_MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE = 20;
24     public static final int DEFAULT_MAX_DATA_CHANGE_LISTENER_QUEUE_SIZE = 1000;
25     public static final int DEFAULT_MAX_DATA_STORE_EXECUTOR_QUEUE_SIZE = 5000;
26
27     private static final InMemoryDOMDataStoreConfigProperties DEFAULT =
28             create(DEFAULT_MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE,
29                     DEFAULT_MAX_DATA_CHANGE_EXECUTOR_QUEUE_SIZE,
30                     DEFAULT_MAX_DATA_CHANGE_LISTENER_QUEUE_SIZE,
31                     DEFAULT_MAX_DATA_STORE_EXECUTOR_QUEUE_SIZE);
32
33     private final int maxDataChangeExecutorQueueSize;
34     private final int maxDataChangeExecutorPoolSize;
35     private final int maxDataChangeListenerQueueSize;
36     private final int maxDataStoreExecutorQueueSize;
37
38     /**
39      * Constructs an instance with the given property values.
40      *
41      * @param maxDataChangeExecutorPoolSize
42      *            maximum thread pool size for the data change notification executor.
43      * @param maxDataChangeExecutorQueueSize
44      *            maximum queue size for the data change notification executor.
45      * @param maxDataChangeListenerQueueSize
46      *            maximum queue size for the data change listeners.
47      * @param maxDataStoreExecutorQueueSize
48      *            maximum queue size for the data store executor.
49      */
50     public static InMemoryDOMDataStoreConfigProperties create(int maxDataChangeExecutorPoolSize,
51             int maxDataChangeExecutorQueueSize, int maxDataChangeListenerQueueSize,
52             int maxDataStoreExecutorQueueSize) {
53         return new InMemoryDOMDataStoreConfigProperties(maxDataChangeExecutorPoolSize,
54                 maxDataChangeExecutorQueueSize, maxDataChangeListenerQueueSize,
55                 maxDataStoreExecutorQueueSize);
56     }
57
58     public static InMemoryDOMDataStoreConfigProperties create(int maxDataChangeExecutorPoolSize,
59             int maxDataChangeExecutorQueueSize, int maxDataChangeListenerQueueSize) {
60         return new InMemoryDOMDataStoreConfigProperties(maxDataChangeExecutorPoolSize,
61                 maxDataChangeExecutorQueueSize, maxDataChangeListenerQueueSize,
62                 DEFAULT_MAX_DATA_STORE_EXECUTOR_QUEUE_SIZE);
63     }
64
65     /**
66      * Returns the InMemoryDOMDataStoreConfigProperties instance with default values.
67      */
68     public static InMemoryDOMDataStoreConfigProperties getDefault() {
69         return DEFAULT;
70     }
71
72     private InMemoryDOMDataStoreConfigProperties(int maxDataChangeExecutorPoolSize,
73             int maxDataChangeExecutorQueueSize, int maxDataChangeListenerQueueSize,
74             int maxDataStoreExecutorQueueSize) {
75         this.maxDataChangeExecutorQueueSize = maxDataChangeExecutorQueueSize;
76         this.maxDataChangeExecutorPoolSize = maxDataChangeExecutorPoolSize;
77         this.maxDataChangeListenerQueueSize = maxDataChangeListenerQueueSize;
78         this.maxDataStoreExecutorQueueSize = maxDataStoreExecutorQueueSize;
79     }
80
81     /**
82      * Returns the maximum queue size for the data change notification executor.
83      */
84     public int getMaxDataChangeExecutorQueueSize() {
85         return maxDataChangeExecutorQueueSize;
86     }
87
88     /**
89      * Returns the maximum thread pool size for the data change notification executor.
90      */
91     public int getMaxDataChangeExecutorPoolSize() {
92         return maxDataChangeExecutorPoolSize;
93     }
94
95     /**
96      * Returns the maximum queue size for the data change listeners.
97      */
98     public int getMaxDataChangeListenerQueueSize() {
99         return maxDataChangeListenerQueueSize;
100     }
101
102     /**
103      * Returns the maximum queue size for the data store executor.
104      */
105     public int getMaxDataStoreExecutorQueueSize() {
106         return maxDataStoreExecutorQueueSize;
107     }
108 }