From 130bf4b37878a2f884c6359e8037d9b89a0e5d76 Mon Sep 17 00:00:00 2001
From: blavenie <benoit.lavenier@e-is.pro>
Date: Tue, 2 May 2017 18:22:29 +0200
Subject: [PATCH] [fix] fix logging config [enh] Upgrade to elasticsearch 2.4.5

---
 duniter4j-core-client/pom.xml                 |  4 ---
 .../model/bma/util/BlockchainBlockUtils.java  | 22 ++++++++++++
 duniter4j-core-shared/pom.xml                 |  4 ---
 .../src/main/assembly/config/logging.yml      | 10 +++---
 .../plugin-descriptor.properties              |  2 +-
 .../duniter/elasticsearch/PluginSettings.java |  8 +----
 .../elasticsearch/dao/AbstractDao.java        | 34 -------------------
 .../duniter/elasticsearch/dao/PeerDao.java    | 22 ++++++++++++
 .../elasticsearch/i18n/I18nInitializer.java   |  3 --
 .../BlockchainTxCountScriptFactory.java       | 22 ++++++++++++
 .../service/changes/ChangeService.java        |  4 +--
 .../LoggingScheduledThreadPoolExecutor.java   | 22 ++++++++++++
 .../elasticsearch/threadpool/RetryPolicy.java | 22 ++++++++++++
 .../plugin-descriptor.properties              |  4 +--
 .../dao/SubscriptionIndexDao.java             | 22 ++++++++++++
 .../dao/SubscriptionIndexDaoImpl.java         | 22 ++++++++++++
 .../execution/SubscriptionExecutionDao.java   | 22 ++++++++++++
 .../SubscriptionExecutionDaoImpl.java         | 22 ++++++++++++
 .../dao/record/SubscriptionRecordDao.java     | 22 ++++++++++++
 .../dao/record/SubscriptionRecordDaoImpl.java | 22 ++++++++++++
 .../subscription/util/DateUtils.java          | 22 ++++++++++++
 .../util/stringtemplate/DateRenderer.java     | 22 ++++++++++++
 .../util/stringtemplate/StringRenderer.java   | 22 ++++++++++++
 .../plugin-descriptor.properties              |  2 +-
 .../plugin-descriptor.properties              |  2 +-
 pom.xml                                       |  7 +---
 26 files changed, 321 insertions(+), 71 deletions(-)

diff --git a/duniter4j-core-client/pom.xml b/duniter4j-core-client/pom.xml
index 0909b3ed..6c2b2846 100644
--- a/duniter4j-core-client/pom.xml
+++ b/duniter4j-core-client/pom.xml
@@ -60,10 +60,6 @@
         <groupId>org.apache.httpcomponents</groupId>
         <artifactId>httpclient</artifactId>
     </dependency>
-    <dependency>
-        <groupId>org.apache.httpcomponents</groupId>
-        <artifactId>httpcore</artifactId>
-    </dependency>
     <dependency>
         <groupId>org.apache.httpcomponents</groupId>
         <artifactId>httpmime</artifactId>
diff --git a/duniter4j-core-client/src/main/java/org/duniter/core/client/model/bma/util/BlockchainBlockUtils.java b/duniter4j-core-client/src/main/java/org/duniter/core/client/model/bma/util/BlockchainBlockUtils.java
index 8ad5793a..2fb098fe 100644
--- a/duniter4j-core-client/src/main/java/org/duniter/core/client/model/bma/util/BlockchainBlockUtils.java
+++ b/duniter4j-core-client/src/main/java/org/duniter/core/client/model/bma/util/BlockchainBlockUtils.java
@@ -1,5 +1,27 @@
 package org.duniter.core.client.model.bma.util;
 
