Package org.fcrepo.config
Class OcflPropsConfig
- java.lang.Object
-
- org.fcrepo.config.OcflPropsConfig
-
@Configuration public class OcflPropsConfig extends Object
Fedora's OCFL related configuration properties- Since:
- 6.0.0
- Author:
- pwinckles
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_FCREPO_CONFIG_FILE_PROP_SOURCE
static String
DEFAULT_FCREPO_HOME_VALUE
static String
FCREPO_CONFIG_FILE_PROP_SOURCE
static String
FCREPO_HOME_PROPERTY
static String
FCREPO_OCFL_ROOT
static String
FCREPO_OCFL_STAGING
static String
FCREPO_OCFL_TEMP
-
Constructor Summary
Constructors Constructor Description OcflPropsConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Path
createDirectories(Path path)
String
getAwsAccessKey()
String
getAwsRegion()
String
getAwsSecretKey()
DigestAlgorithm
getDefaultDigestAlgorithm()
Path
getFedoraOcflStaging()
long
getFedoraToOcflCacheSize()
long
getFedoraToOcflCacheTimeout()
Path
getOcflRepoRoot()
String
getOcflS3Bucket()
String
getOcflS3Prefix()
Path
getOcflTemp()
long
getReindexBatchSize()
long
getReindexingThreads()
long
getResourceHeadersCacheExpireAfterSeconds()
long
getResourceHeadersCacheMaxSize()
String
getS3Endpoint()
Storage
getStorage()
boolean
isAutoVersioningEnabled()
boolean
isOcflS3DbEnabled()
boolean
isOcflUpgradeOnWrite()
boolean
isPathStyleAccessEnabled()
boolean
isReindexFailOnError()
boolean
isResourceHeadersCacheEnabled()
boolean
isUnsafeWriteEnabled()
When unsafe writes are enabled, the OCFL client does not calculate a digest for files that are added, and trusts the digest value that it's given.void
setAutoVersioningEnabled(boolean autoVersioningEnabled)
Determines whether or not new OCFL versions are created on every update.void
setAwsAccessKey(String awsAccessKey)
void
setAwsRegion(String awsRegion)
void
setAwsSecretKey(String awsSecretKey)
void
setFedoraOcflStaging(Path fedoraOcflStaging)
Sets the path to the Fedora staging directory -- should only be used for testing purposes.void
setOcflRepoRoot(Path ocflRepoRoot)
Sets the path to the Fedora OCFL root directory -- should only be used for testing purposes.void
setOcflS3Bucket(String ocflS3Bucket)
void
setOcflS3Prefix(String ocflS3Prefix)
void
setOcflTemp(Path ocflTemp)
Sets the path to the OCFL temp directory -- should only be used for testing purposes.void
setReindexBatchSize(long reindexBatchSize)
void
setReindexFailOnError(boolean reindexFailOnError)
void
setReindexingThreads(long threads)
void
setResourceHeadersCacheEnabled(boolean resourceHeadersCacheEnabled)
void
setResourceHeadersCacheExpireAfterSeconds(long resourceHeadersCacheExpireAfterSeconds)
void
setResourceHeadersCacheMaxSize(long resourceHeadersCacheMaxSize)
void
setStorage(Storage storage)
boolean
verifyInventory()
-
-
-
Field Detail
-
FCREPO_OCFL_STAGING
public static final String FCREPO_OCFL_STAGING
- See Also:
- Constant Field Values
-
FCREPO_OCFL_ROOT
public static final String FCREPO_OCFL_ROOT
- See Also:
- Constant Field Values
-
FCREPO_OCFL_TEMP
public static final String FCREPO_OCFL_TEMP
- See Also:
- Constant Field Values
-
FCREPO_HOME_PROPERTY
public static final String FCREPO_HOME_PROPERTY
- See Also:
- Constant Field Values
-
DEFAULT_FCREPO_HOME_VALUE
public static final String DEFAULT_FCREPO_HOME_VALUE
- See Also:
- Constant Field Values
-
DEFAULT_FCREPO_CONFIG_FILE_PROP_SOURCE
public static final String DEFAULT_FCREPO_CONFIG_FILE_PROP_SOURCE
- See Also:
- Constant Field Values
-
FCREPO_CONFIG_FILE_PROP_SOURCE
public static final String FCREPO_CONFIG_FILE_PROP_SOURCE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
OcflPropsConfig
public OcflPropsConfig()
-
-
Method Detail
-
getFedoraOcflStaging
public Path getFedoraOcflStaging()
- Returns:
- Path to directory Fedora stages resources before moving them into OCFL
-
setFedoraOcflStaging
public void setFedoraOcflStaging(Path fedoraOcflStaging)
Sets the path to the Fedora staging directory -- should only be used for testing purposes.- Parameters:
fedoraOcflStaging
- Path to Fedora staging directory
-
getOcflRepoRoot
public Path getOcflRepoRoot()
- Returns:
- Path to OCFL root directory
-
setOcflRepoRoot
public void setOcflRepoRoot(Path ocflRepoRoot)
Sets the path to the Fedora OCFL root directory -- should only be used for testing purposes.- Parameters:
ocflRepoRoot
- Path to Fedora OCFL root directory
-
getOcflTemp
public Path getOcflTemp()
- Returns:
- Path to the temp directory used by the OCFL client
-
setOcflTemp
public void setOcflTemp(Path ocflTemp)
Sets the path to the OCFL temp directory -- should only be used for testing purposes.- Parameters:
ocflTemp
- Path to OCFL temp directory
-
isAutoVersioningEnabled
public boolean isAutoVersioningEnabled()
- Returns:
- true if every update should create a new OCFL version; false if the mutable HEAD should be used
-
setAutoVersioningEnabled
public void setAutoVersioningEnabled(boolean autoVersioningEnabled)
Determines whether or not new OCFL versions are created on every update.- Parameters:
autoVersioningEnabled
- true to create new versions on every update
-
getStorage
public Storage getStorage()
- Returns:
- Indicates the storage type. ocfl-fs is the default
-
setStorage
public void setStorage(Storage storage)
- Parameters:
storage
- storage to use
-
getAwsAccessKey
public String getAwsAccessKey()
- Returns:
- the aws access key to use, may be null
-
setAwsAccessKey
public void setAwsAccessKey(String awsAccessKey)
- Parameters:
awsAccessKey
- the aws access key to use
-
getAwsSecretKey
public String getAwsSecretKey()
- Returns:
- the aws secret key to use, may be null
-
setAwsSecretKey
public void setAwsSecretKey(String awsSecretKey)
- Parameters:
awsSecretKey
- the aws secret key to use
-
getAwsRegion
public String getAwsRegion()
- Returns:
- the aws region to use, may be null
-
setAwsRegion
public void setAwsRegion(String awsRegion)
- Parameters:
awsRegion
- the aws region to use
-
getOcflS3Bucket
public String getOcflS3Bucket()
- Returns:
- the s3 bucket to store objects in
-
setOcflS3Bucket
public void setOcflS3Bucket(String ocflS3Bucket)
- Parameters:
ocflS3Bucket
- sets the s3 bucket to store objects in
-
getOcflS3Prefix
public String getOcflS3Prefix()
- Returns:
- the s3 prefix to store objects under, may be null
-
setOcflS3Prefix
public void setOcflS3Prefix(String ocflS3Prefix)
- Parameters:
ocflS3Prefix
- the prefix to store objects under
-
isResourceHeadersCacheEnabled
public boolean isResourceHeadersCacheEnabled()
- Returns:
- whether or not to enable the resource headers cache
-
setResourceHeadersCacheEnabled
public void setResourceHeadersCacheEnabled(boolean resourceHeadersCacheEnabled)
- Parameters:
resourceHeadersCacheEnabled
- whether or not to enable the resource headers cache
-
getResourceHeadersCacheMaxSize
public long getResourceHeadersCacheMaxSize()
- Returns:
- maximum number or resource headers in cache
-
setResourceHeadersCacheMaxSize
public void setResourceHeadersCacheMaxSize(long resourceHeadersCacheMaxSize)
- Parameters:
resourceHeadersCacheMaxSize
- maximum number of resource headers in cache
-
getResourceHeadersCacheExpireAfterSeconds
public long getResourceHeadersCacheExpireAfterSeconds()
- Returns:
- number of seconds to wait before expiring a resource header from the cache
-
setResourceHeadersCacheExpireAfterSeconds
public void setResourceHeadersCacheExpireAfterSeconds(long resourceHeadersCacheExpireAfterSeconds)
- Parameters:
resourceHeadersCacheExpireAfterSeconds
- number of seconds to wait before expiring a resource header from the cache
-
setReindexingThreads
public void setReindexingThreads(long threads)
- Parameters:
threads
- number of threads to use when rebuilding from Fedora OCFL on disk.
-
getReindexingThreads
public long getReindexingThreads()
- Returns:
- number of threads to use when rebuilding from Fedora OCFL on disk.
-
getReindexBatchSize
public long getReindexBatchSize()
- Returns:
- number of OCFL ids for a the reindexing manager to hand out at once.
-
setReindexBatchSize
public void setReindexBatchSize(long reindexBatchSize)
- Parameters:
reindexBatchSize
- number of OCFL ids for a the reindexing manager to hand out at once.
-
isReindexFailOnError
public boolean isReindexFailOnError()
- Returns:
- whether to stop the entire reindexing process if a single object fails.
-
setReindexFailOnError
public void setReindexFailOnError(boolean reindexFailOnError)
- Parameters:
reindexFailOnError
- whether to stop the entire reindexing process if a single object fails.
-
getDefaultDigestAlgorithm
public DigestAlgorithm getDefaultDigestAlgorithm()
- Returns:
- the configured OCFL digest algorithm
-
getS3Endpoint
public String getS3Endpoint()
- Returns:
- an optional custom s3 endpoint or null
-
isPathStyleAccessEnabled
public boolean isPathStyleAccessEnabled()
- Returns:
- true if path style S3 access should be used
-
isOcflS3DbEnabled
public boolean isOcflS3DbEnabled()
- Returns:
- true if the ocfl client should be configured to use a database when storing objects in S3
-
isUnsafeWriteEnabled
public boolean isUnsafeWriteEnabled()
When unsafe writes are enabled, the OCFL client does not calculate a digest for files that are added, and trusts the digest value that it's given. If this value is incorrect, the object will be corrupted.- Returns:
- true if objects should be written to OCFL using an "unsafe" write
-
getFedoraToOcflCacheSize
public long getFedoraToOcflCacheSize()
- Returns:
- Size of the fedoraToOcflIndex cache.
-
getFedoraToOcflCacheTimeout
public long getFedoraToOcflCacheTimeout()
- Returns:
- Time to cache expiration in minutes.
-
isOcflUpgradeOnWrite
public boolean isOcflUpgradeOnWrite()
- Returns:
- True to write new versions of OCFL on older objects, false to keep the original version.
-
verifyInventory
public boolean verifyInventory()
- Returns:
- True to verify inventory when performing OCFL operations
-
createDirectories
protected Path createDirectories(Path path) throws IOException
- Throws:
IOException
-
-