<commit_before>package at.ac.ait.ubicity.commons.broker.events;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import at.ac.ait.ubicity.commons.exceptions.UbicityException;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

public class EventEntry implements Serializable {
	private static final long serialVersionUID = -5123460570794468542L;

	private static Gson gson = new GsonBuilder().create();

	public enum Property {
		ID, PLUGIN_CHAIN, // manatory broker properties
		ES_INDEX, ES_TYPE, // Elasticsearch properties
		CB_BUCKET // Couchbase properties
	}

	private HashMap<Property, String> header = new HashMap<Property, String>();
	/**
	 * List of destinations for processing in successive order.
	 */
	private List<String> pluginChain = new ArrayList<String>();
	private String body;

	public EventEntry(HashMap<Property, String> header, String body) throws UbicityException {
		init(header, body);
	}

	public EventEntry(String jsonString) throws UbicityException {
		EventEntry e = gson.fromJson(jsonString, this.getClass());
		init(e.header, e.body);
	}

	@SuppressWarnings("unchecked")
	private void init(HashMap<Property, String> header, String body) {<commit_msg>set pluginChain object volatile (no serialization)<commit_after>package at.ac.ait.ubicity.commons.broker.events;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import at.ac.ait.ubicity.commons.exceptions.UbicityException;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

public class EventEntry implements Serializable {
	private static final long serialVersionUID = -5123460570794468542L;

	private static Gson gson = new GsonBuilder().create();

	public enum Property {
		ID, PLUGIN_CHAIN, // manatory broker properties
		ES_INDEX, ES_TYPE, // Elasticsearch properties
		CB_BUCKET // Couchbase properties
	}

	private HashMap<Property, String> header = new HashMap<Property, String>();
	/**
	 * List of destinations for processing in successive order.
	 */
	private transient List<String> pluginChain = new ArrayList<String>();
	private String body;

	public EventEntry(HashMap<Property, String> header, String body) throws UbicityException {
		init(header, body);
	}

	public EventEntry(String jsonString) throws UbicityException {
		EventEntry e = gson.fromJson(jsonString, this.getClass());
		init(e.header, e.body);
	}

	@SuppressWarnings("unchecked")
	private void init(HashMap<Property, String> header, String body) {
{'fraction_non_alphanumeric': 0.10152284263959391, 'fraction_numerical': 0.01483795392424834, 'mean_word_length': 5.325925925925926, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '982908', 'n_tokens_mistral': 806, 'n_tokens_neox': 761, 'n_words': 206}