Package com.logicaldoc.enterprise.storer
Class MultiStorer
java.lang.Object
com.logicaldoc.core.store.AbstractStorer
com.logicaldoc.enterprise.storer.MultiStorer
- All Implemented Interfaces:
com.logicaldoc.core.store.Storer
,Comparable<com.logicaldoc.core.store.Storer>
- Direct Known Subclasses:
ClusterStorer
public class MultiStorer
extends com.logicaldoc.core.store.AbstractStorer
This is a specialization of the Storer able to span the repository among
multiple storages. In a given time only one store is the write one and allow
for the store of newly created documents.
- Since:
- 6.1
- Author:
- Marco Meschieri - LogicalDOC
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(com.logicaldoc.core.store.Storer o) void
delete
(long docId) void
long
Encrypts all documents in whatever file-system based storage with encrypted flag activeboolean
byte[]
byte[]
com.logicaldoc.util.config.ContextProperties
int
getId()
List<com.logicaldoc.core.store.Storer>
long
void
init()
listResources
(long docId, String fileVersion) int
moveResourcesToStore
(long docId, int targetStorageId) void
setConfig
(com.logicaldoc.util.config.ContextProperties config) void
setId
(int id) long
void
void
store
(InputStream stream, long docId, String resource) boolean
test()
void
writeToFile
(long docId, String resource, File out) void
writeToStream
(long docId, String resource, OutputStream output) void
writeToStream
(long docId, String resource, OutputStream output, long start, long length) Methods inherited from class com.logicaldoc.core.store.AbstractStorer
destroy, equals, getResourceName, getResourceName, getStorerDefinitions, hashCode, isEnabled, newStorer, toString
-
Constructor Details
-
MultiStorer
public MultiStorer()
-
-
Method Details
-
encryptAll
public long encryptAll()Encrypts all documents in whatever file-system based storage with encrypted flag active- Returns:
- number of encrypted files
-
getTotalSize
public long getTotalSize() -
store
- Specified by:
store
in interfacecom.logicaldoc.core.store.Storer
- Overrides:
store
in classcom.logicaldoc.core.store.AbstractStorer
- Throws:
IOException
-
store
- Throws:
IOException
-
delete
-
delete
public void delete(long docId) -
size
-
exists
-
getStream
- Throws:
IOException
-
getBytes
- Throws:
IOException
-
getBytes
- Specified by:
getBytes
in interfacecom.logicaldoc.core.store.Storer
- Overrides:
getBytes
in classcom.logicaldoc.core.store.AbstractStorer
- Throws:
IOException
-
writeToFile
- Specified by:
writeToFile
in interfacecom.logicaldoc.core.store.Storer
- Overrides:
writeToFile
in classcom.logicaldoc.core.store.AbstractStorer
- Throws:
IOException
-
writeToStream
public void writeToStream(long docId, String resource, OutputStream output, long start, long length) throws IOException - Specified by:
writeToStream
in interfacecom.logicaldoc.core.store.Storer
- Overrides:
writeToStream
in classcom.logicaldoc.core.store.AbstractStorer
- Throws:
IOException
-
writeToStream
- Specified by:
writeToStream
in interfacecom.logicaldoc.core.store.Storer
- Overrides:
writeToStream
in classcom.logicaldoc.core.store.AbstractStorer
- Throws:
IOException
-
getString
- Specified by:
getString
in interfacecom.logicaldoc.core.store.Storer
- Overrides:
getString
in classcom.logicaldoc.core.store.AbstractStorer
-
listResources
-
getParameterNames
-
getConfig
public com.logicaldoc.util.config.ContextProperties getConfig()- Overrides:
getConfig
in classcom.logicaldoc.core.store.AbstractStorer
-
setConfig
public void setConfig(com.logicaldoc.util.config.ContextProperties config) - Overrides:
setConfig
in classcom.logicaldoc.core.store.AbstractStorer
-
compareTo
public int compareTo(com.logicaldoc.core.store.Storer o) - Specified by:
compareTo
in interfaceComparable<com.logicaldoc.core.store.Storer>
- Overrides:
compareTo
in classcom.logicaldoc.core.store.AbstractStorer
-
getId
public int getId()- Specified by:
getId
in interfacecom.logicaldoc.core.store.Storer
- Overrides:
getId
in classcom.logicaldoc.core.store.AbstractStorer
-
setId
public void setId(int id) - Specified by:
setId
in interfacecom.logicaldoc.core.store.Storer
- Overrides:
setId
in classcom.logicaldoc.core.store.AbstractStorer
-
getParameters
- Specified by:
getParameters
in interfacecom.logicaldoc.core.store.Storer
- Overrides:
getParameters
in classcom.logicaldoc.core.store.AbstractStorer
-
test
public boolean test()- Specified by:
test
in interfacecom.logicaldoc.core.store.Storer
- Overrides:
test
in classcom.logicaldoc.core.store.AbstractStorer
-
init
@PostConstruct public void init()- Specified by:
init
in interfacecom.logicaldoc.core.store.Storer
- Overrides:
init
in classcom.logicaldoc.core.store.AbstractStorer
-
moveResourcesToStore
- Throws:
IOException
-
getStorers
-