2 * Copyright (c) 2014 Brocade Communications 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
9 package org.opendaylight.controller.md.sal.dom.store.impl;
12 * Holds configuration properties when creating an {@link InMemoryDOMDataStore} instance via the
13 * {@link InMemoryDOMDataStoreFactory}
15 * @author Thomas Pantelis
16 * @see InMemoryDOMDataStoreFactory
18 public class InMemoryDOMDataStoreConfigProperties {
20 public static final int DEFAULT_MAX_DATA_CHANGE_EXECUTOR_QUEUE_SIZE = 1000;
21 public static final int DEFAULT_MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE = 20;
22 public static final int DEFAULT_MAX_DATA_CHANGE_LISTENER_QUEUE_SIZE = 1000;
24 private static final InMemoryDOMDataStoreConfigProperties DEFAULT =
25 create(DEFAULT_MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE,
26 DEFAULT_MAX_DATA_CHANGE_EXECUTOR_QUEUE_SIZE,
27 DEFAULT_MAX_DATA_CHANGE_LISTENER_QUEUE_SIZE);
29 private final int maxDataChangeExecutorQueueSize;
30 private final int maxDataChangeExecutorPoolSize;
31 private final int maxDataChangeListenerQueueSize;
34 * Constructs an instance with the given property values.
36 * @param maxDataChangeExecutorPoolSize
37 * maximum thread pool size for the data change notification executor.
38 * @param maxDataChangeExecutorQueueSize
39 * maximum queue size for the data change notification executor.
40 * @param maxDataChangeListenerQueueSize
41 * maximum queue size for the data change listeners.
43 public static InMemoryDOMDataStoreConfigProperties create(int maxDataChangeExecutorPoolSize,
44 int maxDataChangeExecutorQueueSize, int maxDataChangeListenerQueueSize) {
45 return new InMemoryDOMDataStoreConfigProperties(maxDataChangeExecutorPoolSize,
46 maxDataChangeExecutorQueueSize, maxDataChangeListenerQueueSize);
50 * Returns the InMemoryDOMDataStoreConfigProperties instance with default values.
52 public static InMemoryDOMDataStoreConfigProperties getDefault() {
56 private InMemoryDOMDataStoreConfigProperties(int maxDataChangeExecutorPoolSize,
57 int maxDataChangeExecutorQueueSize, int maxDataChangeListenerQueueSize) {
58 this.maxDataChangeExecutorQueueSize = maxDataChangeExecutorQueueSize;
59 this.maxDataChangeExecutorPoolSize = maxDataChangeExecutorPoolSize;
60 this.maxDataChangeListenerQueueSize = maxDataChangeListenerQueueSize;
64 * Returns the maximum queue size for the data change notification executor.
66 public int getMaxDataChangeExecutorQueueSize() {
67 return maxDataChangeExecutorQueueSize;
71 * Returns the maximum thread pool size for the data change notification executor.
73 public int getMaxDataChangeExecutorPoolSize() {
74 return maxDataChangeExecutorPoolSize;
78 * Returns the maximum queue size for the data change listeners.
80 public int getMaxDataChangeListenerQueueSize() {
81 return maxDataChangeListenerQueueSize;