Class DocumentMessageConsumer
- java.lang.Object
-
- org.nuxeo.lib.stream.pattern.consumer.AbstractConsumer<DocumentMessage>
-
- org.nuxeo.importer.stream.consumer.DocumentMessageConsumer
-
- All Implemented Interfaces:
AutoCloseable,Consumer<DocumentMessage>
public class DocumentMessageConsumer extends AbstractConsumer<DocumentMessage>
Consumes DocumentMessage and produce Nuxeo document.- Since:
- 9.1
-
-
Field Summary
Fields Modifier and Type Field Description protected StringrepositoryNameprotected StringrootPathprotected CoreSessionsession-
Fields inherited from class org.nuxeo.lib.stream.pattern.consumer.AbstractConsumer
consumerId
-
-
Constructor Summary
Constructors Constructor Description DocumentMessageConsumer(String consumerId, String repositoryName, String rootPath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(DocumentMessage message)Consume a message.voidbegin()Begin a batch of messages.voidclose()voidcommit()End of the batch message.protected BlobgetBlob(DocumentMessage message)voidrollback()Called when there is an exception duringConsumer.accept(Message)orConsumer.commit().protected voidsetDocumentProperties(DocumentModel doc, Map<String,Serializable> properties)-
Methods inherited from class org.nuxeo.lib.stream.pattern.consumer.AbstractConsumer
getConsumerId
-
-
-
-
Field Detail
-
rootPath
protected final String rootPath
-
repositoryName
protected final String repositoryName
-
session
protected CoreSession session
-
-
Method Detail
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classAbstractConsumer<DocumentMessage>- Throws:
Exception
-
begin
public void begin()
Description copied from interface:ConsumerBegin a batch of messages.
-
accept
public void accept(DocumentMessage message)
Description copied from interface:ConsumerConsume a message.
-
getBlob
protected Blob getBlob(DocumentMessage message)
-
commit
public void commit()
Description copied from interface:ConsumerEnd of the batch message.
-
rollback
public void rollback()
Description copied from interface:ConsumerCalled when there is an exception duringConsumer.accept(Message)orConsumer.commit().
-
setDocumentProperties
protected void setDocumentProperties(DocumentModel doc, Map<String,Serializable> properties)
-
-