Rework BindingRuntimeTypes
[mdsal.git] / dom / mdsal-dom-inmemory-datastore / src / main / java / org / opendaylight / mdsal / dom / store / inmemory / 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.mdsal.dom.store.inmemory;
9
10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
11 import javax.annotation.processing.Generated;
12 import org.eclipse.jdt.annotation.NonNull;
13 import org.immutables.value.Value;
14 import org.immutables.value.Value.Style.ImplementationVisibility;
15
16 /**
17  * Holds configuration properties when creating an {@link InMemoryDOMDataStore} instance via the
18  * {@link InMemoryDOMDataStoreFactory}.
19  *
20  * @author Thomas Pantelis
21  * @see InMemoryDOMDataStoreFactory
22  */
23 @Value.Immutable
24 @Value.Style(visibility = ImplementationVisibility.PRIVATE, allowedClasspathAnnotations = {
25     SuppressWarnings.class, Generated.class, SuppressFBWarnings.class,
26 })
27 public abstract class InMemoryDOMDataStoreConfigProperties {
28
29     public static final int DEFAULT_MAX_DATA_CHANGE_EXECUTOR_QUEUE_SIZE = 1000;
30     public static final int DEFAULT_MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE = 20;
31     public static final int DEFAULT_MAX_DATA_CHANGE_LISTENER_QUEUE_SIZE = 1000;
32     public static final int DEFAULT_MAX_DATA_STORE_EXECUTOR_QUEUE_SIZE = 5000;
33
34     private static final @NonNull InMemoryDOMDataStoreConfigProperties DEFAULT = builder().build();
35
36     /**
37      * Returns the InMemoryDOMDataStoreConfigProperties instance with default values.
38      *
39      * @return the InMemoryDOMDataStoreConfigProperties instance with default values.
40      */
41     public static @NonNull InMemoryDOMDataStoreConfigProperties getDefault() {
42         return DEFAULT;
43     }
44
45     /**
46      * Returns a new {@link InMemoryDOMDataStoreConfigPropertiesBuilder}.
47      *
48      * @return a new {@link InMemoryDOMDataStoreConfigPropertiesBuilder}.
49      */
50     public static @NonNull InMemoryDOMDataStoreConfigPropertiesBuilder builder() {
51         return new InMemoryDOMDataStoreConfigPropertiesBuilder();
52     }
53
54     /**
55      * Returns true if transaction allocation debugging should be enabled.
56      *
57      * @return true if transaction allocation debugging should be enabled.
58      */
59     @Value.Default
60     public boolean getDebugTransactions() {
61         return false;
62     }
63
64     /**
65      * Returns the maximum queue size for the data change notification executor.
66      *
67      * @return the maximum queue size for the data change notification executor.
68      */
69     @Value.Default
70     public int getMaxDataChangeExecutorQueueSize() {
71         return DEFAULT_MAX_DATA_CHANGE_EXECUTOR_QUEUE_SIZE;
72     }
73
74     /**
75      * Returns the maximum thread pool size for the data change notification executor.
76      *
77      * @return the maximum thread pool size for the data change notification executor.
78      */
79     @Value.Default
80     public int getMaxDataChangeExecutorPoolSize() {
81         return DEFAULT_MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE;
82     }
83
84     /**
85      * Returns the maximum queue size for the data change listeners.
86      */
87     @Value.Default
88     public int getMaxDataChangeListenerQueueSize() {
89         return DEFAULT_MAX_DATA_CHANGE_LISTENER_QUEUE_SIZE;
90     }
91
92     /**
93      * Returns the maximum queue size for the data store executor.
94      */
95     @Value.Default
96     public int getMaxDataStoreExecutorQueueSize() {
97         return DEFAULT_MAX_DATA_STORE_EXECUTOR_QUEUE_SIZE;
98     }
99 }