Package org.opencms.db.storage.policy
Class CmsDefaultStoragePolicy
java.lang.Object
org.opencms.db.storage.policy.CmsDefaultStoragePolicy
- All Implemented Interfaces:
I_CmsConfigurationParameterHandler,I_CmsStoragePolicy
public class CmsDefaultStoragePolicy
extends Object
implements I_CmsStoragePolicy, I_CmsConfigurationParameterHandler
Default content selection policy for the OpenCms deduplicating media storage engine (DMSE).
Content is stored in the active backend when its resource type ID is included in the configured selection and its size is strictly greater than the configured threshold. The defaults select all non-empty binary files and images (type IDs 2 and 3) with a threshold of 0 bytes.
This policy defines no path-based exceptions; matching resources below
/system/ are also selected. Content which does not match remains in the
regular VFS content columns (CMS_CONTENTS, CMS_OFFLINE_CONTENTS).
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default threshold, in bytes.static final StringThe resource type ids parameter name.static final StringThe threshold parameter name.Fields inherited from interface org.opencms.configuration.I_CmsConfigurationParameterHandler
ADD_PARAMETER_METHOD, INIT_CONFIGURATION_METHOD -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new policy with predefined default rules. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConfigurationParameter(String paramName, String paramValue) Adds a configuration parameter to this parameter configurable class instance.Returns the parameters of this configurable class instance, ornullif the class does not need any parameters.voidInitializes a configuration after all parameters have been added.booleanDetermines if the given content should be stored in the external storage.
-
Field Details
-
PARAM_RESOURCE_TYPE_IDS
The resource type ids parameter name.- See Also:
-
PARAM_THRESHOLD
The threshold parameter name.- See Also:
-
DEFAULT_THRESHOLD
The default threshold, in bytes. The default value stores all non-empty binary and image files externally.- See Also:
-
-
Constructor Details
-
CmsDefaultStoragePolicy
public CmsDefaultStoragePolicy()Creates a new policy with predefined default rules.
-
-
Method Details
-
addConfigurationParameter
Description copied from interface:I_CmsConfigurationParameterHandlerAdds a configuration parameter to this parameter configurable class instance.- Specified by:
addConfigurationParameterin interfaceI_CmsConfigurationParameterHandler- Parameters:
paramName- the name of the parameterparamValue- the value for the parameter- See Also:
-
getConfiguration
Description copied from interface:I_CmsConfigurationParameterHandlerReturns the parameters of this configurable class instance, ornullif the class does not need any parameters.- Specified by:
getConfigurationin interfaceI_CmsConfigurationParameterHandler- Returns:
- the parameters of this configurable class instance,
or
nullif the class does not need any parameters - See Also:
-
initConfiguration
Description copied from interface:I_CmsConfigurationParameterHandlerInitializes a configuration after all parameters have been added.- Specified by:
initConfigurationin interfaceI_CmsConfigurationParameterHandler- Throws:
CmsConfigurationException- if something goes wrong- See Also:
-
isExternalStorageRequired
Description copied from interface:I_CmsStoragePolicyDetermines if the given content should be stored in the external storage.- Specified by:
isExternalStorageRequiredin interfaceI_CmsStoragePolicy- Parameters:
context- the storage policy context- Returns:
trueif the file should be offloaded to the external storage,falseotherwise- See Also:
-