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>
Consumes DocumentMessage and produce Nuxeo document.
- Since:
- 9.1
-
Field Summary
Modifier and TypeFieldDescriptionprotected final String
protected final String
protected CoreSession
Fields inherited from class org.nuxeo.lib.stream.pattern.consumer.AbstractConsumer
consumerId
-
Constructor Summary
ConstructorDescriptionDocumentMessageConsumer
(String consumerId, String repositoryName, String rootPath) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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 Details
-
rootPath
-
repositoryName
-
session
-
-
Constructor Details
-
DocumentMessageConsumer
-
-
Method Details
-
close
- 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
Description copied from interface:Consumer
Consume a message. -
getBlob
-
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
-