Package org.commonjava.indy.conf
Class DefaultIndyConfiguration
- java.lang.Object
-
- org.commonjava.indy.conf.DefaultIndyConfiguration
-
- All Implemented Interfaces:
IndyConfigInfo,IndyConfiguration,SystemPropertyProvider
@ApplicationScoped public class DefaultIndyConfiguration extends Object implements IndyConfiguration, IndyConfigInfo, SystemPropertyProvider
-
-
Field Summary
Fields Modifier and Type Field Description static StringCASSANDRA_NFC_PROVIDERstatic BooleanDEFAULT_ALLOW_REMOTE_LIST_DOWNLOADstatic intDEFAULT_CASSANDRA_KEYSPACE_REPLICASstatic StringDEFAULT_DISPOSABLE_STORE_PATTERNstatic intDEFAULT_FORKJOINPOOL_COMMON_PARALLELISMstatic intDEFAULT_NFC_EXPIRATION_SWEEP_MINUTESstatic intDEFAULT_NFC_MAX_RESULT_SET_SIZEstatic StringDEFAULT_NFC_PROVIDERstatic intDEFAULT_NOT_FOUND_CACHE_TIMEOUT_SECONDSstatic intDEFAULT_PASSTHROUGH_TIMEOUT_SECONDSstatic intDEFAULT_REMOTE_METADATA_TIMEOUT_SECONDSstatic intDEFAULT_REQUEST_TIMEOUT_SECONDSstatic BooleanDEFAULT_STANDALONEstatic intDEFAULT_STORE_DISABLE_TIMEOUT_SECONDSstatic BooleanDEFAULT_STORE_MANAGER_STANDALONEstatic BooleanDEFAULT_TIMEOUT_PROCESSINGstatic StringISPN_NFC_PROVIDER-
Fields inherited from interface org.commonjava.indy.conf.IndyConfigInfo
APPEND_DEFAULTS_TO_MAIN_CONF, CONF_INCLUDES_DIR
-
Fields inherited from interface org.commonjava.indy.conf.IndyConfiguration
PROP_NODE_ID
-
-
Constructor Summary
Constructors Constructor Description DefaultIndyConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAffectedGroupsExcludeFilter()StringgetCacheKeyspace()InputStreamgetDefaultConfig()The actual content which should be added to the default configuration file in case no configuration is provided, to allow modification of defaults in future executions.StringgetDefaultConfigFileName()The name of the file to be written in case no configuration is provided, to allow modification of defaults in future executions.StringgetDisposableStorePattern()Disposable stores can be deleted alone with its the content.intgetFileSystemContainingBatchSize()FileSystemContaining is an operation by which we get what path in which repository.intgetForkJoinPoolCommonParallelism()StringgetGACacheStorePattern()voidgetGACacheStorePattern(String gaCacheStorePattern)FilegetIndyConfDir()FilegetIndyHomeDir()intgetKeyspaceReplicas()The replication factor of cassandra keyspacesStringgetMdcHeaders()List of http headers to look for and include in the MDC.intgetNfcExpirationSweepMinutes()Number of minutes between sweeps of the NFC expiration reaper thread.intgetNfcMaxResultSetSize()Page size of NFC getMissing result setStringgetNfcProvider()StringgetNodeId()Retrieve the node identifier to be used when deploying in a clustered context.intgetNotFoundCacheTimeoutSeconds()Number of seconds before a negative cache (or, not-found cache) URL record will timeout.intgetPassthroughTimeoutSeconds()Number of seconds before the content in a repository marked as "pass-through" will timeout.intgetRemoteMetadataTimeoutSeconds()intgetRequestTimeoutSeconds()intgetStoreDisableTimeoutSeconds()PropertiesgetSystemPropertyAdditions()BooleanisAllowRemoteListDownload()booleanisClusterEnabled()booleanisRepositoryFilterEnabled()BooleanisStandalone()Let indy run standalone local mode, which will not enable cassandra path mapped storageBooleanisStoreManagerStandalone()Decide storeDataManager to run as standalone mode or cassandra modeBooleanisTimeoutProcessing()Is for PartyLine Cache Timeout ProcessingvoidsetAffectedGroupsExcludeFilter(String affectedGroupsExcludeFilter)voidsetAllowRemoteListDownload(Boolean allowRemoteListDownload)voidsetCacheKeyspace(String cacheKeyspace)voidsetClusterEnabled(Boolean clusterEnabled)voidsetDefaultNfcExpirationSweepMinutes(int minutes)voidsetDefaultNfcMaxResultSetSize(int size)voidsetDisposableStorePattern(String disposableStorePattern)voidsetFileSystemContainingBatchSize(int fileSystemContainingBatchSize)voidsetForkJoinPoolCommonParallelism(Integer forkJoinPoolCommonParallelism)voidsetKeyspaceReplicas(int keyspaceReplicas)voidsetMDCHeaders(String headers)voidsetNfcProvider(String nfcProvider)voidsetNodeId(String nodeId)voidsetNotFoundCacheTimeoutSeconds(int seconds)voidsetPassthroughTimeoutSeconds(int seconds)voidsetRemoteMetadataTimeoutSeconds(Integer remoteMetadataTimeoutSeconds)voidsetRepositoryFilterEnabled(boolean repositoryFilterEnabled)voidsetRequestTimeoutSeconds(Integer requestTimeoutSeconds)voidsetStandalone(Boolean standalone)voidsetStoreDisableTimeoutSeconds(Integer storeDisableTimeoutSeconds)voidsetStoreManagerStandalone(Boolean storeManagerStandalone)voidsetTimeoutProcessing(Boolean timeoutProcessing)
-
-
-
Field Detail
-
DEFAULT_PASSTHROUGH_TIMEOUT_SECONDS
public static final int DEFAULT_PASSTHROUGH_TIMEOUT_SECONDS
- See Also:
- Constant Field Values
-
DEFAULT_NOT_FOUND_CACHE_TIMEOUT_SECONDS
public static final int DEFAULT_NOT_FOUND_CACHE_TIMEOUT_SECONDS
- See Also:
- Constant Field Values
-
DEFAULT_REQUEST_TIMEOUT_SECONDS
public static final int DEFAULT_REQUEST_TIMEOUT_SECONDS
- See Also:
- Constant Field Values
-
DEFAULT_STORE_DISABLE_TIMEOUT_SECONDS
public static final int DEFAULT_STORE_DISABLE_TIMEOUT_SECONDS
- See Also:
- Constant Field Values
-
DEFAULT_NFC_EXPIRATION_SWEEP_MINUTES
public static final int DEFAULT_NFC_EXPIRATION_SWEEP_MINUTES
- See Also:
- Constant Field Values
-
DEFAULT_NFC_MAX_RESULT_SET_SIZE
public static final int DEFAULT_NFC_MAX_RESULT_SET_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_ALLOW_REMOTE_LIST_DOWNLOAD
public static final Boolean DEFAULT_ALLOW_REMOTE_LIST_DOWNLOAD
-
DEFAULT_REMOTE_METADATA_TIMEOUT_SECONDS
public static final int DEFAULT_REMOTE_METADATA_TIMEOUT_SECONDS
- See Also:
- Constant Field Values
-
DEFAULT_FORKJOINPOOL_COMMON_PARALLELISM
public static final int DEFAULT_FORKJOINPOOL_COMMON_PARALLELISM
- See Also:
- Constant Field Values
-
ISPN_NFC_PROVIDER
public static final String ISPN_NFC_PROVIDER
- See Also:
- Constant Field Values
-
CASSANDRA_NFC_PROVIDER
public static final String CASSANDRA_NFC_PROVIDER
- See Also:
- Constant Field Values
-
DEFAULT_NFC_PROVIDER
public static final String DEFAULT_NFC_PROVIDER
- See Also:
- Constant Field Values
-
DEFAULT_STANDALONE
public static final Boolean DEFAULT_STANDALONE
-
DEFAULT_TIMEOUT_PROCESSING
public static final Boolean DEFAULT_TIMEOUT_PROCESSING
-
DEFAULT_STORE_MANAGER_STANDALONE
public static final Boolean DEFAULT_STORE_MANAGER_STANDALONE
-
DEFAULT_DISPOSABLE_STORE_PATTERN
public static final String DEFAULT_DISPOSABLE_STORE_PATTERN
- See Also:
- Constant Field Values
-
DEFAULT_CASSANDRA_KEYSPACE_REPLICAS
public static final int DEFAULT_CASSANDRA_KEYSPACE_REPLICAS
- See Also:
- Constant Field Values
-
-
Method Detail
-
getNodeId
public String getNodeId()
Description copied from interface:IndyConfigurationRetrieve the node identifier to be used when deploying in a clustered context.- Specified by:
getNodeIdin interfaceIndyConfiguration
-
setNodeId
public void setNodeId(String nodeId)
-
getPassthroughTimeoutSeconds
public int getPassthroughTimeoutSeconds()
Description copied from interface:IndyConfigurationNumber of seconds before the content in a repository marked as "pass-through" will timeout. Pass-through remote repos are designed to hold content for a minimal amount of time. They would be a simple pass-through, non-caching proxy, but in reality artifacts are usually referenced more than once from any given build. So, setting a very low pass-through timeout for content in these repositories helps to cut down on traffic to the upstream repository.- Specified by:
getPassthroughTimeoutSecondsin interfaceIndyConfiguration
-
setPassthroughTimeoutSeconds
public void setPassthroughTimeoutSeconds(int seconds)
-
getNfcProvider
public String getNfcProvider()
- Specified by:
getNfcProviderin interfaceIndyConfiguration
-
setNfcProvider
public void setNfcProvider(String nfcProvider)
-
setNotFoundCacheTimeoutSeconds
public void setNotFoundCacheTimeoutSeconds(int seconds)
-
setMDCHeaders
public void setMDCHeaders(String headers)
-
getMdcHeaders
public String getMdcHeaders()
Description copied from interface:IndyConfigurationList of http headers to look for and include in the MDC.- Specified by:
getMdcHeadersin interfaceIndyConfiguration
-
getNotFoundCacheTimeoutSeconds
public int getNotFoundCacheTimeoutSeconds()
Description copied from interface:IndyConfigurationNumber of seconds before a negative cache (or, not-found cache) URL record will timeout. These are used to prevent constant re-request for URLs that have been known to fail for one reason or another (ranging from 404's to 500's, to just about anything else that's not HTTP 200, 301, or 302). This value can be tuned based on use case, but for most people it should be relatively high.
Also, the NFC (Not-Found Cache) can be maintained manually via the UI.- Specified by:
getNotFoundCacheTimeoutSecondsin interfaceIndyConfiguration
-
getRequestTimeoutSeconds
public int getRequestTimeoutSeconds()
- Specified by:
getRequestTimeoutSecondsin interfaceIndyConfiguration
-
setRequestTimeoutSeconds
public void setRequestTimeoutSeconds(Integer requestTimeoutSeconds)
-
getStoreDisableTimeoutSeconds
public int getStoreDisableTimeoutSeconds()
- Specified by:
getStoreDisableTimeoutSecondsin interfaceIndyConfiguration
-
setDefaultNfcExpirationSweepMinutes
public void setDefaultNfcExpirationSweepMinutes(int minutes)
-
setDefaultNfcMaxResultSetSize
public void setDefaultNfcMaxResultSetSize(int size)
-
getNfcExpirationSweepMinutes
public int getNfcExpirationSweepMinutes()
Description copied from interface:IndyConfigurationNumber of minutes between sweeps of the NFC expiration reaper thread.- Specified by:
getNfcExpirationSweepMinutesin interfaceIndyConfiguration
-
getNfcMaxResultSetSize
public int getNfcMaxResultSetSize()
Description copied from interface:IndyConfigurationPage size of NFC getMissing result set- Specified by:
getNfcMaxResultSetSizein interfaceIndyConfiguration
-
getIndyHomeDir
public File getIndyHomeDir()
- Specified by:
getIndyHomeDirin interfaceIndyConfiguration
-
getIndyConfDir
public File getIndyConfDir()
- Specified by:
getIndyConfDirin interfaceIndyConfiguration
-
isAllowRemoteListDownload
public Boolean isAllowRemoteListDownload()
- Specified by:
isAllowRemoteListDownloadin interfaceIndyConfiguration
-
setAllowRemoteListDownload
public void setAllowRemoteListDownload(Boolean allowRemoteListDownload)
-
getDisposableStorePattern
public String getDisposableStorePattern()
Description copied from interface:IndyConfigurationDisposable stores can be deleted alone with its the content. It serves as a safe guard because mis-deleted repo definition can be restored but mis-deleted content can not.- Specified by:
getDisposableStorePatternin interfaceIndyConfiguration
-
setDisposableStorePattern
public void setDisposableStorePattern(String disposableStorePattern)
-
setStoreDisableTimeoutSeconds
public void setStoreDisableTimeoutSeconds(Integer storeDisableTimeoutSeconds)
-
getRemoteMetadataTimeoutSeconds
public int getRemoteMetadataTimeoutSeconds()
- Specified by:
getRemoteMetadataTimeoutSecondsin interfaceIndyConfiguration
-
getForkJoinPoolCommonParallelism
public int getForkJoinPoolCommonParallelism()
- Specified by:
getForkJoinPoolCommonParallelismin interfaceIndyConfiguration
-
isClusterEnabled
public boolean isClusterEnabled()
- Specified by:
isClusterEnabledin interfaceIndyConfiguration
-
setCacheKeyspace
public void setCacheKeyspace(String cacheKeyspace)
-
getCacheKeyspace
public String getCacheKeyspace()
- Specified by:
getCacheKeyspacein interfaceIndyConfiguration
-
setClusterEnabled
public void setClusterEnabled(Boolean clusterEnabled)
-
setForkJoinPoolCommonParallelism
public void setForkJoinPoolCommonParallelism(Integer forkJoinPoolCommonParallelism)
-
setRemoteMetadataTimeoutSeconds
public void setRemoteMetadataTimeoutSeconds(Integer remoteMetadataTimeoutSeconds)
-
getAffectedGroupsExcludeFilter
public String getAffectedGroupsExcludeFilter()
- Specified by:
getAffectedGroupsExcludeFilterin interfaceIndyConfiguration
-
setAffectedGroupsExcludeFilter
public void setAffectedGroupsExcludeFilter(String affectedGroupsExcludeFilter)
-
getFileSystemContainingBatchSize
public int getFileSystemContainingBatchSize()
Description copied from interface:IndyConfigurationFileSystemContaining is an operation by which we get what path in which repository. We use batching to limit the query candidates size to avoid huge 'IN' query.- Specified by:
getFileSystemContainingBatchSizein interfaceIndyConfiguration- Returns:
-
setFileSystemContainingBatchSize
public void setFileSystemContainingBatchSize(int fileSystemContainingBatchSize)
-
isStandalone
public Boolean isStandalone()
Description copied from interface:IndyConfigurationLet indy run standalone local mode, which will not enable cassandra path mapped storage- Specified by:
isStandalonein interfaceIndyConfiguration- Returns:
-
isStoreManagerStandalone
public Boolean isStoreManagerStandalone()
Description copied from interface:IndyConfigurationDecide storeDataManager to run as standalone mode or cassandra mode- Specified by:
isStoreManagerStandalonein interfaceIndyConfiguration- Returns:
-
setRepositoryFilterEnabled
public void setRepositoryFilterEnabled(boolean repositoryFilterEnabled)
-
isRepositoryFilterEnabled
public boolean isRepositoryFilterEnabled()
- Specified by:
isRepositoryFilterEnabledin interfaceIndyConfiguration
-
isTimeoutProcessing
public Boolean isTimeoutProcessing()
Description copied from interface:IndyConfigurationIs for PartyLine Cache Timeout Processing- Specified by:
isTimeoutProcessingin interfaceIndyConfiguration- Returns:
-
getGACacheStorePattern
public void getGACacheStorePattern(String gaCacheStorePattern)
-
getGACacheStorePattern
public String getGACacheStorePattern()
- Specified by:
getGACacheStorePatternin interfaceIndyConfiguration
-
setStandalone
public void setStandalone(Boolean standalone)
-
setStoreManagerStandalone
public void setStoreManagerStandalone(Boolean storeManagerStandalone)
-
getKeyspaceReplicas
public int getKeyspaceReplicas()
Description copied from interface:IndyConfigurationThe replication factor of cassandra keyspaces- Specified by:
getKeyspaceReplicasin interfaceIndyConfiguration- Returns:
-
setKeyspaceReplicas
public void setKeyspaceReplicas(int keyspaceReplicas)
-
setTimeoutProcessing
public void setTimeoutProcessing(Boolean timeoutProcessing)
-
getDefaultConfigFileName
public String getDefaultConfigFileName()
Description copied from interface:IndyConfigInfoThe name of the file to be written in case no configuration is provided, to allow modification of defaults in future executions.- Specified by:
getDefaultConfigFileNamein interfaceIndyConfigInfo- Returns:
- a filename, of the form *.conf (unless it's 'main.conf', in which case it'll be appended to the main config file), which will be written to the etc/indy/conf.d directory.
-
getDefaultConfig
public InputStream getDefaultConfig()
Description copied from interface:IndyConfigInfoThe actual content which should be added to the default configuration file in case no configuration is provided, to allow modification of defaults in future executions.- Specified by:
getDefaultConfigin interfaceIndyConfigInfo- Returns:
- The content, usually as a result of loading Thread.currentThread().getContextClassLoader().getResourceAsStream("foo")
-
getSystemPropertyAdditions
public Properties getSystemPropertyAdditions()
- Specified by:
getSystemPropertyAdditionsin interfaceSystemPropertyProvider
-
-