Class PropertiesModuleManager
- java.lang.Object
-
- com.marklogic.client.ext.helper.LoggingObject
-
- com.marklogic.client.ext.modulesloader.impl.PropertiesModuleManager
-
- All Implemented Interfaces:
ModulesManager
public class PropertiesModuleManager extends LoggingObject implements ModulesManager
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_FILE_PATH-
Fields inherited from class com.marklogic.client.ext.helper.LoggingObject
logger
-
-
Constructor Summary
Constructors Constructor Description PropertiesModuleManager()PropertiesModuleManager(java.lang.String propertiesFilePath)PropertiesModuleManager(java.lang.String propertiesFilePath, com.marklogic.client.DatabaseClient client)Use this constructor so that the keys generated for the properties file account for the host associated with the given DatabaseClient.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringbuildKey(java.io.File file)voiddeletePropertiesFile()java.lang.StringgetHost()booleanhasFileBeenModifiedSinceLastLoaded(java.io.File file)voidinitialize()Give the implementor a chance to initialize itself - e.g.protected java.lang.StringnormalizeDriveLetter(java.io.File file)Lower-casing avoids some annoying issues on Windows where sometimes you get "C:" at the start, and other times you get "c:".voidsaveLastLoadedTimestamp(java.io.File file, java.util.Date date)voidsetHost(java.lang.String host)voidsetMinimumFileTimestampToLoad(long minimumFileTimestampToLoad)-
Methods inherited from class com.marklogic.client.ext.helper.LoggingObject
format
-
-
-
-
Field Detail
-
DEFAULT_FILE_PATH
public static final java.lang.String DEFAULT_FILE_PATH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PropertiesModuleManager
public PropertiesModuleManager()
-
PropertiesModuleManager
public PropertiesModuleManager(java.lang.String propertiesFilePath)
-
PropertiesModuleManager
public PropertiesModuleManager(java.lang.String propertiesFilePath, com.marklogic.client.DatabaseClient client)Use this constructor so that the keys generated for the properties file account for the host associated with the given DatabaseClient.- Parameters:
propertiesFilePath-client-
-
-
Method Detail
-
initialize
public void initialize()
Description copied from interface:ModulesManagerGive the implementor a chance to initialize itself - e.g. loading data from a properties file or other resource.- Specified by:
initializein interfaceModulesManager
-
deletePropertiesFile
public void deletePropertiesFile()
-
hasFileBeenModifiedSinceLastLoaded
public boolean hasFileBeenModifiedSinceLastLoaded(java.io.File file)
- Specified by:
hasFileBeenModifiedSinceLastLoadedin interfaceModulesManager- Parameters:
file-- Returns:
- true if file has been modified
-
saveLastLoadedTimestamp
public void saveLastLoadedTimestamp(java.io.File file, java.util.Date date)- Specified by:
saveLastLoadedTimestampin interfaceModulesManager- Parameters:
file-date-
-
buildKey
protected java.lang.String buildKey(java.io.File file)
- Parameters:
file-- Returns:
- a string that can be used as a key for a Properties object
-
normalizeDriveLetter
protected java.lang.String normalizeDriveLetter(java.io.File file)
Lower-casing avoids some annoying issues on Windows where sometimes you get "C:" at the start, and other times you get "c:".- Parameters:
file-- Returns:
-
setMinimumFileTimestampToLoad
public void setMinimumFileTimestampToLoad(long minimumFileTimestampToLoad)
-
getHost
public java.lang.String getHost()
-
setHost
public void setHost(java.lang.String host)
-
-