Modifier and Type | Method and Description |
---|---|
static void |
addErrorMessage(ConfigChangeResult ccr,
LocalizableMessage message)
Adds the provided message to the provided config change result.
|
static void |
checkDBDirExistsOrCanCreate(File backendDir,
ConfigChangeResult ccr,
boolean cleanup)
Checks a directory exists or can actually be created.
|
static void |
checkDBDirPermissions(String dbDirPermissions,
Dn configDN,
ConfigChangeResult ccr)
Returns false if directory permissions in the configuration are invalid.
|
static Dn |
getBackendMonitorDn(PluggableBackendCfg cfg)
Returns the name of the monitor entry associated with the provided backend configuration.
|
static File |
getDBDirectory(String parentDbDirectory,
String backendId)
Returns a database directory file from the provided parent database directory and backendId.
|
static void |
removeStorageFiles(File backendDir)
Removes the storage files from the provided backend directory.
|
static void |
setDBDirPermissions(File backendDir,
String dbDirPermissions,
Dn configDN,
ConfigChangeResult ccr)
Sets files permissions on the backend directory.
|
static void |
setupStorageFiles(File backendDir,
String dbDirPermissions,
Dn configDN)
Ensure backendDir exists (creating it if not) and has the specified dbDirPermissions.
|
static StorageStatus |
statusWhenDiskSpaceFull(File directory,
long thresholdInBytes,
String backendId)
Creates a new unusable
StorageStatus for the disk full threshold. |
static StorageStatus |
statusWhenDiskSpaceLow(File directory,
long thresholdInBytes,
String backendId)
Creates a new locked down
StorageStatus for the disk low threshold. |
public static File getDBDirectory(String parentDbDirectory, String backendId)
parentDbDirectory
- the parent database directorybackendId
- the backend idpublic static void setupStorageFiles(File backendDir, String dbDirPermissions, Dn configDN) throws ConfigException
backendDir
- the backend directory where to set the storage filesdbDirPermissions
- the permissions to set for the database directoryconfigDN
- the backend configuration DNConfigException
- if configuration failspublic static void checkDBDirExistsOrCanCreate(File backendDir, ConfigChangeResult ccr, boolean cleanup)
backendDir
- the directory to check forccr
- the list of reasons to return upstream or null if called from setupStorage()cleanup
- true if the directory should be deleted after creationpublic static void checkDBDirPermissions(String dbDirPermissions, Dn configDN, ConfigChangeResult ccr)
dbDirPermissions
- the permissions to set for the database directoryconfigDN
- the backend configuration DNccr
- the current list of change resultspublic static void setDBDirPermissions(File backendDir, String dbDirPermissions, Dn configDN, ConfigChangeResult ccr)
backendDir
- the directory to setupdbDirPermissions
- the permissions to set for the database directoryconfigDN
- the backend configuration DNccr
- the current list of change resultspublic static void addErrorMessage(ConfigChangeResult ccr, LocalizableMessage message)
ccr
- the config change resultmessage
- the message to addpublic static void removeStorageFiles(File backendDir)
backendDir
- the backend directory where to remove storage filespublic static StorageStatus statusWhenDiskSpaceFull(File directory, long thresholdInBytes, String backendId)
StorageStatus
for the disk full threshold.directory
- the directory which reached the disk full thresholdthresholdInBytes
- the threshold in bytesbackendId
- the backend idStorageStatus
public static StorageStatus statusWhenDiskSpaceLow(File directory, long thresholdInBytes, String backendId)
StorageStatus
for the disk low threshold.directory
- the directory which reached the disk low thresholdthresholdInBytes
- the threshold in bytesbackendId
- the backend idStorageStatus
public static Dn getBackendMonitorDn(PluggableBackendCfg cfg)
cfg
- The backend configuration.Dn
representing the name of the monitor entry.Copyright 2010-2022 ForgeRock AS.