+/*-
+ * #%L
+ * Duniter4j :: Core Client API
+ * %%
+ * Copyright (C) 2014 - 2017 EIS
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public
+ * License along with this program.  If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import jnr.ffi.annotations.In;
diff --git a/duniter4j-core-shared/pom.xml b/duniter4j-core-shared/pom.xml
index 389bc867..98883848 100644
--- a/duniter4j-core-shared/pom.xml
+++ b/duniter4j-core-shared/pom.xml
@@ -45,10 +45,6 @@
       <groupId>org.apache.httpcomponents</groupId>
       <artifactId>httpclient</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.apache.httpcomponents</groupId>
-      <artifactId>httpcore</artifactId>
-    </dependency>
 
     <dependency>
       <groupId>javax.websocket</groupId>
diff --git a/duniter4j-es-assembly/src/main/assembly/config/logging.yml b/duniter4j-es-assembly/src/main/assembly/config/logging.yml
index 1218c97d..808683b6 100644
--- a/duniter4j-es-assembly/src/main/assembly/config/logging.yml
+++ b/duniter4j-es-assembly/src/main/assembly/config/logging.yml
@@ -2,7 +2,7 @@
 es.logger.level: INFO
 rootLogger: ${es.logger.level}, console, file
 logger:
-  # log rest execution errors for easier debugging
+  # log action execution errors for easier debugging
   action: DEBUG
 
   # deprecation logging, turn to DEBUG to see them
@@ -14,17 +14,15 @@ logger:
   com.amazonaws.jmx.SdkMBeanRegistrySupport: ERROR
   com.amazonaws.metrics.AwsSdkMetrics: ERROR
 
-  org.apache.http: INFO
-  org.apache.http.client: ERROR
+  duniter: INFO
+  security: INFO
 
   org.duniter: INFO
-
-  #org.duniter.elasticsearch: DEBUG
-
   org.nuiton.i18n: WARN
   org.nuiton.config: ERROR
   org.nuiton.converter: WARN
   org.glassfish.tyrus: WARN
+  org.apache.http: INFO
   org.apache.http.client: ERROR
 
   # gateway
diff --git a/duniter4j-es-core/src/main/filtered-resources/plugin-descriptor.properties b/duniter4j-es-core/src/main/filtered-resources/plugin-descriptor.properties
index 5db9f0fe..df06d1c9 100644
--- a/duniter4j-es-core/src/main/filtered-resources/plugin-descriptor.properties
+++ b/duniter4j-es-core/src/main/filtered-resources/plugin-descriptor.properties
@@ -5,5 +5,5 @@ site=false
 jvm=true
 classname=org.duniter.elasticsearch.Plugin
 java.version=1.7
-elasticsearch.version=2.3.3
+elasticsearch.version=2.4.5
 isolated=false
diff --git a/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/PluginSettings.java b/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/PluginSettings.java
index 35490063..7955ebbe 100644
--- a/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/PluginSettings.java
+++ b/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/PluginSettings.java
@@ -23,7 +23,6 @@ package org.duniter.elasticsearch;
  */
 
 
-import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
 import org.apache.commons.io.FileUtils;
 import org.duniter.core.client.config.Configuration;
@@ -33,19 +32,14 @@ import org.duniter.core.client.model.local.Peer;
 import org.duniter.core.exception.TechnicalException;
 import org.duniter.core.util.StringUtils;
 import org.duniter.elasticsearch.i18n.I18nInitializer;
-import org.duniter.elasticsearch.service.ServiceLocator;
-import org.elasticsearch.common.component.*;
+import org.elasticsearch.common.component.AbstractLifecycleComponent;
 import org.elasticsearch.common.inject.Inject;
-import org.elasticsearch.common.logging.ESLogger;
-import org.elasticsearch.common.logging.ESLoggerFactory;
 import org.elasticsearch.common.settings.Settings;
 import org.nuiton.config.ApplicationConfig;
 import org.nuiton.config.ApplicationConfigHelper;
 import org.nuiton.config.ApplicationConfigProvider;
 import org.nuiton.config.ArgumentsParserException;
 import org.nuiton.i18n.I18n;
-import org.nuiton.i18n.init.DefaultI18nInitializer;
-import org.nuiton.i18n.init.UserI18nInitializer;
 
 import java.io.File;
 import java.io.IOException;
diff --git a/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/dao/AbstractDao.java b/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/dao/AbstractDao.java
index 08e21ed6..1dea7013 100644
--- a/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/dao/AbstractDao.java
+++ b/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/dao/AbstractDao.java
@@ -24,48 +24,14 @@ package org.duniter.elasticsearch.dao;
 
 
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.common.base.Joiner;
-import org.apache.commons.collections4.MapUtils;
 import org.duniter.core.beans.Bean;
 import org.duniter.core.client.model.bma.jackson.JacksonUtils;
