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 void
close()
Close the data storeprotected Backend
createBackend()
protected org.apache.commons.vfs2.FileSystemManager
createFileSystemManager()
Creates aFileSystemManager
instance.protected org.apache.commons.vfs2.FileSystemOptions
createFileSystemOptions()
Builds and returnsFileSystemOptions
instance which is used when resolving thebaseFolder
during the initialization.int
getAsyncWritePoolSize()
Returns the pool size of the async write pool executor.org.apache.commons.vfs2.FileSystemManager
getFileSystemManager()
Returns the VFSFileSystemManager
instance used in this VFS data store.String
getFileSystemManagerClassName()
Returns the class name of the VFSFileSystemManager
instance used in this VFS data store.org.apache.commons.vfs2.FileSystemOptions
getFileSystemOptions()
ReturnsFileSystemOptions
instance used when resolving thebaseFolder
.protected Properties
getFileSystemOptionsProperties()
Returns properties used when building aFileSystemOptions
instance by the properties during the initialization.protected String
getMarkerFile()
void
init(String homeDir)
Initialized the data store.void
setAsyncWritePoolSize(int asyncWritePoolSize)
Sets the pool size of the async write pool executor.void
setBaseFolderUri(String baseFolderUri)
Sets the base VFS folder URI.void
setFileSystemManagerClassName(String fileSystemManagerClassName)
Sets the class name of the VFSFileSystemManager
instance used in this VFS data store.void
setFileSystemOptions(org.apache.commons.vfs2.FileSystemOptions fileSystemOptions)
Sets theFileSystemOptions
instance used when resolving thebaseFolder
.void
setFileSystemOptionsProperties(Properties fileSystemOptionsProperties)
Sets the properties used when building aFileSystemOptions
, usingDelegatingFileSystemOptionsBuilder
.void
setFileSystemOptionsPropertiesInString(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:CachingDataStore
Initialized 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:
init
in interfaceDataStore
- Overrides:
init
in classCachingDataStore
- Parameters:
homeDir
- the home directory of the repository- Throws:
RepositoryException
-
close
public void close() throws DataStoreException
Description copied from interface:DataStore
Close the data store- Specified by:
close
in interfaceDataStore
- Overrides:
close
in classCachingDataStore
- Throws:
DataStoreException
- if a problem occurred
-
createBackend
protected Backend createBackend()
- Specified by:
createBackend
in classCachingDataStore
-
getMarkerFile
protected String getMarkerFile()
- Specified by:
getMarkerFile
in classCachingDataStore
-
getFileSystemManagerClassName
public String getFileSystemManagerClassName()
Returns the class name of the VFSFileSystemManager
instance used in this VFS data store.- Returns:
-
setFileSystemManagerClassName
public void setFileSystemManagerClassName(String fileSystemManagerClassName)
Sets the class name of the VFSFileSystemManager
instance used in this VFS data store. If this is not set, thenStandardFileSystemManager
is used by default.- Parameters:
fileSystemManagerClassName
-
-
getFileSystemManager
public org.apache.commons.vfs2.FileSystemManager getFileSystemManager()
Returns the VFSFileSystemManager
instance used in this VFS data store.- Returns:
- the VFS
FileSystemManager
instance used in this VFS data store
-
getFileSystemOptions
public org.apache.commons.vfs2.FileSystemOptions getFileSystemOptions() throws RepositoryException
ReturnsFileSystemOptions
instance used when resolving thebaseFolder
. This may return null ifFileSystemOptions
instance was not injected or afileSystemOptionsProperties
instance cannot be injected or created. Therefore, the caller should check whether or not this returns null. When returning null, the caller may not use aFileSystemOptions
instance.- Returns:
FileSystemOptions
instance used when resolving thebaseFolder
- Throws:
RepositoryException
-
setFileSystemOptions
public void setFileSystemOptions(org.apache.commons.vfs2.FileSystemOptions fileSystemOptions)
Sets theFileSystemOptions
instance used when resolving thebaseFolder
.- Parameters:
fileSystemOptions
-FileSystemOptions
instance 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 RepositoryException
Creates aFileSystemManager
instance.- Returns:
- a
FileSystemManager
instance. - Throws:
RepositoryException
- if an error occurs creating the manager.
-
createFileSystemOptions
protected org.apache.commons.vfs2.FileSystemOptions createFileSystemOptions() throws RepositoryException
Builds and returnsFileSystemOptions
instance which is used when resolving thebaseFolder
during the initialization. IffileSystemOptionsProperties
is available, this scans all the property key names starting withFILE_SYSTEM_OPTIONS_PROP_PREFIX
and uses the rest of the key name after theFILE_SYSTEM_OPTIONS_PROP_PREFIX
as the combination of scheme and property name when building aFileSystemOptions
usingDelegatingFileSystemOptionsBuilder
.- Returns:
FileSystemOptions
instance which is used when resolving thebaseFolder
during the initialization- Throws:
RepositoryException
- if any file system exception occurs
-
getFileSystemOptionsProperties
protected Properties getFileSystemOptionsProperties()
Returns properties used when building aFileSystemOptions
instance by the properties during the initialization.- Returns:
- properties used when building a
FileSystemOptions
instance by the properties during the initialization
-
-