Class BlobMessageConsumer
- java.lang.Object
-
- org.nuxeo.lib.stream.pattern.consumer.AbstractConsumer<BlobMessage>
-
- org.nuxeo.importer.stream.consumer.BlobMessageConsumer
-
- All Implemented Interfaces:
AutoCloseable
,Consumer<BlobMessage>
- Direct Known Subclasses:
BlobWatermarkMessageConsumer
public class BlobMessageConsumer extends AbstractConsumer<BlobMessage>
Import BlobMessage into a Nuxeo BlobProvider, persist BlobInformation.- Since:
- 9.1
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
BlobMessageConsumer.CloseableBlob
-
Field Summary
Fields Modifier and Type Field Description protected BlobInfoWriter
blobInfoWriter
protected BlobProvider
blobProvider
protected String
blobProviderName
-
Fields inherited from class org.nuxeo.lib.stream.pattern.consumer.AbstractConsumer
consumerId
-
-
Constructor Summary
Constructors Constructor Description BlobMessageConsumer(String consumerId, String blobProviderName, BlobInfoWriter blobInfoWriter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(BlobMessage message)
Consume a message.void
begin()
Begin a batch of messages.void
commit()
End of the batch message.protected BlobMessageConsumer.CloseableBlob
getBlob(BlobMessage message)
void
rollback()
Called when there is an exception duringConsumer.accept(Message)
orConsumer.commit()
.protected void
saveBlobInfo(BlobMessage message, String digest, long length, File blobFile)
-
Methods inherited from class org.nuxeo.lib.stream.pattern.consumer.AbstractConsumer
close, getConsumerId
-
-
-
-
Field Detail
-
blobProvider
protected BlobProvider blobProvider
-
blobProviderName
protected final String blobProviderName
-
blobInfoWriter
protected final BlobInfoWriter blobInfoWriter
-
-
Constructor Detail
-
BlobMessageConsumer
public BlobMessageConsumer(String consumerId, String blobProviderName, BlobInfoWriter blobInfoWriter)
-
-
Method Detail
-
begin
public void begin()
Description copied from interface:Consumer
Begin a batch of messages.
-
accept
public void accept(BlobMessage message)
Description copied from interface:Consumer
Consume a message.
-
getBlob
protected BlobMessageConsumer.CloseableBlob getBlob(BlobMessage message)
-
saveBlobInfo
protected void saveBlobInfo(BlobMessage message, String digest, long length, File blobFile)
-
commit
public void commit()
Description copied from interface:Consumer
End of the batch message.
-
rollback
public void rollback()
Description copied from interface:Consumer
Called when there is an exception duringConsumer.accept(Message)
orConsumer.commit()
.
-
-