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 String
repositoryName
protected String
rootPath
protected CoreSession
session
-
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 void
accept(DocumentMessage message)
Consume a message.void
begin()
Begin a batch of messages.void
close()
void
commit()
End of the batch message.protected Blob
getBlob(DocumentMessage message)
void
rollback()
Called when there is an exception duringConsumer.accept(Message)
orConsumer.commit()
.protected void
setDocumentProperties(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:
close
in interfaceAutoCloseable
- Overrides:
close
in classAbstractConsumer<DocumentMessage>
- Throws:
Exception
-
begin
public void begin()
Description copied from interface:Consumer
Begin a batch of messages.
-
accept
public void accept(DocumentMessage message)
Description copied from interface:Consumer
Consume a message.
-
getBlob
protected Blob getBlob(DocumentMessage message)
-
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()
.
-
setDocumentProperties
protected void setDocumentProperties(DocumentModel doc, Map<String,Serializable> properties)
-
-