-import org.duniter.core.exception.TechnicalException;
 import org.duniter.core.service.CryptoService;
-import org.duniter.core.util.CollectionUtils;
-import org.duniter.core.util.Preconditions;
-import org.duniter.core.util.StringUtils;
 import org.duniter.elasticsearch.PluginSettings;
 import org.duniter.elasticsearch.client.Duniter4jClient;
-import org.duniter.elasticsearch.dao.handler.StringReaderHandler;
-import org.duniter.elasticsearch.exception.AccessDeniedException;
-import org.duniter.elasticsearch.exception.NotFoundException;
-import org.elasticsearch.ElasticsearchException;
-import org.elasticsearch.action.ActionRequestBuilder;
-import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequestBuilder;
-import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsRequestBuilder;
-import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsResponse;
-import org.elasticsearch.action.bulk.BulkItemResponse;
-import org.elasticsearch.action.bulk.BulkRequest;
-import org.elasticsearch.action.bulk.BulkRequestBuilder;
-import org.elasticsearch.action.bulk.BulkResponse;
-import org.elasticsearch.action.get.GetResponse;
-import org.elasticsearch.action.index.IndexResponse;
-import org.elasticsearch.action.search.SearchPhaseExecutionException;
-import org.elasticsearch.action.search.SearchRequestBuilder;
-import org.elasticsearch.action.search.SearchResponse;
-import org.elasticsearch.action.search.SearchType;
-import org.elasticsearch.client.Client;
-import org.elasticsearch.client.Requests;
-import org.elasticsearch.common.bytes.BytesArray;
 import org.elasticsearch.common.inject.Inject;
 import org.elasticsearch.common.logging.ESLogger;
 import org.elasticsearch.common.logging.Loggers;
-import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException;
-import org.elasticsearch.index.query.QueryBuilders;
-import org.elasticsearch.search.SearchHit;
-import org.elasticsearch.search.SearchHitField;
-
-import java.io.*;
-import java.util.*;
 
 /**
  * Created by Benoit on 08/04/2015.
diff --git a/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/dao/PeerDao.java b/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/dao/PeerDao.java
index d5405fcd..d1eee33b 100644
--- a/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/dao/PeerDao.java
+++ b/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/dao/PeerDao.java
@@ -1,5 +1,27 @@
 package org.duniter.elasticsearch.dao;
 
+/*-
+ * #%L
+ * Duniter4j :: ElasticSearch Core plugin
+ * %%
+ * Copyright (C) 2014 - 2017 EIS
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public
+ * License along with this program.  If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
 import org.duniter.elasticsearch.dao.impl.PeerDaoImpl;
 
 /**
diff --git a/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/i18n/I18nInitializer.java b/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/i18n/I18nInitializer.java
index 9adbe5f0..55acfe7c 100644
--- a/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/i18n/I18nInitializer.java
+++ b/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/i18n/I18nInitializer.java
@@ -22,8 +22,6 @@ package org.duniter.elasticsearch.i18n;
  * #L%
  */
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.nuiton.i18n.bundle.I18nBundle;
 import org.nuiton.i18n.init.DefaultI18nInitializer;
 import org.nuiton.i18n.init.UserI18nInitializer;
