Package org.apache.jackrabbit.vfs.ext.ds
Class VFSDataStore
- java.lang.Object
-
- org.apache.jackrabbit.core.data.AbstractDataStore
-
- org.apache.jackrabbit.core.data.CachingDataStore
-
- org.apache.jackrabbit.vfs.ext.ds.VFSDataStore
-
- All Implemented Interfaces:
AsyncTouchCallback,AsyncUploadCallback,DataStore,MultiDataStoreAware
public class VFSDataStore extends CachingDataStore
Commons VFS based data store.
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.core.data.CachingDataStore
asyncDownloadCache, asyncTouchCache, backend, inUse, recLenCache, uploadRetryMap
-
Fields inherited from class org.apache.jackrabbit.core.data.AbstractDataStore
DIGEST
-
-
Constructor Summary
Constructors Constructor Description VFSDataStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the data storeprotected BackendcreateBackend()protected org.apache.commons.vfs2.FileSystemManagercreateFileSystemManager()Creates aFileSystemManagerinstance.protected org.apache.commons.vfs2.FileSystemOptionscreateFileSystemOptions()Builds and returnsFileSystemOptionsinstance which is used when resolving thebaseFolderduring the initialization.intgetAsyncWritePoolSize()Returns the pool size of the async write pool executor.org.apache.commons.vfs2.FileSystemManagergetFileSystemManager()Returns the VFSFileSystemManagerinstance used in this VFS data store.StringgetFileSystemManagerClassName()Returns the class name of the VFSFileSystemManagerinstance used in this VFS data store.org.apache.commons.vfs2.FileSystemOptionsgetFileSystemOptions()ReturnsFileSystemOptionsinstance used when resolving thebaseFolder.protected PropertiesgetFileSystemOptionsProperties()Returns properties used when building aFileSystemOptionsinstance by the properties during the initialization.protected StringgetMarkerFile()voidinit(String homeDir)Initialized the data store.voidsetAsyncWritePoolSize(int asyncWritePoolSize)Sets the pool size of the async write pool executor.voidsetBaseFolderUri(String baseFolderUri)Sets the base VFS folder URI.voidsetFileSystemManagerClassName(String fileSystemManagerClassName)Sets the class name of the VFSFileSystemManagerinstance used in this VFS data store.voidsetFileSystemOptions(org.apache.commons.vfs2.FileSystemOptions fileSystemOptions)Sets theFileSystemOptionsinstance used when resolving thebaseFolder.voidsetFileSystemOptionsProperties(Properties fileSystemOptionsProperties)Sets the properties used when building aFileSystemOptions, usingDelegatingFileSystemOptionsBuilder.voidsetFileSystemOptionsPropertiesInString(String fileSystemOptionsPropertiesInString)Sets the properties in a semi-colon delimited string used when building aFileSystemOptions, usingDelegatingFileSystemOptionsBuilder.-
Methods inherited from class org.apache.jackrabbit.core.data.CachingDataStore
addRecord, clearInUse, confirmDelete, deleteAllOlderThan, deleteFromCache, deleteRecord, getAllIdentifiers, getAsyncUploadLimit, getBackend, getCachePurgeResizeFactor, getCachePurgeTrigFactor, getCacheSize, getConcurrentUploadsThreads, getConfig, getLastModified, getLength, getMinRecordLength, getOrCreateReferenceKey, getPath, getPendingUploads, getRecord, getRecordIfStored, getUploadRetries, isContinueOnAsyncUploadFailure, isInUse, onAbort, onAbort, onFailure, onFailure, onSuccess, onSuccess, setAsyncUploadLimit, setCachePurgeResizeFactor, setCachePurgeTrigFactor, setCacheSize, setConcurrentUploadsThreads, setConfig, setContinueOnAsyncUploadFailure, setMinRecordLength, setPath, setProactiveCaching, setRecLengthCacheSize, setSecret, setTouchAsync, setUploadRetries, updateModifiedDateOnAccess
-
Methods inherited from class org.apache.jackrabbit.core.data.AbstractDataStore
encodeHexString, getRecordFromReference, getReferenceFromIdentifier
-
-
-
-
Method Detail
-
init
public void init(String homeDir) throws RepositoryException
Description copied from class:CachingDataStoreInitialized the data store. If the path is not set, <repository home>/repository/datastore is used. This directory is automatically created if it does not yet exist. During first initialization, it upload all files from local datastore to backed and local datastore act as a local cache.- Specified by:
initin interfaceDataStore- Overrides:
initin classCachingDataStore- Parameters:
homeDir- the home directory of the repository- Throws:
RepositoryException
-
close
public void close() throws DataStoreExceptionDescription copied from interface:DataStoreClose the data store- Specified by:
closein interfaceDataStore- Overrides:
closein classCachingDataStore- Throws:
DataStoreException- if a problem occurred
-
createBackend
protected Backend createBackend()
- Specified by:
createBackendin classCachingDataStore
-
getMarkerFile
protected String getMarkerFile()
- Specified by:
getMarkerFilein classCachingDataStore
-
getFileSystemManagerClassName
public String getFileSystemManagerClassName()
Returns the class name of the VFSFileSystemManagerinstance used in this VFS data store.- Returns:
-
setFileSystemManagerClassName
public void setFileSystemManagerClassName(String fileSystemManagerClassName)
Sets the class name of the VFSFileSystemManagerinstance used in this VFS data store. If this is not set, thenStandardFileSystemManageris used by default.- Parameters:
fileSystemManagerClassName-
-
getFileSystemManager
public org.apache.commons.vfs2.FileSystemManager getFileSystemManager()
Returns the VFSFileSystemManagerinstance used in this VFS data store.- Returns:
- the VFS
FileSystemManagerinstance used in this VFS data store
-
getFileSystemOptions
public org.apache.commons.vfs2.FileSystemOptions getFileSystemOptions() throws RepositoryExceptionReturnsFileSystemOptionsinstance used when resolving thebaseFolder. This may return null ifFileSystemOptionsinstance was not injected or afileSystemOptionsPropertiesinstance cannot be injected or created. Therefore, the caller should check whether or not this returns null. When returning null, the caller may not use aFileSystemOptionsinstance.- Returns:
FileSystemOptionsinstance used when resolving thebaseFolder- Throws:
RepositoryException
-
setFileSystemOptions
public void setFileSystemOptions(org.apache.commons.vfs2.FileSystemOptions fileSystemOptions)
Sets theFileSystemOptionsinstance used when resolving thebaseFolder.- Parameters:
fileSystemOptions-FileSystemOptionsinstance used when resolving thebaseFolder
-
setFileSystemOptionsProperties
public void setFileSystemOptionsProperties(Properties fileSystemOptionsProperties)
Sets the properties used when building aFileSystemOptions, usingDelegatingFileSystemOptionsBuilder.- Parameters:
fileSystemOptionsProperties- properties used when building aFileSystemOptions
-
setFileSystemOptionsPropertiesInString
public void setFileSystemOptionsPropertiesInString(String fileSystemOptionsPropertiesInString)
Sets the properties in a semi-colon delimited string used when building aFileSystemOptions, usingDelegatingFileSystemOptionsBuilder.- Parameters:
fileSystemOptionsPropertiesInString- properties in String
-
setBaseFolderUri
public void setBaseFolderUri(String baseFolderUri)
Sets the base VFS folder URI.- Parameters:
baseFolderUri- base VFS folder URI
-
getAsyncWritePoolSize
public int getAsyncWritePoolSize()
Returns the pool size of the async write pool executor.- Returns:
- the pool size of the async write pool executor
-
setAsyncWritePoolSize
public void setAsyncWritePoolSize(int asyncWritePoolSize)
Sets the pool size of the async write pool executor.- Parameters:
asyncWritePoolSize- pool size of the async write pool executor
-
createFileSystemManager
protected org.apache.commons.vfs2.FileSystemManager createFileSystemManager() throws RepositoryExceptionCreates aFileSystemManagerinstance.- Returns:
- a
FileSystemManagerinstance. - Throws:
RepositoryException- if an error occurs creating the manager.
-
createFileSystemOptions
protected org.apache.commons.vfs2.FileSystemOptions createFileSystemOptions() throws RepositoryExceptionBuilds and returnsFileSystemOptionsinstance which is used when resolving thebaseFolderduring the initialization. IffileSystemOptionsPropertiesis available, this scans all the property key names starting withFILE_SYSTEM_OPTIONS_PROP_PREFIXand uses the rest of the key name after theFILE_SYSTEM_OPTIONS_PROP_PREFIXas the combination of scheme and property name when building aFileSystemOptionsusingDelegatingFileSystemOptionsBuilder.- Returns:
FileSystemOptionsinstance which is used when resolving thebaseFolderduring the initialization- Throws:
RepositoryException- if any file system exception occurs
-
getFileSystemOptionsProperties
protected Properties getFileSystemOptionsProperties()
Returns properties used when building aFileSystemOptionsinstance by the properties during the initialization.- Returns:
- properties used when building a
FileSystemOptionsinstance by the properties during the initialization
-
-