Package com.logicaldoc.enterprise.storer
Class ClusterStorer
- java.lang.Object
-
- com.logicaldoc.core.store.AbstractStorer
-
- com.logicaldoc.enterprise.storer.MultiStorer
-
- com.logicaldoc.enterprise.storer.ClusterStorer
-
- All Implemented Interfaces:
com.logicaldoc.core.store.Storer
,PayloadHandler
,Comparable<com.logicaldoc.core.store.Storer>
public class ClusterStorer extends MultiStorer implements PayloadHandler
A cluster-aware storer that is able to retrieve documents located in other nodes in the same cluster.- Since:
- 8.7.4
- Author:
- Marco Meschieri - LogicalDOC
-
-
Constructor Summary
Constructors Constructor Description ClusterStorer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete(long docId)
void
delete(long docId, String resource)
boolean
exists(long docId, String resource)
byte[]
getBytes(long docId, String resource)
byte[]
getBytes(long docId, String resource, long start, long length)
InputStream
getStream(long docId, String resource)
String
getString(long docId, String resource)
Object
handle(Payload payload)
Invoked when a new message arrives from the cluster.void
init()
Initializes the storers listList<String>
listResources(long docId, String fileVersion)
long
size(long docId, String resource)
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.enterprise.storer.MultiStorer
compareTo, encryptAll, getConfig, getId, getParameterNames, getParameters, getStorers, getTotalSize, moveResourcesToStore, setConfig, setId, store, store, test
-
-
-
-
Method Detail
-
exists
public boolean exists(long docId, String resource)
- Specified by:
exists
in interfacecom.logicaldoc.core.store.Storer
- Overrides:
exists
in classMultiStorer
-
getBytes
public byte[] getBytes(long docId, String resource, long start, long length) throws IOException
- Specified by:
getBytes
in interfacecom.logicaldoc.core.store.Storer
- Overrides:
getBytes
in classMultiStorer
- Throws:
IOException
-
getBytes
public byte[] getBytes(long docId, String resource) throws IOException
- Specified by:
getBytes
in interfacecom.logicaldoc.core.store.Storer
- Overrides:
getBytes
in classMultiStorer
- Throws:
IOException
-
getStream
public InputStream getStream(long docId, String resource) throws IOException
- Specified by:
getStream
in interfacecom.logicaldoc.core.store.Storer
- Overrides:
getStream
in classMultiStorer
- Throws:
IOException
-
writeToFile
public void writeToFile(long docId, String resource, File out) throws IOException
- Specified by:
writeToFile
in interfacecom.logicaldoc.core.store.Storer
- Overrides:
writeToFile
in classMultiStorer
- 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 classMultiStorer
- Throws:
IOException
-
writeToStream
public void writeToStream(long docId, String resource, OutputStream output) throws IOException
- Specified by:
writeToStream
in interfacecom.logicaldoc.core.store.Storer
- Overrides:
writeToStream
in classMultiStorer
- Throws:
IOException
-
size
public long size(long docId, String resource)
- Specified by:
size
in interfacecom.logicaldoc.core.store.Storer
- Overrides:
size
in classMultiStorer
-
delete
public void delete(long docId, String resource)
- Specified by:
delete
in interfacecom.logicaldoc.core.store.Storer
- Overrides:
delete
in classMultiStorer
-
delete
public void delete(long docId)
- Specified by:
delete
in interfacecom.logicaldoc.core.store.Storer
- Overrides:
delete
in classMultiStorer
-
getString
public String getString(long docId, String resource)
- Specified by:
getString
in interfacecom.logicaldoc.core.store.Storer
- Overrides:
getString
in classMultiStorer
-
listResources
public List<String> listResources(long docId, String fileVersion)
- Specified by:
listResources
in interfacecom.logicaldoc.core.store.Storer
- Overrides:
listResources
in classMultiStorer
-
handle
public Object handle(Payload payload) throws Exception
Description copied from interface:PayloadHandler
Invoked when a new message arrives from the cluster.- Specified by:
handle
in interfacePayloadHandler
- Parameters:
payload
- Payload to be processed- Returns:
- The response to the received message
- Throws:
Exception
- a generic error
-
init
public void init()
Description copied from class:MultiStorer
Initializes the storers list- Specified by:
init
in interfacecom.logicaldoc.core.store.Storer
- Overrides:
init
in classMultiStorer
-
-