@@ -36,7 +34,6 @@ import java.util.List;
  * Created by blavenie on 10/01/17.
  */
 public class I18nInitializer extends org.nuiton.i18n.init.I18nInitializer{
-    private static final Log log = LogFactory.getLog(UserI18nInitializer.class);
     protected final File userDirectory;
 
     private String[] bundleNames;
diff --git a/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/script/BlockchainTxCountScriptFactory.java b/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/script/BlockchainTxCountScriptFactory.java
index 34774866..31176d21 100644
--- a/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/script/BlockchainTxCountScriptFactory.java
+++ b/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/script/BlockchainTxCountScriptFactory.java
@@ -1,5 +1,27 @@
 package org.duniter.elasticsearch.script;
 
+/*-
+ * #%L
+ * Duniter4j :: ElasticSearch Core plugin
+ * %%
+ * Copyright (C) 2014 - 2017 EIS
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public
+ * License along with this program.  If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
 import org.elasticsearch.common.Nullable;
 import org.elasticsearch.script.AbstractFloatSearchScript;
 import org.elasticsearch.script.ExecutableScript;
diff --git a/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/service/changes/ChangeService.java b/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/service/changes/ChangeService.java
index 95392288..8c77d5c3 100644
--- a/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/service/changes/ChangeService.java
+++ b/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/service/changes/ChangeService.java
@@ -127,7 +127,7 @@ public class ChangeService {
                         }
 
                         @Override
-                        public void postIndex(Engine.Index index) {
+                        public void postIndex(Engine.Index index, boolean created) {
                             if (!hasListener(indexName, index.type(), index.id())) {
                                 return;
                             }
@@ -137,7 +137,7 @@ public class ChangeService {
                                     index.type(),
                                     index.id(),
                                     new DateTime(),
-                                    ChangeEvent.Operation.INDEX,
+                                    created ? ChangeEvent.Operation.CREATE : ChangeEvent.Operation.INDEX,
                                     index.version(),
                                     index.source()
                             );
diff --git a/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/threadpool/LoggingScheduledThreadPoolExecutor.java b/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/threadpool/LoggingScheduledThreadPoolExecutor.java
index ebd4c9c4..4fb5efd9 100644
--- a/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/threadpool/LoggingScheduledThreadPoolExecutor.java
+++ b/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/threadpool/LoggingScheduledThreadPoolExecutor.java
@@ -1,5 +1,27 @@
 package org.duniter.elasticsearch.threadpool;
 
+/*-
+ * #%L
+ * Duniter4j :: ElasticSearch Core plugin
+ * %%
+ * Copyright (C) 2014 - 2017 EIS
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public
+ * License along with this program.  If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
 import org.elasticsearch.common.logging.ESLogger;
 
 import java.util.concurrent.*;
diff --git a/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/threadpool/RetryPolicy.java b/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/threadpool/RetryPolicy.java
index e8a792f2..04ed708d 100644
--- a/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/threadpool/RetryPolicy.java
+++ b/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/threadpool/RetryPolicy.java
@@ -1,5 +1,27 @@
 package org.duniter.elasticsearch.threadpool;
 
+/*-
+ * #%L
+ * Duniter4j :: ElasticSearch Core plugin
+ * %%
+ * Copyright (C) 2014 - 2017 EIS
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public
+ * License along with this program.  If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
 import org.elasticsearch.common.logging.ESLogger;
 import org.elasticsearch.common.logging.Loggers;
 import org.elasticsearch.common.util.concurrent.EsAbortPolicy;
diff --git a/duniter4j-es-subscription/src/main/filtered-resources/plugin-descriptor.properties b/duniter4j-es-subscription/src/main/filtered-resources/plugin-descriptor.properties
index 78fb7eb1..77759b1c 100644
--- a/duniter4j-es-subscription/src/main/filtered-resources/plugin-descriptor.properties
+++ b/duniter4j-es-subscription/src/main/filtered-resources/plugin-descriptor.properties
@@ -1,9 +1,9 @@
-name=gchange
+name=subscription
 description=Plugin for Gchange API
 version=${project.version}
 site=false
 jvm=true
 classname=org.duniter.elasticsearch.subscription.Plugin
 java.version=1.7
-elasticsearch.version=2.3.3
+elasticsearch.version=2.4.5
 isolated=false
diff --git a/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/dao/SubscriptionIndexDao.java b/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/dao/SubscriptionIndexDao.java
index f252212c..ecdcded3 100644
--- a/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/dao/SubscriptionIndexDao.java
+++ b/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/dao/SubscriptionIndexDao.java
@@ -1,5 +1,27 @@
 package org.duniter.elasticsearch.subscription.dao;
 
+/*-
+ * #%L
+ * Duniter4j :: ElasticSearch Subscription plugin
+ * %%
+ * Copyright (C) 2014 - 2017 EIS
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public
+ * License along with this program.  If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
 import org.duniter.elasticsearch.dao.IndexDao;
 import org.duniter.elasticsearch.dao.IndexTypeDao;
 
diff --git a/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/dao/SubscriptionIndexDaoImpl.java b/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/dao/SubscriptionIndexDaoImpl.java
index a3494113..b93ec943 100644
--- a/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/dao/SubscriptionIndexDaoImpl.java
+++ b/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/dao/SubscriptionIndexDaoImpl.java
@@ -1,5 +1,27 @@
 package org.duniter.elasticsearch.subscription.dao;
 
+/*-
+ * #%L
+ * Duniter4j :: ElasticSearch Subscription plugin
+ * %%
+ * Copyright (C) 2014 - 2017 EIS
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public
+ * License along with this program.  If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
 import com.fasterxml.jackson.core.JsonProcessingException;
 import org.duniter.core.exception.TechnicalException;
 import org.duniter.elasticsearch.dao.AbstractIndexDao;
diff --git a/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/dao/execution/SubscriptionExecutionDao.java b/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/dao/execution/SubscriptionExecutionDao.java
index f957532c..2ea19c36 100644
--- a/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/dao/execution/SubscriptionExecutionDao.java
+++ b/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/dao/execution/SubscriptionExecutionDao.java
@@ -1,5 +1,27 @@
 package org.duniter.elasticsearch.subscription.dao.execution;
 
+/*-
+ * #%L
+ * Duniter4j :: ElasticSearch Subscription plugin
+ * %%
+ * Copyright (C) 2014 - 2017 EIS
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public
+ * License along with this program.  If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
 import org.duniter.elasticsearch.subscription.dao.SubscriptionIndexTypeDao;
 import org.duniter.elasticsearch.subscription.model.SubscriptionExecution;
 import org.duniter.elasticsearch.subscription.model.SubscriptionRecord;
diff --git a/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/dao/execution/SubscriptionExecutionDaoImpl.java b/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/dao/execution/SubscriptionExecutionDaoImpl.java
index f38d6d28..d21bf52e 100644
--- a/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/dao/execution/SubscriptionExecutionDaoImpl.java
+++ b/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/dao/execution/SubscriptionExecutionDaoImpl.java
@@ -1,5 +1,27 @@
 package org.duniter.elasticsearch.subscription.dao.execution;
 
+/*-
+ * #%L
+ * Duniter4j :: ElasticSearch Subscription plugin
+ * %%
+ * Copyright (C) 2014 - 2017 EIS
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public
+ * License along with this program.  If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
 import com.fasterxml.jackson.core.JsonProcessingException;
 import org.duniter.core.client.model.bma.BlockchainBlock;
 import org.duniter.core.exception.TechnicalException;
diff --git a/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/dao/record/SubscriptionRecordDao.java b/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/dao/record/SubscriptionRecordDao.java
index d1fa0b80..6b414bfe 100644
--- a/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/dao/record/SubscriptionRecordDao.java
+++ b/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/dao/record/SubscriptionRecordDao.java
@@ -1,5 +1,27 @@
 package org.duniter.elasticsearch.subscription.dao.record;
 
+/*-
+ * #%L
+ * Duniter4j :: ElasticSearch Subscription plugin
+ * %%
+ * Copyright (C) 2014 - 2017 EIS
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public
+ * License along with this program.  If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
 import org.duniter.elasticsearch.subscription.dao.SubscriptionIndexTypeDao;
 import org.duniter.elasticsearch.subscription.model.SubscriptionRecord;
 
diff --git a/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/dao/record/SubscriptionRecordDaoImpl.java b/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/dao/record/SubscriptionRecordDaoImpl.java
index f3682afc..e5fa09dd 100644
--- a/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/dao/record/SubscriptionRecordDaoImpl.java
+++ b/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/dao/record/SubscriptionRecordDaoImpl.java
@@ -1,5 +1,27 @@
 package org.duniter.elasticsearch.subscription.dao.record;
 
+/*-
+ * #%L
+ * Duniter4j :: ElasticSearch Subscription plugin
+ * %%
+ * Copyright (C) 2014 - 2017 EIS
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public
+ * License along with this program.  If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
 import org.duniter.core.exception.TechnicalException;
 import org.duniter.core.util.CollectionUtils;
 import org.duniter.elasticsearch.subscription.PluginSettings;
diff --git a/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/util/DateUtils.java b/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/util/DateUtils.java
index a67fecb2..d6264c70 100644
--- a/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/util/DateUtils.java
+++ b/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/util/DateUtils.java
@@ -1,5 +1,27 @@
 package org.duniter.elasticsearch.subscription.util;
 
+/*-
+ * #%L
+ * Duniter4j :: ElasticSearch Subscription plugin
+ * %%
+ * Copyright (C) 2014 - 2017 EIS
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public
+ * License along with this program.  If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
 import java.util.Calendar;
 import java.util.Date;
 import java.util.GregorianCalendar;
diff --git a/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/util/stringtemplate/DateRenderer.java b/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/util/stringtemplate/DateRenderer.java
index eb84ec8d..9fb695d1 100644
--- a/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/util/stringtemplate/DateRenderer.java
+++ b/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/util/stringtemplate/DateRenderer.java
@@ -1,5 +1,27 @@
 package org.duniter.elasticsearch.subscription.util.stringtemplate;
 
+/*-
+ * #%L
+ * Duniter4j :: ElasticSearch Subscription plugin
+ * %%
+ * Copyright (C) 2014 - 2017 EIS
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public
+ * License along with this program.  If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
 import org.stringtemplate.v4.AttributeRenderer;
 
 import java.text.DateFormat;
diff --git a/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/util/stringtemplate/StringRenderer.java b/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/util/stringtemplate/StringRenderer.java
index 92b638ba..fdbda8bd 100644
--- a/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/util/stringtemplate/StringRenderer.java
+++ b/duniter4j-es-subscription/src/main/java/org/duniter/elasticsearch/subscription/util/stringtemplate/StringRenderer.java
@@ -1,5 +1,27 @@
 package org.duniter.elasticsearch.subscription.util.stringtemplate;
 
+/*-
+ * #%L
+ * Duniter4j :: ElasticSearch Subscription plugin
+ * %%
+ * Copyright (C) 2014 - 2017 EIS
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public
+ * License along with this program.  If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
 import org.duniter.core.client.model.ModelUtils;
 import org.duniter.core.util.CollectionUtils;
 import org.duniter.core.util.StringUtils;
diff --git a/duniter4j-es-subscription/src/test/es-home/plugins/mapper-attachments/plugin-descriptor.properties b/duniter4j-es-subscription/src/test/es-home/plugins/mapper-attachments/plugin-descriptor.properties
index b2ab3586..241c0434 100644
--- a/duniter4j-es-subscription/src/test/es-home/plugins/mapper-attachments/plugin-descriptor.properties
+++ b/duniter4j-es-subscription/src/test/es-home/plugins/mapper-attachments/plugin-descriptor.properties
@@ -68,7 +68,7 @@ java.version=1.7
 # elasticsearch release. This version is checked when the plugin
 # is loaded so Elasticsearch will refuse to start in the presence of
 # plugins with the incorrect elasticsearch.version.
-elasticsearch.version=2.3.3
+elasticsearch.version=2.4.5
 #
 ### deprecated elements for jvm plugins :
 #
diff --git a/duniter4j-es-user/src/main/filtered-resources/plugin-descriptor.properties b/duniter4j-es-user/src/main/filtered-resources/plugin-descriptor.properties
index 0d42d562..e29af830 100644
--- a/duniter4j-es-user/src/main/filtered-resources/plugin-descriptor.properties
+++ b/duniter4j-es-user/src/main/filtered-resources/plugin-descriptor.properties
@@ -5,5 +5,5 @@ site=false
 jvm=true
 classname=org.duniter.elasticsearch.user.Plugin
 java.version=1.7
-elasticsearch.version=2.3.3
+elasticsearch.version=2.4.5
 isolated=false
diff --git a/pom.xml b/pom.xml
index b0e4eebf..b16002f6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -20,7 +20,7 @@
     <xml-apis.version>2.0.2</xml-apis.version>
     <kalium.version>0.5.0_blavenie</kalium.version>
     <scrypt.version>1.4.0</scrypt.version>
-    <elasticsearch.version>2.3.3</elasticsearch.version>
+    <elasticsearch.version>2.4.5</elasticsearch.version>
     <jna.version>4.1.0</jna.version>
     <tyrus.version>1.13</tyrus.version>
 
@@ -188,11 +188,6 @@
         <artifactId>nuiton-i18n</artifactId>
         <version>${nuitonI18nVersion}</version>
       </dependency>
-      <dependency>
-        <groupId>org.apache.httpcomponents</groupId>
-        <artifactId>httpcore</artifactId>
-        <version>4.3.2</version>
-      </dependency>
       <dependency>
         <groupId>org.apache.httpcomponents</groupId>
         <artifactId>httpclient</artifactId>
-- 
GitLab