@@ -0,0 +1,1849 @@
+package com.github.aureliano.evtbridge.core.agent;%0A%0Aimport com.github.aureliano.evtbridge.core.config.IConfigOutput;%0Aimport com.github.aureliano.evtbridge.core.config.IConfiguration;%0Aimport com.github.aureliano.evtbridge.core.event.AfterWritingEvent;%0Aimport com.github.aureliano.evtbridge.core.event.BeforeWritingEvent;%0Aimport com.github.aureliano.evtbridge.core.formatter.IOutputFormatter;%0Aimport com.github.aureliano.evtbridge.core.listener.DataWritingListener;%0A%0Apublic abstract class AbstractDataWriter implements IDataWriter %7B%0A%0A%09protected IConfigOutput outputConfiguration;%0A%09%0A%09public AbstractDataWriter() %7B%0A%09%09super();%0A%09%7D%0A%09%0A%09@Override%0A%09public IConfigOutput getConfiguration() %7B%0A%09%09return outputConfiguration;%0A%09%7D%0A%0A%09@Override%0A%09public IDataWriter withConfiguration(IConfiguration configuration) %7B%0A%09%09this.outputConfiguration = (IConfigOutput) configuration;%0A%09%09return this;%0A%09%7D%0A%0A%09@Override%0A%09public Object parseEvent(String event) %7B%0A%09%09return this.outputConfiguration.getParser().parse(event);%0A%09%7D%0A%09%0A%09@Override%0A%09public boolean applyFilter(Object data) %7B%0A%09%09return this.outputConfiguration.getFilter().accept(data);%0A%09%7D%0A%09%0A%09@Override%0A%09public Object formatData(Object data) %7B%0A%09%09IOutputFormatter formatter = this.outputConfiguration.getOutputFormatter();%0A%09%09return (formatter == null) ? data : formatter.format(data);%0A%09%7D%0A%09%0A%09@Override%0A%09public void executeBeforeWritingListeners(Object data) %7B%0A%09%09for (DataWritingListener listener : this.outputConfiguration.getDataWritingListeners()) %7B%0A%09%09%09listener.beforeDataWriting(new BeforeWritingEvent(this.outputConfiguration, data));%0A%09%09%7D%0A%09%7D%0A%09%0A%09@Override%0A%09public void executeAfterWritingListeners(Object data, boolean accepeted) %7B%0A%09%09for (DataWritingListener listener : this.outputConfiguration.getDataWritingListeners()) %7B%0A%09%09%09listener.afterDataWriting(new AfterWritingEvent(this.outputConfiguration, accepeted, data));%0A%09%09%7D%0A%09%7D%0A%7D

Create abstract data writer.