This is an automated email from the ASF dual-hosted git repository.

krisztiankasa pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
     new 42a46e9  AMBARI-24692 - JDK 11 support for Log Search (#2843)
42a46e9 is described below

commit 42a46e961d3ea2ce53328aa8f2fa41998e4379c3
Author: kasakrisz <33458261+kasakr...@users.noreply.github.com>
AuthorDate: Fri Mar 1 15:37:02 2019 +0100

    AMBARI-24692 - JDK 11 support for Log Search (#2843)
---
 .../ambari-logsearch-logfeeder/pom.xml             | 14 +++-
 .../org/apache/ambari/logfeeder/LogFeeder.java     |  2 +-
 .../src/main/scripts/logfeeder.sh                  | 16 ++++-
 ambari-logsearch/ambari-logsearch-server/pom.xml   | 76 +++++++++++++++++++---
 .../org/apache/ambari/logsearch/LogSearch.java     | 11 ++--
 .../ambari/logsearch/conf/LogSearchHttpConfig.java | 22 ++++++-
 .../logsearch/conf/LogSearchServletConfig.java     | 43 +-----------
 .../conf/LogSearchWebServerCustomizer.java         | 67 +++++++++++++++++++
 .../ambari/logsearch/conf/SecurityConfig.java      | 30 +++++----
 .../apache/ambari/logsearch/conf/SolrConfig.java   |  5 +-
 .../org/apache/ambari/logsearch/dao/UserDao.java   | 11 ++--
 .../apache/ambari/logsearch/util/CommonUtil.java   | 41 ------------
 .../LogsearchSecurityContextFormationFilter.java   |  6 +-
 .../logsearch/web/filters/NoServletContext.java    | 43 ++++++++++--
 .../LogsearchFileAuthenticationProvider.java       | 22 +++++--
 .../src/main/scripts/logsearch.sh                  | 16 ++++-
 .../converter/AuditLogRequestConverterTest.java    |  8 +--
 .../AuditServiceLoadRequestQueryConverterTest.java |  8 +--
 .../BaseServiceLogRequestQueryConverterTest.java   |  8 +--
 .../FieldAuditLogRequestQueryConverterTest.java    |  8 +--
 .../ServiceLogAnyGraphRequestConverterTest.java    |  8 +--
 ...LogComponentLevelRequestQueryConverterTest.java | 10 +--
 ...LogComponentRequestFacetQueryConverterTest.java | 10 +--
 ...viceLogLevelCountRequestQueryConverterTest.java |  8 +--
 ...rviceLogTreeRequestFacetQueryConverterTest.java | 10 +--
 ...rviceLogTruncatedRequestQueryConverterTest.java |  8 +--
 .../TopFieldAuditLogRequestQueryConverterTest.java |  8 +--
 .../UserExportRequestQueryConverterTest.java       |  8 +--
 .../LogsearchFileAuthenticationProviderTest.java   | 58 +++++++++--------
 ambari-logsearch/docker/Dockerfile                 |  9 +--
 30 files changed, 374 insertions(+), 220 deletions(-)

diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml 
b/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml
index 272d6b8..2783d58 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml
@@ -33,8 +33,8 @@
 
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    <spring.version>4.3.18.RELEASE</spring.version>
-    <spring-boot.version>1.5.14.RELEASE</spring-boot.version>
+    <spring.version>5.1.1.RELEASE</spring.version>
+    <spring-boot.version>2.0.6.RELEASE</spring-boot.version>
   </properties>
 
   <dependencies>
@@ -91,7 +91,7 @@
     <dependency>
       <groupId>org.easymock</groupId>
       <artifactId>easymock</artifactId>
-      <version>3.4</version>
+      <version>3.6</version>
       <scope>test</scope>
     </dependency>
     <dependency>
@@ -309,6 +309,14 @@
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>${jdk.version}</source>
+          <target>${jdk.version}</target>
+        </configuration>
+      </plugin>
       <!-- ant pacakge -->
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
diff --git 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeeder.java
 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeeder.java
index 4025d3d..a0d8b4f 100644
--- 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeeder.java
+++ 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeeder.java
@@ -22,7 +22,7 @@ import org.springframework.boot.Banner;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.solr.SolrAutoConfiguration;
 import org.springframework.boot.builder.SpringApplicationBuilder;
-import org.springframework.boot.system.ApplicationPidFileWriter;
+import org.springframework.boot.context.ApplicationPidFileWriter;
 
 @SpringBootApplication(
   scanBasePackages = {"org.apache.ambari.logfeeder"},
diff --git 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/scripts/logfeeder.sh 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/scripts/logfeeder.sh
index abe062f..539f4bd 100755
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/scripts/logfeeder.sh
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/scripts/logfeeder.sh
@@ -80,7 +80,12 @@ else
   LOGFEEDER_GC_LOGFILE="$LOG_PATH_WITHOUT_SLASH/$LOGFEEDER_GC_LOGFILE"
 fi
 
-LOGFEEDER_GC_OPTS="-XX:+PrintGCDetails -XX:+PrintGCDateStamps 
-Xloggc:$LOGFEEDER_GC_LOGFILE"
+java_version=$($JVM -version 2>&1 | grep 'version' | cut -d'"' -f2 | cut -d'.' 
-f2)
+if [ $java_version == "8" ]; then
+  LOGFEEDER_GC_OPTS="-XX:+PrintGCDetails -XX:+PrintGCDateStamps 
-Xloggc:$LOGFEEDER_GC_LOGFILE"
+else
+  LOGFEEDER_GC_OPTS="-Xlog:gc*:file=$LOGFEEDER_GC_LOGFILE:time"
+fi
 
 function print_usage() {
   cat << EOF
@@ -154,7 +159,12 @@ function start() {
   LOGFEEDER_DEBUG_PORT=${LOGFEEDER_DEBUG_PORT:-"5006"}
 
   if [ "$LOGFEEDER_DEBUG" = "true" ]; then
-    LOGFEEDER_JAVA_OPTS="$LOGFEEDER_JAVA_OPTS -Xdebug 
-Xrunjdwp:transport=dt_socket,address=$LOGFEEDER_DEBUG_PORT,server=y,suspend=$LOGFEEDER_DEBUG_SUSPEND
 "
+    if [ $java_version == "8" ]; then
+      LOGFEEDER_DEBUG_ADDRESS=$LOGFEEDER_DEBUG_PORT
+    else
+      LOGFEEDER_DEBUG_ADDRESS="*:$LOGFEEDER_DEBUG_PORT"
+    fi
+    LOGFEEDER_JAVA_OPTS="$LOGFEEDER_JAVA_OPTS -Xdebug 
-Xrunjdwp:transport=dt_socket,address=$LOGFEEDER_DEBUG_ADDRESS,server=y,suspend=$LOGFEEDER_DEBUG_SUSPEND
 "
   fi
 
   if [ "$LOGFEEDER_SSL" = "true" ]; then
@@ -209,7 +219,7 @@ function start() {
 }
 
 function stop() {
-  LOGFEEDER_STOP_WAIT=3
+  LOGFEEDER_STOP_WAIT=${LOGFEEDER_STOP_WAIT:-60}
   if [ -f "$LOGFEEDER_PID_FILE" ]; then
     LOGFEEDER_PID=`cat "$LOGFEEDER_PID_FILE"`
   fi
diff --git a/ambari-logsearch/ambari-logsearch-server/pom.xml 
b/ambari-logsearch/ambari-logsearch-server/pom.xml
index a6a1326..9c1cf5a 100755
--- a/ambari-logsearch/ambari-logsearch-server/pom.xml
+++ b/ambari-logsearch/ambari-logsearch-server/pom.xml
@@ -27,15 +27,16 @@
   <url>http://maven.apache.org</url>
   <name>Ambari Logsearch Server</name>
   <properties>
-    <spring.version>4.3.20.RELEASE</spring.version>
-    <spring.security.version>4.2.4.RELEASE</spring.security.version>
-    <spring.ldap.version>2.2.0.RELEASE</spring.ldap.version>
-    <jersey.version>2.25.1</jersey.version>
+    <spring.version>5.1.1.RELEASE</spring.version>
+    <spring.security.version>5.1.1.RELEASE</spring.security.version>
+    <spring-data-solr.version>3.0.10.RELEASE</spring-data-solr.version>
+    <spring-data.version>2.0.10.RELEASE</spring-data.version>
+    <spring-boot.version>2.0.6.RELEASE</spring-boot.version>
+    <jersey.version>2.27</jersey.version>
     <jetty.version>9.4.12.v20180830</jetty.version>
     <swagger.version>1.5.16</swagger.version>
-    <spring-data-solr.version>2.0.2.RELEASE</spring-data-solr.version>
     <jjwt.version>0.6.0</jjwt.version>
-    <spring-boot.version>1.5.17.RELEASE</spring-boot.version>
+    <javax-servlet.version>4.0.1</javax-servlet.version>
   </properties>
   <profiles>
     <profile>
@@ -172,9 +173,14 @@
     <dependency>
       <groupId>org.easymock</groupId>
       <artifactId>easymock</artifactId>
-      <version>3.4</version>
+      <version>3.6</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>javax.validation</groupId>
+      <artifactId>validation-api</artifactId>
+      <version>2.0.1.Final</version>
+    </dependency>
     <!-- Spring dependencies -->
     <dependency>
       <groupId>org.springframework</groupId>
@@ -249,6 +255,12 @@
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter-web</artifactId>
       <version>${spring-boot.version}</version>
+      <exclusions>
+        <exclusion>
+          <groupId>org.springframework.boot</groupId>
+          <artifactId>spring-boot-starter-tomcat</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.springframework.boot</groupId>
@@ -264,11 +276,23 @@
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter-jetty</artifactId>
       <version>${spring-boot.version}</version>
+      <exclusions>
+        <exclusion>
+          <groupId>org.springframework.boot</groupId>
+          <artifactId>spring-boot-starter-tomcat</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter-jersey</artifactId>
-      <version>${spring-boot.version}</version>
+      <version>2.1.0.M2</version>
+      <exclusions>
+        <exclusion>
+          <artifactId>tomcat-embed-el</artifactId>
+          <groupId>org.apache.tomcat.embed</groupId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.springframework.boot</groupId>
@@ -309,8 +333,26 @@
     <dependency>
       <groupId>javax.servlet</groupId>
       <artifactId>javax.servlet-api</artifactId>
-      <version>3.1.0</version>
+      <version>${javax-servlet.version}</version>
     </dependency>
+
+    <dependency>
+      <groupId>javax.xml.bind</groupId>
+      <artifactId>jaxb-api</artifactId>
+      <version>2.3.0</version>
+    </dependency>
+
+    <dependency>
+      <groupId>javax.annotation</groupId>
+      <artifactId>javax.annotation-api</artifactId>
+      <version>1.3.2</version>
+    </dependency>
+    <dependency>
+      <groupId>javax.activation</groupId>
+      <artifactId>activation</artifactId>
+      <version>1.1.1</version>
+    </dependency>
+
     <dependency>
       <groupId>org.apache.solr</groupId>
       <artifactId>solr-solrj</artifactId>
@@ -481,7 +523,7 @@
     <dependency>
       <groupId>org.springframework.data</groupId>
       <artifactId>spring-data-commons</artifactId>
-      <version>1.13.12.RELEASE</version>
+      <version>${spring-data.version}</version>
     </dependency>
     <dependency>
       <groupId>org.springframework</groupId>
@@ -527,6 +569,20 @@
       <artifactId>spring-boot-starter-tomcat</artifactId>
       <version>${spring-boot.version}</version>
       <scope>provided</scope>
+      <exclusions>
+        <exclusion>
+          <groupId>org.apache.tomcat.embed</groupId>
+          <artifactId>tomcat-embed-el</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.apache.tomcat.embed</groupId>
+          <artifactId>tomcat-embed-core</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.apache.tomcat.embed</groupId>
+          <artifactId>tomcat-embed-websocket</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.apache.tomcat.embed</groupId>
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/LogSearch.java
 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/LogSearch.java
index 7d42a92..cd92cb6 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/LogSearch.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/LogSearch.java
@@ -19,19 +19,22 @@
 package org.apache.ambari.logsearch;
 
 import org.springframework.boot.Banner;
+import org.springframework.boot.WebApplicationType;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import 
org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration;
+import 
org.springframework.boot.autoconfigure.data.solr.SolrRepositoriesAutoConfiguration;
 import org.springframework.boot.autoconfigure.solr.SolrAutoConfiguration;
-import org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration;
+import 
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration;
 import org.springframework.boot.builder.SpringApplicationBuilder;
-import org.springframework.boot.system.ApplicationPidFileWriter;
+import org.springframework.boot.context.ApplicationPidFileWriter;
 
 @SpringBootApplication(
   scanBasePackages = {"org.apache.ambari.logsearch"},
   exclude = {
     RepositoryRestMvcAutoConfiguration.class,
     WebMvcAutoConfiguration.class,
-    SolrAutoConfiguration.class
+    SolrAutoConfiguration.class,
+    SolrRepositoriesAutoConfiguration.class
   }
 )
 public class LogSearch {
@@ -42,7 +45,7 @@ public class LogSearch {
     new SpringApplicationBuilder(LogSearch.class)
       .bannerMode(Banner.Mode.OFF)
       .listeners(new ApplicationPidFileWriter(pidFile))
-      .web(true)
+      .web(WebApplicationType.SERVLET)
       .run(args);
   }
 
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/LogSearchHttpConfig.java
 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/LogSearchHttpConfig.java
index 4a7280d..fc76425 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/LogSearchHttpConfig.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/LogSearchHttpConfig.java
@@ -18,12 +18,12 @@
  */
 package org.apache.ambari.logsearch.conf;
 
+import static 
org.apache.ambari.logsearch.common.LogSearchConstants.LOGSEARCH_PROPERTIES_FILE;
+
 import org.apache.ambari.logsearch.config.api.LogSearchPropertyDescription;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Configuration;
 
-import static 
org.apache.ambari.logsearch.common.LogSearchConstants.LOGSEARCH_PROPERTIES_FILE;
-
 @Configuration
 public class LogSearchHttpConfig {
 
@@ -57,6 +57,16 @@ public class LogSearchHttpConfig {
   @Value("${logsearch.protocol:http}")
   private String protocol;
 
+  @LogSearchPropertyDescription(
+          name = "logsearch.session.timeout",
+          description = "Log Search http session timeout in minutes.",
+          examples = {"300"},
+          defaultValue = "30",
+          sources = {LOGSEARCH_PROPERTIES_FILE}
+  )
+  @Value("${logsearch.session.timeout:30}")
+  private Integer sessionTimeout;
+
   public String getProtocol() {
     return protocol;
   }
@@ -80,4 +90,12 @@ public class LogSearchHttpConfig {
   public void setHttpsPort(int httpsPort) {
     this.httpsPort = httpsPort;
   }
+
+  public Integer getSessionTimeout() {
+    return sessionTimeout;
+  }
+
+  public void setSessionTimeout(Integer sessionTimeout) {
+    this.sessionTimeout = sessionTimeout;
+  }
 }
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/LogSearchServletConfig.java
 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/LogSearchServletConfig.java
index a7a27da..a86929b 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/LogSearchServletConfig.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/LogSearchServletConfig.java
@@ -18,29 +18,18 @@
  */
 package org.apache.ambari.logsearch.conf;
 
+import javax.inject.Inject;
+import javax.servlet.http.HttpSessionListener;
+
 import org.apache.ambari.logsearch.configurer.SslConfigurer;
 import org.apache.ambari.logsearch.web.listener.LogSearchSessionListener;
-import org.eclipse.jetty.server.Connector;
-import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.server.ServerConnector;
-import org.eclipse.jetty.util.ssl.SslContextFactory;
 import org.glassfish.jersey.servlet.ServletContainer;
 import org.glassfish.jersey.servlet.ServletProperties;
 import org.springframework.boot.autoconfigure.web.ServerProperties;
-import 
org.springframework.boot.context.embedded.EmbeddedServletContainerFactory;
-import 
org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainer;
-import 
org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory;
-import org.springframework.boot.context.embedded.jetty.JettyServerCustomizer;
 import org.springframework.boot.web.servlet.ServletRegistrationBean;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 
-import javax.inject.Inject;
-import javax.servlet.http.HttpSessionListener;
-
-import static 
org.apache.ambari.logsearch.common.LogSearchConstants.LOGSEARCH_APPLICATION_NAME;
-import static 
org.apache.ambari.logsearch.common.LogSearchConstants.LOGSEARCH_SESSION_ID;
-
 @Configuration
 public class LogSearchServletConfig {
 
@@ -66,30 +55,4 @@ public class LogSearchServletConfig {
     registration.addInitParameter(ServletProperties.JAXRS_APPLICATION_CLASS, 
LogSearchJerseyResourceConfig.class.getName());
     return registration;
   }
-
-  @Bean
-  public EmbeddedServletContainerFactory containerFactory() {
-    final JettyEmbeddedServletContainerFactory 
jettyEmbeddedServletContainerFactory = new 
JettyEmbeddedServletContainerFactory() {
-      @Override
-      protected JettyEmbeddedServletContainer 
getJettyEmbeddedServletContainer(Server server) {
-        return new JettyEmbeddedServletContainer(server);
-      }
-    };
-    jettyEmbeddedServletContainerFactory.setSessionTimeout(SESSION_TIMEOUT);
-    serverProperties.getSession().getCookie().setName(LOGSEARCH_SESSION_ID);
-    serverProperties.setDisplayName(LOGSEARCH_APPLICATION_NAME);
-    if ("https".equals(logSearchHttpConfig.getProtocol())) {
-      sslConfigurer.ensureStorePasswords();
-      sslConfigurer.loadKeystore();
-      
jettyEmbeddedServletContainerFactory.addServerCustomizers((JettyServerCustomizer)
 server -> {
-        SslContextFactory sslContextFactory = 
sslConfigurer.getSslContextFactory();
-        ServerConnector sslConnector = new ServerConnector(server, 
sslContextFactory);
-        sslConnector.setPort(logSearchHttpConfig.getHttpsPort());
-        server.setConnectors(new Connector[]{sslConnector});
-      });
-    } else {
-      
jettyEmbeddedServletContainerFactory.setPort(logSearchHttpConfig.getHttpPort());
-    }
-    return jettyEmbeddedServletContainerFactory;
-  }
 }
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/LogSearchWebServerCustomizer.java
 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/LogSearchWebServerCustomizer.java
new file mode 100644
index 0000000..581f5a5
--- /dev/null
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/LogSearchWebServerCustomizer.java
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ambari.logsearch.conf;
+
+import static 
org.apache.ambari.logsearch.common.LogSearchConstants.LOGSEARCH_SESSION_ID;
+
+import java.time.Duration;
+
+import javax.inject.Inject;
+
+import org.apache.ambari.logsearch.configurer.SslConfigurer;
+import org.eclipse.jetty.server.Connector;
+import org.eclipse.jetty.server.ServerConnector;
+import org.eclipse.jetty.util.ssl.SslContextFactory;
+import org.springframework.boot.autoconfigure.web.ServerProperties;
+import org.springframework.boot.web.embedded.jetty.JettyServerCustomizer;
+import 
org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory;
+import org.springframework.boot.web.server.WebServerFactoryCustomizer;
+import org.springframework.stereotype.Component;
+
+@Component
+public class LogSearchWebServerCustomizer implements 
WebServerFactoryCustomizer<JettyServletWebServerFactory> {
+
+  @Inject
+  private ServerProperties serverProperties;
+
+  @Inject
+  private LogSearchHttpConfig logSearchHttpConfig;
+
+  @Inject
+  private SslConfigurer sslConfigurer;
+
+  @Override
+  public void customize(JettyServletWebServerFactory webServerFactory) {
+    
serverProperties.getServlet().getSession().setTimeout(Duration.ofMinutes(logSearchHttpConfig.getSessionTimeout()));
+    
serverProperties.getServlet().getSession().getCookie().setName(LOGSEARCH_SESSION_ID);
+
+    if ("https".equals(logSearchHttpConfig.getProtocol())) {
+      sslConfigurer.ensureStorePasswords();
+      sslConfigurer.loadKeystore();
+      webServerFactory.addServerCustomizers((JettyServerCustomizer) server -> {
+        SslContextFactory sslContextFactory = 
sslConfigurer.getSslContextFactory();
+        ServerConnector sslConnector = new ServerConnector(server, 
sslContextFactory);
+        sslConnector.setPort(logSearchHttpConfig.getHttpsPort());
+        server.setConnectors(new Connector[]{sslConnector});
+      });
+    } else {
+      webServerFactory.setPort(logSearchHttpConfig.getHttpPort());
+    }
+  }
+}
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/SecurityConfig.java
 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/SecurityConfig.java
index 0bc1519..f465129 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/SecurityConfig.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/SecurityConfig.java
@@ -18,24 +18,30 @@
  */
 package org.apache.ambari.logsearch.conf;
 
-import com.google.common.collect.Lists;
+import static 
org.apache.ambari.logsearch.common.LogSearchConstants.LOGSEARCH_SESSION_ID;
 
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import org.apache.ambari.logsearch.conf.global.LogLevelFilterManagerState;
 import org.apache.ambari.logsearch.conf.global.LogSearchConfigState;
 import org.apache.ambari.logsearch.conf.global.SolrCollectionState;
-import org.apache.ambari.logsearch.conf.global.LogLevelFilterManagerState;
 import 
org.apache.ambari.logsearch.web.authenticate.LogsearchAuthFailureHandler;
 import 
org.apache.ambari.logsearch.web.authenticate.LogsearchAuthSuccessHandler;
 import 
org.apache.ambari.logsearch.web.authenticate.LogsearchLogoutSuccessHandler;
+import org.apache.ambari.logsearch.web.filters.LogSearchConfigStateFilter;
 import 
org.apache.ambari.logsearch.web.filters.LogSearchLogLevelFilterManagerFilter;
 import org.apache.ambari.logsearch.web.filters.LogsearchAuditLogsStateFilter;
 import 
org.apache.ambari.logsearch.web.filters.LogsearchAuthenticationEntryPoint;
 import org.apache.ambari.logsearch.web.filters.LogsearchCorsFilter;
-import org.apache.ambari.logsearch.web.filters.LogSearchConfigStateFilter;
-import 
org.apache.ambari.logsearch.web.filters.LogsearchKRBAuthenticationFilter;
+import 
org.apache.ambari.logsearch.web.filters.LogsearchEventHistoryStateFilter;
 import org.apache.ambari.logsearch.web.filters.LogsearchJWTFilter;
+import 
org.apache.ambari.logsearch.web.filters.LogsearchKRBAuthenticationFilter;
 import 
org.apache.ambari.logsearch.web.filters.LogsearchSecurityContextFormationFilter;
 import org.apache.ambari.logsearch.web.filters.LogsearchServiceLogsStateFilter;
-import 
org.apache.ambari.logsearch.web.filters.LogsearchEventHistoryStateFilter;
 import 
org.apache.ambari.logsearch.web.filters.LogsearchUsernamePasswordAuthenticationFilter;
 import 
org.apache.ambari.logsearch.web.security.LogsearchAuthenticationProvider;
 import org.springframework.context.annotation.Bean;
@@ -43,18 +49,15 @@ import org.springframework.context.annotation.Configuration;
 import 
org.springframework.security.config.annotation.web.builders.HttpSecurity;
 import 
org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
 import 
org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
+import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
+import org.springframework.security.crypto.password.PasswordEncoder;
 import 
org.springframework.security.web.access.intercept.FilterSecurityInterceptor;
 import 
org.springframework.security.web.authentication.www.BasicAuthenticationFilter;
 import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
 import org.springframework.security.web.util.matcher.OrRequestMatcher;
 import org.springframework.security.web.util.matcher.RequestMatcher;
 
-import javax.inject.Inject;
-import javax.inject.Named;
-import java.util.ArrayList;
-import java.util.List;
-
-import static 
org.apache.ambari.logsearch.common.LogSearchConstants.LOGSEARCH_SESSION_ID;
+import com.google.common.collect.Lists;
 
 @Configuration
 @EnableWebSecurity
@@ -172,6 +175,11 @@ public class SecurityConfig extends 
WebSecurityConfigurerAdapter {
   }
 
   @Bean
+  public PasswordEncoder passwordEncoder() {
+    return new BCryptPasswordEncoder();
+  }
+
+  @Bean
   public LogsearchServiceLogsStateFilter logsearchServiceLogFilter() {
     return new LogsearchServiceLogsStateFilter(serviceLogsRequestMatcher(), 
solrServiceLogsState, solrServiceLogPropsConfig);
   }
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/SolrConfig.java
 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/SolrConfig.java
index 33f4f6f..338c987 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/SolrConfig.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/conf/SolrConfig.java
@@ -20,17 +20,14 @@ package org.apache.ambari.logsearch.conf;
 
 import org.apache.ambari.logsearch.conf.global.SolrAuditLogsState;
 import org.apache.ambari.logsearch.conf.global.SolrCollectionState;
-import org.apache.ambari.logsearch.conf.global.LogLevelFilterManagerState;
-import org.apache.ambari.logsearch.conf.global.SolrServiceLogsState;
 import org.apache.ambari.logsearch.conf.global.SolrEventHistoryState;
+import org.apache.ambari.logsearch.conf.global.SolrServiceLogsState;
 import org.apache.ambari.logsearch.dao.SolrSchemaFieldDao;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
-import org.springframework.data.solr.repository.config.EnableSolrRepositories;
 import org.springframework.scheduling.annotation.EnableScheduling;
 
 @Configuration
-@EnableSolrRepositories
 @EnableScheduling
 public class SolrConfig {
 
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/dao/UserDao.java
 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/dao/UserDao.java
index 63cc89e..0e5ffab 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/dao/UserDao.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/dao/UserDao.java
@@ -27,9 +27,6 @@ import javax.annotation.PostConstruct;
 import javax.inject.Inject;
 
 import org.apache.ambari.logsearch.conf.AuthPropsConfig;
-import org.springframework.security.core.GrantedAuthority;
-import org.springframework.stereotype.Repository;
-import org.apache.ambari.logsearch.util.CommonUtil;
 import org.apache.ambari.logsearch.util.FileUtil;
 import org.apache.ambari.logsearch.util.JSONUtil;
 import org.apache.ambari.logsearch.web.model.Privilege;
@@ -39,6 +36,9 @@ import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections.Predicate;
 import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.crypto.password.PasswordEncoder;
+import org.springframework.stereotype.Repository;
 
 @Repository
 public class UserDao {
@@ -52,6 +52,9 @@ public class UserDao {
   @Inject
   private AuthPropsConfig authPropsConfig;
 
+  @Inject
+  private PasswordEncoder passwordEncoder;
+
   private ArrayList<HashMap<String, String>> userList = null;
 
   @SuppressWarnings("unchecked")
@@ -136,7 +139,7 @@ public class UserDao {
       String username = user.get(USER_NAME);
       String password = user.get(PASSWORD);
       if (StringUtils.isNotBlank(password)) {
-        encPassword = CommonUtil.encryptPassword(username, password);
+        encPassword = passwordEncoder.encode(password);
         user.put(PASSWORD, "");
         user.put(ENC_PASSWORD, encPassword);
         isUpdated = true;
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/util/CommonUtil.java
 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/util/CommonUtil.java
deleted file mode 100644
index 1cfe469..0000000
--- 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/util/CommonUtil.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.ambari.logsearch.util;
-
-import java.security.SecureRandom;
-
-import org.springframework.security.authentication.encoding.Md5PasswordEncoder;
-
-public class CommonUtil {
-  private CommonUtil() {
-    throw new UnsupportedOperationException();
-  }
-  
-  private static SecureRandom secureRandom = new SecureRandom();
-  private static int counter = 0;
-
-  public static String genGUI() {
-    return System.currentTimeMillis() + "_" + secureRandom.nextInt(1000) + "_" 
+ counter++;
-  }
-  
-  private static final Md5PasswordEncoder md5Encoder = new 
Md5PasswordEncoder();
-  public static String encryptPassword(String username, String password) {
-    return md5Encoder.encodePassword(password, username);
-  }
-}
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchSecurityContextFormationFilter.java
 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchSecurityContextFormationFilter.java
index fed86e8..b2cf041 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchSecurityContextFormationFilter.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchSecurityContextFormationFilter.java
@@ -19,6 +19,7 @@
 package org.apache.ambari.logsearch.web.filters;
 
 import java.io.IOException;
+import java.security.SecureRandom;
 
 import javax.inject.Inject;
 import javax.servlet.FilterChain;
@@ -32,7 +33,6 @@ import javax.servlet.http.HttpSession;
 
 import org.apache.ambari.logsearch.common.LogSearchContext;
 import org.apache.ambari.logsearch.manager.SessionManager;
-import org.apache.ambari.logsearch.util.CommonUtil;
 import org.apache.ambari.logsearch.web.model.User;
 import org.apache.log4j.Logger;
 import 
org.springframework.security.authentication.AnonymousAuthenticationToken;
@@ -47,6 +47,8 @@ public class LogsearchSecurityContextFormationFilter extends 
GenericFilterBean {
   public static final String LOGSEARCH_SC_SESSION_KEY = 
"LOGSEARCH_SECURITY_CONTEXT";
   public static final String USER_AGENT = "User-Agent";
 
+  private static SecureRandom secureRandom = new SecureRandom();
+
   @Inject
   SessionManager sessionManager;
 
@@ -80,7 +82,7 @@ public class LogsearchSecurityContextFormationFilter extends 
GenericFilterBean {
         }
         if (msaCookie == null) {
           HttpServletResponse httpResponse = (HttpServletResponse) response;
-          msaCookie = CommonUtil.genGUI();
+          msaCookie = System.currentTimeMillis() + "_" + 
secureRandom.nextInt(1000);
           Cookie cookie = new Cookie("msa", msaCookie);
           // TODO: Need to revisit this
           cookie.setMaxAge(Integer.MAX_VALUE);
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/filters/NoServletContext.java
 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/filters/NoServletContext.java
index f1663bc..7df09dc 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/filters/NoServletContext.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/filters/NoServletContext.java
@@ -28,6 +28,7 @@ import java.util.Set;
 
 import javax.servlet.Filter;
 import javax.servlet.FilterRegistration;
+import javax.servlet.FilterRegistration.Dynamic;
 import javax.servlet.RequestDispatcher;
 import javax.servlet.Servlet;
 import javax.servlet.ServletContext;
@@ -35,7 +36,6 @@ import javax.servlet.ServletException;
 import javax.servlet.ServletRegistration;
 import javax.servlet.SessionCookieConfig;
 import javax.servlet.SessionTrackingMode;
-import javax.servlet.FilterRegistration.Dynamic;
 import javax.servlet.descriptor.JspConfigDescriptor;
 
 public class NoServletContext implements ServletContext {
@@ -76,6 +76,36 @@ public class NoServletContext implements ServletContext {
   }
 
   @Override
+  public int getSessionTimeout() {
+    return 0;
+  }
+
+  @Override
+  public void setSessionTimeout(int i) {
+
+  }
+
+  @Override
+  public String getRequestCharacterEncoding() {
+    return null;
+  }
+
+  @Override
+  public void setRequestCharacterEncoding(String s) {
+
+  }
+
+  @Override
+  public String getResponseCharacterEncoding() {
+    return null;
+  }
+
+  @Override
+  public void setResponseCharacterEncoding(String s) {
+
+  }
+
+  @Override
   public SessionCookieConfig getSessionCookieConfig() {
     return null;
   }
@@ -253,19 +283,24 @@ public class NoServletContext implements ServletContext {
   }
 
   @Override
-  public javax.servlet.ServletRegistration.Dynamic addServlet(
+  public ServletRegistration.Dynamic addServlet(
       String servletName, Class<? extends Servlet> servletClass) {
     return null;
   }
 
   @Override
-  public javax.servlet.ServletRegistration.Dynamic addServlet(
+  public ServletRegistration.Dynamic addJspFile(String s, String s1) {
+    return null;
+  }
+
+  @Override
+  public ServletRegistration.Dynamic addServlet(
       String servletName, Servlet servlet) {
     return null;
   }
 
   @Override
-  public javax.servlet.ServletRegistration.Dynamic addServlet(
+  public ServletRegistration.Dynamic addServlet(
       String servletName, String className) {
     return null;
   }
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchFileAuthenticationProvider.java
 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchFileAuthenticationProvider.java
index 8c12e0a..90af07d 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchFileAuthenticationProvider.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchFileAuthenticationProvider.java
@@ -20,8 +20,10 @@ package org.apache.ambari.logsearch.web.security;
 
 import java.util.Collection;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+
 import org.apache.ambari.logsearch.conf.AuthPropsConfig;
-import org.apache.ambari.logsearch.util.CommonUtil;
 import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
@@ -32,9 +34,9 @@ import 
org.springframework.security.core.AuthenticationException;
 import org.springframework.security.core.GrantedAuthority;
 import org.springframework.security.core.userdetails.UserDetails;
 import org.springframework.security.core.userdetails.UserDetailsService;
+import org.springframework.security.crypto.password.PasswordEncoder;
 
-import javax.inject.Inject;
-import javax.inject.Named;
+import com.google.common.annotations.VisibleForTesting;
 
 @Named
 public class LogsearchFileAuthenticationProvider extends 
LogsearchAbstractAuthenticationProvider {
@@ -47,6 +49,9 @@ public class LogsearchFileAuthenticationProvider extends 
LogsearchAbstractAuthen
   @Inject
   private UserDetailsService userDetailsService;
 
+  @Inject
+  private PasswordEncoder passwordEncoder;
+
   @Override
   public Authentication authenticate(Authentication authentication) throws 
AuthenticationException {
     if (!authPropsConfig.isAuthFileEnabled()) {
@@ -75,14 +80,19 @@ public class LogsearchFileAuthenticationProvider extends 
LogsearchAbstractAuthen
       logger.error("Password can't be null or empty.");
       throw new BadCredentialsException("Password can't be null or empty.");
     }
-    String encPassword = CommonUtil.encryptPassword(username, password);
-    if (!encPassword.equals(user.getPassword())) {
+    //String encPassword = passwordEncoder.encode(password);
+    if (!passwordEncoder.matches(password, user.getPassword())) {
       logger.error("Wrong password for user=" + username);
       throw new BadCredentialsException("Wrong password.");
     }
     
     Collection<? extends GrantedAuthority> authorities = user.getAuthorities();
-    authentication = new UsernamePasswordAuthenticationToken(username, 
encPassword, authorities);
+    authentication = new UsernamePasswordAuthenticationToken(username, 
user.getPassword(), authorities);
     return authentication;
   }
+
+  @VisibleForTesting
+  public void setPasswordEncoder(PasswordEncoder passwordEncoder) {
+    this.passwordEncoder = passwordEncoder;
+  }
 }
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/main/scripts/logsearch.sh 
b/ambari-logsearch/ambari-logsearch-server/src/main/scripts/logsearch.sh
index a51775d..66760e2 100755
--- a/ambari-logsearch/ambari-logsearch-server/src/main/scripts/logsearch.sh
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/scripts/logsearch.sh
@@ -78,7 +78,12 @@ else
   LOGSEARCH_GC_LOGFILE="$LOG_PATH_WITHOUT_SLASH/$LOGSEARCH_GC_LOGFILE"
 fi
 
-LOGSEARCH_GC_OPTS="-XX:+PrintGCDetails -XX:+PrintGCDateStamps 
-Xloggc:$LOGSEARCH_GC_LOGFILE"
+java_version=$($JVM -version 2>&1 | grep 'version' | cut -d'"' -f2 | cut -d'.' 
-f2)
+if [ $java_version == "8" ]; then
+  LOGSEARCH_GC_OPTS="-XX:+PrintGCDetails -XX:+PrintGCDateStamps 
-Xloggc:$LOGSEARCH_GC_LOGFILE"
+else
+  LOGSEARCH_GC_OPTS="-Xlog:gc*:file=$LOGSEARCH_GC_LOGFILE:time"
+fi
 
 function print_usage() {
   cat << EOF
@@ -144,7 +149,12 @@ function start() {
   LOGSEARCH_DEBUG_PORT=${LOGSEARCH_DEBUG_PORT:-"5005"}
 
   if [ "$LOGSEARCH_DEBUG" = "true" ]; then
-    LOGSEARCH_JAVA_OPTS="$LOGSEARCH_JAVA_OPTS -Xdebug 
-Xrunjdwp:transport=dt_socket,address=$LOGSEARCH_DEBUG_PORT,server=y,suspend=$LOGSEARCH_DEBUG_SUSPEND
 "
+    if [ $java_version == "8" ]; then
+      LOGSEARCH_DEBUG_ADDRESS=$LOGSEARCH_DEBUG_PORT
+    else
+      LOGSEARCH_DEBUG_ADDRESS="*:$LOGSEARCH_DEBUG_PORT"
+    fi
+    LOGSEARCH_JAVA_OPTS="$LOGSEARCH_JAVA_OPTS -Xdebug 
-Xrunjdwp:transport=dt_socket,address=$LOGSEARCH_DEBUG_ADDRESS,server=y,suspend=$LOGSEARCH_DEBUG_SUSPEND
 "
   fi
 
   if [ "$LOGSEARCH_SSL" = "true" ]; then
@@ -199,7 +209,7 @@ function start() {
 }
 
 function stop() {
-  LOGSEARCH_STOP_WAIT=3
+  LOGSEARCH_STOP_WAIT=${LOGSEARCH_STOP_WAIT:-10}
   if [ -f "$LOGSEARCH_PID_FILE" ]; then
     LOGSEARCH_PID=`cat "$LOGSEARCH_PID_FILE"`
   fi
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/AuditLogRequestConverterTest.java
 
b/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/AuditLogRequestConverterTest.java
index 2ccc741..a9edc80 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/AuditLogRequestConverterTest.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/AuditLogRequestConverterTest.java
@@ -18,6 +18,8 @@
  */
 package org.apache.ambari.logsearch.converter;
 
+import static org.junit.Assert.assertEquals;
+
 import org.apache.ambari.logsearch.model.request.impl.AuditLogRequest;
 import 
org.apache.ambari.logsearch.model.request.impl.query.AuditLogQueryRequest;
 import org.apache.solr.client.solrj.SolrQuery;
@@ -26,8 +28,6 @@ import org.junit.Test;
 import org.springframework.data.solr.core.DefaultQueryParser;
 import org.springframework.data.solr.core.query.SimpleQuery;
 
-import static org.junit.Assert.assertEquals;
-
 public class AuditLogRequestConverterTest extends AbstractRequestConverterTest 
{
 
   private AuditLogRequestQueryConverter underTest;
@@ -47,8 +47,8 @@ public class AuditLogRequestConverterTest extends 
AbstractRequestConverterTest {
     SimpleQuery simpleQuery = underTest.convert(request);
     SolrQuery queryResult = new 
DefaultQueryParser().doConstructSolrQuery(simpleQuery);
     // THEN
-    
assertEquals("?q=*%3A*&start=0&rows=25&fq=repo%3A%28logsearch_app+OR+secure_log%29&fq=-repo%3A%28hst_agent+OR+system_message%29"
 +
-        
"&fq=log_message%3Amyincludemessage&fq=-log_message%3Amyexcludemessage&fq=cluster%3Acl1&fq=reqUser%3A%28joe+OR+steven%29&sort=evtTime+desc%2Cseq_num+desc",
+    
assertEquals("?q=*%3A*&start=0&rows=25&fq=repo%3A%28logsearch_app+%22OR%22+secure_log%29&fq=-repo%3A%28hst_agent+%22OR%22+system_message%29"
 +
+        
"&fq=log_message%3Amyincludemessage&fq=-log_message%3Amyexcludemessage&fq=cluster%3Acl1&fq=reqUser%3A%28joe+%22OR%22+steven%29&sort=evtTime+desc%2Cseq_num+desc",
       queryResult.toQueryString());
   }
 
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/AuditServiceLoadRequestQueryConverterTest.java
 
b/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/AuditServiceLoadRequestQueryConverterTest.java
index 9d3d145..5eed28b 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/AuditServiceLoadRequestQueryConverterTest.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/AuditServiceLoadRequestQueryConverterTest.java
@@ -18,6 +18,8 @@
  */
 package org.apache.ambari.logsearch.converter;
 
+import static org.junit.Assert.assertEquals;
+
 import org.apache.ambari.logsearch.model.request.impl.AuditServiceLoadRequest;
 import 
org.apache.ambari.logsearch.model.request.impl.query.AuditServiceLoadQueryRequest;
 import org.apache.solr.client.solrj.SolrQuery;
@@ -25,8 +27,6 @@ import org.junit.Before;
 import org.junit.Test;
 import org.springframework.data.solr.core.DefaultQueryParser;
 
-import static org.junit.Assert.assertEquals;
-
 public class AuditServiceLoadRequestQueryConverterTest extends 
AbstractRequestConverterTest {
 
   private AuditServiceLoadRequestQueryConverter underTest;
@@ -45,8 +45,8 @@ public class AuditServiceLoadRequestQueryConverterTest 
extends AbstractRequestCo
     SolrQuery solrQuery = new 
DefaultQueryParser().doConstructSolrQuery(underTest.convert(request));
     // THEN
     
assertEquals("?q=*%3A*&rows=0&fq=evtTime%3A%5B2016-09-13T22%3A00%3A01.000Z+TO+2016-09-14T22%3A00%3A01.000Z%5D"
 +
-      
"&fq=log_message%3Amyincludemessage&fq=-log_message%3Amyexcludemessage&fq=repo%3A%28logsearch_app+OR+secure_log%29"
 +
-      
"&fq=-repo%3A%28hst_agent+OR+system_message%29&fq=cluster%3Acl1&facet=true&facet.mincount=1&facet.limit=10&facet.field=repo",
 solrQuery.toQueryString());
+      
"&fq=log_message%3Amyincludemessage&fq=-log_message%3Amyexcludemessage&fq=repo%3A%28logsearch_app+%22OR%22+secure_log%29"
 +
+      
"&fq=-repo%3A%28hst_agent+%22OR%22+system_message%29&fq=cluster%3Acl1&facet=true&facet.mincount=1&facet.limit=10&facet.field=repo",
 solrQuery.toQueryString());
   }
 
   @Test
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/BaseServiceLogRequestQueryConverterTest.java
 
b/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/BaseServiceLogRequestQueryConverterTest.java
index 45745da..63b02f3 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/BaseServiceLogRequestQueryConverterTest.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/BaseServiceLogRequestQueryConverterTest.java
@@ -18,6 +18,8 @@
  */
 package org.apache.ambari.logsearch.converter;
 
+import static org.junit.Assert.assertEquals;
+
 import org.apache.ambari.logsearch.model.request.impl.ServiceLogRequest;
 import 
org.apache.ambari.logsearch.model.request.impl.query.ServiceLogQueryRequest;
 import org.apache.ambari.logsearch.util.SolrUtil;
@@ -27,8 +29,6 @@ import org.junit.Test;
 import org.springframework.data.solr.core.DefaultQueryParser;
 import org.springframework.data.solr.core.query.SimpleQuery;
 
-import static org.junit.Assert.assertEquals;
-
 public class BaseServiceLogRequestQueryConverterTest extends 
AbstractRequestConverterTest {
 
   private BaseServiceLogRequestQueryConverter underTest;
@@ -53,9 +53,9 @@ public class BaseServiceLogRequestQueryConverterTest extends 
AbstractRequestConv
     SolrQuery solrQuery = defaultQueryParser.doConstructSolrQuery(query);
     SolrUtil.removeDoubleOrTripleEscapeFromFilters(solrQuery);
     // THEN
-    
assertEquals("?q=*%3A*&start=0&rows=25&fq=type%3A%28logsearch_app+OR+secure_log%29&fq=-type%3A%28hst_agent+OR+system_message%29"
 +
+    
assertEquals("?q=*%3A*&start=0&rows=25&fq=type%3A%28logsearch_app+%22OR%22+secure_log%29&fq=-type%3A%28hst_agent+%22OR%22+system_message%29"
 +
         
"&fq=log_message%3Amyincludemessage&fq=-log_message%3Amyexcludemessage&fq=cluster%3Acl1&fq=path%3A%5C%2Fvar%5C%2Flog%5C%2Fmyfile%5C-%5C*%5C-hdfs.log"
 +
-        
"&fq=type%3Acomponent&fq=level%3A%28FATAL+OR+ERROR+OR+WARN+OR+UNKNOWN%29&fq=host%3A%28logsearch1.com+OR+logsearch2.com%29"
 +
+        
"&fq=type%3Acomponent&fq=level%3A%28FATAL+%22OR%22+ERROR+%22OR%22+WARN+%22OR%22+UNKNOWN%29&fq=host%3A%28logsearch1.com+%22OR%22+logsearch2.com%29"
 +
         
"&fq=logtime%3A%5B2016-09-13T22%3A00%3A01.000Z+TO+2016-09-14T22%3A00%3A01.000Z%5D&sort=logtime+desc%2Cseq_num+desc",
       solrQuery.toQueryString());
   }
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/FieldAuditLogRequestQueryConverterTest.java
 
b/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/FieldAuditLogRequestQueryConverterTest.java
index 669ef1a..7c41520 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/FieldAuditLogRequestQueryConverterTest.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/FieldAuditLogRequestQueryConverterTest.java
@@ -18,6 +18,8 @@
  */
 package org.apache.ambari.logsearch.converter;
 
+import static org.junit.Assert.assertEquals;
+
 import org.apache.ambari.logsearch.model.request.impl.FieldAuditLogRequest;
 import 
org.apache.ambari.logsearch.model.request.impl.query.FieldAuditLogQueryRequest;
 import org.apache.solr.client.solrj.SolrQuery;
@@ -25,8 +27,6 @@ import org.junit.Before;
 import org.junit.Test;
 import org.springframework.data.solr.core.DefaultQueryParser;
 
-import static org.junit.Assert.assertEquals;
-
 public class FieldAuditLogRequestQueryConverterTest extends 
AbstractRequestConverterTest {
 
   private FieldAuditLogRequestQueryConverter underTest;
@@ -46,8 +46,8 @@ public class FieldAuditLogRequestQueryConverterTest extends 
AbstractRequestConve
     SolrQuery query = new 
DefaultQueryParser().doConstructSolrQuery(underTest.convert(request));
     // THEN
     
assertEquals("?q=*%3A*&rows=0&fq=evtTime%3A%5B2016-09-13T22%3A00%3A01.000Z+TO+2016-09-14T22%3A00%3A01.000Z%5D"
 +
-        
"&fq=log_message%3Amyincludemessage&fq=-log_message%3Amyexcludemessage&fq=repo%3A%28logsearch_app+OR+secure_log%29"
 +
-        
"&fq=-repo%3A%28hst_agent+OR+system_message%29&fq=cluster%3Acl1&facet=true&facet.mincount=1&facet.limit=-1&facet.pivot=myfield%2Crepo",
+        
"&fq=log_message%3Amyincludemessage&fq=-log_message%3Amyexcludemessage&fq=repo%3A%28logsearch_app+%22OR%22+secure_log%29"
 +
+        
"&fq=-repo%3A%28hst_agent+%22OR%22+system_message%29&fq=cluster%3Acl1&facet=true&facet.mincount=1&facet.limit=-1&facet.pivot=myfield%2Crepo",
       query.toQueryString());
   }
 
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogAnyGraphRequestConverterTest.java
 
b/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogAnyGraphRequestConverterTest.java
index 02819f1..73d9aff 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogAnyGraphRequestConverterTest.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogAnyGraphRequestConverterTest.java
@@ -18,6 +18,8 @@
  */
 package org.apache.ambari.logsearch.converter;
 
+import static org.junit.Assert.assertEquals;
+
 import org.apache.ambari.logsearch.model.request.impl.ServiceAnyGraphRequest;
 import 
org.apache.ambari.logsearch.model.request.impl.query.ServiceAnyGraphQueryRequest;
 import org.apache.solr.client.solrj.SolrQuery;
@@ -25,8 +27,6 @@ import org.junit.Before;
 import org.junit.Test;
 import org.springframework.data.solr.core.DefaultQueryParser;
 
-import static org.junit.Assert.assertEquals;
-
 public class ServiceLogAnyGraphRequestConverterTest extends 
AbstractRequestConverterTest {
 
   private ServiceLogAnyGraphRequestQueryConverter underTest;
@@ -46,8 +46,8 @@ public class ServiceLogAnyGraphRequestConverterTest extends 
AbstractRequestConve
     SolrQuery query = new 
DefaultQueryParser().doConstructSolrQuery(underTest.convert(request));
     // THEN
     
assertEquals("?q=*%3A*&rows=0&fq=logtime%3A%5B2016-09-13T22%3A00%3A01.000Z+TO+2016-09-14T22%3A00%3A01.000Z%5D"
 +
-        
"&fq=log_message%3Amyincludemessage&fq=-log_message%3Amyexcludemessage&fq=type%3A%28logsearch_app+OR+secure_log%29"
 +
-        
"&fq=-type%3A%28hst_agent+OR+system_message%29&fq=cluster%3Acl1&facet=true&facet.mincount=1&facet.limit=-1&facet.field=level",
+        
"&fq=log_message%3Amyincludemessage&fq=-log_message%3Amyexcludemessage&fq=type%3A%28logsearch_app+%22OR%22+secure_log%29"
 +
+        
"&fq=-type%3A%28hst_agent+%22OR%22+system_message%29&fq=cluster%3Acl1&facet=true&facet.mincount=1&facet.limit=-1&facet.field=level",
       query.toQueryString());
   }
 
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogComponentLevelRequestQueryConverterTest.java
 
b/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogComponentLevelRequestQueryConverterTest.java
index f395c88..902f7e5 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogComponentLevelRequestQueryConverterTest.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogComponentLevelRequestQueryConverterTest.java
@@ -18,6 +18,8 @@
  */
 package org.apache.ambari.logsearch.converter;
 
+import static org.junit.Assert.assertEquals;
+
 import 
org.apache.ambari.logsearch.model.request.impl.ServiceLogComponentLevelRequest;
 import 
org.apache.ambari.logsearch.model.request.impl.query.ServiceLogComponentLevelQueryRequest;
 import org.apache.solr.client.solrj.SolrQuery;
@@ -25,8 +27,6 @@ import org.junit.Before;
 import org.junit.Test;
 import org.springframework.data.solr.core.DefaultQueryParser;
 
-import static org.junit.Assert.assertEquals;
-
 public class ServiceLogComponentLevelRequestQueryConverterTest extends 
AbstractRequestConverterTest {
 
   private ServiceLogComponentLevelRequestQueryConverter underTest;
@@ -47,8 +47,8 @@ public class 
ServiceLogComponentLevelRequestQueryConverterTest extends AbstractR
     SolrQuery query = new 
DefaultQueryParser().doConstructSolrQuery(underTest.convert(request));
     // THEN
     
assertEquals("?q=*%3A*&rows=0&fq=logtime%3A%5B2016-09-13T22%3A00%3A01.000Z+TO+2016-09-14T22%3A00%3A01.000Z%5D"
 +
-        
"&fq=log_message%3Amyincludemessage&fq=-log_message%3Amyexcludemessage&fq=type%3A%28logsearch_app+OR+secure_log%29"
 +
-        
"&fq=-type%3A%28hst_agent+OR+system_message%29&fq=type%3Amycomponent&fq=level%3A%28WARN+OR+ERROR+OR+FATAL%29&fq=cluster%3Acl1"
 +
+        
"&fq=log_message%3Amyincludemessage&fq=-log_message%3Amyexcludemessage&fq=type%3A%28logsearch_app+%22OR%22+secure_log%29"
 +
+        
"&fq=-type%3A%28hst_agent+%22OR%22+system_message%29&fq=type%3Amycomponent&fq=level%3A%28WARN+%22OR%22+ERROR+%22OR%22+FATAL%29&fq=cluster%3Acl1"
 +
         
"&facet=true&facet.mincount=1&facet.limit=-1&facet.sort=index&facet.pivot=type%2Clevel",
       query.toQueryString());
   }
@@ -61,7 +61,7 @@ public class 
ServiceLogComponentLevelRequestQueryConverterTest extends AbstractR
     // WHEN
     SolrQuery query = new 
DefaultQueryParser().doConstructSolrQuery(underTest.convert(request));
     // THEN
-    
assertEquals("?q=*%3A*&rows=0&fq=logtime%3A%5B*+TO+*%5D&fq=level%3A%28WARN+OR+ERROR+OR+FATAL%29&facet=true"
 +
+    
assertEquals("?q=*%3A*&rows=0&fq=logtime%3A%5B*+TO+*%5D&fq=level%3A%28WARN+%22OR%22+ERROR+%22OR%22+FATAL%29&facet=true"
 +
       
"&facet.mincount=1&facet.limit=-1&facet.sort=index&facet.pivot=type%2Clevel", 
query.toQueryString());
   }
 }
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogComponentRequestFacetQueryConverterTest.java
 
b/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogComponentRequestFacetQueryConverterTest.java
index 8ece866..779a0ab 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogComponentRequestFacetQueryConverterTest.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogComponentRequestFacetQueryConverterTest.java
@@ -18,6 +18,8 @@
  */
 package org.apache.ambari.logsearch.converter;
 
+import static org.junit.Assert.assertEquals;
+
 import 
org.apache.ambari.logsearch.model.request.impl.ServiceLogComponentHostRequest;
 import 
org.apache.ambari.logsearch.model.request.impl.query.ServiceLogComponentHostQueryRequest;
 import org.apache.solr.client.solrj.SolrQuery;
@@ -25,8 +27,6 @@ import org.junit.Before;
 import org.junit.Test;
 import org.springframework.data.solr.core.DefaultQueryParser;
 
-import static org.junit.Assert.assertEquals;
-
 public class ServiceLogComponentRequestFacetQueryConverterTest extends 
AbstractRequestConverterTest {
 
   private ServiceLogComponentRequestFacetQueryConverter underTest;
@@ -47,8 +47,8 @@ public class 
ServiceLogComponentRequestFacetQueryConverterTest extends AbstractR
     SolrQuery query = new 
DefaultQueryParser().doConstructSolrQuery(underTest.convert(request));
     // THEN
     
assertEquals("?q=*%3A*&rows=0&fq=logtime%3A%5B2016-09-13T22%3A00%3A01.000Z+TO+2016-09-14T22%3A00%3A01.000Z%5D"
 +
-        
"&fq=log_message%3Amyincludemessage&fq=-log_message%3Amyexcludemessage&fq=type%3A%28logsearch_app+OR+secure_log%29"
 +
-        
"&fq=-type%3A%28hst_agent+OR+system_message%29&fq=type%3Amycomponent&fq=level%3A%28WARN+OR+ERROR+OR+FATAL%29"
 +
+        
"&fq=log_message%3Amyincludemessage&fq=-log_message%3Amyexcludemessage&fq=type%3A%28logsearch_app+%22OR%22+secure_log%29"
 +
+        
"&fq=-type%3A%28hst_agent+%22OR%22+system_message%29&fq=type%3Amycomponent&fq=level%3A%28WARN+%22OR%22+ERROR+%22OR%22+FATAL%29"
 +
         
"&fq=cluster%3Acl1&facet=true&facet.mincount=1&facet.limit=-1&facet.sort=index&facet.pivot=type%2Chost%2Clevel&facet.pivot=type%2Clevel",
       query.toQueryString());
   }
@@ -61,7 +61,7 @@ public class 
ServiceLogComponentRequestFacetQueryConverterTest extends AbstractR
     // WHEN
     SolrQuery query = new 
DefaultQueryParser().doConstructSolrQuery(underTest.convert(request));
     // THEN
-    
assertEquals("?q=*%3A*&rows=0&fq=logtime%3A%5B*+TO+*%5D&fq=level%3A%28WARN+OR+ERROR+OR+FATAL%29"
 +
+    
assertEquals("?q=*%3A*&rows=0&fq=logtime%3A%5B*+TO+*%5D&fq=level%3A%28WARN+%22OR%22+ERROR+%22OR%22+FATAL%29"
 +
         
"&facet=true&facet.mincount=1&facet.limit=-1&facet.sort=index&facet.pivot=type%2Chost%2Clevel&facet.pivot=type%2Clevel",
       query.toQueryString());
   }
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogLevelCountRequestQueryConverterTest.java
 
b/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogLevelCountRequestQueryConverterTest.java
index 54d3435..c6d7b14 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogLevelCountRequestQueryConverterTest.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogLevelCountRequestQueryConverterTest.java
@@ -18,6 +18,8 @@
  */
 package org.apache.ambari.logsearch.converter;
 
+import static org.junit.Assert.assertEquals;
+
 import 
org.apache.ambari.logsearch.model.request.impl.ServiceLogLevelCountRequest;
 import 
org.apache.ambari.logsearch.model.request.impl.query.ServiceLogLevelCountQueryRequest;
 import org.apache.solr.client.solrj.SolrQuery;
@@ -25,8 +27,6 @@ import org.junit.Before;
 import org.junit.Test;
 import org.springframework.data.solr.core.DefaultQueryParser;
 
-import static org.junit.Assert.assertEquals;
-
 public class ServiceLogLevelCountRequestQueryConverterTest extends 
AbstractRequestConverterTest {
 
   private ServiceLogLevelCountRequestQueryConverter underTest;
@@ -45,8 +45,8 @@ public class ServiceLogLevelCountRequestQueryConverterTest 
extends AbstractReque
     SolrQuery query = new 
DefaultQueryParser().doConstructSolrQuery(underTest.convert(request));
     // THEN
     
assertEquals("?q=*%3A*&rows=0&fq=logtime%3A%5B2016-09-13T22%3A00%3A01.000Z+TO+2016-09-14T22%3A00%3A01.000Z%5D"
 +
-        
"&fq=log_message%3Amyincludemessage&fq=-log_message%3Amyexcludemessage&fq=type%3A%28logsearch_app+OR+secure_log%29"
 +
-        
"&fq=-type%3A%28hst_agent+OR+system_message%29&fq=cluster%3Acl1&facet=true&facet.mincount=1&facet.limit=-1&facet.field=level",
+        
"&fq=log_message%3Amyincludemessage&fq=-log_message%3Amyexcludemessage&fq=type%3A%28logsearch_app+%22OR%22+secure_log%29"
 +
+        
"&fq=-type%3A%28hst_agent+%22OR%22+system_message%29&fq=cluster%3Acl1&facet=true&facet.mincount=1&facet.limit=-1&facet.field=level",
       query.toQueryString());
   }
 
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogTreeRequestFacetQueryConverterTest.java
 
b/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogTreeRequestFacetQueryConverterTest.java
index 7c6c9fd..4209bf6 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogTreeRequestFacetQueryConverterTest.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogTreeRequestFacetQueryConverterTest.java
@@ -18,6 +18,8 @@
  */
 package org.apache.ambari.logsearch.converter;
 
+import static org.junit.Assert.assertEquals;
+
 import 
org.apache.ambari.logsearch.model.request.impl.ServiceLogHostComponentRequest;
 import 
org.apache.ambari.logsearch.model.request.impl.query.ServiceLogHostComponentQueryRequest;
 import org.apache.solr.client.solrj.SolrQuery;
@@ -25,8 +27,6 @@ import org.junit.Before;
 import org.junit.Test;
 import org.springframework.data.solr.core.DefaultQueryParser;
 
-import static org.junit.Assert.assertEquals;
-
 public class ServiceLogTreeRequestFacetQueryConverterTest extends 
AbstractRequestConverterTest {
   private ServiceLogTreeRequestFacetQueryConverter underTest;
 
@@ -45,8 +45,8 @@ public class ServiceLogTreeRequestFacetQueryConverterTest 
extends AbstractReques
     SolrQuery query = new 
DefaultQueryParser().doConstructSolrQuery(underTest.convert(request));
     // THEN
     
assertEquals("?q=*%3A*&rows=0&fq=logtime%3A%5B2016-09-13T22%3A00%3A01.000Z+TO+2016-09-14T22%3A00%3A01.000Z%5D"
 +
-        
"&fq=log_message%3Amyincludemessage&fq=-log_message%3Amyexcludemessage&fq=type%3A%28logsearch_app+OR+secure_log%29"
 +
-        
"&fq=-type%3A%28hst_agent+OR+system_message%29&fq=level%3A%28WARN+OR+ERROR+OR+FATAL%29&fq=cluster%3Acl1&facet=true"
 +
+        
"&fq=log_message%3Amyincludemessage&fq=-log_message%3Amyexcludemessage&fq=type%3A%28logsearch_app+%22OR%22+secure_log%29"
 +
+        
"&fq=-type%3A%28hst_agent+%22OR%22+system_message%29&fq=level%3A%28WARN+%22OR%22+ERROR+%22OR%22+FATAL%29&fq=cluster%3Acl1&facet=true"
 +
         
"&facet.mincount=1&facet.limit=-1&facet.sort=index&facet.pivot=host%2Ctype%2Clevel&facet.pivot=host%2Clevel",
       query.toQueryString());
   }
@@ -59,7 +59,7 @@ public class ServiceLogTreeRequestFacetQueryConverterTest 
extends AbstractReques
     // WHEN
     SolrQuery query = new 
DefaultQueryParser().doConstructSolrQuery(underTest.convert(request));
     // THEN
-    
assertEquals("?q=*%3A*&rows=0&fq=logtime%3A%5B*+TO+*%5D&fq=level%3A%28WARN+OR+ERROR+OR+FATAL%29"
 +
+    
assertEquals("?q=*%3A*&rows=0&fq=logtime%3A%5B*+TO+*%5D&fq=level%3A%28WARN+%22OR%22+ERROR+%22OR%22+FATAL%29"
 +
         
"&facet=true&facet.mincount=1&facet.limit=-1&facet.sort=index&facet.pivot=host%2Ctype%2Clevel&facet.pivot=host%2Clevel",
       query.toQueryString());
   }
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogTruncatedRequestQueryConverterTest.java
 
b/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogTruncatedRequestQueryConverterTest.java
index b2b7014..4b1ccb3 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogTruncatedRequestQueryConverterTest.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/ServiceLogTruncatedRequestQueryConverterTest.java
@@ -18,6 +18,8 @@
  */
 package org.apache.ambari.logsearch.converter;
 
+import static org.junit.Assert.assertEquals;
+
 import 
org.apache.ambari.logsearch.model.request.impl.ServiceLogTruncatedRequest;
 import 
org.apache.ambari.logsearch.model.request.impl.query.ServiceLogTruncatedQueryRequest;
 import org.apache.solr.client.solrj.SolrQuery;
@@ -25,8 +27,6 @@ import org.junit.Before;
 import org.junit.Test;
 import org.springframework.data.solr.core.DefaultQueryParser;
 
-import static org.junit.Assert.assertEquals;
-
 public class ServiceLogTruncatedRequestQueryConverterTest extends 
AbstractRequestConverterTest {
 
   private ServiceLogTruncatedRequestQueryConverter underTest;
@@ -47,8 +47,8 @@ public class ServiceLogTruncatedRequestQueryConverterTest 
extends AbstractReques
     // WHEN
     SolrQuery query = new 
DefaultQueryParser().doConstructSolrQuery(underTest.convert(request));
     // THEN
-    
assertEquals("?q=*%3A*&start=0&rows=10&fq=type%3A%28logsearch_app+OR+secure_log%29"
 +
-        
"&fq=-type%3A%28hst_agent+OR+system_message%29&fq=log_message%3Amyincludemessage&fq=-log_message%3Amyexcludemessage"
 +
+    
assertEquals("?q=*%3A*&start=0&rows=10&fq=type%3A%28logsearch_app+%22OR%22+secure_log%29"
 +
+        
"&fq=-type%3A%28hst_agent+%22OR%22+system_message%29&fq=log_message%3Amyincludemessage&fq=-log_message%3Amyexcludemessage"
 +
         "&fq=cluster%3Acl1&sort=logtime+desc%2Cseq_num+desc",
       query.toQueryString());
   }
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/TopFieldAuditLogRequestQueryConverterTest.java
 
b/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/TopFieldAuditLogRequestQueryConverterTest.java
index b1b4d49..6ada7dc 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/TopFieldAuditLogRequestQueryConverterTest.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/TopFieldAuditLogRequestQueryConverterTest.java
@@ -18,6 +18,8 @@
  */
 package org.apache.ambari.logsearch.converter;
 
+import static org.junit.Assert.assertEquals;
+
 import org.apache.ambari.logsearch.model.request.impl.TopFieldAuditLogRequest;
 import 
org.apache.ambari.logsearch.model.request.impl.query.TopFieldAuditLogQueryRequest;
 import org.apache.solr.client.solrj.SolrQuery;
@@ -25,8 +27,6 @@ import org.junit.Before;
 import org.junit.Test;
 import org.springframework.data.solr.core.DefaultQueryParser;
 
-import static org.junit.Assert.assertEquals;
-
 public class TopFieldAuditLogRequestQueryConverterTest extends 
AbstractRequestConverterTest {
 
   private TopFieldAuditLogRequestQueryConverter underTest;
@@ -47,8 +47,8 @@ public class TopFieldAuditLogRequestQueryConverterTest 
extends AbstractRequestCo
     SolrQuery query = new 
DefaultQueryParser().doConstructSolrQuery(underTest.convert(request));
     // THEN
     
assertEquals("?q=*%3A*&rows=0&fq=evtTime%3A%5B2016-09-13T22%3A00%3A01.000Z+TO+2016-09-14T22%3A00%3A01.000Z%5D"
 +
-        
"&fq=log_message%3Amyincludemessage&fq=-log_message%3Amyexcludemessage&fq=repo%3A%28logsearch_app+OR+secure_log%29"
 +
-        
"&fq=-repo%3A%28hst_agent+OR+system_message%29&fq=cluster%3Acl1&facet=true&facet.mincount=1&facet.limit=10&facet.pivot=myfield%2Crepo",
+        
"&fq=log_message%3Amyincludemessage&fq=-log_message%3Amyexcludemessage&fq=repo%3A%28logsearch_app+%22OR%22+secure_log%29"
 +
+        
"&fq=-repo%3A%28hst_agent+%22OR%22+system_message%29&fq=cluster%3Acl1&facet=true&facet.mincount=1&facet.limit=10&facet.pivot=myfield%2Crepo",
       query.toQueryString());
   }
 
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/UserExportRequestQueryConverterTest.java
 
b/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/UserExportRequestQueryConverterTest.java
index 1ec6414..34b7831 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/UserExportRequestQueryConverterTest.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/converter/UserExportRequestQueryConverterTest.java
@@ -18,6 +18,8 @@
  */
 package org.apache.ambari.logsearch.converter;
 
+import static org.junit.Assert.assertEquals;
+
 import org.apache.ambari.logsearch.model.request.impl.UserExportRequest;
 import 
org.apache.ambari.logsearch.model.request.impl.query.UserExportQueryRequest;
 import org.apache.solr.client.solrj.SolrQuery;
@@ -25,8 +27,6 @@ import org.junit.Before;
 import org.junit.Test;
 import org.springframework.data.solr.core.DefaultQueryParser;
 
-import static org.junit.Assert.assertEquals;
-
 public class UserExportRequestQueryConverterTest extends 
AbstractRequestConverterTest {
   private UserExportRequestQueryConverter underTest;
 
@@ -46,8 +46,8 @@ public class UserExportRequestQueryConverterTest extends 
AbstractRequestConverte
     SolrQuery query = new 
DefaultQueryParser().doConstructSolrQuery(underTest.convert(request));
     // THEN
     
assertEquals("?q=*%3A*&rows=0&fq=evtTime%3A%5B2016-09-13T22%3A00%3A01.000Z+TO+2016-09-14T22%3A00%3A01.000Z%5D"
 +
-        
"&fq=log_message%3Amyincludemessage&fq=-log_message%3Amyexcludemessage&fq=repo%3A%28logsearch_app+OR+secure_log%29"
 +
-        
"&fq=-repo%3A%28hst_agent+OR+system_message%29&facet=true&facet.mincount=1&facet.limit=-1&facet.pivot=reqUser%2Crepo&facet.pivot=resource%2Crepo",
+        
"&fq=log_message%3Amyincludemessage&fq=-log_message%3Amyexcludemessage&fq=repo%3A%28logsearch_app+%22OR%22+secure_log%29"
 +
+        
"&fq=-repo%3A%28hst_agent+%22OR%22+system_message%29&facet=true&facet.mincount=1&facet.limit=-1&facet.pivot=reqUser%2Crepo&facet.pivot=resource%2Crepo",
       query.toQueryString());
   }
 
diff --git 
a/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/web/security/LogsearchFileAuthenticationProviderTest.java
 
b/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/web/security/LogsearchFileAuthenticationProviderTest.java
index 407cc83..d3d8120 100644
--- 
a/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/web/security/LogsearchFileAuthenticationProviderTest.java
+++ 
b/ambari-logsearch/ambari-logsearch-server/src/test/java/org/apache/ambari/logsearch/web/security/LogsearchFileAuthenticationProviderTest.java
@@ -18,8 +18,19 @@
  */
 package org.apache.ambari.logsearch.web.security;
 
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertSame;
+import static junit.framework.Assert.fail;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.strictMock;
+import static org.easymock.EasyMock.verify;
+
+import java.lang.reflect.Field;
+import java.util.Collections;
+import java.util.List;
+
 import org.apache.ambari.logsearch.conf.AuthPropsConfig;
-import org.apache.ambari.logsearch.util.CommonUtil;
 import org.apache.ambari.logsearch.web.model.User;
 import org.junit.Before;
 import org.junit.Test;
@@ -29,24 +40,15 @@ import org.springframework.security.core.Authentication;
 import org.springframework.security.core.GrantedAuthority;
 import org.springframework.security.core.authority.SimpleGrantedAuthority;
 import org.springframework.security.core.userdetails.UserDetailsService;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertSame;
-import static junit.framework.Assert.assertTrue;
-import static org.easymock.EasyMock.strictMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-
-import java.lang.reflect.Field;
-import java.util.Arrays;
-import java.util.List;
+import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
+import org.springframework.security.crypto.password.PasswordEncoder;
 
 public class LogsearchFileAuthenticationProviderTest {
 
   private LogsearchFileAuthenticationProvider provider;
   private AuthPropsConfig mockAuthPropsConfig;
   private UserDetailsService mockUserDetailsService;
+  private PasswordEncoder passwordEncoder;
   
   @Before
   public void init() throws Exception {
@@ -61,6 +63,9 @@ public class LogsearchFileAuthenticationProviderTest {
     Field userDetailsServiceField = 
LogsearchFileAuthenticationProvider.class.getDeclaredField("userDetailsService");
     userDetailsServiceField.setAccessible(true);
     userDetailsServiceField.set(provider, mockUserDetailsService);
+
+    passwordEncoder = new BCryptPasswordEncoder();
+    provider.setPasswordEncoder(passwordEncoder);
   }
   
   @Test
@@ -85,7 +90,7 @@ public class LogsearchFileAuthenticationProviderTest {
     
     try {
       provider.authenticate(authentication);
-      assertTrue("Should have thrown BadCredentialsException", false);
+      fail("Should have thrown BadCredentialsException");
     } catch(BadCredentialsException e) {
       assertEquals("Username can't be null or empty.", e.getMessage());
     }
@@ -103,7 +108,7 @@ public class LogsearchFileAuthenticationProviderTest {
     
     try {
       provider.authenticate(authentication);
-      assertTrue("Should have thrown BadCredentialsException", false);
+      fail("Should have thrown BadCredentialsException");
     } catch(BadCredentialsException e) {
       assertEquals("Username can't be null or empty.", e.getMessage());
     }
@@ -122,7 +127,7 @@ public class LogsearchFileAuthenticationProviderTest {
     
     try {
       provider.authenticate(authentication);
-      assertTrue("Should have thrown BadCredentialsException", false);
+      fail("Should have thrown BadCredentialsException");
     } catch(BadCredentialsException e) {
       assertEquals("Password can't be null or empty.", e.getMessage());
     }
@@ -140,7 +145,7 @@ public class LogsearchFileAuthenticationProviderTest {
     
     try {
       provider.authenticate(authentication);
-      assertTrue("Should have thrown BadCredentialsException", false);
+      fail("Should have thrown BadCredentialsException");
     } catch(BadCredentialsException e) {
       assertEquals("Password can't be null or empty.", e.getMessage());
     }
@@ -158,7 +163,7 @@ public class LogsearchFileAuthenticationProviderTest {
     Authentication authentication = new 
TestingAuthenticationToken("principal", "credentials");
     try {
       provider.authenticate(authentication);
-      assertTrue("Should have thrown BadCredentialsException", false);
+      fail("Should have thrown BadCredentialsException");
     } catch (BadCredentialsException e) {
       assertEquals("User not found.", e.getMessage());
     }
@@ -168,7 +173,7 @@ public class LogsearchFileAuthenticationProviderTest {
   
   @Test
   public void testAuthenticationNoPassword() {
-    List<GrantedAuthority> grantedAuths = Arrays.<GrantedAuthority>asList(new 
SimpleGrantedAuthority("ROLE_USER"));
+    List<GrantedAuthority> grantedAuths = Collections.singletonList(new 
SimpleGrantedAuthority("ROLE_USER"));
     User user = new User("principal", null, grantedAuths);
     
     expect(mockAuthPropsConfig.isAuthFileEnabled()).andReturn(true);
@@ -179,7 +184,7 @@ public class LogsearchFileAuthenticationProviderTest {
     Authentication authentication = new 
TestingAuthenticationToken("principal", "credentials");
     try {
       provider.authenticate(authentication);
-      assertTrue("Should have thrown BadCredentialsException", false);
+      fail("Should have thrown BadCredentialsException");
     } catch (BadCredentialsException e) {
       assertEquals("Password can't be null or empty.", e.getMessage());
     }
@@ -189,8 +194,8 @@ public class LogsearchFileAuthenticationProviderTest {
   
   @Test
   public void testAuthenticationWrongPassword() {
-    List<GrantedAuthority> grantedAuths = Arrays.<GrantedAuthority>asList(new 
SimpleGrantedAuthority("ROLE_USER"));
-    User user = new User("principal", CommonUtil.encryptPassword("principal", 
"notCredentials"), grantedAuths);
+    List<GrantedAuthority> grantedAuths = Collections.singletonList(new 
SimpleGrantedAuthority("ROLE_USER"));
+    User user = new User("principal", 
passwordEncoder.encode("notCredentials"), grantedAuths);
     
     expect(mockAuthPropsConfig.isAuthFileEnabled()).andReturn(true);
     
expect(mockUserDetailsService.loadUserByUsername("principal")).andReturn(user);
@@ -200,7 +205,7 @@ public class LogsearchFileAuthenticationProviderTest {
     Authentication authentication = new 
TestingAuthenticationToken("principal", "credentials");
     try {
       provider.authenticate(authentication);
-      assertTrue("Should have thrown BadCredentialsException", false);
+      fail("Should have thrown BadCredentialsException");
     } catch (BadCredentialsException e) {
       assertEquals("Wrong password.", e.getMessage());
     }
@@ -210,8 +215,9 @@ public class LogsearchFileAuthenticationProviderTest {
   
   @Test
   public void testAuthenticationSuccessful() {
-    List<GrantedAuthority> grantedAuths = Arrays.<GrantedAuthority>asList(new 
SimpleGrantedAuthority("ROLE_USER"));
-    User user = new User("principal", CommonUtil.encryptPassword("principal", 
"credentials"), grantedAuths);
+    List<GrantedAuthority> grantedAuths = Collections.singletonList(new 
SimpleGrantedAuthority("ROLE_USER"));
+    String encodedPassword = passwordEncoder.encode("credentials");
+    User user = new User("principal", encodedPassword, grantedAuths);
     
     expect(mockAuthPropsConfig.isAuthFileEnabled()).andReturn(true);
     
expect(mockUserDetailsService.loadUserByUsername("principal")).andReturn(user);
@@ -219,10 +225,8 @@ public class LogsearchFileAuthenticationProviderTest {
     replay(mockAuthPropsConfig, mockUserDetailsService);
     
     Authentication authentication = new 
TestingAuthenticationToken("principal", "credentials");
-    
     Authentication authenticationResult = 
provider.authenticate(authentication);
     assertEquals("principal", authenticationResult.getName());
-    assertEquals(CommonUtil.encryptPassword("principal", "credentials"), 
authenticationResult.getCredentials());
     assertEquals(1, authenticationResult.getAuthorities().size());
     assertEquals(new SimpleGrantedAuthority("ROLE_USER"), 
authenticationResult.getAuthorities().iterator().next());
     
diff --git a/ambari-logsearch/docker/Dockerfile 
b/ambari-logsearch/docker/Dockerfile
index ed89a89..4fd7bee 100644
--- a/ambari-logsearch/docker/Dockerfile
+++ b/ambari-logsearch/docker/Dockerfile
@@ -22,10 +22,11 @@ RUN yum -y install glibc-common
 ENV HOME /root
 
 #Install JAVA
-ENV JAVA_VERSION 8u131
-ENV BUILD_VERSION b11
-RUN wget --no-check-certificate --no-cookies --header 
"Cookie:oraclelicense=accept-securebackup-cookie" 
http://download.oracle.com/otn-pub/java/jdk/$JAVA_VERSION-$BUILD_VERSION/d54c1d3a095b4ff2b6607d096fa80163/jdk-$JAVA_VERSION-linux-x64.rpm
 -O jdk-8-linux-x64.rpm
-RUN rpm -ivh jdk-8-linux-x64.rpm
+ENV JAVA_VERSION 11.0.2
+ENV BUILD_VERSION 9
+
+RUN wget --no-check-certificate --no-cookies --header 
"Cookie:oraclelicense=accept-securebackup-cookie" 
http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION}+${BUILD_VERSION}/f51449fcd52f4d52b93a989c5c56ed3c/jdk-${JAVA_VERSION}_linux-x64_bin.rpm
 -O jdk-11-linux-x64.rpm
+RUN rpm -ivh jdk-11-linux-x64.rpm
 ENV JAVA_HOME /usr/java/default/
 
 #Install Selenium server

Reply via email to