@Component
@Scope(value="singleton")
public class SystemConfig
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
SystemConfig.RetentionPolicy |
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_THREAD_POOL_SIZE |
Constructor and Description |
---|
SystemConfig() |
Modifier and Type | Method and Description |
---|---|
SystemConfig |
deepCopyUpdatedConfig(SystemConfig updatedConfig)
Update the newConfig
|
int |
getAuditCleanupFrequencyInSec()
Get the reminder cleanup frequency for audit report cleanup.
|
LightningCoreConstants.HttpMethod |
getDefaultHTTPMethod()
Get the default HTTP for processing URL tasks.
|
RequestConfig |
getDefaultRequestConfig(LightningCoreConstants.HttpMethod method)
Get the default {code @RequestConfig} for the HTTP method.
|
java.util.Map<LightningCoreConstants.HttpMethod,RequestConfig> |
getDefaultRequestConfigMap()
Get the default {code @RequestConfig} map.
|
int |
getExecutorThreadPoolSize()
Get the pool size of the executor service.
|
int |
getMaxInetCacheSize()
Get the maximum
InetAddress cache size. |
int |
getMaxTaskCapacity()
Get the maximum capacity of the seed.
|
int |
getOldReservationCleanupReminderTimeInMillis()
Get the reminder frequency for cleaning up
ReservationReceipt . |
int |
getReservationResponseExpireTimeInSec()
Get the validity time of the
ReservationReceipt . |
SystemConfig.RetentionPolicy |
getRetentionPolicy()
Get the retention policy for audit reports.
|
int |
getTaskCapacityStress()
Get the maximum capacity stress percentage.
|
int |
getTimeToSleepBetweenEachQueueProcessInMillis()
Get the time to wait for polling request from queue for processing.
|
java.lang.String |
getUpdateSystemConfigStatusMsg() |
int |
getWorkerBatchSize()
Get the batch size for request processing.
|
boolean |
isLoadFromFile()
Check to load system configuration from file.
|
SystemConfig |
loadFromFile()
Initializes the
SystemConfig from the file. |
void |
setAuditCleanupFrequencyInSec(int auditCleanupFrequencyInSec)
Set the reminder cleanup frequency for audit report cleanup.
|
void |
setDefaultHTTPMethod(LightningCoreConstants.HttpMethod defaultHTTPMethod)
Set the default HTTP for processing URL tasks.
|
void |
setDefaultRequestConfigMap(java.util.Map<LightningCoreConstants.HttpMethod,RequestConfig> defaultRequestConfigMap)
Set the default {code @RequestConfig} map.
|
void |
setExecutorThreadPoolSize(int executorThreadPoolSize)
Set the pool size of the executor service.
|
void |
setLoadFromFile(boolean isLoadFromFile)
Set to load system configuration from file.
|
void |
setMaxInetCacheSize(int maxInetCacheSize)
Set the maximum
InetAddress cache size. |
void |
setMaxTaskCapacity(int maxTaskCapacity)
Set the maximum capacity of the seed.
|
void |
setOldReservationCleanupReminderTimeInMillis(int oldReservationCleanupReminderTimeInMillis)
Set the reminder frequency for cleaning up
ReservationReceipt . |
void |
setReservationResponseExpireTimeInSec(int reservationResponseExpireTimeInSec)
Set the validity time of the
ReservationReceipt . |
void |
setRetentionPolicy(SystemConfig.RetentionPolicy retentionPolicy)
Set the retention policy for audit reports.
|
void |
setTaskCapacityStress(int taskCapacityStress)
Set the maximum capacity stress percentage.
|
void |
setTimeToSleepBetweenEachQueueProcessInMillis(int timeToSleepBetweenEachQueueProcessInMillis)
Set the time to wait for polling request from queue for processing.
|
void |
setUpdateSystemConfigStatusMsg(java.lang.String updateSystemConfigStatusMsg) |
void |
setWorkerBatchSize(int workerBatchSize)
Set the batch size for request processing.
|
java.lang.String |
toString() |
SystemConfig |
updateSystemConfig(SystemConfig updatedConfig)
Clone the
SystemConfig . |
public static final int DEFAULT_THREAD_POOL_SIZE
public SystemConfig loadFromFile()
SystemConfig
from the file.public SystemConfig updateSystemConfig(SystemConfig updatedConfig)
SystemConfig
.updatedConfig
- the SystemConfig
to clonepublic SystemConfig deepCopyUpdatedConfig(SystemConfig updatedConfig)
updatedConfig
- the new config to updatepublic java.lang.String toString()
toString
in class java.lang.Object
public int getMaxTaskCapacity()
public void setMaxTaskCapacity(int maxTaskCapacity)
maxTaskCapacity
- the maximum capacity of the seedpublic int getTaskCapacityStress()
public void setTaskCapacityStress(int taskCapacityStress)
taskCapacityStress
- the maximum capacity stress percentagepublic int getMaxInetCacheSize()
InetAddress
cache size.public void setMaxInetCacheSize(int maxInetCacheSize)
InetAddress
cache size.maxInetCacheSize
- the maximum InetAddress cache sizepublic int getWorkerBatchSize()
public void setWorkerBatchSize(int workerBatchSize)
workerBatchSize
- the batch size for request processingpublic int getReservationResponseExpireTimeInSec()
ReservationReceipt
.public void setReservationResponseExpireTimeInSec(int reservationResponseExpireTimeInSec)
ReservationReceipt
.reservationResponseExpireTimeInSec
- the validity time of the ReservationReceiptpublic int getTimeToSleepBetweenEachQueueProcessInMillis()
public void setTimeToSleepBetweenEachQueueProcessInMillis(int timeToSleepBetweenEachQueueProcessInMillis)
timeToSleepBetweenEachQueueProcessInMillis
- the time to wait for polling request from queuepublic int getOldReservationCleanupReminderTimeInMillis()
ReservationReceipt
.public void setOldReservationCleanupReminderTimeInMillis(int oldReservationCleanupReminderTimeInMillis)
ReservationReceipt
.oldReservationCleanupReminderTimeInMillis
- the reminder frequency for cleaning reservationspublic int getExecutorThreadPoolSize()
public void setExecutorThreadPoolSize(int executorThreadPoolSize)
executorThreadPoolSize
- the pool size of the executor servicepublic int getAuditCleanupFrequencyInSec()
public void setAuditCleanupFrequencyInSec(int auditCleanupFrequencyInSec)
auditCleanupFrequencyInSec
- the reminder cleanup frequency for audit report cleanuppublic SystemConfig.RetentionPolicy getRetentionPolicy()
public void setRetentionPolicy(SystemConfig.RetentionPolicy retentionPolicy)
retentionPolicy
- the retention policy for audit reportspublic java.lang.String getUpdateSystemConfigStatusMsg()
public void setUpdateSystemConfigStatusMsg(java.lang.String updateSystemConfigStatusMsg)
public boolean isLoadFromFile()
public void setLoadFromFile(boolean isLoadFromFile)
isLoadFromFile
- load system configuration from filepublic LightningCoreConstants.HttpMethod getDefaultHTTPMethod()
public void setDefaultHTTPMethod(LightningCoreConstants.HttpMethod defaultHTTPMethod)
defaultHTTPMethod
- the default HTTP for processing URL taskspublic RequestConfig getDefaultRequestConfig(LightningCoreConstants.HttpMethod method)
method
- the HTTP methodpublic java.util.Map<LightningCoreConstants.HttpMethod,RequestConfig> getDefaultRequestConfigMap()
public void setDefaultRequestConfigMap(java.util.Map<LightningCoreConstants.HttpMethod,RequestConfig> defaultRequestConfigMap)
defaultRequestConfigMap
- the {code @RequestConfig} map