Package org.nuxeo.ecm.platform.audit.io
Class LogEntryJsonWriter
- java.lang.Object
-
- org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter<EntityType>
-
- org.nuxeo.ecm.core.io.marshallers.json.ExtensibleEntityJsonWriter<LogEntry>
-
- org.nuxeo.ecm.platform.audit.io.LogEntryJsonWriter
-
- All Implemented Interfaces:
Marshaller<LogEntry>
,Writer<LogEntry>
@Setup(mode=SINGLETON, priority=2000) public class LogEntryJsonWriter extends ExtensibleEntityJsonWriter<LogEntry>
ConvertLogEntry
to Json.This marshaller is enrichable: register class implementing
AbstractJsonEnricher
and managingLogEntry
.This marshaller is also extensible: extend it and simply override
ExtensibleEntityJsonWriter.extend(Object, JsonGenerator)
.Format is:
{ "entity-type":"logEntry", "category": "LOG_ENTRY_CATEGORY", "principalName": "LOG_ENTRY_PRINCIPAL", "comment": "LOG_ENTRY_COMMENT", "docLifeCycle": "DOC_LIFECYCLE", "docPath": "DOC_PATH", "docType": "DOC_TYPE", "docUUID": "DOC_UUID", "eventId": "EVENT_ID", "repositoryId": "REPO_ID", "eventDate": "LOG_EVENT_DATE", "logDate": "LOG_DATE" <-- contextParameters if there are enrichers activated <-- additional property provided by extend() method }
- Since:
- 7.2
-
-
Field Summary
Fields Modifier and Type Field Description static String
ENTITY_TYPE
-
Fields inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter
ctx, registry
-
-
Constructor Summary
Constructors Constructor Description LogEntryJsonWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
writeEntityBody(LogEntry logEntry, com.fasterxml.jackson.core.JsonGenerator jg)
Implement this method to write the entity body.protected void
writeExtendedInfo(com.fasterxml.jackson.core.JsonGenerator jg, String key, Serializable value)
protected void
writeExtendedInfos(com.fasterxml.jackson.core.JsonGenerator jg, LogEntry logEntry)
protected void
writeValues(com.fasterxml.jackson.core.JsonGenerator jg, String key, Serializable value)
-
Methods inherited from class org.nuxeo.ecm.core.io.marshallers.json.ExtensibleEntityJsonWriter
extend, write
-
Methods inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter
accept, getGenerator, write, writeEntity, writeEntity, writeEntityField, writeSerializable, writeSerializableField, writeSerializableListField, writeSerializableMapField
-
-
-
-
Field Detail
-
ENTITY_TYPE
public static final String ENTITY_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
writeEntityBody
protected void writeEntityBody(LogEntry logEntry, com.fasterxml.jackson.core.JsonGenerator jg) throws IOException
Description copied from class:ExtensibleEntityJsonWriter
Implement this method to write the entity body.- Specified by:
writeEntityBody
in classExtensibleEntityJsonWriter<LogEntry>
- Parameters:
logEntry
- The Java entity.jg
- AJsonGenerator
ready to write your entity as Json.- Throws:
IOException
-
writeExtendedInfos
protected void writeExtendedInfos(com.fasterxml.jackson.core.JsonGenerator jg, LogEntry logEntry) throws IOException
- Throws:
IOException
-
writeExtendedInfo
protected void writeExtendedInfo(com.fasterxml.jackson.core.JsonGenerator jg, String key, Serializable value) throws IOException
- Throws:
IOException
-
writeValues
protected void writeValues(com.fasterxml.jackson.core.JsonGenerator jg, String key, Serializable value) throws IOException
- Throws:
IOException
-
-