Explorar el Código

AMBARI-18310. Refactor logsearch portal side code (oleewere)

oleewere hace 9 años
padre
commit
77f9e8ffcf
Se han modificado 100 ficheros con 4628 adiciones y 6136 borrados
  1. 1 1
      ambari-logsearch/ambari-logsearch-portal/pom.xml
  2. 0 28
      ambari-logsearch/ambari-logsearch-portal/production/build.js
  3. 0 4836
      ambari-logsearch/ambari-logsearch-portal/production/r.js
  4. 0 1
      ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/managed-schema
  5. 0 24
      ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/managed-schema
  6. 0 35
      ambari-logsearch/ambari-logsearch-portal/src/main/dev/solrcloud/README.md
  7. 0 28
      ambari-logsearch/ambari-logsearch-portal/src/main/dev/solrcloud/reset_collections.sh
  8. 0 37
      ambari-logsearch/ambari-logsearch-portal/src/main/dev/solrcloud/restart_solr.sh
  9. 0 49
      ambari-logsearch/ambari-logsearch-portal/src/main/dev/solrcloud/update_config.sh
  10. 0 1
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/LogSearch.java
  11. 2 32
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/ConfigHelper.java
  12. 8 9
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/ExternalServerClient.java
  13. 56 2
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/LogSearchConstants.java
  14. 29 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/Marker.java
  15. 59 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/PropertyMapper.java
  16. 0 304
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/SearchCriteria.java
  17. 59 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/conf/ApiDocConfig.java
  18. 84 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/conf/ApplicationConfig.java
  19. 87 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/conf/AuthConfig.java
  20. 181 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/conf/SolrAuditLogConfig.java
  21. 36 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/conf/SolrColumnConfig.java
  22. 50 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/conf/SolrConfig.java
  23. 49 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/conf/SolrConnectionConfig.java
  24. 48 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/conf/SolrKerberosConfig.java
  25. 144 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/conf/SolrServiceLogConfig.java
  26. 104 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/conf/SolrUserConfig.java
  27. 17 12
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/AuditSolrDao.java
  28. 13 8
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/ServiceLogsSolrDao.java
  29. 14 5
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/SolrDaoBase.java
  30. 18 14
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/UserConfigSolrDao.java
  31. 7 3
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/UserDao.java
  32. 16 10
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/doc/DocConstants.java
  33. 41 40
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/graph/GraphDataGenerator.java
  34. 19 15
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/graph/GraphDataGeneratorBase.java
  35. 146 179
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/AuditLogsManager.java
  36. 69 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/JsonManagerBase.java
  37. 29 19
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/LogFileManager.java
  38. 38 73
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/ManagerBase.java
  39. 11 9
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/PublicManager.java
  40. 209 231
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/ServiceLogsManager.java
  41. 3 3
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/SessionManager.java
  42. 7 7
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/UserConfigManager.java
  43. 44 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/AnyGraphParamDefinition.java
  44. 32 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/BundleIdParamDefinition.java
  45. 69 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/CommonSearchParamDefinition.java
  46. 38 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/DateRangeParamDefinition.java
  47. 32 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/FieldParamDefinition.java
  48. 32 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/FormatParamDefinition.java
  49. 31 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/LastPageParamDefinition.java
  50. 45 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/LogFileParamDefinition.java
  51. 32 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/LogFileTailParamDefinition.java
  52. 68 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/LogParamDefinition.java
  53. 44 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/LogTruncatedParamDefinition.java
  54. 32 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/QueryParamDefinition.java
  55. 25 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/SearchRequest.java
  56. 38 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/ServiceLogFileParamDefinition.java
  57. 80 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/ServiceLogParamDefinition.java
  58. 50 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/ServiceLogSearchParamDefinition.java
  59. 33 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/UnitParamDefinition.java
  60. 44 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/UserConfigParamDefinition.java
  61. 32 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/UtcOffsetParamDefinition.java
  62. 109 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AnyGraphRequest.java
  63. 13 25
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AuditBarGraphRequest.java
  64. 40 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AuditLogRequest.java
  65. 53 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/BaseAuditLogRequest.java
  66. 118 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/BaseLogRequest.java
  67. 186 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/BaseServiceLogRequest.java
  68. 119 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/CommonSearchRequest.java
  69. 40 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/FieldAuditBarGraphRequest.java
  70. 41 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/FieldAuditLogRequest.java
  71. 67 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/LogFileRequest.java
  72. 40 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/LogFileTailRequest.java
  73. 40 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/QueryRequest.java
  74. 109 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceAnyGraphRequest.java
  75. 41 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceExtremeDatesRequest.java
  76. 40 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceGraphRequest.java
  77. 54 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogExportRequest.java
  78. 54 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogFileRequest.java
  79. 93 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogRequest.java
  80. 66 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogTruncatedRequest.java
  81. 42 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/SimpleQueryRequest.java
  82. 66 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/UserConfigRequest.java
  83. 40 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/UserExportRequest.java
  84. 149 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/AuditLogData.java
  85. 48 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/AuditLogResponse.java
  86. 17 14
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/BarGraphData.java
  87. 12 16
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/BarGraphDataListResponse.java
  88. 113 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/CommonLogData.java
  89. 32 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/ComponentTypeLogData.java
  90. 11 23
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/CountData.java
  91. 48 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/CountDataListResponse.java
  92. 26 28
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/GraphData.java
  93. 39 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/GraphDataListResponse.java
  94. 48 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/GroupListResponse.java
  95. 30 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/HostLogData.java
  96. 25 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/LogData.java
  97. 7 15
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/LogFileData.java
  98. 48 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/LogFileDataListResponse.java
  99. 27 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/LogListResponse.java
  100. 22 0
      ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/LogSearchResponse.java

+ 1 - 1
ambari-logsearch/ambari-logsearch-portal/pom.xml

@@ -548,7 +548,7 @@
     </dependency>
     <dependency>
       <groupId>org.glassfish.jersey.media</groupId>
-      <artifactId>jersey-media-moxy</artifactId>
+      <artifactId>jersey-media-json-jackson</artifactId>
       <version>${jersey.version}</version>
     </dependency>
     <dependency>

+ 0 - 28
ambari-logsearch/ambari-logsearch-portal/production/build.js

@@ -1,28 +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.
-*/
-
-{
-    appDir: "../src/main/webapp",
-    baseUrl: "scripts",
-    dir: "../target/webapp-build",
-    modules: [
-        {
-            name: "Init"
-        }
-    ]
-}

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 4836
ambari-logsearch/ambari-logsearch-portal/production/r.js


+ 0 - 1
ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/managed-schema

@@ -106,7 +106,6 @@
   <field name="file" type="key_lower_case" multiValued="false"/>
   <field name="log_message" type="key_lower_case" multiValued="false" omitNorms="false"/>
   <field name="logfile_line_number" type="tint" omitNorms="false"/>
-  <!-- <field name="message" type="text_std_token_lower_case" indexed="true" stored="true"/> -->
   <field name="message_md5" type="string" multiValued="false"/>
   <field name="type" type="key_lower_case" multiValued="false"/>
   

+ 0 - 24
ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/managed-schema

@@ -101,7 +101,6 @@
   <field name="logger_name" type="key_lower_case" multiValued="false"/>
   <field name="logtime" type="tdate" multiValued="false"  docValues="true"/>
   <field name="logtype" type="key_lower_case" multiValued="false"/>
-  <!-- <field name="message" type="text_std_token_lower_case" indexed="true" stored="true"/> -->
   <field name="message_md5" type="string" multiValued="false"/>
   <field name="method" type="key_lower_case" multiValued="false" omitNorms="false"/>
   <field name="path" type="key_lower_case" multiValued="false"/>
@@ -117,28 +116,5 @@
   <dynamicField name='key_*' type="key_lower_case" multiValued="false" stored="false"/>
   <dynamicField name="ws_*" type="text_ws" multiValued="false" omitNorms="false" stored="false"/>
   <copyField source="log_message" dest="key_log_message"/>
-  <!-- <copyField source="log_message" dest="ws_log_message"/> -->
 
-  
-  <!-- Copy Fields-->
-  <!-- ngram fields -->
-  <!-- Whenever using a copy field provide following structure "ngram_"<OriginalFieldName> --> 
-<!-- Commenting till we test properly. Now it is not used and it is taking unnecessary cpu, memory and disk space
-  <copyField source="bundle_id" dest="ngram_bundle_id"/>
-  <copyField source="case_id" dest="ngram_case_id"/>
-  <copyField source="cluster" dest="ngram_cluster"/>
-  <copyField source="file" dest="ngram_file"/>
-  <copyField source="host" dest="ngram_host"/>
-  <copyField source="level" dest="ngram_level"/>
-  <copyField source="log_message" dest="ngram_log_message"/>
-  <copyField source="logger_name" dest="ngram_logger_name"/>
-  <copyField source="logtype" dest="ngram_logtype"/>
-  <copyField source="method" dest="ngram_method"/>
-  <copyField source="path" dest="ngram_path"/>
-  <copyField source="thread_name" dest="ngram_thread_name"/>
-  <copyField source="type" dest="ngram_type"/>
-  
--->
-
-  
 </schema>

+ 0 - 35
ambari-logsearch/ambari-logsearch-portal/src/main/dev/solrcloud/README.md

@@ -1,35 +0,0 @@
-<!--
-{% comment %}
-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.
-{% endcomment %}
--->
-
-This folder contains scripts to configure and run SolrCloud for development. 
-
-This helps in seting up SolrCloud using embedded zookeeper.
-
-##Setup Solr Collections
-```./update_config.sh <path to solr install folder>
-```
-
-
-##Run Solr
-```./restart_solr.sh
-```
-
-##Delete collections
-```./reset_collections.sh
-```

+ 0 - 28
ambari-logsearch/ambari-logsearch-portal/src/main/dev/solrcloud/reset_collections.sh

@@ -1,28 +0,0 @@
-#!/bin/bash
-# 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.
-
-# This script is used to delete all the documents in Solr
-host_port=localhost:8983
-if [ $# -eq 1 ]; then
-    host_port=$1
-fi
-set -x
-curl http://${host_port}/solr/hadoop_logs/update --data '<delete><query>*:*</query></delete>' -H 'Content-type:text/xml; charset=utf-8'
-curl http://${host_port}/solr/hadoop_logs/update --data '<commit/>' -H 'Content-type:text/xml; charset=utf-8'
-
-curl http://${host_port}/solr/audit_logs/update --data '<delete><query>*:*</query></delete>' -H 'Content-type:text/xml; charset=utf-8'
-curl http://${host_port}/solr/audit_logs/update --data '<commit/>' -H 'Content-type:text/xml; charset=utf-8'
-

+ 0 - 37
ambari-logsearch/ambari-logsearch-portal/src/main/dev/solrcloud/restart_solr.sh

@@ -1,37 +0,0 @@
-#!/bin/bash
-# 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.
-
-
-function usage {
-    echo "Usage: $0 <Solr Install Folder>"
-}
-
-if [ $# -ne 1 ]; then
-    usage
-    exit 1
-fi
-
-SOLR_INSTALL=$1
-if [ -x $SOLR_INSTALL/bin/solr ]; then
-    SOLR_BIN=$SOLR_INSTALL/bin/solr
-else
-    echo "ERROR: Invalid Solr install folder $SOLR_INSTALL"
-    usage
-    exit 1
-fi
-
-set -x
-$SOLR_BIN restart -c

+ 0 - 49
ambari-logsearch/ambari-logsearch-portal/src/main/dev/solrcloud/update_config.sh

@@ -1,49 +0,0 @@
-#!/bin/bash
-# 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.
-
-function usage {
-    echo "Usage: $0 <Solr Install Folder> [zk_hosts]"
-}
-
-if [ $# -lt 1 ]; then
-    usage
-    exit 1
-fi
-
-curr_dir=`pwd`
-cd `dirname $0`; script_dir=`pwd`; cd $curr_dir
-
-SOLR_INSTALL=$1
-if [ -x $SOLR_INSTALL/server/scripts/cloud-scripts/zkcli.sh ]; then
-    ZK_CLI=$SOLR_INSTALL/server/scripts/cloud-scripts/zkcli.sh
-else
-    echo "ERROR: Invalid Solr install folder $SOLR_INSTALL"
-    usage
-    exit 1
-fi
-
-zk_hosts="localhost:9983"
-if [ $# -eq 2 ]; then
-    zk_hosts=$2
-fi
-
-
-CONFIGSET_FOLDER=$script_dir/../../configsets
-
-set -x
-$ZK_CLI -zkhost $zk_hosts -cmd upconfig -confdir $CONFIGSET_FOLDER/audit_logs/conf -confname audit_logs
-$ZK_CLI -zkhost $zk_hosts -cmd upconfig -confdir $CONFIGSET_FOLDER/hadoop_logs/conf -confname hadoop_logs
-$ZK_CLI -zkhost $zk_hosts -cmd upconfig -confdir $CONFIGSET_FOLDER/history/conf -confname history

+ 0 - 1
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/LogSearch.java

@@ -92,7 +92,6 @@ public class LogSearch {
     logger.debug(server.dump());
     logger
         .debug("==============================================================================");
-    ConfigHelper.initializeApplicationConfig();
     server.join();
   }
 

+ 2 - 32
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/ConfigHelper.java

@@ -25,48 +25,18 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.ambari.logsearch.dao.SolrDaoBase;
-import org.apache.ambari.logsearch.manager.MgrBase;
+import org.apache.ambari.logsearch.manager.ManagerBase;
 import org.apache.commons.lang.ArrayUtils;
 import org.apache.log4j.Logger;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONObject;
 
 public class ConfigHelper {
-  private static final Logger logger = Logger.getLogger(MgrBase.class);
-
-  public static HashMap<String, String> serviceLogsColumnMapping = new HashMap<String, String>();
-  public static HashMap<String, String> auditLogsColumnMapping = new HashMap<String, String>();
+  private static final Logger logger = Logger.getLogger(ManagerBase.class);
 
   private ConfigHelper() {
     throw new UnsupportedOperationException();
   }
-  
-  public static void initializeApplicationConfig() {
-    String serviceLogsColumnMappingArray[] = PropertiesHelper.getPropertyStringList("logsearch.solr.service.logs.column.mapping");
-    String auditLogsColumnMappingArray[] = PropertiesHelper.getPropertyStringList("logsearch.solr.audit.logs.column.mapping");
-
-    // Initializing column mapping for Service Logs
-    intializeUISolrColumnMapping(serviceLogsColumnMappingArray, serviceLogsColumnMapping);
-
-    // Initializing column mapping for Audit Logs
-    intializeUISolrColumnMapping(auditLogsColumnMappingArray, auditLogsColumnMapping);
-  }
-
-  private static void intializeUISolrColumnMapping(String columnMappingArray[], HashMap<String, String> columnMappingMap) {
-
-    if (columnMappingArray != null && columnMappingArray.length > 0) {
-      for (String columnMapping : columnMappingArray) {
-        String mapping[] = columnMapping.split(":");
-        if (mapping.length > 1) {
-          String solrField = mapping[0];
-          String uiField = mapping[1];
-          
-          columnMappingMap.put(solrField + LogSearchConstants.SOLR_SUFFIX, uiField);
-          columnMappingMap.put(uiField + LogSearchConstants.UI_SUFFIX, solrField);
-        }
-      }
-    }
-  }
 
   public static void extractSchemaFieldsName(String responseString, HashMap<String, String> schemaFieldsNameMap,
       HashMap<String, String> schemaFieldTypeMap) {

+ 8 - 9
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/ExternalServerClient.java

@@ -22,11 +22,13 @@ import java.util.List;
 import java.util.Map;
 
 import javax.annotation.PostConstruct;
+import javax.inject.Inject;
 import javax.ws.rs.client.Invocation;
 import javax.ws.rs.client.WebTarget;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
 
+import org.apache.ambari.logsearch.conf.AuthConfig;
 import org.apache.ambari.logsearch.web.security.LogsearchAbstractAuthenticationProvider;
 import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
@@ -41,6 +43,7 @@ import org.springframework.stereotype.Component;
  */
 @Component
 public class ExternalServerClient {
+
   private static Logger LOG = Logger.getLogger(ExternalServerClient.class);
   private static final ThreadLocal<JerseyClient> localJerseyClient = new ThreadLocal<JerseyClient>(){
     @Override
@@ -48,15 +51,11 @@ public class ExternalServerClient {
       return JerseyClientBuilder.createClient();
     }
   };
-  private String hostURL = "http://host:ip";// default
-  private boolean enableLog = false;// default
 
-  @PostConstruct
-  public void initialization() {
-    hostURL = PropertiesHelper.getProperty(
-        LogsearchAbstractAuthenticationProvider.AUTH_METHOD_PROP_START_WITH
-            + "external_auth.host_url", hostURL);
-  }
+  @Inject
+  private AuthConfig authConfig;
+
+  private boolean enableLog = false;// default
 
   /**
    * Send GET request to an external server
@@ -65,7 +64,7 @@ public class ExternalServerClient {
   public Object sendGETRequest(String url, Class klass, MultivaluedMap<String, String> queryParam,
                                String username, String password)
       throws Exception {
-    url = hostURL + url;
+    url = authConfig.getExternalAuthHostUrl() + url;
     JerseyClient client = localJerseyClient.get();
     HttpAuthenticationFeature authFeature = HttpAuthenticationFeature.basicBuilder().build();
 

+ 56 - 2
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/LogSearchConstants.java

@@ -118,6 +118,60 @@ public class LogSearchConstants {
   public static final String FACET_RANGE_GAP = "facet.range.gap";
   public static final String FACET_GROUP = "group";
   public static final String FACET_GROUP_MAIN = "group.main";
-  public static final String FACET_GROUP_FIELD = "group.field"; 
-  
+  public static final String FACET_GROUP_FIELD = "group.field";
+
+  // Request params
+  public static final String REQUEST_PARAM_QUERY = "q";
+  public static final String REQUEST_PARAM_XAXIS = "xAxis";
+  public static final String REQUEST_PARAM_YAXIS = "yAxis";
+  public static final String REQUEST_PARAM_STACK_BY = "stackBy";
+  public static final String REQUEST_PARAM_UNIT = "unit";
+  public static final String REQUEST_PARAM_BUNDLE_ID = "bundle_id";
+  public static final String REQUEST_PARAM_START_INDEX = "startIndex";
+  public static final String REQUEST_PARAM_PAGE = "page";
+  public static final String REQUEST_PARAM_PAGE_SIZE = "pageSize";
+  public static final String REQUEST_PARAM_SORT_BY = "sortBy";
+  public static final String REQUEST_PARAM_SORT_TYPE = "sortType";
+  public static final String REQUEST_PARAM_START_TIME = "start_time";
+  public static final String REQUEST_PARAM_END_TIME = "end_time";
+  public static final String REQUEST_PARAM_FROM = "from";
+  public static final String REQUEST_PARAM_TO = "to";
+  public static final String REQUEST_PARAM_FIELD = "field";
+  public static final String REQUEST_PARAM_FORMAT = "format";
+  public static final String REQUEST_PARAM_LAST_PAGE = "lastPage";
+  public static final String REQUEST_PARAM_LOG_TYPE = "logType";
+  public static final String REQUEST_PARAM_COMPONENT = "component";
+  public static final String REQUEST_PARAM_HOST = "host";
+  public static final String REQUEST_PARAM_TAIL_SIZE = "tailSize";
+  public static final String REQUEST_PARAM_COLUMN_QUERY = "columnQuery";
+  public static final String REQUEST_PARAM_I_MESSAGE = "iMessage";
+  public static final String REQUEST_PARAM_G_E_MESSAGE = "gEMessage";
+  public static final String REQUEST_PARAM_MUST_BE = "mustBe";
+  public static final String REQUEST_PARAM_MUST_NOT = "mustNot";
+  public static final String REQUEST_PARAM_INCLUDE_QUERY = "includeQuery";
+  public static final String REQUEST_PARAM_EXCLUDE_QUERY = "excludeQuery";
+  public static final String REQUEST_PARAM_ID = "id";
+  public static final String REQUEST_PARAM_SCROLL_TYPE = "scrollType";
+  public static final String REQUEST_PARAM_NUMBER_ROWS = "numberRows";
+  public static final String REQUEST_PARAM_HOST_LOG_FILE = "host";
+  public static final String REQUEST_PARAM_COMPONENT_LOG_FILE = "component";
+  public static final String REQUEST_PARAM_LEVEL = "level";
+  public static final String REQUEST_PARAM_ADVANCED_SEARCH = "advancedSearch";
+  public static final String REQUEST_PARAM_TREE_PARAMS = "treeParams";
+  public static final String REQUEST_PARAM_E_MESSAGE = "eMessage";
+  public static final String REQUEST_PARAM_G_MUST_NOT = "gMustNot";
+  public static final String REQUEST_PARAM_HOST_NAME = "host_name";
+  public static final String REQUEST_PARAM_COMPONENT_NAME = "component_name";
+  public static final String REQUEST_PARAM_FILE_NAME = "file_name";
+  public static final String REQUEST_PARAM_DATE_RANGE_LABEL = "dateRangeLabel";
+  public static final String REQUEST_PARAM_KEYWORD = "find";
+  public static final String REQUEST_PARAM_SOURCE_LOG_ID = "sourceLogId";
+  public static final String REQUEST_PARAM_KEYWORD_TYPE = "keywordType";
+  public static final String REQUEST_PARAM_TOKEN = "token";
+  public static final String REQUEST_PARAM_USER_ID = "userId";
+  public static final String REQUEST_PARAM_FILTER_NAME = "filterName";
+  public static final String REQUEST_PARAM_ROW_TYPE = "rowType";
+  public static final String REQUEST_PARAM_UTC_OFFSET = "utcOffset";
+
+
 }

+ 29 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/Marker.java

@@ -0,0 +1,29 @@
+/*
+ * 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.common;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target({ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Marker {
+}

+ 59 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/PropertyMapper.java

@@ -0,0 +1,59 @@
+/*
+ * 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.common;
+
+import com.google.common.base.Splitter;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Component("propertyMapper")
+public class PropertyMapper {
+
+  public Map<String, String> map(String property) {
+    return this.map(property, ",");
+  }
+
+  public List<String> list(String property) {
+    return this.list(property, ",");
+  }
+
+  public Map<String, String> solrUiMap(String property) { return this.solrUiMap(property, ","); }
+
+  private List<String> list(String property, String splitter) {
+    return Splitter.on(splitter).omitEmptyStrings().trimResults().splitToList(property);
+  }
+
+  private Map<String, String> map(String property, String splitter) {
+    return Splitter.on(splitter).omitEmptyStrings().trimResults().withKeyValueSeparator(":").split(property);
+  }
+
+  private Map<String, String> solrUiMap(String property, String splitter) {
+    Map<String, String> result = new HashMap<>();
+    Map<String, String> map = this.map(property, splitter);
+    for (Map.Entry<String, String> propEntry : map.entrySet()) {
+      result.put(propEntry.getKey() + LogSearchConstants.SOLR_SUFFIX, propEntry.getValue());
+      result.put(propEntry.getValue() + LogSearchConstants.UI_SUFFIX, propEntry.getKey());
+    }
+    return result;
+  }
+
+}

+ 0 - 304
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/SearchCriteria.java

@@ -1,304 +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.common;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang.StringEscapeUtils;
-
-public class SearchCriteria {
-  private int startIndex = 0;
-  private int maxRows = Integer.MAX_VALUE;
-  private String sortBy = null;
-  private String sortType = null;
-  private int page = 0;
-
-  private String globalStartTime = null;
-  private String globalEndTime = null;
-
-  private boolean getCount = true;
-  private boolean isDistinct = false;
-  private HashMap<String, Object> paramList = new HashMap<String, Object>();
-  final private Set<String> nullParamList = new HashSet<String>();
-  final private Set<String> notNullParamList = new HashSet<String>();
-
-  private Map<String, Object> urlParamMap = new HashMap<String, Object>();
-
-  public SearchCriteria(HttpServletRequest request) {
-    try {
-      if (request.getParameter("startIndex") != null && (!request.getParameter("startIndex").isEmpty())) {
-        this.startIndex = new Integer(request.getParameter("startIndex"));
-      }
-      if (request.getParameter("page") != null && (!request.getParameter("page").isEmpty())) {
-        this.page = new Integer(request.getParameter("page"));
-      }
-      if (request.getParameter("pageSize") != null && (!request.getParameter("pageSize").isEmpty())) {
-        this.maxRows = new Integer(request.getParameter("pageSize"));
-      } else {
-        this.maxRows = PropertiesHelper.getIntProperty("db.maxResults", 50);
-      }
-    } catch (NumberFormatException e) {
-      // do nothing
-    }
-
-    // Sort fields
-    if (request.getParameter("sortBy") != null && (!request.getParameter("sortBy").isEmpty())) {
-      this.sortBy = "" + request.getParameter("sortBy");
-    }
-    if (request.getParameter("sortType") != null && (!request.getParameter("sortType").isEmpty())) {
-      this.sortType = "" + request.getParameter("sortType");
-    }
-
-    // url params
-    if (request.getParameter("start_time") != null && (!request.getParameter("start_time").isEmpty())) {
-      this.globalStartTime = "" + request.getParameter("start_time");
-      this.urlParamMap.put("globalStartTime", request.getParameter("start_time"));
-    }
-    if (request.getParameter("end_time") != null && (!request.getParameter("end_time").isEmpty())) {
-      this.globalEndTime = "" + request.getParameter("end_time");
-      this.urlParamMap.put("globalEndTime", request.getParameter("end_time"));
-    }
-  }
-
-  public SearchCriteria() {
-    // Auto-generated constructor stub
-  }
-
-  /**
-   * @return the startIndex
-   */
-  public int getStartIndex() {
-    return startIndex;
-  }
-
-  /**
-   * @param startIndex the startIndex to set
-   */
-  public void setStartIndex(int startIndex) {
-    this.startIndex = startIndex;
-  }
-
-  /**
-   * @return the maxRows
-   */
-  public int getMaxRows() {
-    return maxRows;
-  }
-
-  /**
-   * @param maxRows the maxRows to set
-   */
-  public void setMaxRows(int maxRows) {
-    this.maxRows = maxRows;
-  }
-
-  /**
-   * @return the sortType
-   */
-
-  public String getSortType() {
-    return sortType;
-  }
-
-  /**
-   * @param sortType the sortType to set
-   */
-
-  public boolean isGetCount() {
-    return getCount;
-  }
-
-  public void setGetCount(boolean getCount) {
-    this.getCount = getCount;
-  }
-
-  /**
-   * @return the paramList
-   */
-  public HashMap<String, Object> getParamList() {
-    return paramList;
-  }
-
-  /**
-   * @param paramList the paramList to set
-   */
-  public void setParamList(HashMap<String, Object> paramList) {
-    this.paramList = paramList;
-  }
-
-  /**
-   * @param request
-   */
-  public void addRequiredServiceLogsParams(HttpServletRequest request) {
-    this.addParam("advanceSearch", StringEscapeUtils.unescapeXml(request.getParameter("advanceSearch")));
-    this.addParam("q", request.getParameter("q"));
-    this.addParam("treeParams", StringEscapeUtils.unescapeHtml(request.getParameter("treeParams")));
-    this.addParam("level", request.getParameter("level"));
-    this.addParam("gMustNot", request.getParameter("gMustNot"));
-    this.addParam("from", request.getParameter("from"));
-    this.addParam("to", request.getParameter("to"));
-    this.addParam("selectComp", request.getParameter("mustBe"));
-    this.addParam("unselectComp", request.getParameter("mustNot"));
-    this.addParam("iMessage", StringEscapeUtils.unescapeXml(request.getParameter("iMessage")));
-    this.addParam("gEMessage", StringEscapeUtils.unescapeXml(request.getParameter("gEMessage")));
-    this.addParam("eMessage", StringEscapeUtils.unescapeXml(request.getParameter("eMessage")));
-    this.addParam(LogSearchConstants.BUNDLE_ID, request.getParameter(LogSearchConstants.BUNDLE_ID));
-    this.addParam("host_name", request.getParameter("host_name"));
-    this.addParam("component_name", request.getParameter("component_name"));
-    this.addParam("file_name", request.getParameter("file_name"));
-    this.addParam("startDate", request.getParameter("start_time"));
-    this.addParam("endDate", request.getParameter("end_time"));
-    this.addParam("excludeQuery", StringEscapeUtils.unescapeXml(request.getParameter("excludeQuery")));
-    this.addParam("includeQuery", StringEscapeUtils.unescapeXml(request.getParameter("includeQuery")));
-  }
-
-  /**
-   * @param request
-   */
-  public void addRequiredAuditLogsParams(HttpServletRequest request) {
-    this.addParam("q", request.getParameter("q"));
-    this.addParam("columnQuery", StringEscapeUtils.unescapeXml(request.getParameter("columnQuery")));
-    this.addParam("iMessage", StringEscapeUtils.unescapeXml(request.getParameter("iMessage")));
-    this.addParam("gEMessage", StringEscapeUtils.unescapeXml(request.getParameter("gEMessage")));
-    this.addParam("eMessage", StringEscapeUtils.unescapeXml(request.getParameter("eMessage")));
-    this.addParam("includeString", request.getParameter("mustBe"));
-    this.addParam("unselectComp", request.getParameter("mustNot"));
-    this.addParam("excludeQuery", StringEscapeUtils.unescapeXml(request.getParameter("excludeQuery")));
-    this.addParam("includeQuery", StringEscapeUtils.unescapeXml(request.getParameter("includeQuery")));
-    this.addParam("startTime", request.getParameter("from"));
-    this.addParam("endTime", request.getParameter("to"));
-  }
-
-  /**
-   * @param string
-   * @param caId
-   */
-  public void addParam(String name, Object value) {
-    String solrValue = PropertiesHelper.getProperty(name);
-    if (solrValue == null || solrValue.isEmpty()) {
-      paramList.put(name, value);
-    } else {
-      try {
-        String propertyFieldMappings[] = solrValue.split(",");
-        HashMap<String, String> propertyFieldValue = new HashMap<String, String>();
-        for (String temp : propertyFieldMappings) {
-          String arrayValue[] = temp.split(":");
-          propertyFieldValue.put(arrayValue[0].toLowerCase(Locale.ENGLISH), arrayValue[1].toLowerCase(Locale.ENGLISH));
-        }
-        String originalValue = propertyFieldValue.get(value.toString().toLowerCase(Locale.ENGLISH));
-        if (originalValue != null && !originalValue.isEmpty())
-          paramList.put(name, originalValue);
-
-      } catch (Exception e) {
-        //do nothing
-      }
-    }
-  }
-
-  public void setNullParam(String name) {
-    nullParamList.add(name);
-  }
-
-  public void setNotNullParam(String name) {
-    notNullParamList.add(name);
-  }
-
-  public Object getParamValue(String name) {
-    return paramList.get(name);
-  }
-
-  /**
-   * @return the nullParamList
-   */
-  public Set<String> getNullParamList() {
-    return nullParamList;
-  }
-
-  /**
-   * @return the notNullParamList
-   */
-  public Set<String> getNotNullParamList() {
-    return notNullParamList;
-  }
-
-  /**
-   * @return the isDistinct
-   */
-  public boolean isDistinct() {
-    return isDistinct;
-  }
-
-  public String getSortBy() {
-    return sortBy;
-  }
-
-  public void setSortBy(String sortBy) {
-    this.sortBy = sortBy;
-  }
-
-  public void setSortType(String sortType) {
-    this.sortType = sortType;
-  }
-
-  /**
-   * @param isDistinct the isDistinct to set
-   */
-  public void setDistinct(boolean isDistinct) {
-    this.isDistinct = isDistinct;
-  }
-
-  public int getPage() {
-    return page;
-  }
-
-  public void setPage(int page) {
-    this.page = page;
-  }
-
-  public String getGlobalStartTime() {
-    return globalStartTime;
-  }
-
-  public void setGlobalStartTime(String globalStartTime) {
-    this.globalStartTime = globalStartTime;
-  }
-
-  public String getGlobalEndTime() {
-    return globalEndTime;
-  }
-
-  public void setGlobalEndTime(String globalEndTime) {
-    this.globalEndTime = globalEndTime;
-  }
-
-  public Map<String, Object> getUrlParamMap() {
-    return urlParamMap;
-  }
-
-  public void setUrlParamMap(Map<String, Object> urlParamMap) {
-    this.urlParamMap = urlParamMap;
-  }
-
-}

+ 59 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/conf/ApiDocConfig.java

@@ -0,0 +1,59 @@
+/*
+ * 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 io.swagger.jaxrs.config.BeanConfig;
+import io.swagger.jaxrs.listing.ApiListingResource;
+import io.swagger.jaxrs.listing.SwaggerSerializers;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+@Configuration
+public class ApiDocConfig {
+
+  @Bean
+  public ApiListingResource apiListingResource() {
+    return new ApiListingResource();
+  }
+
+  @Bean
+  public SwaggerSerializers swaggerSerializers() {
+    return new SwaggerSerializers();
+  }
+
+  @Bean
+  public BeanConfig swaggerConfig() throws UnknownHostException {
+    BeanConfig beanConfig = new BeanConfig();
+    beanConfig.setSchemes(new String[]{"http", "https"});
+    beanConfig.setHost(InetAddress.getLocalHost().getHostAddress() + ":61888"); // TODO: port from property
+    beanConfig.setBasePath("/api/v1");
+    beanConfig.setTitle("Log Search REST API");
+    beanConfig.setDescription("Log aggregation, analysis, and visualization.");
+    beanConfig.setLicense("Apache 2.0");
+    beanConfig.setLicenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html");
+    beanConfig.setScan(true);
+    beanConfig.setVersion("1.0.0");
+    beanConfig.setResourcePackage("org.apache.ambari.logsearch.rest");
+    return beanConfig;
+  }
+}

+ 84 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/conf/ApplicationConfig.java

@@ -0,0 +1,84 @@
+/*
+ * 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 org.apache.ambari.logsearch.query.converter.AnyGraphRequestConverter;
+import org.apache.ambari.logsearch.query.converter.AuditBarGraphRequestConverter;
+import org.apache.ambari.logsearch.query.converter.AuditLogRequestConverter;
+import org.apache.ambari.logsearch.query.converter.BaseAuditLogRequestConverter;
+import org.apache.ambari.logsearch.query.converter.BaseServiceLogRequestConverter;
+import org.apache.ambari.logsearch.query.converter.FieldAuditLogRequestConverter;
+import org.apache.ambari.logsearch.query.converter.FieldBarGraphRequestConverter;
+import org.apache.ambari.logsearch.query.converter.ServiceAnyGraphRequestConverter;
+import org.apache.ambari.logsearch.query.converter.ServiceExtremeDatesRequestConverter;
+import org.apache.ambari.logsearch.query.converter.ServiceGraphRequestConverter;
+import org.apache.ambari.logsearch.query.converter.ServiceLogExportRequestConverter;
+import org.apache.ambari.logsearch.query.converter.ServiceLogFileRequestConverter;
+import org.apache.ambari.logsearch.query.converter.ServiceLogRequestConverter;
+import org.apache.ambari.logsearch.query.converter.ServiceLogTruncatedRequestConverter;
+import org.apache.ambari.logsearch.query.converter.SimpleQueryRequestConverter;
+import org.apache.ambari.logsearch.query.converter.UserExportRequestConverter;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.ImportResource;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.context.support.ConversionServiceFactoryBean;
+import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
+import org.springframework.core.convert.converter.Converter;
+
+import java.util.HashSet;
+import java.util.Set;
+
+@Configuration
+@ComponentScan("org.apache.ambari.logsearch")
+@PropertySource(value = {"classpath:default.properties", "classpath:logsearch.properties"})
+@ImportResource("META-INF/security-applicationContext.xml")
+public class ApplicationConfig {
+
+  @Bean
+  public static PropertySourcesPlaceholderConfigurer propertyConfigurer() {
+    return new PropertySourcesPlaceholderConfigurer();
+  }
+
+  @Bean(name="conversionService")
+  public ConversionServiceFactoryBean conversionServiceFactoryBean() {
+    ConversionServiceFactoryBean conversionServiceFactoryBean = new ConversionServiceFactoryBean();
+    Set<Converter> converters = new HashSet<>();
+    converters.add(new AnyGraphRequestConverter());
+    converters.add(new AuditBarGraphRequestConverter());
+    converters.add(new AuditLogRequestConverter());
+    converters.add(new BaseAuditLogRequestConverter());
+    converters.add(new BaseServiceLogRequestConverter());
+    converters.add(new FieldAuditLogRequestConverter());
+    converters.add(new FieldBarGraphRequestConverter());
+    converters.add(new SimpleQueryRequestConverter());
+    converters.add(new UserExportRequestConverter());
+    converters.add(new ServiceAnyGraphRequestConverter());
+    converters.add(new ServiceExtremeDatesRequestConverter());
+    converters.add(new ServiceGraphRequestConverter());
+    converters.add(new ServiceLogExportRequestConverter());
+    converters.add(new ServiceLogFileRequestConverter());
+    converters.add(new ServiceLogRequestConverter());
+    converters.add(new ServiceLogTruncatedRequestConverter());
+    conversionServiceFactoryBean.setConverters(converters);
+    return conversionServiceFactoryBean;
+  }
+
+}

+ 87 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/conf/AuthConfig.java

@@ -0,0 +1,87 @@
+/*
+ * 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 org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class AuthConfig {
+
+  @Value("${logsearch.auth.file.enable:true}")
+  boolean authFileEnabled;
+  @Value("${logsearch.auth.ldap.enable:false}")
+  boolean authLdapEnabled;
+  @Value("${logsearch.auth.simple.enable:false}")
+  boolean authSimpleEnabled;
+  @Value("${logsearch.auth.external_auth.host_url:'http://ip:port'}")
+  private String externalAuthHostUrl;
+  @Value("${logsearch.auth.login_url:/api/v1/users/$USERNAME/privileges?fields=*}")
+  private String externalAuthLoginUrl;
+  @Value("${logsearch.login.credentials.file:user_pass.json}")
+  private String credentialsFile;
+
+  public boolean isAuthFileEnabled() {
+    return authFileEnabled;
+  }
+
+  public void setAuthFileEnabled(boolean authFileEnabled) {
+    this.authFileEnabled = authFileEnabled;
+  }
+
+  public boolean isAuthLdapEnabled() {
+    return authLdapEnabled;
+  }
+
+  public void setAuthLdapEnabled(boolean authLdapEnabled) {
+    this.authLdapEnabled = authLdapEnabled;
+  }
+
+  public boolean isAuthSimpleEnabled() {
+    return authSimpleEnabled;
+  }
+
+  public void setAuthSimpleEnabled(boolean authSimpleEnabled) {
+    this.authSimpleEnabled = authSimpleEnabled;
+  }
+
+  public String getCredentialsFile() {
+    return credentialsFile;
+  }
+
+  public void setCredentialsFile(String credentialsFile) {
+    this.credentialsFile = credentialsFile;
+  }
+
+  public String getExternalAuthHostUrl() {
+    return externalAuthHostUrl;
+  }
+
+  public void setExternalAuthHostUrl(String externalAuthHostUrl) {
+    this.externalAuthHostUrl = externalAuthHostUrl;
+  }
+
+  public String getExternalAuthLoginUrl() {
+    return externalAuthLoginUrl;
+  }
+
+  public void setExternalAuthLoginUrl(String externalAuthLoginUrl) {
+    this.externalAuthLoginUrl = externalAuthLoginUrl;
+  }
+}

+ 181 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/conf/SolrAuditLogConfig.java

@@ -0,0 +1,181 @@
+/*
+ * 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 org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+
+import java.util.List;
+import java.util.Map;
+
+@Configuration
+public class SolrAuditLogConfig implements SolrConfig, SolrColumnConfig {
+
+  @Value("${logsearch.solr.audit.logs.url:}")
+  private String solrUrl;
+
+  @Value("${logsearch.solr.audit.logs.zk_connect_string:}")
+  private String zkConnectString;
+
+  @Value("${logsearch.solr.collection.audit.logs:audit_logs}")
+  private String collection;
+
+  @Value("${logsearch.ranger.audit.logs.collection.name:}")
+  private String rangerCollection;
+
+  @Value("${logsearch.solr.audit.logs.config.name:audit_logs}")
+  private String configName;
+
+  @Value("${logsearch.solr.audit.logs.alias.name:audit_logs_alias}")
+  private String aliasNameIn;
+
+  @Value("${logsearch.audit.logs.split.interval.mins:none}")
+  private String splitInterval;
+
+  @Value("${logsearch.collection.audit.logs.numshards:1}")
+  private Integer numberOfShards;
+
+  @Value("${logsearch.collection.audit.logs.replication.factor:1}")
+  private Integer replicationFactor;
+
+  @Value("#{propertyMapper.map('${logsearch.solr.audit.logs.column.mapping}')}")
+  private Map<String, String> columnMapping;
+
+  @Value("#{propertyMapper.list('${logsearch.solr.audit.logs.exclude.columnlist}')}")
+  private List<String> excludeColumnList;
+
+  @Value("#{propertyMapper.solrUiMap('${logsearch.solr.audit.logs.column.mapping}')}")
+  private Map<String, String> solrAndUiColumns;
+
+  @Override
+  public String getSolrUrl() {
+    return solrUrl;
+  }
+
+  @Override
+  public void setSolrUrl(String solrUrl) {
+    this.solrUrl = solrUrl;
+  }
+
+  @Override
+  public String getCollection() {
+    return collection;
+  }
+
+  @Override
+  public void setCollection(String collection) {
+    this.collection = collection;
+  }
+
+  @Override
+  public String getZkConnectString() {
+    return zkConnectString;
+  }
+
+  @Override
+  public void setZkConnectString(String zkConnectString) {
+    this.zkConnectString = zkConnectString;
+  }
+
+  @Override
+  public String getConfigName() {
+    return configName;
+  }
+
+  @Override
+  public void setConfigName(String configName) {
+    this.configName = configName;
+  }
+
+  @Override
+  public Integer getNumberOfShards() {
+    return numberOfShards;
+  }
+
+  @Override
+  public void setNumberOfShards(Integer numberOfShards) {
+    this.numberOfShards = numberOfShards;
+  }
+
+  @Override
+  public Integer getReplicationFactor() {
+    return replicationFactor;
+  }
+
+  @Override
+  public void setReplicationFactor(Integer replicationFactor) {
+    this.replicationFactor = replicationFactor;
+  }
+
+  @Override
+  public String getSplitInterval() {
+    return splitInterval;
+  }
+
+  @Override
+  public void setSplitInterval(String splitInterval) {
+    this.splitInterval = splitInterval;
+  }
+
+  @Override
+  public List<String> getExcludeColumnList() {
+    return excludeColumnList;
+  }
+
+  @Override
+  public void setExcludeColumnList(List<String> excludeColumnList) {
+    this.excludeColumnList = excludeColumnList;
+  }
+
+  @Override
+  public Map<String, String> getColumnMapping() {
+    return columnMapping;
+  }
+
+  @Override
+  public void setColumnMapping(Map<String, String> columnMappings) {
+    this.columnMapping = columnMappings;
+  }
+
+  @Override
+  public Map<String, String> getSolrAndUiColumns() {
+    return solrAndUiColumns;
+  }
+
+  @Override
+  public void setSolrAndUiColumns(Map<String, String> solrAndUiColumns) {
+    this.solrAndUiColumns = solrAndUiColumns;
+  }
+
+  public String getRangerCollection() {
+    return rangerCollection;
+  }
+
+  public void setRangerCollection(String rangerCollection) {
+    this.rangerCollection = rangerCollection;
+  }
+
+  public String getAliasNameIn() {
+    return aliasNameIn;
+  }
+
+  public void setAliasNameIn(String aliasNameIn) {
+    this.aliasNameIn = aliasNameIn;
+  }
+}

+ 36 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/conf/SolrColumnConfig.java

@@ -0,0 +1,36 @@
+/*
+ * 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 java.util.List;
+import java.util.Map;
+
+public interface SolrColumnConfig {
+  Map<String, String> getColumnMapping();
+
+  void setColumnMapping(Map<String, String> columnMapping);
+
+  List<String> getExcludeColumnList();
+
+  void setExcludeColumnList(List<String> excludeColumnList);
+
+  Map<String, String> getSolrAndUiColumns();
+
+  void setSolrAndUiColumns(Map<String, String> solrAndUiColumns);
+}

+ 50 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/conf/SolrConfig.java

@@ -0,0 +1,50 @@
+/*
+ * 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;
+
+public interface SolrConfig {
+  String getSolrUrl();
+
+  void setSolrUrl(String solrUrl);
+
+  String getZkConnectString();
+
+  void setZkConnectString(String zkConnectString);
+
+  String getCollection();
+
+  void setCollection(String collection);
+
+  String getConfigName();
+
+  void setConfigName(String configName);
+
+  Integer getNumberOfShards();
+
+  void setNumberOfShards(Integer numberOfShards);
+
+  Integer getReplicationFactor();
+
+  void setReplicationFactor(Integer replicationFactor);
+
+  String getSplitInterval();
+
+  void setSplitInterval(String splitInterval);
+
+}

+ 49 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/conf/SolrConnectionConfig.java

@@ -0,0 +1,49 @@
+/*
+ * 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 org.springframework.beans.factory.annotation.Value;
+
+public abstract class SolrConnectionConfig implements SolrConfig {
+  @Value("${logsearch.solr.url:}")
+  private String solrUrl;
+
+  @Value("${logsearch.solr.zk_connect_string:}")
+  private String zkConnectString;
+
+  @Override
+  public String getSolrUrl() {
+    return solrUrl;
+  }
+
+  @Override
+  public void setSolrUrl(String solrUrl) {
+    this.solrUrl = solrUrl;
+  }
+
+  @Override
+  public String getZkConnectString() {
+    return zkConnectString;
+  }
+
+  @Override
+  public void setZkConnectString(String zkConnectString) {
+    this.zkConnectString = zkConnectString;
+  }
+}

+ 48 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/conf/SolrKerberosConfig.java

@@ -0,0 +1,48 @@
+/*
+ * 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 org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class SolrKerberosConfig {
+
+  @Value("${logsearch.solr.jaas.file:/usr/lib/ambari-logsearch-portal/logsearch_solr_jaas.conf}")
+  private String jaasFile;
+
+  @Value("${logsearch.solr.kerberos.enable:false}")
+  private boolean enabled;
+
+  public String getJaasFile() {
+    return jaasFile;
+  }
+
+  public void setJaasFile(String jaasFile) {
+    this.jaasFile = jaasFile;
+  }
+
+  public boolean isEnabled() {
+    return enabled;
+  }
+
+  public void setEnabled(boolean enabled) {
+    this.enabled = enabled;
+  }
+}

+ 144 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/conf/SolrServiceLogConfig.java

@@ -0,0 +1,144 @@
+/*
+ * 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 org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+
+import java.util.List;
+import java.util.Map;
+
+@Configuration
+public class SolrServiceLogConfig extends SolrConnectionConfig implements SolrColumnConfig {
+
+  @Value("${logsearch.solr.collection.service.logs:hadoop_logs}")
+  private String collection;
+
+  @Value("${logsearch.service.logs.split.interval.mins:none}")
+  private String splitInterval;
+
+  @Value("${logsearch.solr.service.logs.config.name:hadoop_logs}")
+  private String configName;
+
+  @Value("${logsearch.collection.service.logs.numshards:1}")
+  private Integer numberOfShards;
+
+  @Value("${logsearch.collection.service.logs.replication.factor:1}")
+  private Integer replicationFactor;
+
+  @Value("#{propertyMapper.list('${logsearch.service.logs.fields}')}")
+  private List<String> fields;
+
+  @Value("#{propertyMapper.map('${logsearch.solr.audit.logs.column.mapping}')}")
+  private Map<String, String> columnMapping;
+
+  @Value("#{propertyMapper.list('${logsearch.solr.audit.logs.exclude.columnlist}')}")
+  private List<String> excludeColumnList;
+
+  @Value("#{propertyMapper.solrUiMap('${logsearch.solr.audit.logs.column.mapping}}')}")
+  private Map<String, String> solrAndUiColumns;
+
+  @Override
+  public String getCollection() {
+    return collection;
+  }
+
+  @Override
+  public void setCollection(String collection) {
+    this.collection = collection;
+  }
+
+  @Override
+  public String getSplitInterval() {
+    return splitInterval;
+  }
+
+  @Override
+  public void setSplitInterval(String splitInterval) {
+    this.splitInterval = splitInterval;
+  }
+
+  @Override
+  public String getConfigName() {
+    return configName;
+  }
+
+  @Override
+  public void setConfigName(String configName) {
+    this.configName = configName;
+  }
+
+  @Override
+  public Integer getNumberOfShards() {
+    return numberOfShards;
+  }
+
+  @Override
+  public void setNumberOfShards(Integer numberOfShards) {
+    this.numberOfShards = numberOfShards;
+  }
+
+  @Override
+  public Integer getReplicationFactor() {
+    return replicationFactor;
+  }
+
+  @Override
+  public void setReplicationFactor(Integer replicationFactor) {
+    this.replicationFactor = replicationFactor;
+  }
+
+  @Override
+  public Map<String, String> getColumnMapping() {
+    return columnMapping;
+  }
+
+  @Override
+  public void setColumnMapping(Map<String, String> columnMapping) {
+    this.columnMapping = columnMapping;
+  }
+
+  @Override
+  public List<String> getExcludeColumnList() {
+    return excludeColumnList;
+  }
+
+  @Override
+  public void setExcludeColumnList(List<String> excludeColumnList) {
+    this.excludeColumnList = excludeColumnList;
+  }
+
+  @Override
+  public Map<String, String> getSolrAndUiColumns() {
+    return solrAndUiColumns;
+  }
+
+  @Override
+  public void setSolrAndUiColumns(Map<String, String> solrAndUiColumns) {
+    this.solrAndUiColumns = solrAndUiColumns;
+  }
+
+  public List<String> getFields() {
+    return fields;
+  }
+
+  public void setFields(List<String> fields) {
+    this.fields = fields;
+  }
+}

+ 104 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/conf/SolrUserConfig.java

@@ -0,0 +1,104 @@
+/*
+ * 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 org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+
+import java.util.List;
+
+@Configuration
+public class SolrUserConfig extends SolrConnectionConfig {
+
+  @Value("${logsearch.solr.collection.history:history}")
+  private String collection;
+
+  @Value("${logsearch.history.split.interval.mins:none}")
+  private String splitInterval;
+
+  @Value("${logsearch.solr.history.config.name:history}")
+  private String configName;
+
+  @Value("${logsearch.collection.history.numshards:1}")
+  private Integer numberOfShards;
+
+  @Value("${logsearch.collection.history.replication.factor:2}")
+  private Integer replicationFactor;
+
+  @Value("#{'${logsearch.logfeeder.include.default.level:FATAL,ERROR,WARN,INFO,DEBUG,TRACE,UNKNOWN}'.split(',')}")
+  private List<String> logLevels;
+
+  @Override
+  public String getCollection() {
+    return collection;
+  }
+
+  @Override
+  public void setCollection(String collection) {
+    this.collection = collection;
+  }
+
+  @Override
+  public String getSplitInterval() {
+    return splitInterval;
+  }
+
+  @Override
+  public void setSplitInterval(String splitInterval) {
+    this.splitInterval = splitInterval;
+  }
+
+  @Override
+  public String getConfigName() {
+    return configName;
+  }
+
+  @Override
+  public void setConfigName(String configName) {
+    this.configName = configName;
+  }
+
+  @Override
+  public Integer getNumberOfShards() {
+    return numberOfShards;
+  }
+
+  @Override
+  public void setNumberOfShards(Integer numberOfShards) {
+    this.numberOfShards = numberOfShards;
+  }
+
+  @Override
+  public Integer getReplicationFactor() {
+    return replicationFactor;
+  }
+
+  @Override
+  public void setReplicationFactor(Integer replicationFactor) {
+    this.replicationFactor = replicationFactor;
+  }
+
+  public List<String> getLogLevels() {
+    return logLevels;
+  }
+
+  public void setLogLevels(List<String> logLevels) {
+    this.logLevels = logLevels;
+  }
+}

+ 17 - 12
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/AuditSolrDao.java

@@ -23,9 +23,11 @@ import java.util.Arrays;
 import java.util.Collection;
 
 import javax.annotation.PostConstruct;
+import javax.inject.Inject;
 
 import org.apache.ambari.logsearch.common.PropertiesHelper;
-import org.apache.ambari.logsearch.manager.MgrBase.LogType;
+import org.apache.ambari.logsearch.conf.SolrAuditLogConfig;
+import org.apache.ambari.logsearch.manager.ManagerBase.LogType;
 import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
@@ -33,23 +35,26 @@ import org.springframework.stereotype.Component;
 @Component
 public class AuditSolrDao extends SolrDaoBase {
 
-  static private Logger logger = Logger.getLogger(AuditSolrDao.class);
-  
+  private static final Logger logger = Logger.getLogger(AuditSolrDao.class);
+
+  @Inject
+  private SolrAuditLogConfig solrAuditLogConfig;
+
   public AuditSolrDao() {
     super(LogType.AUDIT);
   }
 
   @PostConstruct
   public void postConstructor() {
-    String solrUrl = PropertiesHelper.getProperty("logsearch.solr.audit.logs.url");
-    String zkConnectString = PropertiesHelper.getProperty("logsearch.solr.audit.logs.zk_connect_string");
-    String collection = PropertiesHelper.getProperty("logsearch.solr.collection.audit.logs", "audit_logs");
-    String aliasNameIn = PropertiesHelper.getProperty("logsearch.solr.audit.logs.alias.name", "audit_logs_alias");
-    String rangerAuditCollection = PropertiesHelper.getProperty("logsearch.ranger.audit.logs.collection.name");
-    String splitInterval = PropertiesHelper.getProperty("logsearch.audit.logs.split.interval.mins", "none");
-    String configName = PropertiesHelper.getProperty("logsearch.solr.audit.logs.config.name", "audit_logs");
-    int numberOfShards = PropertiesHelper.getIntProperty("logsearch.collection.audit.logs.numshards", 1);
-    int replicationFactor = PropertiesHelper.getIntProperty("logsearch.collection.audit.logs.replication.factor", 1);
+    String solrUrl = solrAuditLogConfig.getSolrUrl();
+    String zkConnectString = solrAuditLogConfig.getZkConnectString();
+    String collection = solrAuditLogConfig.getCollection();
+    String aliasNameIn = solrAuditLogConfig.getAliasNameIn();
+    String rangerAuditCollection = solrAuditLogConfig.getRangerCollection();
+    String splitInterval = solrAuditLogConfig.getSplitInterval();
+    String configName = solrAuditLogConfig.getConfigName();
+    int numberOfShards = solrAuditLogConfig.getNumberOfShards();
+    int replicationFactor = solrAuditLogConfig.getReplicationFactor();
 
     try {
       connectToSolr(solrUrl, zkConnectString, collection);

+ 13 - 8
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/ServiceLogsSolrDao.java

@@ -20,9 +20,11 @@
 package org.apache.ambari.logsearch.dao;
 
 import javax.annotation.PostConstruct;
+import javax.inject.Inject;
 
 import org.apache.ambari.logsearch.common.PropertiesHelper;
-import org.apache.ambari.logsearch.manager.MgrBase.LogType;
+import org.apache.ambari.logsearch.conf.SolrServiceLogConfig;
+import org.apache.ambari.logsearch.manager.ManagerBase.LogType;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
@@ -30,6 +32,9 @@ import org.springframework.stereotype.Component;
 public class ServiceLogsSolrDao extends SolrDaoBase {
 
   private static final Logger logger = Logger.getLogger(ServiceLogsSolrDao.class);
+
+  @Inject
+  private SolrServiceLogConfig solrServiceLogConfig;
   
   public ServiceLogsSolrDao() {
     super(LogType.SERVICE);
@@ -38,13 +43,13 @@ public class ServiceLogsSolrDao extends SolrDaoBase {
   @PostConstruct
   public void postConstructor() {
     logger.info("postConstructor() called.");
-    String solrUrl = PropertiesHelper.getProperty("logsearch.solr.url");
-    String zkConnectString = PropertiesHelper.getProperty("logsearch.solr.zk_connect_string");
-    String collection = PropertiesHelper.getProperty("logsearch.solr.collection.service.logs", "hadoop_logs");
-    String splitInterval = PropertiesHelper.getProperty("logsearch.service.logs.split.interval.mins", "none");
-    String configName = PropertiesHelper.getProperty("logsearch.solr.service.logs.config.name", "hadoop_logs");
-    int numberOfShards = PropertiesHelper.getIntProperty("logsearch.collection.service.logs.numshards", 1);
-    int replicationFactor = PropertiesHelper.getIntProperty("logsearch.collection.service.logs.replication.factor", 1);
+    String solrUrl = solrServiceLogConfig.getSolrUrl();
+    String zkConnectString = solrServiceLogConfig.getZkConnectString();
+    String collection = solrServiceLogConfig.getCollection();
+    String splitInterval = solrServiceLogConfig.getSplitInterval();
+    String configName = solrServiceLogConfig.getConfigName();
+    int numberOfShards = solrServiceLogConfig.getNumberOfShards();
+    int replicationFactor = solrServiceLogConfig.getReplicationFactor();
 
     try {
       connectToSolr(solrUrl, zkConnectString, collection);

+ 14 - 5
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/SolrDaoBase.java

@@ -30,7 +30,9 @@ import org.apache.ambari.logsearch.common.ConfigHelper;
 import org.apache.ambari.logsearch.common.LogSearchContext;
 import org.apache.ambari.logsearch.common.MessageEnums;
 import org.apache.ambari.logsearch.common.PropertiesHelper;
-import org.apache.ambari.logsearch.manager.MgrBase.LogType;
+import org.apache.ambari.logsearch.conf.SolrKerberosConfig;
+import org.apache.ambari.logsearch.conf.SolrUserConfig;
+import org.apache.ambari.logsearch.manager.ManagerBase.LogType;
 import org.apache.ambari.logsearch.util.RESTErrorUtil;
 import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
@@ -58,6 +60,8 @@ import org.apache.solr.common.util.NamedList;
 
 import com.google.common.annotations.VisibleForTesting;
 
+import javax.inject.Inject;
+
 public abstract class SolrDaoBase {
   private static final Logger logger = Logger.getLogger(SolrDaoBase.class);
   private static final Logger logPerformance = Logger.getLogger("org.apache.ambari.logsearch.performance");
@@ -85,6 +89,11 @@ public abstract class SolrDaoBase {
   private String solrDetail = "";
 
   private boolean populateFieldsThreadActive = false;
+
+  @Inject
+  private SolrKerberosConfig solrKerberosConfig;
+  @Inject
+  private SolrUserConfig solrUserConfig;
   
   protected SolrDaoBase(LogType logType) {
     this.logType = logType;
@@ -461,8 +470,8 @@ public abstract class SolrDaoBase {
   }
 
   private void setupSecurity() {
-    String jaasFile = PropertiesHelper.getProperty("logsearch.solr.jaas.file", "/etc/security/keytabs/logsearch_solr.service.keytab");
-    boolean securityEnabled = PropertiesHelper.getBooleanProperty("logsearch.solr.kerberos.enable", false);
+    String jaasFile = solrKerberosConfig.getJaasFile();
+    boolean securityEnabled = solrKerberosConfig.isEnabled();
     if (securityEnabled) {
       System.setProperty("java.security.auth.login.config", jaasFile);
       HttpClientUtil.setConfigurer(new Krb5HttpClientConfigurer());
@@ -512,12 +521,12 @@ public abstract class SolrDaoBase {
     SolrRequest<SchemaResponse> request = new SchemaRequest();
     request.setMethod(METHOD.GET);
     request.setPath("/schema");
-    String historyCollection = PropertiesHelper.getProperty("logsearch.solr.collection.history","history");
+    String historyCollection = solrUserConfig.getCollection();
     if (solrClient != null && !collectionName.equals(historyCollection)) {
       NamedList<Object> namedList = null;
       try {
         namedList = solrClient.request(request);
-        logger.info("populateSchemaFields() collection=" + collectionName + ", fields=" + namedList);
+        logger.debug("populateSchemaFields() collection=" + collectionName + ", fields=" + namedList);
       } catch (SolrException | SolrServerException | IOException e) {
         logger.error("Error occured while popuplating field. collection=" + collectionName, e);
       }

+ 18 - 14
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/UserConfigSolrDao.java

@@ -21,15 +21,17 @@ package org.apache.ambari.logsearch.dao;
 
 import java.io.File;
 import java.io.IOException;
-import java.util.Arrays;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Scanner;
 import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+
+import org.apache.ambari.logsearch.conf.SolrUserConfig;
 import org.apache.ambari.logsearch.view.VLogfeederFilterWrapper;
 import org.apache.ambari.logsearch.common.LogSearchConstants;
-import org.apache.ambari.logsearch.common.PropertiesHelper;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.response.QueryResponse;
@@ -42,7 +44,7 @@ import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import com.google.gson.JsonParseException;
 
-import org.apache.ambari.logsearch.manager.MgrBase.LogType;
+import org.apache.ambari.logsearch.manager.ManagerBase.LogType;
 import org.apache.ambari.logsearch.util.JSONUtil;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
@@ -52,7 +54,9 @@ import org.springframework.util.CollectionUtils;
 public class UserConfigSolrDao extends SolrDaoBase {
 
   private static final Logger logger = Logger.getLogger(UserConfigSolrDao.class);
-  private static final String DEFAULT_LEVELS = "FATAL,ERROR,WARN,INFO,DEBUG,TRACE";
+
+  @Inject
+  private SolrUserConfig solrUserConfig;
 
   public UserConfigSolrDao() {
     super(LogType.SERVICE);
@@ -60,13 +64,13 @@ public class UserConfigSolrDao extends SolrDaoBase {
 
   @PostConstruct
   public void postConstructor() {
-    String solrUrl = PropertiesHelper.getProperty("logsearch.solr.url");
-    String zkConnectString = PropertiesHelper.getProperty("logsearch.solr.zk_connect_string");
-    String collection = PropertiesHelper.getProperty("logsearch.solr.collection.history", "history");
-    String configName = PropertiesHelper.getProperty("logsearch.solr.history.config.name", "history");
-    int replicationFactor = PropertiesHelper.getIntProperty("logsearch.collection.history.replication.factor", 2);
-    String splitInterval = "none";
-    int numberOfShards = 1;
+    String solrUrl = solrUserConfig.getSolrUrl();
+    String zkConnectString = solrUserConfig.getZkConnectString();
+    String collection = solrUserConfig.getCollection();
+    String configName = solrUserConfig.getConfigName();
+    int replicationFactor = solrUserConfig.getReplicationFactor();
+    String splitInterval = solrUserConfig.getSplitInterval();
+    int numberOfShards = solrUserConfig.getNumberOfShards();
 
     try {
       connectToSolr(solrUrl, zkConnectString, collection);
@@ -117,14 +121,14 @@ public class UserConfigSolrDao extends SolrDaoBase {
     if (!CollectionUtils.isEmpty(documentList)) {
       SolrDocument configDoc = documentList.get(0);
       String configJson = JSONUtil.objToJson(configDoc);
-      HashMap<String, Object> configMap = (HashMap<String, Object>) JSONUtil.jsonToMapObject(configJson);
+      HashMap<String, Object> configMap = JSONUtil.jsonToMapObject(configJson);
       String json = (String) configMap.get(LogSearchConstants.VALUES);
       logfeederFilterWrapper = (VLogfeederFilterWrapper) JSONUtil.jsonToObj(json, VLogfeederFilterWrapper.class);
       logfeederFilterWrapper.setId("" + configDoc.get(LogSearchConstants.ID));
 
     } else {
-      String logfeederDefaultLevels = PropertiesHelper.getProperty("logsearch.logfeeder.include.default.level", DEFAULT_LEVELS);
-      JSONArray levelJsonArray = new JSONArray(Arrays.asList(logfeederDefaultLevels.split(",")));
+      List<String> logfeederDefaultLevels = solrUserConfig.getLogLevels();
+      JSONArray levelJsonArray = new JSONArray(logfeederDefaultLevels);
 
       String hadoopServiceString = getHadoopServiceConfigJSON();
       String key = null;

+ 7 - 3
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/UserDao.java

@@ -24,8 +24,9 @@ import java.util.Arrays;
 import java.util.HashMap;
 
 import javax.annotation.PostConstruct;
+import javax.inject.Inject;
 
-import org.springframework.beans.factory.annotation.Autowired;
+import org.apache.ambari.logsearch.conf.AuthConfig;
 import org.springframework.security.core.GrantedAuthority;
 import org.springframework.stereotype.Repository;
 import org.apache.ambari.logsearch.common.PropertiesHelper;
@@ -50,9 +51,12 @@ public class UserDao {
   private static final String ENC_PASSWORD = "en_password";
   private static final String NAME = "name";
 
-  @Autowired
+  @Inject
   private LogsearchFileAuthenticationProvider fileAuthenticationProvider;
 
+  @Inject
+  private AuthConfig authConfig;
+
   private ArrayList<HashMap<String, String>> userList = null;
 
   @SuppressWarnings("unchecked")
@@ -60,7 +64,7 @@ public class UserDao {
   public void initialization() {
     if (fileAuthenticationProvider.isEnable()) {
       try {
-        String userPassJsonFileName = PropertiesHelper.getProperty("logsearch.login.credentials.file");
+        String userPassJsonFileName = authConfig.getCredentialsFile();
         logger.info("USER PASS JSON  file NAME:" + userPassJsonFileName);
         File jsonFile = FileUtil.getFileFromClasspath(userPassJsonFileName);
         if (jsonFile == null || !jsonFile.exists()) {

+ 16 - 10
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/doc/DocConstants.java

@@ -26,18 +26,25 @@ public class DocConstants {
     public static final String STACK_BY_D = "The graph property for stacking the plot";
     public static final String EXCLUDE_QUERY_D = "Exclude the values in query result e.g.: [{message:*timeout*}]";
     public static final String INCLUDE_QUERY_D = "Include the values in query result e.g.: [{message:*exception*}]";
-    public static final String MUST_BE_D = "Include the components, comman separated values";
-    public static final String MUST_NOT_D = "Exclude the components, comman separated values";
+    public static final String MUST_BE_D = "Include the components, comma separated values";
+    public static final String MUST_NOT_D = "Exclude the components, comma separated values";
     public static final String FROM_D = "Date range param, start date";
     public static final String TO_D = "Date range param, end date";
+    public static final String START_TIME_D = "Date range param which is suportted from browser url";
+    public static final String END_TIME_D = "Date range param which is supported from browser url";
+    public static final String START_INDEX_D = "Start index of the queried result";
+    public static final String SORT_TYPE_D = "Type of sorting (osc, desc)";
+    public static final String SORT_BY_D = "Sorting the results based on this field";
+    public static final String PAGE_D = "Number of pages for the results";
+    public static final String PAGE_SIZE_D = "Page size of the results";
     public static final String UNIT_D = "Aggregate the data with time gap as unit i.e 1MINUTE";
     public static final String QUERY_D = "not required";
     public static final String COLUMN_QUERY_D = "not required";
-    public static final String I_MESSAGE_D = "Include query which will query againt message column";
+    public static final String I_MESSAGE_D = "Include query which will query against message column";
     public static final String G_E_MESSAGE_D = "not required";
-    public static final String E_MESSAGE_D = "Exclude query which will query againt message column";
-    public static final String IS_LAST_PAGE_D = "";
-    public static final String FIELD_D = "Get top ten values for particular field";
+    public static final String E_MESSAGE_D = "Exclude query which will query against message column";
+    public static final String IS_LAST_PAGE_D = "Show last page (true/false)";
+    public static final String FIELD_D = "Get values for particular field";
     public static final String FORMAT_D = "File Export format, can be 'txt' or 'json'";
   }
 
@@ -48,7 +55,6 @@ public class DocConstants {
     public static final String GET_AUDIT_LINE_GRAPH_DATA_OD = "Get the data required for line graph";
     public static final String GET_TOP_AUDIT_USERS_OD = "Get the top audit users having maximum access";
     public static final String GET_TOP_AUDIT_RESOURCES_OD = "Get the top audit resources having maximum access";
-    public static final String GET_TOP_AUDIT_COMPONENTS_OD = "not required";
     public static final String GET_LIVE_LOGS_COUNT_OD = "not required";
     public static final String GET_REQUEST_USER_LINE_GRAPH_OD = "not required";
     public static final String GET_ANY_GRAPH_DATA_OD = "Get the data generic enough to use for graph plots";
@@ -59,11 +65,11 @@ public class DocConstants {
   public class ServiceDescriptions {
     public static final String LEVEL_D = "filter for log level";
     public static final String ADVANCED_SEARCH_D = "not required";
-    public static final String TREE_PARAMS_D = "Host hierarchy shown on UI,filtering there is supported by this param";
-    public static final String START_TIME_D = "Date range param which is suportted from browser url";
-    public static final String END_TIME_D = "Date range param which is supported from browser url";
+    public static final String BUNDLE_ID = "filter for host";
+    public static final String TREE_PARAMS_D = "Host hierarchy shown on UI, filtering there is supported by this param";
     public static final String FILE_NAME_D = "File name filter which is supported from browser url";
     public static final String HOST_NAME_D = "Host name filter which is supported from browser url";
+    public static final String DATE_RANGE_LABEL_D = "Date range label (e.g.: Today)";
     public static final String COMPONENT_NAME_D = "Component name filter which is supported from browser url";
     public static final String FIND_D = "Finding particular text on subsequent pages in case of table view with pagination";
     public static final String ID_D = "Log id value for traversing to that particular record with that log id";

+ 41 - 40
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/graph/GraphDataGenerator.java

@@ -26,14 +26,14 @@ import java.util.List;
 
 import org.apache.ambari.logsearch.common.LogSearchConstants;
 import org.apache.ambari.logsearch.common.MessageEnums;
-import org.apache.ambari.logsearch.common.SearchCriteria;
+import org.apache.ambari.logsearch.model.response.BarGraphData;
+import org.apache.ambari.logsearch.model.response.BarGraphDataListResponse;
+import org.apache.ambari.logsearch.model.response.NameValueData;
+import org.apache.ambari.logsearch.query.model.SearchCriteria;
 import org.apache.ambari.logsearch.dao.SolrDaoBase;
 import org.apache.ambari.logsearch.query.QueryGeneration;
 import org.apache.ambari.logsearch.util.RESTErrorUtil;
 import org.apache.ambari.logsearch.util.SolrUtil;
-import org.apache.ambari.logsearch.view.VBarDataList;
-import org.apache.ambari.logsearch.view.VBarGraphData;
-import org.apache.ambari.logsearch.view.VNameValue;
 import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
 import org.apache.solr.client.solrj.SolrQuery;
@@ -44,18 +44,19 @@ import org.apache.solr.client.solrj.response.QueryResponse;
 import org.apache.solr.client.solrj.response.RangeFacet;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.util.SimpleOrderedMap;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import javax.inject.Inject;
+
 @Component
 public class GraphDataGenerator extends GraphDataGeneratorBase {
 
   private static final Logger logger = Logger.getLogger(GraphDataGenerator.class);
 
-  @Autowired
+  @Inject
   private QueryGeneration queryGenerator;
 
-  public VBarDataList getAnyGraphData(SearchCriteria searchCriteria, SolrDaoBase solrDaoBase, SolrQuery solrQuery) {
+  public BarGraphDataListResponse getAnyGraphData(SearchCriteria searchCriteria, SolrDaoBase solrDaoBase, SolrQuery solrQuery) {
     // X axis credentials
     String xAxisField = (String) searchCriteria.getParamValue("xAxis");
     String stackField = (String) searchCriteria.getParamValue("stackBy");
@@ -119,12 +120,12 @@ public class GraphDataGenerator extends GraphDataGeneratorBase {
   }
 
   @SuppressWarnings("unchecked")
-  private VBarDataList normalGraph(String xAxisField, String yAxisField, String from, String to, SolrDaoBase solrDaoBase,
+  private BarGraphDataListResponse normalGraph(String xAxisField, String yAxisField, String from, String to, SolrDaoBase solrDaoBase,
       String typeXAxis, String fieldTime, SolrQuery solrQuery) {
-    VBarDataList dataList = new VBarDataList();
-    Collection<VBarGraphData> vBarGraphDatas = new ArrayList<VBarGraphData>();
-    VBarGraphData vBarGraphData = new VBarGraphData();
-    Collection<VNameValue> vNameValues = new ArrayList<VNameValue>();
+    BarGraphDataListResponse dataList = new BarGraphDataListResponse();
+    Collection<BarGraphData> vBarGraphDatas = new ArrayList<BarGraphData>();
+    BarGraphData vBarGraphData = new BarGraphData();
+    Collection<NameValueData> vNameValues = new ArrayList<NameValueData>();
     SolrUtil.setMainQuery(solrQuery, null);
     queryGenerator.setSingleIncludeFilter(solrQuery, fieldTime, "[" + from + " TO " + to + "]");
     if (typeXAxis.contains("string") || typeXAxis.contains("key_lower_case") || typeXAxis.contains("text")) {
@@ -140,7 +141,7 @@ public class GraphDataGenerator extends GraphDataGeneratorBase {
               if (countValues != null) {
                 for (Count countValue : countValues) {
                   if (countValue != null) {
-                    VNameValue vNameValue = new VNameValue();
+                    NameValueData vNameValue = new NameValueData();
                     vNameValue.setName(countValue.getName());
                     vNameValue.setValue("" + countValue.getCount());
                     vNameValues.add(vNameValue);
@@ -154,12 +155,12 @@ public class GraphDataGenerator extends GraphDataGeneratorBase {
           }
         }
         if (xAxisField.equalsIgnoreCase(LogSearchConstants.SOLR_LEVEL)) {
-          Collection<VNameValue> sortedVNameValues = new ArrayList<VNameValue>();
+          Collection<NameValueData> sortedVNameValues = new ArrayList<NameValueData>();
           for (String level : LogSearchConstants.SUPPORTED_LOG_LEVEL) {
-            VNameValue value = new VNameValue();
+            NameValueData value = new NameValueData();
             value.setName(level);
             String val = "0";
-            for (VNameValue valueLevel : vNameValues) {
+            for (NameValueData valueLevel : vNameValues) {
               if (valueLevel.getName().equalsIgnoreCase(level)) {
                 val = valueLevel.getValue();
                 break;
@@ -168,9 +169,9 @@ public class GraphDataGenerator extends GraphDataGeneratorBase {
             value.setValue(val);
             sortedVNameValues.add(value);
           }
-          vBarGraphData.setDataCounts(sortedVNameValues);
+          vBarGraphData.setDataCount(sortedVNameValues);
         } else {
-          vBarGraphData.setDataCounts(vNameValues);
+          vBarGraphData.setDataCount(vNameValues);
         }
         return dataList;
       } catch (SolrException | SolrServerException | IOException e) {
@@ -188,12 +189,12 @@ public class GraphDataGenerator extends GraphDataGeneratorBase {
         if (jsonFacetResponse.toString().equals("{count=0}")) {
           return dataList;
         }
-        VNameValue value = new VNameValue();
+        NameValueData value = new NameValueData();
         String sum = (String) jsonFacetResponse.getVal(1);
         value.setName(xAxisField);
         value.setValue(sum != null ? sum.substring(0, sum.indexOf(".")) : "");
         vNameValues.add(value);
-        vBarGraphData.setDataCounts(vNameValues);
+        vBarGraphData.setDataCount(vNameValues);
         vBarGraphData.setName(xAxisField);
         vBarGraphDatas.add(vBarGraphData);
         dataList.setGraphData(vBarGraphDatas);
@@ -207,10 +208,10 @@ public class GraphDataGenerator extends GraphDataGeneratorBase {
   }
 
   @SuppressWarnings("unchecked")
-  private VBarDataList nonRangeStackGraph(String xAxisField, String yAxisField, String stackField, String from, String to,
+  private BarGraphDataListResponse nonRangeStackGraph(String xAxisField, String yAxisField, String stackField, String from, String to,
       SolrDaoBase solrDaoBase, String typeXAxis, String fieldTime, SolrQuery solrQuery) {
-    VBarDataList dataList = new VBarDataList();
-    Collection<VBarGraphData> vGraphData = new ArrayList<VBarGraphData>();
+    BarGraphDataListResponse dataList = new BarGraphDataListResponse();
+    Collection<BarGraphData> vGraphData = new ArrayList<BarGraphData>();
     String mainQuery = queryGenerator.buildInclusiveRangeFilterQuery(fieldTime, from, to);
     SolrUtil.setMainQuery(solrQuery, mainQuery);
     SolrUtil.setFacetSort(solrQuery, LogSearchConstants.FACET_INDEX);
@@ -238,24 +239,24 @@ public class GraphDataGenerator extends GraphDataGeneratorBase {
       }
       extractNonRangeStackValuesFromBucket(jsonFacetResponse, stackField, vGraphData, typeXAxis);
       if (LogSearchConstants.SOLR_LEVEL.equalsIgnoreCase(stackField) && LogSearchConstants.SOLR_LEVEL.equalsIgnoreCase(xAxisField)) {
-        Collection<VBarGraphData> levelVGraphData = dataList.getGraphData();
-        for (VBarGraphData garphData : levelVGraphData) {
-          Collection<VNameValue> valueList = garphData.getDataCount();
-          Collection<VNameValue> valueListSorted = new ArrayList<VNameValue>();
+        Collection<BarGraphData> levelVGraphData = dataList.getGraphData();
+        for (BarGraphData graphData : levelVGraphData) {
+          Collection<NameValueData> valueList = graphData.getDataCount();
+          Collection<NameValueData> valueListSorted = new ArrayList<NameValueData>();
           for (String level : LogSearchConstants.SUPPORTED_LOG_LEVEL) {
             String val = "0";
-            for (VNameValue value : valueList) {
+            for (NameValueData value : valueList) {
               if (value.getName().equalsIgnoreCase(level)) {
                 val = value.getValue();
                 break;
               }
             }
-            VNameValue v1 = new VNameValue();
+            NameValueData v1 = new NameValueData();
             v1.setName(level.toUpperCase());
             v1.setValue(val);
             valueListSorted.add(v1);
           }
-          garphData.setDataCounts(valueListSorted);
+          graphData.setDataCount(valueListSorted);
         }
       }
       return dataList;
@@ -267,12 +268,12 @@ public class GraphDataGenerator extends GraphDataGeneratorBase {
   }
 
   @SuppressWarnings("unchecked")
-  private VBarDataList rangeNonStackGraph(String xAxisField, String yAxisField, String from, String to, String unit,
+  private BarGraphDataListResponse rangeNonStackGraph(String xAxisField, String yAxisField, String from, String to, String unit,
       SolrDaoBase solrDaoBase, String typeXAxis, String fieldTime, SolrQuery solrQuery) {
-    VBarDataList dataList = new VBarDataList();
-    Collection<VBarGraphData> vBarGraphDatas = new ArrayList<VBarGraphData>();
-    VBarGraphData vBarGraphData = new VBarGraphData();
-    Collection<VNameValue> vNameValues = new ArrayList<VNameValue>();
+    BarGraphDataListResponse dataList = new BarGraphDataListResponse();
+    Collection<BarGraphData> vBarGraphDatas = new ArrayList<BarGraphData>();
+    BarGraphData vBarGraphData = new BarGraphData();
+    Collection<NameValueData> vNameValues = new ArrayList<NameValueData>();
     SolrUtil.setMainQuery(solrQuery, null);
     if (SolrUtil.isSolrFieldNumber(typeXAxis,solrDaoBase)) {
       queryGenerator.setSingleRangeFilter(solrQuery, fieldTime, from, to);
@@ -290,12 +291,12 @@ public class GraphDataGenerator extends GraphDataGeneratorBase {
               List<RangeFacet.Count> listCount = rangeFacet.get(0).getCounts();
               if (listCount != null) {
                 for (RangeFacet.Count cnt : listCount) {
-                  VNameValue vNameValue = new VNameValue();
+                  NameValueData vNameValue = new NameValueData();
                   vNameValue.setName(cnt.getValue());
                   vNameValue.setValue("" + cnt.getCount());
                   vNameValues.add(vNameValue);
                 }
-                vBarGraphData.setDataCounts(vNameValues);
+                vBarGraphData.setDataCount(vNameValues);
                 vBarGraphDatas.add(vBarGraphData);
                 vBarGraphData.setName(xAxisField);
                 dataList.setGraphData(vBarGraphDatas);
@@ -312,10 +313,10 @@ public class GraphDataGenerator extends GraphDataGeneratorBase {
   }
 
   @SuppressWarnings("unchecked")
-  private VBarDataList rangeStackGraph(String xAxisField, String stackField, String from, String to, String unit,
+  private BarGraphDataListResponse rangeStackGraph(String xAxisField, String stackField, String from, String to, String unit,
       SolrDaoBase solrDaoBase, SolrQuery solrQuery) {
-    VBarDataList dataList = new VBarDataList();
-    List<VBarGraphData> histogramData = new ArrayList<VBarGraphData>();
+    BarGraphDataListResponse dataList = new BarGraphDataListResponse();
+    List<BarGraphData> histogramData = new ArrayList<BarGraphData>();
     SolrUtil.setMainQuery(solrQuery, null);
     SolrUtil.setFacetSort(solrQuery, LogSearchConstants.FACET_INDEX);
     String jsonHistogramQuery =

+ 19 - 15
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/graph/GraphDataGeneratorBase.java

@@ -23,15 +23,15 @@ import java.util.Collection;
 import java.util.Date;
 import java.util.List;
 
-import org.apache.ambari.logsearch.manager.MgrBase;
+import org.apache.ambari.logsearch.manager.ManagerBase;
+import org.apache.ambari.logsearch.model.response.BarGraphData;
+import org.apache.ambari.logsearch.model.response.NameValueData;
 import org.apache.ambari.logsearch.util.DateUtil;
-import org.apache.ambari.logsearch.view.VBarGraphData;
-import org.apache.ambari.logsearch.view.VNameValue;
 import org.apache.commons.lang.StringUtils;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.common.util.SimpleOrderedMap;
 
-class GraphDataGeneratorBase extends MgrBase {
+class GraphDataGeneratorBase {
 
   private static final String BUCKETS = "buckets";
   
@@ -62,19 +62,19 @@ class GraphDataGeneratorBase extends MgrBase {
 
   @SuppressWarnings("unchecked")
   protected void extractRangeStackValuesFromBucket(SimpleOrderedMap<Object> jsonFacetResponse, String outerField,
-      String innerField, List<VBarGraphData> histogramData) {
+      String innerField, List<BarGraphData> histogramData) {
     if (jsonFacetResponse != null) {
       NamedList<Object> stack = (NamedList<Object>) jsonFacetResponse.get(outerField);
       if (stack != null) {
         ArrayList<Object> stackBuckets = (ArrayList<Object>) stack.get(BUCKETS);
         if (stackBuckets != null) {
           for (Object stackBucket : stackBuckets) {
-            VBarGraphData vBarGraphData = new VBarGraphData();
+            BarGraphData vBarGraphData = new BarGraphData();
             SimpleOrderedMap<Object> level = (SimpleOrderedMap<Object>) stackBucket;
             if (level != null) {
               String name = level.getVal(0) != null ? level.getVal(0).toString().toUpperCase() : "";
               vBarGraphData.setName(name);
-              Collection<VNameValue> vNameValues = new ArrayList<VNameValue>();
+              Collection<NameValueData> vNameValues = new ArrayList<NameValueData>();
               NamedList<Object> innerFiledValue = (NamedList<Object>) level.get(innerField);
               if (innerFiledValue != null) {
                 ArrayList<Object> levelBuckets = (ArrayList<Object>) innerFiledValue.get(BUCKETS);
@@ -84,13 +84,15 @@ class GraphDataGeneratorBase extends MgrBase {
                     if (countValue != null) {
                       String innerName = DateUtil.convertDateWithMillisecondsToSolrDate((Date) countValue.getVal(0));
                       String innerValue = countValue.getVal(1) != null ? countValue.getVal(1).toString() : "";
-                      VNameValue vNameValue = new VNameValue(innerName, innerValue);
+                      NameValueData vNameValue = new NameValueData();
+                      vNameValue.setName(innerName);
+                      vNameValue.setValue(innerValue);
                       vNameValues.add(vNameValue);
                     }
                   }
                 }
               }
-              vBarGraphData.setDataCounts(vNameValues);
+              vBarGraphData.setDataCount(vNameValues);
             }
             histogramData.add(vBarGraphData);
           }
@@ -101,7 +103,7 @@ class GraphDataGeneratorBase extends MgrBase {
 
   @SuppressWarnings("unchecked")
   protected boolean extractNonRangeStackValuesFromBucket(SimpleOrderedMap<Object> jsonFacetResponse, String level,
-      Collection<VBarGraphData> vGraphDatas, String typeXAxis) {
+      Collection<BarGraphData> vGraphDatas, String typeXAxis) {
     boolean zeroFlag = true;
     if (jsonFacetResponse == null || jsonFacetResponse.get(level) == null
         || jsonFacetResponse.get(level).toString().equals("{count=0}")) {
@@ -114,11 +116,11 @@ class GraphDataGeneratorBase extends MgrBase {
         for (int index = 0; index < bucketList.size(); index++) {
           SimpleOrderedMap<Object> valueCount = (SimpleOrderedMap<Object>) bucketList.get(index);
           if (valueCount != null && valueCount.size() > 2) {
-            VBarGraphData vGraphData = new VBarGraphData();
-            Collection<VNameValue> levelCounts = new ArrayList<VNameValue>();
+            BarGraphData vGraphData = new BarGraphData();
+            Collection<NameValueData> levelCounts = new ArrayList<NameValueData>();
             String name = valueCount.getVal(0) != null ? valueCount.getVal(0).toString().trim() : "";
             if (isTypeNumber(typeXAxis)) {
-              VNameValue nameValue = new VNameValue();
+              NameValueData nameValue = new NameValueData();
               Double sumValue = (Double) valueCount.getVal(2);
               String value = "0";// default is zero
               if (sumValue != null) {
@@ -137,7 +139,9 @@ class GraphDataGeneratorBase extends MgrBase {
                     if (innerValueCount != null) {
                       String innerName = innerValueCount.getVal(0) != null ? innerValueCount.getVal(0).toString().trim() : "";
                       String innerValue = innerValueCount.getVal(1) != null ? innerValueCount.getVal(1).toString().trim() : "";
-                      VNameValue nameValue = new VNameValue(innerName, innerValue);
+                      NameValueData nameValue = new NameValueData();
+                      nameValue.setValue(innerValue);
+                      nameValue.setName(innerName);
                       levelCounts.add(nameValue);
                     }
                   }
@@ -145,7 +149,7 @@ class GraphDataGeneratorBase extends MgrBase {
               }
             }
             vGraphData.setName(name);
-            vGraphData.setDataCounts(levelCounts);
+            vGraphData.setDataCount(levelCounts);
             vGraphDatas.add(vGraphData);
           }
         }

+ 146 - 179
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/AuditMgr.java → ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/AuditLogsManager.java

@@ -19,6 +19,7 @@
 
 package org.apache.ambari.logsearch.manager;
 
+import javax.inject.Inject;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
@@ -27,6 +28,7 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.text.ParseException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Date;
 import java.util.HashMap;
@@ -36,21 +38,26 @@ import org.apache.ambari.logsearch.common.ConfigHelper;
 import org.apache.ambari.logsearch.common.LogSearchConstants;
 import org.apache.ambari.logsearch.common.ManageStartEndTime;
 import org.apache.ambari.logsearch.common.MessageEnums;
-import org.apache.ambari.logsearch.common.PropertiesHelper;
-import org.apache.ambari.logsearch.common.SearchCriteria;
+import org.apache.ambari.logsearch.conf.SolrAuditLogConfig;
 import org.apache.ambari.logsearch.dao.AuditSolrDao;
 import org.apache.ambari.logsearch.graph.GraphDataGenerator;
+import org.apache.ambari.logsearch.model.response.AuditLogResponse;
+import org.apache.ambari.logsearch.model.response.BarGraphData;
+import org.apache.ambari.logsearch.model.response.BarGraphDataListResponse;
+import org.apache.ambari.logsearch.model.response.GroupListResponse;
+import org.apache.ambari.logsearch.model.response.LogData;
+import org.apache.ambari.logsearch.model.response.LogSearchResponse;
+import org.apache.ambari.logsearch.model.response.NameValueData;
+import org.apache.ambari.logsearch.model.response.NameValueDataListResponse;
+import org.apache.ambari.logsearch.solr.model.SolrAuditLogData;
+import org.apache.ambari.logsearch.solr.model.SolrComponentTypeLogData;
 import org.apache.ambari.logsearch.util.BizUtil;
 import org.apache.ambari.logsearch.util.DateUtil;
 import org.apache.ambari.logsearch.util.RESTErrorUtil;
 import org.apache.ambari.logsearch.util.SolrUtil;
-import org.apache.ambari.logsearch.view.VBarDataList;
-import org.apache.ambari.logsearch.view.VBarGraphData;
-import org.apache.ambari.logsearch.view.VGroupList;
-import org.apache.ambari.logsearch.view.VNameValue;
-import org.apache.ambari.logsearch.view.VNameValueList;
 import org.apache.ambari.logsearch.view.VResponse;
-import org.apache.ambari.logsearch.view.VSolrLogList;
+import org.apache.ambari.logsearch.query.model.AuditLogSearchCriteria;
+import org.apache.ambari.logsearch.query.model.SearchCriteria;
 import org.apache.log4j.Logger;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.SolrServerException;
@@ -58,43 +65,39 @@ import org.apache.solr.client.solrj.response.FacetField;
 import org.apache.solr.client.solrj.response.FacetField.Count;
 import org.apache.solr.client.solrj.response.QueryResponse;
 import org.apache.solr.client.solrj.response.RangeFacet;
-import org.apache.solr.common.SolrDocument;
-import org.apache.solr.common.SolrDocumentList;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.common.util.SimpleOrderedMap;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 @Component
-public class AuditMgr extends MgrBase {
-  private static final Logger logger = Logger.getLogger(AuditMgr.class); 
+public class AuditLogsManager extends ManagerBase<SolrAuditLogData, AuditLogResponse> {
+  private static final Logger logger = Logger.getLogger(AuditLogsManager.class);
 
-  @Autowired
+  @Inject
   private AuditSolrDao auditSolrDao;
-  @Autowired
+  @Inject
   private GraphDataGenerator graphDataGenerator;
-
-  public String getLogs(SearchCriteria searchCriteria) {
-    String lastPage = (String)  searchCriteria.getParamValue("isLastPage");
-    Boolean isLastPage = Boolean.parseBoolean(lastPage);
-     if (isLastPage) {
-       SolrQuery lastPageQuery = queryGenerator.commonAuditFilterQuery(searchCriteria);
-      VSolrLogList collection = getLastPage(searchCriteria, LogSearchConstants.AUDIT_EVTTIME, auditSolrDao, lastPageQuery);
-      if(collection == null){
-        collection = new VSolrLogList();
-      }
-      return convertObjToString(collection);
+  @Inject
+  private SolrAuditLogConfig solrAuditLogConfig;
+
+  public AuditLogResponse getLogs(AuditLogSearchCriteria searchCriteria) {
+    Boolean isLastPage = (Boolean) searchCriteria.getParamValue("isLastPage");
+    if (isLastPage) {
+      SolrQuery lastPageQuery = queryGenerator.commonAuditFilterQuery(searchCriteria);
+      LogSearchResponse logResponse = getLastPage(searchCriteria, LogSearchConstants.AUDIT_EVTTIME, auditSolrDao, lastPageQuery);
+      if (logResponse == null) {
+        logResponse = new AuditLogResponse();
+      }
+      return (AuditLogResponse) logResponse;
     }
     SolrQuery solrQuery = queryGenerator.commonAuditFilterQuery(searchCriteria);
-    VSolrLogList collection = getLogAsPaginationProvided(solrQuery, auditSolrDao);
-    return convertObjToString(collection);
-
+    return getLogAsPaginationProvided(solrQuery, auditSolrDao);
   }
 
-  private SolrDocumentList getComponents(SearchCriteria searchCriteria) {
+  private List<LogData> getComponents(SearchCriteria searchCriteria) {
     SolrQuery solrQuery = queryGenerator.commonAuditFilterQuery(searchCriteria);
-    SolrDocumentList docList = new SolrDocumentList();
+    List<LogData> docList = new ArrayList<>();
     try {
       SolrUtil.setFacetField(solrQuery, LogSearchConstants.AUDIT_COMPONENT);
       SolrUtil.setFacetSort(solrQuery, LogSearchConstants.FACET_INDEX);
@@ -117,11 +120,11 @@ public class AuditMgr extends MgrBase {
       if (facetField != null) {
         componentsCount = facetField.getValues();
       }
-    
-      for (Count compnonet : componentsCount) {
-        SolrDocument solrDocument = new SolrDocument();
-        solrDocument.addField("type", compnonet.getName());
-        docList.add(solrDocument);
+
+      for (Count component : componentsCount) {
+        SolrComponentTypeLogData logData = new SolrComponentTypeLogData();
+        logData.setType(component.getName());
+        docList.add(logData);
       }
       return docList;
     } catch (SolrException | SolrServerException | IOException e) {
@@ -130,24 +133,23 @@ public class AuditMgr extends MgrBase {
     }
   }
 
-  public String getAuditComponents(SearchCriteria searchCriteria) {
-    VGroupList vGroupList = new VGroupList();
-    SolrDocumentList docList = getComponents(searchCriteria);
-
-    vGroupList.setGroupDocuments(docList);
-    return convertObjToString(vGroupList);
+  public GroupListResponse getAuditComponents(SearchCriteria searchCriteria) {
+    GroupListResponse componentResponse = new GroupListResponse();
+    List<LogData> docList = getComponents(searchCriteria);
+    componentResponse.setGroupList(docList);
+    return componentResponse;
   }
 
   @SuppressWarnings("unchecked")
-  public String getAuditLineGraphData(SearchCriteria searchCriteria) {
-    VBarDataList dataList = new VBarDataList();
+  public BarGraphDataListResponse getAuditBarGraphData(SearchCriteria searchCriteria) {
+    BarGraphDataListResponse dataList = new BarGraphDataListResponse();
     SolrQuery solrQuery = queryGenerator.commonAuditFilterQuery(searchCriteria);
 
     String from = getFrom((String) searchCriteria.getParamValue("startTime"));
     String to = getTo((String) searchCriteria.getParamValue("endTime"));
     String unit = getUnit((String) searchCriteria.getParamValue("unit"));
 
-    List<VBarGraphData> histogramData = new ArrayList<VBarGraphData>();
+    List<BarGraphData> histogramData = new ArrayList<BarGraphData>();
     String jsonHistogramQuery = queryGenerator.buildJSONFacetTermTimeRangeQuery(LogSearchConstants.AUDIT_COMPONENT,
       LogSearchConstants.AUDIT_EVTTIME, from, to, unit).replace("\\", "");
 
@@ -155,19 +157,19 @@ public class AuditMgr extends MgrBase {
       SolrUtil.setJSONFacet(solrQuery, jsonHistogramQuery);
       SolrUtil.setRowCount(solrQuery, 0);
       QueryResponse response = auditSolrDao.process(solrQuery);
-      if (response == null){
-        return convertObjToString(dataList);
+      if (response == null) {
+        return dataList;
       }
       SimpleOrderedMap<Object> jsonFacetResponse = (SimpleOrderedMap<Object>) response.getResponse().get("facets");
 
       if (jsonFacetResponse == null || jsonFacetResponse.toString().equals("{count=0}")) {
-        return convertObjToString(dataList);
+        return dataList;
       }
 
       extractValuesFromBucket(jsonFacetResponse, "x", "y", histogramData);
 
       dataList.setGraphData(histogramData);
-      return convertObjToString(dataList);
+      return dataList;
 
     } catch (SolrServerException | SolrException | IOException e) {
       logger.error(e);
@@ -176,55 +178,9 @@ public class AuditMgr extends MgrBase {
     }
   }
 
-  public String getTopAuditFieldCount(SearchCriteria searchCriteria) {
-    int topCounts = 10;
-    Integer top = (Integer) searchCriteria.getParamValue("top");
-    String facetField = (String) searchCriteria.getParamValue("field");
-    if (top == null){
-      top = new Integer(topCounts);
-    }
-    SolrQuery solrQuery = queryGenerator.commonAuditFilterQuery(searchCriteria);
-    try {
-
-      List<VNameValue> nameValues = new ArrayList<VNameValue>();
-
-      VNameValueList nameValueList = new VNameValueList(nameValues);
-
-      SolrUtil.setFacetField(solrQuery, facetField);
-      SolrUtil.setFacetSort(solrQuery, LogSearchConstants.FACET_COUNT);
-      SolrUtil.setFacetLimit(solrQuery, top.intValue());
-
-      List<Count> countList = new ArrayList<FacetField.Count>();
-      QueryResponse queryResponse = auditSolrDao.process(solrQuery);
-      if (queryResponse == null) {
-        return convertObjToString(nameValueList);
-      }
-      
-      if (queryResponse.getFacetField(facetField) != null) {
-        FacetField queryFacetField = queryResponse.getFacetField(facetField);
-        if (queryFacetField != null) {
-          countList = queryFacetField.getValues();
-        }
-      }
-
-      for (Count cnt : countList) {
-        VNameValue nameValue = new VNameValue();
-        nameValue.setName(cnt.getName());
-
-        nameValue.setValue("" + cnt.getCount());
-        nameValues.add(nameValue);
-      }
-      return convertObjToString(nameValueList);
-
-    } catch (SolrException | IOException | SolrServerException e) {
-      logger.error("Error during solrQuery=" + solrQuery, e);
-      throw RESTErrorUtil.createRESTException(MessageEnums.SOLR_ERROR.getMessage().getMessage(), MessageEnums.ERROR_SYSTEM);
-    }
-  }
-
-  @SuppressWarnings({ "unchecked", "rawtypes" })
-  public String getLiveLogCounts() {
-    VNameValueList nameValueList = new VNameValueList();
+  @SuppressWarnings({"unchecked", "rawtypes"})
+  public NameValueDataListResponse getLiveLogCounts() {
+    NameValueDataListResponse nameValueList = new NameValueDataListResponse();
     SolrQuery solrQuery = new SolrQuery();
     solrQuery.setParam("event", "/audit/logs/live/count");
     try {
@@ -237,30 +193,30 @@ public class AuditMgr extends MgrBase {
       List<RangeFacet.Count> listCount;
 
       QueryResponse response = auditSolrDao.process(solrQuery);
- 
+
       List<RangeFacet> rangeFacet = response.getFacetRanges();
-      if (rangeFacet == null){
-        return convertObjToString(nameValueList);
+      if (rangeFacet == null) {
+        return nameValueList;
       }
-      RangeFacet range=rangeFacet.get(0);
-      
-      if(range == null){
-        return convertObjToString(nameValueList);
+      RangeFacet range = rangeFacet.get(0);
+
+      if (range == null) {
+        return nameValueList;
       }
-      
+
       listCount = range.getCounts();
 
-      List<VNameValue> nameValues = new ArrayList<VNameValue>();
+      List<NameValueData> nameValues = new ArrayList<>();
       int count = 0;
       for (RangeFacet.Count cnt : listCount) {
-        VNameValue nameValue = new VNameValue();
+        NameValueData nameValue = new NameValueData();
         nameValue.setName("" + count);
         nameValue.setValue("" + cnt.getCount());
         nameValues.add(nameValue);
         count++;
       }
-      nameValueList.setVNameValues(nameValues);
-      return convertObjToString(nameValueList);
+      nameValueList.setvNameValues(nameValues);
+      return nameValueList;
 
     } catch (SolrException | SolrServerException | ParseException
       | IOException e) {
@@ -269,36 +225,36 @@ public class AuditMgr extends MgrBase {
     }
   }
 
-  public String topTenUsers(SearchCriteria searchCriteria) {
+  public BarGraphDataListResponse topTenUsers(SearchCriteria searchCriteria) {
 
     String jsonUserQuery =
-        "{Users:{type:terms, field:reqUser, facet:{ Repo:{ type:terms, field:repo, facet:{eventCount:\"sum(event_count)\"}}}}}";
+      "{Users:{type:terms, field:reqUser, facet:{ Repo:{ type:terms, field:repo, facet:{eventCount:\"sum(event_count)\"}}}}}";
     SolrQuery solrQuery = queryGenerator.commonAuditFilterQuery(searchCriteria);
     SolrUtil.setJSONFacet(solrQuery, jsonUserQuery);
     SolrUtil.setRowCount(solrQuery, 0);
     try {
-      VBarDataList vBarDataList = new VBarDataList();
+      BarGraphDataListResponse barGraphDataListResponse = new BarGraphDataListResponse();
       QueryResponse queryResponse = auditSolrDao.process(solrQuery);
       if (queryResponse == null) {
-        return convertObjToString(vBarDataList);
+        return barGraphDataListResponse;
       }
 
       NamedList<Object> namedList = queryResponse.getResponse();
-      
+
       if (namedList == null) {
-        return convertObjToString(vBarDataList);
+        return barGraphDataListResponse;
       }
 
       @SuppressWarnings("unchecked")
       SimpleOrderedMap<Object> jsonFacetResponse = (SimpleOrderedMap<Object>) namedList.get("facets");
       if (jsonFacetResponse == null) {
-        return convertObjToString(vBarDataList);
+        return barGraphDataListResponse;
       }
       if (jsonFacetResponse.toString().equals("{count=0}")) {
-        return convertObjToString(vBarDataList);
+        return barGraphDataListResponse;
       }
-      vBarDataList = BizUtil.buildSummaryForTopCounts(jsonFacetResponse,"Repo","Users");
-      return convertObjToString(vBarDataList);
+      barGraphDataListResponse = BizUtil.buildSummaryForTopCounts(jsonFacetResponse, "Repo", "Users");
+      return barGraphDataListResponse;
 
     } catch (SolrServerException | SolrException | IOException e) {
       logger.error("Error during solrQuery=" + e);
@@ -306,30 +262,30 @@ public class AuditMgr extends MgrBase {
     }
   }
 
-  public String topTenResources(SearchCriteria searchCriteria) {
+  public BarGraphDataListResponse topTenResources(SearchCriteria searchCriteria) {
 
     String jsonUserQuery =
-        "{Users:{type:terms,field:resource,facet:{Repo:{type:terms,field:repo,facet:{eventCount:\"sum(event_count)\"}}}}}";
+      "{Users:{type:terms,field:resource,facet:{Repo:{type:terms,field:repo,facet:{eventCount:\"sum(event_count)\"}}}}}";
     SolrQuery solrQuery = queryGenerator.commonAuditFilterQuery(searchCriteria);
     SolrUtil.setJSONFacet(solrQuery, jsonUserQuery);
     SolrUtil.setRowCount(solrQuery, 0);
     try {
-      VBarDataList vBarDataList = new VBarDataList();
+      BarGraphDataListResponse barGraphDataListResponse = new BarGraphDataListResponse();
       QueryResponse queryResponse = auditSolrDao.process(solrQuery);
-      if(queryResponse == null){
-        return convertObjToString(vBarDataList);
+      if (queryResponse == null) {
+        return barGraphDataListResponse;
       }
 
       NamedList<Object> namedList = queryResponse.getResponse();
       if (namedList == null) {
-        return convertObjToString(vBarDataList);
+        return barGraphDataListResponse;
       }
 
       @SuppressWarnings("unchecked")
       SimpleOrderedMap<Object> jsonFacetResponse = (SimpleOrderedMap<Object>) namedList.get("facets");
 
-      vBarDataList = BizUtil.buildSummaryForTopCounts(jsonFacetResponse,"Repo","Users");
-      return convertObjToString(vBarDataList);
+      barGraphDataListResponse = BizUtil.buildSummaryForTopCounts(jsonFacetResponse, "Repo", "Users");
+      return barGraphDataListResponse;
 
     } catch (SolrServerException | SolrException | IOException e) {
       logger.error("Error during solrQuery=" + solrQuery, e);
@@ -338,38 +294,38 @@ public class AuditMgr extends MgrBase {
   }
 
   @SuppressWarnings("unchecked")
-  public String getRequestUserLineGraph(SearchCriteria searchCriteria) {
+  public BarGraphDataListResponse getRequestUserLineGraph(SearchCriteria searchCriteria) {
 
     String from = getFrom((String) searchCriteria.getParamValue("startTime"));
     String to = getTo((String) searchCriteria.getParamValue("endTime"));
     String unit = getUnit((String) searchCriteria.getParamValue("unit"));
-    
+
     SolrQuery solrQuery = queryGenerator.commonAuditFilterQuery(searchCriteria);
 
-    VBarDataList dataList = new VBarDataList();
-    List<VBarGraphData> histogramData = new ArrayList<VBarGraphData>();
+    BarGraphDataListResponse dataList = new BarGraphDataListResponse();
+    List<BarGraphData> histogramData = new ArrayList<BarGraphData>();
 
     SolrUtil.setFacetSort(solrQuery, LogSearchConstants.FACET_INDEX);
 
     String jsonHistogramQuery = queryGenerator.buildJSONFacetTermTimeRangeQuery(LogSearchConstants.AUDIT_REQUEST_USER,
-        LogSearchConstants.AUDIT_EVTTIME, from, to, unit).replace("\\", "");
+      LogSearchConstants.AUDIT_EVTTIME, from, to, unit).replace("\\", "");
 
     try {
       SolrUtil.setJSONFacet(solrQuery, jsonHistogramQuery);
       SolrUtil.setRowCount(solrQuery, 0);
       QueryResponse response = auditSolrDao.process(solrQuery);
-      if (response == null){
-        return convertObjToString(dataList);
+      if (response == null) {
+        return dataList;
       }
       SimpleOrderedMap<Object> jsonFacetResponse = (SimpleOrderedMap<Object>) response.getResponse().get("facets");
 
       if (jsonFacetResponse == null || jsonFacetResponse.toString().equals("{count=0}")) {
-        return convertObjToString(dataList);
+        return dataList;
       }
       extractValuesFromBucket(jsonFacetResponse, "x", "y", histogramData);
 
       dataList.setGraphData(histogramData);
-      return convertObjToString(dataList);
+      return dataList;
 
     } catch (SolrException | IOException | SolrServerException e) {
       logger.error("Error during solrQuery=" + solrQuery, e);
@@ -379,13 +335,14 @@ public class AuditMgr extends MgrBase {
   }
 
   public String getAuditLogsSchemaFieldsName() {
-    String excludeArray[] = PropertiesHelper.getPropertyStringList("logsearch.solr.audit.logs.exclude.columnlist");
+    String excludeArray[] = Arrays.copyOf(solrAuditLogConfig.getExcludeColumnList().toArray(),
+      solrAuditLogConfig.getExcludeColumnList().size(), String[].class);
     List<String> fieldNames = new ArrayList<String>();
     HashMap<String, String> uiFieldColumnMapping = new HashMap<String, String>();
-    ConfigHelper.getSchemaFieldsName(excludeArray, fieldNames,auditSolrDao);
+    ConfigHelper.getSchemaFieldsName(excludeArray, fieldNames, auditSolrDao);
 
     for (String fieldName : fieldNames) {
-      String uiField = ConfigHelper.auditLogsColumnMapping.get(fieldName + LogSearchConstants.SOLR_SUFFIX);
+      String uiField = solrAuditLogConfig.getSolrAndUiColumns().get(fieldName + LogSearchConstants.SOLR_SUFFIX);
       if (uiField == null) {
         uiFieldColumnMapping.put(fieldName, fieldName);
       } else {
@@ -398,38 +355,38 @@ public class AuditMgr extends MgrBase {
 
   }
 
-  public String getAnyGraphData(SearchCriteria searchCriteria) {
+  public BarGraphDataListResponse getAnyGraphData(SearchCriteria searchCriteria) {
     searchCriteria.addParam("fieldTime", LogSearchConstants.AUDIT_EVTTIME);
     SolrQuery solrQuery = queryGenerator.commonAuditFilterQuery(searchCriteria);
-    VBarDataList result = graphDataGenerator.getAnyGraphData(searchCriteria, auditSolrDao, solrQuery);
+    BarGraphDataListResponse result = graphDataGenerator.getAnyGraphData(searchCriteria, auditSolrDao, solrQuery);
     if (result == null) {
-      result = new VBarDataList();
+      result = new BarGraphDataListResponse();
     }
-    return convertObjToString(result);
+    return result;
 
   }
 
   @SuppressWarnings("unchecked")
   private void extractValuesFromBucket(SimpleOrderedMap<Object> jsonFacetResponse, String outerField, String innerField,
-      List<VBarGraphData> histogramData) {
+                                       List<BarGraphData> histogramData) {
     NamedList<Object> stack = (NamedList<Object>) jsonFacetResponse.get(outerField);
     ArrayList<Object> stackBuckets = (ArrayList<Object>) stack.get("buckets");
     for (Object temp : stackBuckets) {
-      VBarGraphData vBarGraphData = new VBarGraphData();
+      BarGraphData vBarGraphData = new BarGraphData();
 
       SimpleOrderedMap<Object> level = (SimpleOrderedMap<Object>) temp;
       String name = ((String) level.getVal(0)).toUpperCase();
       vBarGraphData.setName(name);
 
-      Collection<VNameValue> vNameValues = new ArrayList<VNameValue>();
-      vBarGraphData.setDataCounts(vNameValues);
+      Collection<NameValueData> vNameValues = new ArrayList<NameValueData>();
+      vBarGraphData.setDataCount(vNameValues);
       ArrayList<Object> levelBuckets = (ArrayList<Object>) ((NamedList<Object>) level.get(innerField)).get("buckets");
       for (Object temp1 : levelBuckets) {
         SimpleOrderedMap<Object> countValue = (SimpleOrderedMap<Object>) temp1;
         String value = DateUtil.convertDateWithMillisecondsToSolrDate((Date) countValue.getVal(0));
 
         String count = "" + countValue.getVal(1);
-        VNameValue vNameValue = new VNameValue();
+        NameValueData vNameValue = new NameValueData();
         vNameValue.setName(value);
         vNameValue.setValue(count);
         vNameValues.add(vNameValue);
@@ -441,7 +398,7 @@ public class AuditMgr extends MgrBase {
   @SuppressWarnings({"unchecked"})
   public Response exportUserTableToTextFile(SearchCriteria searchCriteria) {
     String jsonUserQuery =
-        "{ Users: { type: terms, field: reqUser, facet:  {Repo: {  type: terms, field: repo, facet: {  eventCount: \"sum(event_count)\"}}}},x:{ type: terms,field: resource, facet: {y: {  type: terms, field: repo,facet: {  eventCount: \"sum(event_count)\"}}}}}";
+      "{ Users: { type: terms, field: reqUser, facet:  {Repo: {  type: terms, field: repo, facet: {  eventCount: \"sum(event_count)\"}}}},x:{ type: terms,field: resource, facet: {y: {  type: terms, field: repo,facet: {  eventCount: \"sum(event_count)\"}}}}}";
 
     SolrQuery solrQuery = queryGenerator.commonAuditFilterQuery(searchCriteria);
     String startTime = (String) searchCriteria.getParamValue("startTime");
@@ -457,24 +414,24 @@ public class AuditMgr extends MgrBase {
     FileOutputStream fis = null;
     try {
       QueryResponse queryResponse = auditSolrDao.process(solrQuery);
-      if(queryResponse == null){
+      if (queryResponse == null) {
         VResponse response = new VResponse();
-        response.setMsgDesc("Query was not able to execute "+solrQuery);
+        response.setMsgDesc("Query was not able to execute " + solrQuery);
         throw RESTErrorUtil.createRESTException(response);
       }
 
       NamedList<Object> namedList = queryResponse.getResponse();
       if (namedList == null) {
         VResponse response = new VResponse();
-        response.setMsgDesc("Query was not able to execute "+solrQuery);
+        response.setMsgDesc("Query was not able to execute " + solrQuery);
         throw RESTErrorUtil.createRESTException(response);
       }
-      VBarDataList vBarUserDataList = new VBarDataList();
-      VBarDataList vBarResourceDataList = new VBarDataList();
+      BarGraphDataListResponse vBarUserDataList = new BarGraphDataListResponse();
+      BarGraphDataListResponse vBarResourceDataList = new BarGraphDataListResponse();
 
       SimpleOrderedMap<Object> jsonFacetResponse = (SimpleOrderedMap<Object>) namedList.get("facets");
-      vBarUserDataList = BizUtil.buildSummaryForTopCounts(jsonFacetResponse,"Repo","Users");
-      vBarResourceDataList = BizUtil.buildSummaryForTopCounts(jsonFacetResponse,"y","x");
+      vBarUserDataList = BizUtil.buildSummaryForTopCounts(jsonFacetResponse, "Repo", "Users");
+      vBarResourceDataList = BizUtil.buildSummaryForTopCounts(jsonFacetResponse, "y", "x");
       String data = "";
       String summary = "";
       if ("text".equals(dataFormat)) {
@@ -483,8 +440,8 @@ public class AuditMgr extends MgrBase {
         summary += "\n\n\n\n";
         data += addBlank("Users") + "Components/Access" + "\n";
         data += "--------------------------------------------------------------------------\n";
-        Collection<VBarGraphData> tableUserData = vBarUserDataList.getGraphData();
-        for (VBarGraphData graphData : tableUserData) {
+        Collection<BarGraphData> tableUserData = vBarUserDataList.getGraphData();
+        for (BarGraphData graphData : tableUserData) {
           String userName = graphData.getName();
           String largeUserName = "";
 
@@ -494,10 +451,10 @@ public class AuditMgr extends MgrBase {
           } else
             data += addBlank(userName);
 
-          Collection<VNameValue> vnameValueList = graphData.getDataCount();
+          Collection<NameValueData> vnameValueList = graphData.getDataCount();
           int count = 0;
           String blank = "";
-          for (VNameValue vNameValue : vnameValueList) {
+          for (NameValueData vNameValue : vnameValueList) {
             data += blank + vNameValue.getName() + " " + vNameValue.getValue() + "\n";
             if (count == 0)
               blank = addBlank(blank);
@@ -513,8 +470,8 @@ public class AuditMgr extends MgrBase {
         data += "\n\n\n\n\n\n";
         data += addBlank("Resources") + "Components/Access" + "\n";
         data += "--------------------------------------------------------------------------\n";
-        Collection<VBarGraphData> tableResourceData = vBarResourceDataList.getGraphData();
-        for (VBarGraphData graphData : tableResourceData) {
+        Collection<BarGraphData> tableResourceData = vBarResourceDataList.getGraphData();
+        for (BarGraphData graphData : tableResourceData) {
           String resourceName = graphData.getName();
           String largeResourceName = resourceName;
           if (largeResourceName.length() > 45) {
@@ -526,10 +483,10 @@ public class AuditMgr extends MgrBase {
 
           //resourceName = resourceName.replaceAll("(.{45})", resourceName.substring(0, 45)+"\n");
           data += addBlank(resourceName);
-          Collection<VNameValue> vnameValueList = graphData.getDataCount();
+          Collection<NameValueData> vnameValueList = graphData.getDataCount();
           int count = 0;
           String blank = "";
-          for (VNameValue vNameValue : vnameValueList) {
+          for (NameValueData vNameValue : vnameValueList) {
             data += blank + vNameValue.getName() + " " + vNameValue.getValue() + "\n";
             if (count == 0)
               blank = addBlank(blank);
@@ -586,9 +543,9 @@ public class AuditMgr extends MgrBase {
     return fieldWithBlank;
   }
 
-  public String getServiceLoad(SearchCriteria searchCriteria) {
-    VBarDataList dataList = new VBarDataList();
-    Collection<VBarGraphData> vaDatas = new ArrayList<VBarGraphData>();
+  public BarGraphDataListResponse getServiceLoad(SearchCriteria searchCriteria) {
+    BarGraphDataListResponse dataList = new BarGraphDataListResponse();
+    Collection<BarGraphData> vaDatas = new ArrayList<BarGraphData>();
     dataList.setGraphData(vaDatas);
 
     SolrQuery serivceLoadQuery = queryGenerator.commonAuditFilterQuery(searchCriteria);
@@ -596,35 +553,45 @@ public class AuditMgr extends MgrBase {
     try {
       SolrUtil.setFacetField(serivceLoadQuery, LogSearchConstants.AUDIT_COMPONENT);
       QueryResponse serviceLoadResponse = auditSolrDao.process(serivceLoadQuery);
-      if (serviceLoadResponse == null){
-        return convertObjToString(dataList);
+      if (serviceLoadResponse == null) {
+        return dataList;
       }
-      FacetField serviceFacetField =serviceLoadResponse.getFacetField(LogSearchConstants.AUDIT_COMPONENT);
+      FacetField serviceFacetField = serviceLoadResponse.getFacetField(LogSearchConstants.AUDIT_COMPONENT);
       if (serviceFacetField == null) {
-        return convertObjToString(dataList);
+        return dataList;
       }
-      
+
       List<Count> serviceLoadFacets = serviceFacetField.getValues();
       if (serviceLoadFacets == null) {
-        return convertObjToString(dataList);
+        return dataList;
       }
       for (Count cnt : serviceLoadFacets) {
-        List<VNameValue> valueList = new ArrayList<VNameValue>();
-        VBarGraphData vBarGraphData = new VBarGraphData();
+        List<NameValueData> valueList = new ArrayList<NameValueData>();
+        BarGraphData vBarGraphData = new BarGraphData();
         vaDatas.add(vBarGraphData);
-        VNameValue vNameValue = new VNameValue();
+        NameValueData vNameValue = new NameValueData();
         vNameValue.setName(cnt.getName());
         vBarGraphData.setName(cnt.getName().toUpperCase());
         vNameValue.setValue("" + cnt.getCount());
         valueList.add(vNameValue);
-        vBarGraphData.setDataCounts(valueList);
+        vBarGraphData.setDataCount(valueList);
       }
 
-      return convertObjToString(dataList);
+      return dataList;
 
     } catch (SolrException | SolrServerException | IOException e) {
       logger.error("Error during solrQuery=" + e);
       throw RESTErrorUtil.createRESTException(MessageEnums.SOLR_ERROR.getMessage().getMessage(), MessageEnums.ERROR_SYSTEM);
     }
   }
+
+  @Override
+  protected List<SolrAuditLogData> convertToSolrBeans(QueryResponse response) {
+    return response.getBeans(SolrAuditLogData.class);
+  }
+
+  @Override
+  protected AuditLogResponse createLogSearchResponse() {
+    return new AuditLogResponse();
+  }
 }

+ 69 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/JsonManagerBase.java

@@ -0,0 +1,69 @@
+/*
+ * 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.manager;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonDeserializationContext;
+import com.google.gson.JsonDeserializer;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonParseException;
+import com.google.gson.JsonPrimitive;
+import com.google.gson.JsonSerializationContext;
+import com.google.gson.JsonSerializer;
+
+import java.util.Date;
+
+public class JsonManagerBase {
+
+  private JsonSerializer<Date> jsonDateSerialiazer = null;
+  private JsonDeserializer<Date> jsonDateDeserialiazer = null;
+
+  public JsonManagerBase() {
+    jsonDateSerialiazer = new JsonSerializer<Date>() {
+
+      @Override
+      public JsonElement serialize(Date paramT, java.lang.reflect.Type paramType, JsonSerializationContext paramJsonSerializationContext) {
+        return paramT == null ? null : new JsonPrimitive(paramT.getTime());
+      }
+    };
+
+    jsonDateDeserialiazer = new JsonDeserializer<Date>() {
+
+      @Override
+      public Date deserialize(JsonElement json, java.lang.reflect.Type typeOfT, JsonDeserializationContext context)
+        throws JsonParseException {
+        return json == null ? null : new Date(json.getAsLong());
+      }
+
+    };
+  }
+
+  protected String convertObjToString(Object obj) {
+    if (obj == null) {
+      return "";
+    }
+
+    Gson gson = new GsonBuilder()
+      .registerTypeAdapter(Date.class, jsonDateSerialiazer)
+      .registerTypeAdapter(Date.class, jsonDateDeserialiazer).create();
+
+    return gson.toJson(obj);
+  }
+}

+ 29 - 19
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/LogFileMgr.java → ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/LogFileManager.java

@@ -24,15 +24,17 @@ import java.util.List;
 
 import org.apache.ambari.logsearch.common.LogSearchConstants;
 import org.apache.ambari.logsearch.common.MessageEnums;
-import org.apache.ambari.logsearch.common.SearchCriteria;
+import org.apache.ambari.logsearch.model.response.LogFileData;
+import org.apache.ambari.logsearch.model.response.LogFileDataListResponse;
+import org.apache.ambari.logsearch.model.response.LogListResponse;
+import org.apache.ambari.logsearch.model.response.ServiceLogData;
+import org.apache.ambari.logsearch.model.response.ServiceLogResponse;
+import org.apache.ambari.logsearch.query.model.SearchCriteria;
 import org.apache.ambari.logsearch.dao.AuditSolrDao;
 import org.apache.ambari.logsearch.dao.ServiceLogsSolrDao;
 import org.apache.ambari.logsearch.dao.SolrDaoBase;
 import org.apache.ambari.logsearch.util.RESTErrorUtil;
 import org.apache.ambari.logsearch.util.SolrUtil;
-import org.apache.ambari.logsearch.view.VLogFile;
-import org.apache.ambari.logsearch.view.VLogFileList;
-import org.apache.ambari.logsearch.view.VSolrLogList;
 import org.apache.commons.io.FilenameUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
@@ -42,23 +44,24 @@ import org.apache.solr.client.solrj.response.FacetField;
 import org.apache.solr.client.solrj.response.FacetField.Count;
 import org.apache.solr.client.solrj.response.QueryResponse;
 import org.apache.solr.common.SolrException;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import javax.inject.Inject;
+
 
 @Component
-public class LogFileMgr extends MgrBase {
+public class LogFileManager extends ManagerBase<ServiceLogData, ServiceLogResponse> {
 
-  private static final Logger logger = Logger.getLogger(LogFileMgr.class);
+  private static final Logger logger = Logger.getLogger(LogFileManager.class);
 
-  @Autowired
+  @Inject
   private ServiceLogsSolrDao serviceLogsSolrDao;
-  @Autowired
+  @Inject
   private AuditSolrDao auditSolrDao;
 
-  public String searchLogFiles(SearchCriteria searchCriteria) {
-    VLogFileList logFileList = new VLogFileList();
-    List<VLogFile> logFiles = new ArrayList<VLogFile>();
+  public LogFileDataListResponse searchLogFiles(SearchCriteria searchCriteria) {
+    LogFileDataListResponse logFileList = new LogFileDataListResponse();
+    List<LogFileData> logFiles = new ArrayList<LogFileData>();
     String componentName = (String) searchCriteria.getParamValue("component");
     String host = (String) searchCriteria.getParamValue("host");
     int minCount = 1;// to remove zero count facet
@@ -87,7 +90,7 @@ public class LogFileMgr extends MgrBase {
         if (queryFacetField != null) {
           List<Count> countList = queryFacetField.getValues();
           for (Count count : countList) {
-            VLogFile vLogFile = new VLogFile();
+            LogFileData vLogFile = new LogFileData();
             String filePath = count.getName();
             String fileName = FilenameUtils.getName(filePath);
             vLogFile.setPath(filePath);
@@ -101,13 +104,11 @@ public class LogFileMgr extends MgrBase {
       throw RESTErrorUtil.createRESTException(MessageEnums.SOLR_ERROR.getMessage().getMessage(), MessageEnums.ERROR_SYSTEM);
     }
     logFileList.setLogFiles(logFiles);
-    String jsonStr = "";
-    jsonStr = convertObjToString(logFileList);
 
-    return jsonStr;
+    return logFileList;
   }
 
-  public String getLogFileTail(SearchCriteria searchCriteria) {
+  public LogListResponse getLogFileTail(SearchCriteria searchCriteria) {
     String host = (String) searchCriteria.getParamValue("host");
     String logFile = (String) searchCriteria.getParamValue("name");
     String component = (String) searchCriteria.getParamValue("component");
@@ -132,8 +133,7 @@ public class LogFileMgr extends MgrBase {
 
       SolrUtil.setRowCount(logFileTailQuery, tail);
       queryGenerator.setSortOrderDefaultServiceLog(logFileTailQuery, new SearchCriteria());
-      VSolrLogList solrLogList = getLogAsPaginationProvided(logFileTailQuery, serviceLogsSolrDao);
-      return convertObjToString(solrLogList);
+      return getLogAsPaginationProvided(logFileTailQuery, serviceLogsSolrDao);
 
     } catch (NumberFormatException ne) {
 
@@ -142,4 +142,14 @@ public class LogFileMgr extends MgrBase {
 
     }
   }
+
+  @Override
+  protected List<ServiceLogData> convertToSolrBeans(QueryResponse response) {
+    throw new UnsupportedOperationException();
+  }
+
+  @Override
+  protected ServiceLogResponse createLogSearchResponse() {
+    throw new UnsupportedOperationException();
+  }
 }

+ 38 - 73
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/MgrBase.java → ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/ManagerBase.java

@@ -22,49 +22,39 @@ package org.apache.ambari.logsearch.manager;
 import java.io.File;
 import java.io.IOException;
 import java.text.ParseException;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Date;
+import java.util.List;
 import java.util.Scanner;
 
 import org.apache.ambari.logsearch.common.LogSearchConstants;
 import org.apache.ambari.logsearch.common.MessageEnums;
-import org.apache.ambari.logsearch.common.SearchCriteria;
+import org.apache.ambari.logsearch.model.response.LogData;
+import org.apache.ambari.logsearch.model.response.LogSearchResponse;
+import org.apache.ambari.logsearch.query.model.SearchCriteria;
 import org.apache.ambari.logsearch.dao.SolrDaoBase;
 import org.apache.ambari.logsearch.query.QueryGeneration;
 import org.apache.ambari.logsearch.util.DateUtil;
 import org.apache.ambari.logsearch.util.JSONUtil;
 import org.apache.ambari.logsearch.util.RESTErrorUtil;
 import org.apache.ambari.logsearch.util.SolrUtil;
-import org.apache.ambari.logsearch.view.VSolrLogList;
 import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.response.QueryResponse;
-import org.apache.solr.common.SolrDocument;
 import org.apache.solr.common.SolrDocumentList;
 import org.apache.solr.common.SolrException;
-import org.springframework.beans.factory.annotation.Autowired;
 
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.JsonDeserializationContext;
-import com.google.gson.JsonDeserializer;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonParseException;
-import com.google.gson.JsonPrimitive;
-import com.google.gson.JsonSerializationContext;
-import com.google.gson.JsonSerializer;
+import javax.inject.Inject;
 
-public class MgrBase {
-  private static final Logger logger = Logger.getLogger(MgrBase.class);
+public abstract class ManagerBase<LOG_DATA_TYPE extends LogData, SEARCH_RESPONSE extends LogSearchResponse> extends JsonManagerBase {
+  private static final Logger logger = Logger.getLogger(ManagerBase.class);
 
-  @Autowired
+  @Inject
   protected QueryGeneration queryGenerator;
 
-  private JsonSerializer<Date> jsonDateSerialiazer = null;
-  private JsonDeserializer<Date> jsonDateDeserialiazer = null;
-
   public enum LogType {
     SERVICE("Service"),
     AUDIT("Audit");
@@ -80,36 +70,8 @@ public class MgrBase {
     }
   }
 
-  public MgrBase() {
-    jsonDateSerialiazer = new JsonSerializer<Date>() {
-
-      @Override
-      public JsonElement serialize(Date paramT, java.lang.reflect.Type paramType, JsonSerializationContext paramJsonSerializationContext) {
-        return paramT == null ? null : new JsonPrimitive(paramT.getTime());
-      }
-    };
-
-    jsonDateDeserialiazer = new JsonDeserializer<Date>() {
-
-      @Override
-      public Date deserialize(JsonElement json, java.lang.reflect.Type typeOfT, JsonDeserializationContext context)
-          throws JsonParseException {
-        return json == null ? null : new Date(json.getAsLong());
-      }
-
-    };
-  }
-
-  protected String convertObjToString(Object obj) {
-    if (obj == null) {
-      return "";
-    }
-
-    Gson gson = new GsonBuilder()
-        .registerTypeAdapter(Date.class, jsonDateSerialiazer)
-        .registerTypeAdapter(Date.class, jsonDateDeserialiazer).create();
-
-    return gson.toJson(obj);
+  public ManagerBase() {
+    super();
   }
 
   public String getHadoopServiceConfigJSON() {
@@ -141,8 +103,8 @@ public class MgrBase {
 
   }
   
-  protected VSolrLogList getLastPage(SearchCriteria searchCriteria, String logTimeField, SolrDaoBase solrDoaBase,
-      SolrQuery lastPageQuery) {
+  protected SEARCH_RESPONSE getLastPage(SearchCriteria searchCriteria, String logTimeField, SolrDaoBase solrDoaBase,
+                                    SolrQuery lastPageQuery) {
     
     Integer maxRows = searchCriteria.getMaxRows();
     String givenSortType = searchCriteria.getSortType();
@@ -160,24 +122,22 @@ public class MgrBase {
     Long totalLogs = 0l;
     int startIndex = 0;
     int numberOfLogsOnLastPage = 0;
-    VSolrLogList collection = null;
+    SEARCH_RESPONSE logResponse = null;
     try {
       SolrUtil.setStart(lastPageQuery, 0);
       SolrUtil.setRowCount(lastPageQuery, maxRows);
-      collection = getLogAsPaginationProvided(lastPageQuery, solrDoaBase);
+      logResponse = getLogAsPaginationProvided(lastPageQuery, solrDoaBase);
       totalLogs = countQuery(lastPageQuery,solrDoaBase);
-      if(maxRows != null){
-        startIndex = Integer.parseInt("" + ((totalLogs/maxRows) * maxRows));
-        numberOfLogsOnLastPage = Integer.parseInt("" + (totalLogs-startIndex));
-      }
-      collection.setStartIndex(startIndex);
-      collection.setTotalCount(totalLogs);
-      collection.setPageSize(maxRows);
-      SolrDocumentList docList = collection.getList();
-      SolrDocumentList lastPageDocList = new SolrDocumentList();
-      collection.setSolrDocuments(lastPageDocList);
+      startIndex = Integer.parseInt("" + ((totalLogs / maxRows) * maxRows));
+      numberOfLogsOnLastPage = Integer.parseInt("" + (totalLogs - startIndex));
+      logResponse.setStartIndex(startIndex);
+      logResponse.setTotalCount(totalLogs);
+      logResponse.setPageSize(maxRows);
+      List<LOG_DATA_TYPE> docList = logResponse.getLogList();
+      List<LOG_DATA_TYPE> lastPageDocList = new ArrayList<>();
+      logResponse.setLogList(lastPageDocList);
       int cnt = 0;
-      for(SolrDocument doc:docList){
+      for(LOG_DATA_TYPE doc:docList){
         if(cnt<numberOfLogsOnLastPage){
           lastPageDocList.add(doc);
         }
@@ -189,26 +149,27 @@ public class MgrBase {
       logger.error("Count Query was not executed successfully",e);
       throw RESTErrorUtil.createRESTException(MessageEnums.SOLR_ERROR.getMessage().getMessage(), MessageEnums.ERROR_SYSTEM);
     }
-    return collection;
+    return logResponse;
   }
 
-  protected VSolrLogList getLogAsPaginationProvided(SolrQuery solrQuery, SolrDaoBase solrDaoBase) {
+  protected SEARCH_RESPONSE getLogAsPaginationProvided(SolrQuery solrQuery, SolrDaoBase solrDaoBase) {
     try {
       QueryResponse response = solrDaoBase.process(solrQuery);
-      VSolrLogList collection = new VSolrLogList();
+      SEARCH_RESPONSE logResponse = createLogSearchResponse();
       SolrDocumentList docList = response.getResults();
+      List<LOG_DATA_TYPE> serviceLogDataList = convertToSolrBeans(response);
       if (docList != null && !docList.isEmpty()) {
-        collection.setSolrDocuments(docList);
-        collection.setStartIndex((int) docList.getStart());
-        collection.setTotalCount(docList.getNumFound());
+        logResponse.setLogList(serviceLogDataList);
+        logResponse.setStartIndex((int) docList.getStart());
+        logResponse.setTotalCount(docList.getNumFound());
         Integer rowNumber = solrQuery.getRows();
         if (rowNumber == null) {
           logger.error("No RowNumber was set in solrQuery");
-          return new VSolrLogList();
+          return createLogSearchResponse();
         }
-        collection.setPageSize(rowNumber);
+        logResponse.setPageSize(rowNumber);
       }
-      return collection;
+      return logResponse;
     } catch (SolrException | SolrServerException | IOException e) {
       logger.error("Error during solrQuery=" + solrQuery, e);
       throw RESTErrorUtil.createRESTException(MessageEnums.SOLR_ERROR.getMessage().getMessage(), MessageEnums.ERROR_SYSTEM);
@@ -253,4 +214,8 @@ public class MgrBase {
     }
     return to;
   }
+
+  protected abstract List<LOG_DATA_TYPE> convertToSolrBeans(QueryResponse response);
+
+  protected abstract SEARCH_RESPONSE createLogSearchResponse();
 }

+ 11 - 9
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/PublicMgr.java → ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/PublicManager.java

@@ -22,25 +22,27 @@ package org.apache.ambari.logsearch.manager;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.ambari.logsearch.view.VNameValue;
-import org.apache.ambari.logsearch.view.VNameValueList;
+import org.apache.ambari.logsearch.model.response.NameValueData;
+import org.apache.ambari.logsearch.model.response.NameValueDataListResponse;
 import org.apache.ambari.logsearch.web.security.LogsearchSimpleAuthenticationProvider;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import javax.inject.Inject;
+
 @Component
-public class PublicMgr extends MgrBase {
-  @Autowired
+public class PublicManager extends JsonManagerBase {
+
+  @Inject
   private LogsearchSimpleAuthenticationProvider simpleAuthenticationProvider;
 
   public String getGeneralConfig() {
-    VNameValueList nameValueList = new VNameValueList();
-    List<VNameValue> nameValues = new ArrayList<VNameValue>();
-    VNameValue nameValue = new VNameValue();
+    NameValueDataListResponse nameValueList = new NameValueDataListResponse();
+    List<NameValueData> nameValues = new ArrayList<>();
+    NameValueData nameValue = new NameValueData();
     nameValue.setName("simpleAuth");
     nameValue.setValue("" + simpleAuthenticationProvider.isEnable());
     nameValues.add(nameValue);
-    nameValueList.setVNameValues(nameValues);
+    nameValueList.setvNameValues(nameValues);
     return convertObjToString(nameValueList);
   }
 }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 209 - 231
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/ServiceLogsManager.java


+ 3 - 3
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/SessionMgr.java → ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/SessionManager.java

@@ -27,11 +27,11 @@ import org.springframework.security.web.authentication.WebAuthenticationDetails;
 import org.springframework.stereotype.Component;
 
 @Component
-public class SessionMgr {
+public class SessionManager {
 
-  private static final Logger logger = Logger.getLogger(SessionMgr.class);
+  private static final Logger logger = Logger.getLogger(SessionManager.class);
 
-  public SessionMgr() {
+  public SessionManager() {
     logger.debug("SessionManager created");
   }
 

+ 7 - 7
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/UserConfigMgr.java → ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/UserConfigManager.java

@@ -26,7 +26,6 @@ import java.util.List;
 
 import org.apache.ambari.logsearch.common.LogSearchConstants;
 import org.apache.ambari.logsearch.common.MessageEnums;
-import org.apache.ambari.logsearch.common.SearchCriteria;
 import org.apache.ambari.logsearch.dao.UserConfigSolrDao;
 import org.apache.ambari.logsearch.query.QueryGeneration;
 import org.apache.ambari.logsearch.util.JSONUtil;
@@ -35,6 +34,7 @@ import org.apache.ambari.logsearch.util.SolrUtil;
 import org.apache.ambari.logsearch.view.VLogfeederFilterWrapper;
 import org.apache.ambari.logsearch.view.VUserConfig;
 import org.apache.ambari.logsearch.view.VUserConfigList;
+import org.apache.ambari.logsearch.query.model.SearchCriteria;
 import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
 import org.apache.solr.client.solrj.SolrQuery;
@@ -45,17 +45,18 @@ import org.apache.solr.common.SolrDocument;
 import org.apache.solr.common.SolrDocumentList;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.SolrInputDocument;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import javax.inject.Inject;
+
 @Component
-public class UserConfigMgr extends MgrBase {
+public class UserConfigManager extends JsonManagerBase {
 
-  private static final Logger logger = Logger.getLogger(UserConfigMgr.class);
+  private static final Logger logger = Logger.getLogger(UserConfigManager.class);
 
-  @Autowired
+  @Inject
   private UserConfigSolrDao userConfigSolrDao;
-  @Autowired
+  @Inject
   private QueryGeneration queryGenerator;
 
   public String saveUserConfig(VUserConfig vHistory) {
@@ -272,5 +273,4 @@ public class UserConfigMgr extends MgrBase {
     }
     return convertObjToString(userList);
   }
-
 }

+ 44 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/AnyGraphParamDefinition.java

@@ -0,0 +1,44 @@
+/*
+ * 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.model.request;
+
+import io.swagger.annotations.ApiParam;
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+
+import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.X_AXIS_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.Y_AXIS_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.STACK_BY_D;
+
+public interface AnyGraphParamDefinition {
+
+  String getxAxis();
+
+  @ApiParam(value = X_AXIS_D, name = LogSearchConstants.REQUEST_PARAM_XAXIS)
+  void setxAxis(String xAxis);
+
+  String getyAxis();
+
+  @ApiParam(value = Y_AXIS_D, name = LogSearchConstants.REQUEST_PARAM_YAXIS)
+  void setyAxis(String yAxis);
+
+  String getStackBy();
+
+  @ApiParam(value = STACK_BY_D, name = LogSearchConstants.REQUEST_PARAM_STACK_BY)
+  void setStackBy(String stackBy);
+}

+ 32 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/BundleIdParamDefinition.java

@@ -0,0 +1,32 @@
+/*
+ * 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.model.request;
+
+import io.swagger.annotations.ApiParam;
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+
+import static org.apache.ambari.logsearch.doc.DocConstants.ServiceDescriptions.BUNDLE_ID;
+
+public interface BundleIdParamDefinition {
+
+  String getBundleId();
+
+  @ApiParam(value = BUNDLE_ID, name = LogSearchConstants.REQUEST_PARAM_BUNDLE_ID)
+  void setBundleId(String bundleId);
+}

+ 69 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/CommonSearchParamDefinition.java

@@ -0,0 +1,69 @@
+/*
+ * 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.model.request;
+
+import io.swagger.annotations.ApiParam;
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+
+import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.START_TIME_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.END_TIME_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.START_INDEX_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.PAGE_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.PAGE_SIZE_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.SORT_BY_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.SORT_TYPE_D;
+
+
+public interface CommonSearchParamDefinition {
+
+  String getStartIndex();
+
+  @ApiParam(value = START_INDEX_D, name = LogSearchConstants.REQUEST_PARAM_START_INDEX)
+  void setStartIndex(String startIndex);
+
+  String getPage();
+
+  @ApiParam(value = PAGE_D, name = LogSearchConstants.REQUEST_PARAM_PAGE)
+  void setPage(String page);
+
+  String getPageSize();
+
+  @ApiParam(value = PAGE_SIZE_D, name = LogSearchConstants.REQUEST_PARAM_PAGE_SIZE)
+  void setPageSize(String pageSize);
+
+  String getSortBy();
+
+  @ApiParam(value = SORT_BY_D, name = LogSearchConstants.REQUEST_PARAM_SORT_BY)
+  void setSortBy(String sortBy);
+
+  String getSortType();
+
+  @ApiParam(value = SORT_TYPE_D, name = LogSearchConstants.REQUEST_PARAM_SORT_TYPE)
+  void setSortType(String sortType);
+
+  String getStartTime();
+
+  @ApiParam(value = START_TIME_D, name = LogSearchConstants.REQUEST_PARAM_START_TIME)
+  void setStartTime(String startTime);
+
+  String getEndTime();
+
+  @ApiParam(value = END_TIME_D, name = LogSearchConstants.REQUEST_PARAM_END_TIME)
+  void setEndTime(String endTime);
+}

+ 38 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/DateRangeParamDefinition.java

@@ -0,0 +1,38 @@
+/*
+ * 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.model.request;
+
+import io.swagger.annotations.ApiParam;
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+
+import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.FROM_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.TO_D;
+
+public interface DateRangeParamDefinition {
+
+  String getFrom();
+
+  @ApiParam(value = FROM_D, name = LogSearchConstants.REQUEST_PARAM_FROM)
+  void setFrom(String from);
+
+  String getTo();
+
+  @ApiParam(value = TO_D, name = LogSearchConstants.REQUEST_PARAM_TO)
+  void setTo(String to);
+}

+ 32 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/FieldParamDefinition.java

@@ -0,0 +1,32 @@
+/*
+ * 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.model.request;
+
+import io.swagger.annotations.ApiParam;
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+
+import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.FIELD_D;
+
+public interface FieldParamDefinition {
+
+  String getField();
+
+  @ApiParam(value = FIELD_D, name = LogSearchConstants.REQUEST_PARAM_FIELD)
+  void setField(String field);
+}

+ 32 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/FormatParamDefinition.java

@@ -0,0 +1,32 @@
+/*
+ * 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.model.request;
+
+import io.swagger.annotations.ApiParam;
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+
+import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.FORMAT_D;
+
+public interface FormatParamDefinition {
+
+  String getFormat();
+
+  @ApiParam(value = FORMAT_D, name = LogSearchConstants.REQUEST_PARAM_FORMAT)
+  void setFormat(String format);
+}

+ 31 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/LastPageParamDefinition.java

@@ -0,0 +1,31 @@
+/*
+ * 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.model.request;
+
+import io.swagger.annotations.ApiParam;
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+
+import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.IS_LAST_PAGE_D;
+
+public interface LastPageParamDefinition {
+  boolean isLastPage();
+
+  @ApiParam(value = IS_LAST_PAGE_D, name = LogSearchConstants.REQUEST_PARAM_LAST_PAGE)
+  void setLastPage(boolean lastPage);
+}

+ 45 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/LogFileParamDefinition.java

@@ -0,0 +1,45 @@
+/*
+ * 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.model.request;
+
+import io.swagger.annotations.ApiParam;
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+
+import static org.apache.ambari.logsearch.doc.DocConstants.LogFileDescriptions.COMPONENT_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.LogFileDescriptions.HOST_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.LogFileDescriptions.LOG_TYPE_D;
+
+
+public interface LogFileParamDefinition {
+
+  String getComponent();
+
+  @ApiParam(value = COMPONENT_D, name = LogSearchConstants.REQUEST_PARAM_COMPONENT)
+  void setComponent(String component);
+
+  String getHost();
+
+  @ApiParam(value = HOST_D, name = LogSearchConstants.REQUEST_PARAM_HOST)
+  void setHost(String host);
+
+  String getLogType();
+
+  @ApiParam(value = LOG_TYPE_D, name = LogSearchConstants.REQUEST_PARAM_LOG_TYPE)
+  void setLogType(String logType);
+}

+ 32 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/LogFileTailParamDefinition.java

@@ -0,0 +1,32 @@
+/*
+ * 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.model.request;
+
+import io.swagger.annotations.ApiParam;
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+
+import static org.apache.ambari.logsearch.doc.DocConstants.LogFileDescriptions.TAIL_SIZE_D;
+
+public interface LogFileTailParamDefinition {
+
+  String getTailSize();
+
+  @ApiParam(value = TAIL_SIZE_D, name = LogSearchConstants.REQUEST_PARAM_TAIL_SIZE)
+  void setTailSize(String tailSize);
+}

+ 68 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/LogParamDefinition.java

@@ -0,0 +1,68 @@
+/*
+ * 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.model.request;
+
+import io.swagger.annotations.ApiParam;
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+
+import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.COLUMN_QUERY_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.I_MESSAGE_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.G_E_MESSAGE_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.MUST_BE_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.MUST_NOT_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.INCLUDE_QUERY_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.EXCLUDE_QUERY_D;
+
+public interface LogParamDefinition {
+
+  String getColumnQuery();
+
+  @ApiParam(value = COLUMN_QUERY_D, name = LogSearchConstants.REQUEST_PARAM_COLUMN_QUERY)
+  void setColumnQuery(String columnQuery);
+
+  String getiMessage();
+
+  @ApiParam(value = I_MESSAGE_D, name = LogSearchConstants.REQUEST_PARAM_I_MESSAGE)
+  void setiMessage(String iMessage);
+
+  String getgEMessage();
+
+  @ApiParam(value = G_E_MESSAGE_D, name = LogSearchConstants.REQUEST_PARAM_G_E_MESSAGE)
+  void setgEMessage(String gEMessage);
+
+  String getMustBe();
+
+  @ApiParam(value = MUST_BE_D, name = LogSearchConstants.REQUEST_PARAM_MUST_BE)
+  void setMustBe(String mustBe);
+
+  String getMustNot();
+
+  @ApiParam(value = MUST_NOT_D, name = LogSearchConstants.REQUEST_PARAM_MUST_NOT)
+  void setMustNot(String mustNot);
+
+  String getIncludeQuery();
+
+  @ApiParam(value = INCLUDE_QUERY_D, name = LogSearchConstants.REQUEST_PARAM_INCLUDE_QUERY)
+  void setIncludeQuery(String includeQuery);
+
+  String getExcludeQuery();
+
+  @ApiParam(value = EXCLUDE_QUERY_D, name = LogSearchConstants.REQUEST_PARAM_EXCLUDE_QUERY)
+  void setExcludeQuery(String excludeQuery);
+}

+ 44 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/LogTruncatedParamDefinition.java

@@ -0,0 +1,44 @@
+/*
+ * 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.model.request;
+
+import io.swagger.annotations.ApiParam;
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+
+import static org.apache.ambari.logsearch.doc.DocConstants.ServiceDescriptions.ID_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.ServiceDescriptions.SCROLL_TYPE_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.ServiceDescriptions.NUMBER_ROWS_D;
+
+public interface LogTruncatedParamDefinition {
+
+  String getId();
+
+  @ApiParam(value = ID_D, name = LogSearchConstants.REQUEST_PARAM_ID)
+  void setId(String id);
+
+  String getScrollType();
+
+  @ApiParam(value = SCROLL_TYPE_D, name = LogSearchConstants.REQUEST_PARAM_SCROLL_TYPE)
+  void setScrollType(String scrollType);
+
+  String getNumberRows();
+
+  @ApiParam(value = NUMBER_ROWS_D, name = LogSearchConstants.REQUEST_PARAM_NUMBER_ROWS)
+  void setNumberRows(String numberRows);
+}

+ 32 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/QueryParamDefinition.java

@@ -0,0 +1,32 @@
+/*
+ * 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.model.request;
+
+import io.swagger.annotations.ApiParam;
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+
+import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.QUERY_D;
+
+public interface QueryParamDefinition {
+
+  String getQuery();
+
+  @ApiParam(value = QUERY_D, name = LogSearchConstants.REQUEST_PARAM_QUERY)
+  void setQuery(String query);
+}

+ 25 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/SearchRequest.java

@@ -0,0 +1,25 @@
+/*
+ * 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.model.request;
+
+import org.apache.ambari.logsearch.common.Marker;
+
+@Marker
+public interface SearchRequest {
+}

+ 38 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/ServiceLogFileParamDefinition.java

@@ -0,0 +1,38 @@
+/*
+ * 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.model.request;
+
+import io.swagger.annotations.ApiParam;
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+
+import static org.apache.ambari.logsearch.doc.DocConstants.ServiceDescriptions.HOST_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.ServiceDescriptions.COMPONENT_D;
+
+public interface ServiceLogFileParamDefinition {
+
+  String getHostLogFile();
+
+  @ApiParam(value = HOST_D, name = LogSearchConstants.REQUEST_PARAM_HOST_LOG_FILE)
+  void setHostLogFile(String hostLogFile);
+
+  String getComponentLogFile();
+
+  @ApiParam(value = COMPONENT_D, name = LogSearchConstants.REQUEST_PARAM_COMPONENT_LOG_FILE)
+  void setComponentLogFile(String componentLogFile);
+}

+ 80 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/ServiceLogParamDefinition.java

@@ -0,0 +1,80 @@
+/*
+ * 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.model.request;
+
+import io.swagger.annotations.ApiParam;
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+
+import static org.apache.ambari.logsearch.doc.DocConstants.ServiceDescriptions.LEVEL_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.ServiceDescriptions.ADVANCED_SEARCH_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.ServiceDescriptions.TREE_PARAMS_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.E_MESSAGE_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.ServiceDescriptions.G_MUST_NOT_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.ServiceDescriptions.HOST_NAME_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.ServiceDescriptions.COMPONENT_NAME_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.ServiceDescriptions.FILE_NAME_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.ServiceDescriptions.DATE_RANGE_LABEL_D;
+
+public interface ServiceLogParamDefinition {
+
+  String getLevel();
+
+  @ApiParam(value = LEVEL_D, name = LogSearchConstants.REQUEST_PARAM_LEVEL)
+  void setLevel(String level);
+
+  String getAdvancedSearch();
+
+  @ApiParam(value = ADVANCED_SEARCH_D, name = LogSearchConstants.REQUEST_PARAM_ADVANCED_SEARCH)
+  void setAdvancedSearch(String advancedSearch);
+
+  String getTreeParams();
+
+  @ApiParam(value = TREE_PARAMS_D, name = LogSearchConstants.REQUEST_PARAM_TREE_PARAMS)
+  void setTreeParams(String treeParams);
+
+  String geteMessage();
+
+  @ApiParam(value = E_MESSAGE_D, name = LogSearchConstants.REQUEST_PARAM_E_MESSAGE)
+  void seteMessage(String eMessage);
+
+  String getgMustNot();
+
+  @ApiParam(value = G_MUST_NOT_D, name = LogSearchConstants.REQUEST_PARAM_G_MUST_NOT)
+  void setgMustNot(String gMustNot);
+
+  String getHostName();
+
+  @ApiParam(value = HOST_NAME_D, name = LogSearchConstants.REQUEST_PARAM_HOST_NAME)
+  void setHostName(String hostName);
+
+  String getComponentName();
+
+  @ApiParam(value = COMPONENT_NAME_D, name = LogSearchConstants.REQUEST_PARAM_COMPONENT_NAME)
+  void setComponentName(String componentName);
+
+  String getFileName();
+
+  @ApiParam(value = FILE_NAME_D, name = LogSearchConstants.REQUEST_PARAM_FILE_NAME)
+  void setFileName(String fileName);
+
+  String getDateRangeLabel();
+
+  @ApiParam(value = DATE_RANGE_LABEL_D, name = LogSearchConstants.REQUEST_PARAM_DATE_RANGE_LABEL)
+  void setDateRangeLabel(String dateRangeLabel);
+}

+ 50 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/ServiceLogSearchParamDefinition.java

@@ -0,0 +1,50 @@
+/*
+ * 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.model.request;
+
+import io.swagger.annotations.ApiParam;
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+
+import static org.apache.ambari.logsearch.doc.DocConstants.ServiceDescriptions.FIND_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.ServiceDescriptions.KEYWORD_TYPE_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.ServiceDescriptions.SOURCE_LOG_ID_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.ServiceDescriptions.TOKEN_D;
+
+public interface ServiceLogSearchParamDefinition {
+
+  String getKeyWord();
+
+  @ApiParam(value = FIND_D, name = LogSearchConstants.REQUEST_PARAM_KEYWORD)
+  void setKeyWord(String keyWord);
+
+  String getSourceLogId();
+
+  @ApiParam(value = SOURCE_LOG_ID_D, name = LogSearchConstants.REQUEST_PARAM_SOURCE_LOG_ID)
+  void setSourceLogId(String sourceLogId);
+
+  String getKeywordType();
+
+  @ApiParam(value = KEYWORD_TYPE_D, name = LogSearchConstants.REQUEST_PARAM_KEYWORD_TYPE)
+  void setKeywordType(String keywordType);
+
+  String getToken();
+
+  @ApiParam(value = TOKEN_D, name = LogSearchConstants.REQUEST_PARAM_TOKEN)
+  void setToken(String token);
+}

+ 33 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/UnitParamDefinition.java

@@ -0,0 +1,33 @@
+/*
+ * 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.model.request;
+
+import io.swagger.annotations.ApiParam;
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+
+import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.UNIT_D;
+
+public interface UnitParamDefinition {
+
+  String getUnit();
+
+  @ApiParam(value = UNIT_D, name = LogSearchConstants.REQUEST_PARAM_UNIT)
+  void setUnit(String unit);
+
+}

+ 44 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/UserConfigParamDefinition.java

@@ -0,0 +1,44 @@
+/*
+ * 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.model.request;
+
+import io.swagger.annotations.ApiParam;
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+
+import static org.apache.ambari.logsearch.doc.DocConstants.UserConfigDescriptions.USER_ID_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.UserConfigDescriptions.FILTER_NAME_D;
+import static org.apache.ambari.logsearch.doc.DocConstants.UserConfigDescriptions.ROW_TYPE_D;
+
+public interface UserConfigParamDefinition {
+
+  String getUserId();
+
+  @ApiParam(value = USER_ID_D, name = LogSearchConstants.REQUEST_PARAM_USER_ID)
+  void setUserId(String userId);
+
+  String getFilterName();
+
+  @ApiParam(value = FILTER_NAME_D, name = LogSearchConstants.REQUEST_PARAM_FILTER_NAME)
+  void setFilterName(String filterName);
+
+  String getRowType();
+
+  @ApiParam(value = ROW_TYPE_D, name = LogSearchConstants.REQUEST_PARAM_ROW_TYPE)
+  void setRowType(String rowType);
+}

+ 32 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/UtcOffsetParamDefinition.java

@@ -0,0 +1,32 @@
+/*
+ * 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.model.request;
+
+import io.swagger.annotations.ApiParam;
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+
+import static org.apache.ambari.logsearch.doc.DocConstants.ServiceDescriptions.UTC_OFFSET_D;
+
+public interface UtcOffsetParamDefinition {
+
+  String getUtcOffset();
+
+  @ApiParam(value = UTC_OFFSET_D, name = LogSearchConstants.REQUEST_PARAM_UTC_OFFSET)
+  void setUtcOffset(String utcOffset);
+}

+ 109 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AnyGraphRequest.java

@@ -0,0 +1,109 @@
+/*
+ * 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.model.request.impl;
+
+import io.swagger.annotations.ApiParam;
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.model.request.AnyGraphParamDefinition;
+import org.apache.ambari.logsearch.model.request.DateRangeParamDefinition;
+import org.apache.ambari.logsearch.model.request.UnitParamDefinition;
+
+import javax.ws.rs.QueryParam;
+
+public class AnyGraphRequest extends CommonSearchRequest
+  implements AnyGraphParamDefinition, DateRangeParamDefinition, UnitParamDefinition{
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_XAXIS)
+  private String xAxis;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_YAXIS)
+  private String yAxis;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_STACK_BY)
+  private String stackBy;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_FROM)
+  private String from;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_TO)
+  private String to;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_UNIT)
+  private String unit;
+
+  @Override
+  public String getxAxis() {
+    return xAxis;
+  }
+
+  @Override
+  public void setxAxis(String xAxis) {
+    this.xAxis = xAxis;
+  }
+
+  @Override
+  public String getyAxis() {
+    return yAxis;
+  }
+
+  @Override
+  public void setyAxis(String yAxis) {
+    this.yAxis = yAxis;
+  }
+
+  @Override
+  public String getStackBy() {
+    return stackBy;
+  }
+
+  @Override
+  public void setStackBy(String stackBy) {
+    this.stackBy = stackBy;
+  }
+
+  @Override
+  public String getFrom() {
+    return from;
+  }
+
+  @Override
+  public void setFrom(String from) {
+    this.from = from;
+  }
+
+  @Override
+  public String getTo() {
+    return to;
+  }
+
+  @Override
+  public void setTo(String to) {
+    this.to = to;
+  }
+
+  @Override
+  public String getUnit() {
+    return unit;
+  }
+
+  @Override
+  public void setUnit(String unit) {
+    this.unit = unit;
+  }
+}

+ 13 - 25
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VString.java → ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AuditBarGraphRequest.java

@@ -16,37 +16,25 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.ambari.logsearch.view;
+package org.apache.ambari.logsearch.model.request.impl;
 
-import javax.xml.bind.annotation.XmlRootElement;
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.model.request.UnitParamDefinition;
 
-@XmlRootElement
-public class VString {
+import javax.ws.rs.QueryParam;
 
-  /**
-   * Value
-   */
-  protected String value;
+public class AuditBarGraphRequest extends BaseAuditLogRequest implements UnitParamDefinition {
 
-  /**
-   * Default constructor. This will set all the attributes to default value.
-   */
-  public VString() {
-  }
-
-  public String getValue() {
-    return value;
-  }
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_UNIT)
+  private String unit;
 
-  public void setValue(String value) {
-    this.value = value;
+  @Override
+  public String getUnit() {
+    return unit;
   }
 
-  public String toString() {
-    String str = "VString={";
-    str += super.toString();
-    str += "value={" + value + "} ";
-    str += "}";
-    return str;
+  @Override
+  public void setUnit(String unit) {
+    this.unit = unit;
   }
 }

+ 40 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AuditLogRequest.java

@@ -0,0 +1,40 @@
+/*
+ * 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.model.request.impl;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.model.request.LastPageParamDefinition;
+
+import javax.ws.rs.QueryParam;
+
+public class AuditLogRequest extends BaseAuditLogRequest implements LastPageParamDefinition {
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_LAST_PAGE)
+  private boolean isLastPage;
+
+  @Override
+  public boolean isLastPage() {
+    return isLastPage;
+  }
+
+  @Override
+  public void setLastPage(boolean lastPage) {
+    isLastPage = lastPage;
+  }
+}

+ 53 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/BaseAuditLogRequest.java

@@ -0,0 +1,53 @@
+/*
+ * 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.model.request.impl;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.model.request.DateRangeParamDefinition;
+
+import javax.ws.rs.QueryParam;
+
+public class BaseAuditLogRequest extends BaseLogRequest implements DateRangeParamDefinition {
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_FROM)
+  private String from;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_TO)
+  private String to;
+
+  @Override
+  public String getFrom() {
+    return from;
+  }
+
+  @Override
+  public void setFrom(String from) {
+    this.from = from;
+  }
+
+  @Override
+  public String getTo() {
+    return to;
+  }
+
+  @Override
+  public void setTo(String to) {
+    this.to = to;
+  }
+}

+ 118 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/BaseLogRequest.java

@@ -0,0 +1,118 @@
+/*
+ * 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.model.request.impl;
+
+import io.swagger.annotations.ApiParam;
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.model.request.LogParamDefinition;
+
+import javax.ws.rs.QueryParam;
+
+public class BaseLogRequest extends QueryRequest implements LogParamDefinition {
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_COLUMN_QUERY)
+  private String columnQuery;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_I_MESSAGE)
+  private String iMessage;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_G_E_MESSAGE)
+  private String gEMessage;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_MUST_BE)
+  private String mustBe;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_MUST_NOT)
+  private String mustNot;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_EXCLUDE_QUERY)
+  private String excludeQuery;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_INCLUDE_QUERY)
+  private String includeQuery;
+
+  @Override
+  public String getColumnQuery() {
+    return columnQuery;
+  }
+
+  @Override
+  public void setColumnQuery(String columnQuery) {
+    this.columnQuery = columnQuery;
+  }
+
+  @Override
+  public String getiMessage() {
+    return iMessage;
+  }
+
+  @Override
+  public void setiMessage(String iMessage) {
+    this.iMessage = iMessage;
+  }
+
+  @Override
+  public String getgEMessage() {
+    return gEMessage;
+  }
+
+  @Override
+  public void setgEMessage(String gEMessage) {
+    this.gEMessage = gEMessage;
+  }
+
+  @Override
+  public String getMustBe() {
+    return mustBe;
+  }
+
+  @Override
+  public void setMustBe(String mustBe) {
+    this.mustBe = mustBe;
+  }
+
+  @Override
+  public String getMustNot() {
+    return mustNot;
+  }
+
+  @Override
+  public void setMustNot(String mustNot) {
+    this.mustNot = mustNot;
+  }
+
+  @Override
+  public String getIncludeQuery() {
+    return includeQuery;
+  }
+
+  @Override
+  public void setIncludeQuery(String includeQuery) {
+    this.includeQuery = includeQuery;
+  }
+
+  @Override
+  public String getExcludeQuery() {
+    return excludeQuery;
+  }
+
+  @Override
+  public void setExcludeQuery(String excludeQuery) {
+    this.excludeQuery = excludeQuery;
+  }
+}

+ 186 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/BaseServiceLogRequest.java

@@ -0,0 +1,186 @@
+/*
+ * 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.model.request.impl;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.model.request.BundleIdParamDefinition;
+import org.apache.ambari.logsearch.model.request.DateRangeParamDefinition;
+import org.apache.ambari.logsearch.model.request.ServiceLogParamDefinition;
+
+import javax.ws.rs.QueryParam;
+
+public class BaseServiceLogRequest extends BaseLogRequest
+  implements ServiceLogParamDefinition, BundleIdParamDefinition, DateRangeParamDefinition {
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_LEVEL)
+  private String level;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_ADVANCED_SEARCH)
+  private String advancedSearch;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_TREE_PARAMS)
+  private String treeParams;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_E_MESSAGE)
+  private String eMessage;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_G_MUST_NOT)
+  private String gMustNot;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_HOST_NAME)
+  private String hostName;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_COMPONENT_NAME)
+  private String componentName;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_FILE_NAME)
+  private String fileName;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_BUNDLE_ID)
+  private String bundleId;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_FROM)
+  private String from;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_TO)
+  private String to;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_DATE_RANGE_LABEL)
+  private String dateRangeLabel;
+
+  @Override
+  public String getLevel() {
+    return level;
+  }
+
+  @Override
+  public void setLevel(String level) {
+    this.level = level;
+  }
+
+  @Override
+  public String getAdvancedSearch() {
+    return advancedSearch;
+  }
+
+  @Override
+  public void setAdvancedSearch(String advancedSearch) {
+    this.advancedSearch = advancedSearch;
+  }
+
+  @Override
+  public String getTreeParams() {
+    return treeParams;
+  }
+
+  @Override
+  public void setTreeParams(String treeParams) {
+    this.treeParams = treeParams;
+  }
+
+  @Override
+  public String geteMessage() {
+    return eMessage;
+  }
+
+  @Override
+  public void seteMessage(String eMessage) {
+    this.eMessage = eMessage;
+  }
+
+  @Override
+  public String getgMustNot() {
+    return gMustNot;
+  }
+
+  @Override
+  public void setgMustNot(String gMustNot) {
+    this.gMustNot = gMustNot;
+  }
+
+  @Override
+  public String getHostName() {
+    return hostName;
+  }
+
+  @Override
+  public void setHostName(String hostName) {
+    this.hostName = hostName;
+  }
+
+  @Override
+  public String getComponentName() {
+    return componentName;
+  }
+
+  @Override
+  public void setComponentName(String componentName) {
+    this.componentName = componentName;
+  }
+
+  @Override
+  public String getFileName() {
+    return fileName;
+  }
+
+  @Override
+  public void setFileName(String fileName) {
+    this.fileName = fileName;
+  }
+
+  @Override
+  public String getBundleId() {
+    return bundleId;
+  }
+
+  @Override
+  public void setBundleId(String bundleId) {
+    this.bundleId = bundleId;
+  }
+
+  @Override
+  public String getFrom() {
+    return from;
+  }
+
+  @Override
+  public void setFrom(String from) {
+    this.from = from;
+  }
+
+  @Override
+  public String getTo() {
+    return to;
+  }
+
+  @Override
+  public void setTo(String to) {
+    this.to = to;
+  }
+
+  @Override
+  public String getDateRangeLabel() {
+    return dateRangeLabel;
+  }
+
+  @Override
+  public void setDateRangeLabel(String dateRangeLabel) {
+    this.dateRangeLabel = dateRangeLabel;
+  }
+}

+ 119 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/CommonSearchRequest.java

@@ -0,0 +1,119 @@
+/*
+ * 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.model.request.impl;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.model.request.CommonSearchParamDefinition;
+import org.apache.ambari.logsearch.model.request.SearchRequest;
+
+import javax.ws.rs.QueryParam;
+
+public class CommonSearchRequest implements SearchRequest, CommonSearchParamDefinition {
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_START_INDEX)
+  private String startIndex;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_PAGE)
+  private String page;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_PAGE_SIZE)
+  private String pageSize;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_SORT_BY)
+  private String sortBy;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_SORT_TYPE)
+  private String sortType;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_START_TIME)
+  private String startTime;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_END_TIME)
+  private String endTime;
+
+  @Override
+  public String getStartIndex() {
+    return startIndex;
+  }
+
+  @Override
+  public void setStartIndex(String startIndex) {
+    this.startIndex = startIndex;
+  }
+
+  @Override
+  public String getPage() {
+    return page;
+  }
+
+  @Override
+  public void setPage(String page) {
+    this.page = page;
+  }
+
+  @Override
+  public String getPageSize() {
+    return pageSize;
+  }
+
+  @Override
+  public void setPageSize(String pageSize) {
+    this.pageSize = pageSize;
+  }
+
+  @Override
+  public String getSortBy() {
+    return sortBy;
+  }
+
+  @Override
+  public void setSortBy(String sortBy) {
+    this.sortBy = sortBy;
+  }
+
+  @Override
+  public String getSortType() {
+    return sortType;
+  }
+
+  @Override
+  public void setSortType(String sortType) {
+    this.sortType = sortType;
+  }
+
+  @Override
+  public String getStartTime() {
+    return startTime;
+  }
+
+  @Override
+  public void setStartTime(String startTime) {
+    this.startTime = startTime;
+  }
+
+  @Override
+  public String getEndTime() {
+    return endTime;
+  }
+
+  @Override
+  public void setEndTime(String endTime) {
+    this.endTime = endTime;
+  }
+}

+ 40 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/FieldAuditBarGraphRequest.java

@@ -0,0 +1,40 @@
+/*
+ * 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.model.request.impl;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.model.request.FieldParamDefinition;
+
+import javax.ws.rs.QueryParam;
+
+public class FieldAuditBarGraphRequest extends AuditBarGraphRequest implements FieldParamDefinition {
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_FIELD)
+  private String field;
+
+  @Override
+  public String getField() {
+    return field;
+  }
+
+  @Override
+  public void setField(String field) {
+    this.field = field;
+  }
+}

+ 41 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/FieldAuditLogRequest.java

@@ -0,0 +1,41 @@
+/*
+ * 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.model.request.impl;
+
+import io.swagger.annotations.ApiParam;
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.model.request.FieldParamDefinition;
+
+import javax.ws.rs.QueryParam;
+
+public class FieldAuditLogRequest extends BaseAuditLogRequest implements FieldParamDefinition {
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_FIELD)
+  private String field;
+
+  @Override
+  public String getField() {
+    return field;
+  }
+
+  @Override
+  public void setField(String field) {
+    this.field = field;
+  }
+}

+ 67 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/LogFileRequest.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.model.request.impl;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.model.request.LogFileParamDefinition;
+import org.apache.ambari.logsearch.model.request.SearchRequest;
+
+import javax.ws.rs.QueryParam;
+
+public class LogFileRequest implements SearchRequest, LogFileParamDefinition {
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_COMPONENT)
+  private String component;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_HOST)
+  private String host;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_LOG_TYPE)
+  private String logType;
+
+  @Override
+  public String getComponent() {
+    return component;
+  }
+
+  @Override
+  public void setComponent(String component) {
+    this.component = component;
+  }
+
+  @Override
+  public String getHost() {
+    return host;
+  }
+
+  @Override
+  public void setHost(String host) {
+    this.host = host;
+  }
+
+  @Override
+  public String getLogType() {
+    return logType;
+  }
+
+  @Override
+  public void setLogType(String logType) {
+    this.logType = logType;
+  }
+}

+ 40 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/LogFileTailRequest.java

@@ -0,0 +1,40 @@
+/*
+ * 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.model.request.impl;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.model.request.LogFileTailParamDefinition;
+
+import javax.ws.rs.QueryParam;
+
+public class LogFileTailRequest extends LogFileRequest implements LogFileTailParamDefinition {
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_TAIL_SIZE)
+  private String tailSize;
+
+  @Override
+  public String getTailSize() {
+    return tailSize;
+  }
+
+  @Override
+  public void setTailSize(String tailSize) {
+    this.tailSize = tailSize;
+  }
+}

+ 40 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/QueryRequest.java

@@ -0,0 +1,40 @@
+/*
+ * 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.model.request.impl;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.model.request.QueryParamDefinition;
+
+import javax.ws.rs.QueryParam;
+
+public class QueryRequest extends CommonSearchRequest implements QueryParamDefinition {
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_QUERY)
+  private String query;
+
+  @Override
+  public String getQuery() {
+    return query;
+  }
+
+  @Override
+  public void setQuery(String query) {
+    this.query = query;
+  }
+}

+ 109 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceAnyGraphRequest.java

@@ -0,0 +1,109 @@
+/*
+ * 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.model.request.impl;
+
+import io.swagger.annotations.ApiParam;
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.model.request.AnyGraphParamDefinition;
+import org.apache.ambari.logsearch.model.request.DateRangeParamDefinition;
+import org.apache.ambari.logsearch.model.request.UnitParamDefinition;
+
+import javax.ws.rs.QueryParam;
+
+public class ServiceAnyGraphRequest extends ServiceLogRequest
+  implements AnyGraphParamDefinition, DateRangeParamDefinition, UnitParamDefinition {
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_XAXIS)
+  private String xAxis;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_YAXIS)
+  private String yAxis;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_STACK_BY)
+  private String stackBy;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_UNIT)
+  private String unit;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_FROM)
+  private String from;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_TO)
+  private String to;
+
+  @Override
+  public String getxAxis() {
+    return xAxis;
+  }
+
+  @Override
+  public void setxAxis(String xAxis) {
+    this.xAxis = xAxis;
+  }
+
+  @Override
+  public String getyAxis() {
+    return yAxis;
+  }
+
+  @Override
+  public void setyAxis(String yAxis) {
+    this.yAxis = yAxis;
+  }
+
+  @Override
+  public String getStackBy() {
+    return stackBy;
+  }
+
+  @Override
+  public void setStackBy(String stackBy) {
+    this.stackBy = stackBy;
+  }
+
+  @Override
+  public String getUnit() {
+    return unit;
+  }
+
+  @Override
+  public void setUnit(String unit) {
+    this.unit = unit;
+  }
+
+  @Override
+  public String getFrom() {
+    return from;
+  }
+
+  @Override
+  public void setFrom(String from) {
+    this.from = from;
+  }
+
+  @Override
+  public String getTo() {
+    return to;
+  }
+
+  @Override
+  public void setTo(String to) {
+    this.to = to;
+  }
+}

+ 41 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceExtremeDatesRequest.java

@@ -0,0 +1,41 @@
+/*
+ * 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.model.request.impl;
+
+import io.swagger.annotations.ApiParam;
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.model.request.BundleIdParamDefinition;
+
+import javax.ws.rs.QueryParam;
+
+public class ServiceExtremeDatesRequest extends CommonSearchRequest implements BundleIdParamDefinition {
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_BUNDLE_ID)
+  private String bundleId;
+
+  @Override
+  public String getBundleId() {
+    return bundleId;
+  }
+
+  @Override
+  public void setBundleId(String bundleId) {
+    this.bundleId = bundleId;
+  }
+}

+ 40 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceGraphRequest.java

@@ -0,0 +1,40 @@
+/*
+ * 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.model.request.impl;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.model.request.UnitParamDefinition;
+
+import javax.ws.rs.QueryParam;
+
+public class ServiceGraphRequest extends ServiceLogFileRequest implements UnitParamDefinition {
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_UNIT)
+  private String unit;
+
+  @Override
+  public String getUnit() {
+    return unit;
+  }
+
+  @Override
+  public void setUnit(String unit) {
+    this.unit = unit;
+  }
+}

+ 54 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogExportRequest.java

@@ -0,0 +1,54 @@
+/*
+ * 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.model.request.impl;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.model.request.FormatParamDefinition;
+import org.apache.ambari.logsearch.model.request.UtcOffsetParamDefinition;
+
+import javax.ws.rs.QueryParam;
+
+public class ServiceLogExportRequest extends ServiceLogFileRequest implements FormatParamDefinition, UtcOffsetParamDefinition {
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_FORMAT)
+  private String format;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_UTC_OFFSET)
+  private String utcOffset;
+
+  @Override
+  public String getFormat() {
+    return format;
+  }
+
+  @Override
+  public void setFormat(String format) {
+    this.format = format;
+  }
+
+  @Override
+  public String getUtcOffset() {
+    return utcOffset;
+  }
+
+  @Override
+  public void setUtcOffset(String utcOffset) {
+    this.utcOffset = utcOffset;
+  }
+}

+ 54 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogFileRequest.java

@@ -0,0 +1,54 @@
+/*
+ * 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.model.request.impl;
+
+import io.swagger.annotations.ApiParam;
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.model.request.ServiceLogFileParamDefinition;
+
+import javax.ws.rs.QueryParam;
+
+public class ServiceLogFileRequest extends BaseServiceLogRequest implements ServiceLogFileParamDefinition {
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_HOST_LOG_FILE)
+  private String hostLogFile;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_COMPONENT_LOG_FILE)
+  private String componentLogFile;
+
+  @Override
+  public String getHostLogFile() {
+    return hostLogFile;
+  }
+
+  @Override
+  public void setHostLogFile(String hostLogFile) {
+    this.hostLogFile = hostLogFile;
+  }
+
+  @Override
+  public String getComponentLogFile() {
+    return componentLogFile;
+  }
+
+  @Override
+  public void setComponentLogFile(String componentLogFile) {
+    this.componentLogFile = componentLogFile;
+  }
+}

+ 93 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogRequest.java

@@ -0,0 +1,93 @@
+/*
+ * 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.model.request.impl;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.model.request.LastPageParamDefinition;
+import org.apache.ambari.logsearch.model.request.ServiceLogSearchParamDefinition;
+
+import javax.ws.rs.QueryParam;
+
+public class ServiceLogRequest extends ServiceLogFileRequest implements ServiceLogSearchParamDefinition, LastPageParamDefinition {
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_KEYWORD)
+  private String keyWord;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_SOURCE_LOG_ID)
+  private String sourceLogId;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_KEYWORD_TYPE)
+  private String keywordType;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_TOKEN)
+  private String token;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_LAST_PAGE)
+  private boolean isLastPage;
+
+  @Override
+  public String getKeyWord() {
+    return keyWord;
+  }
+
+  @Override
+  public void setKeyWord(String keyWord) {
+    this.keyWord = keyWord;
+  }
+
+  @Override
+  public String getSourceLogId() {
+    return sourceLogId;
+  }
+
+  @Override
+  public void setSourceLogId(String sourceLogId) {
+    this.sourceLogId = sourceLogId;
+  }
+
+  @Override
+  public String getKeywordType() {
+    return keywordType;
+  }
+
+  @Override
+  public void setKeywordType(String keywordType) {
+    this.keywordType = keywordType;
+  }
+
+  @Override
+  public String getToken() {
+    return token;
+  }
+
+  @Override
+  public void setToken(String token) {
+    this.token = token;
+  }
+
+  @Override
+  public boolean isLastPage() {
+    return isLastPage;
+  }
+
+  @Override
+  public void setLastPage(boolean lastPage) {
+    isLastPage = lastPage;
+  }
+}

+ 66 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogTruncatedRequest.java

@@ -0,0 +1,66 @@
+/*
+ * 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.model.request.impl;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.model.request.LogTruncatedParamDefinition;
+
+import javax.ws.rs.QueryParam;
+
+public class ServiceLogTruncatedRequest extends ServiceLogFileRequest implements LogTruncatedParamDefinition {
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_ID)
+  private String id;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_SCROLL_TYPE)
+  private String scrollType;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_NUMBER_ROWS)
+  private String numberRows;
+
+  @Override
+  public String getId() {
+    return id;
+  }
+
+  @Override
+  public void setId(String id) {
+    this.id = id;
+  }
+
+  @Override
+  public String getScrollType() {
+    return scrollType;
+  }
+
+  @Override
+  public void setScrollType(String scrollType) {
+    this.scrollType = scrollType;
+  }
+
+  @Override
+  public String getNumberRows() {
+    return numberRows;
+  }
+
+  @Override
+  public void setNumberRows(String numberRows) {
+    this.numberRows = numberRows;
+  }
+}

+ 42 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/SimpleQueryRequest.java

@@ -0,0 +1,42 @@
+/*
+ * 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.model.request.impl;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.model.request.QueryParamDefinition;
+import org.apache.ambari.logsearch.model.request.SearchRequest;
+
+import javax.ws.rs.QueryParam;
+
+
+public class SimpleQueryRequest implements SearchRequest, QueryParamDefinition {
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_QUERY)
+  private String query;
+
+  @Override
+  public String getQuery() {
+    return query;
+  }
+
+  @Override
+  public void setQuery(String query) {
+    this.query = query;
+  }
+}

+ 66 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/UserConfigRequest.java

@@ -0,0 +1,66 @@
+/*
+ * 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.model.request.impl;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.model.request.UserConfigParamDefinition;
+
+import javax.ws.rs.QueryParam;
+
+public class UserConfigRequest extends CommonSearchRequest implements UserConfigParamDefinition {
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_USER_ID)
+  private String userId;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_FILE_NAME)
+  private String filterName;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_ROW_TYPE)
+  private String rowType;
+
+  @Override
+  public String getUserId() {
+    return userId;
+  }
+
+  @Override
+  public void setUserId(String userId) {
+    this.userId = userId;
+  }
+
+  @Override
+  public String getFilterName() {
+    return filterName;
+  }
+
+  @Override
+  public void setFilterName(String filterName) {
+    this.filterName = filterName;
+  }
+
+  @Override
+  public String getRowType() {
+    return rowType;
+  }
+
+  @Override
+  public void setRowType(String rowType) {
+    this.rowType = rowType;
+  }
+}

+ 40 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/UserExportRequest.java

@@ -0,0 +1,40 @@
+/*
+ * 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.model.request.impl;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.model.request.FormatParamDefinition;
+
+import javax.ws.rs.QueryParam;
+
+public class UserExportRequest extends FieldAuditLogRequest implements FormatParamDefinition {
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_FORMAT)
+  private String format;
+
+  @Override
+  public String getFormat() {
+    return format;
+  }
+
+  @Override
+  public void setFormat(String format) {
+    this.format = format;
+  }
+}

+ 149 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/AuditLogData.java

@@ -0,0 +1,149 @@
+/*
+ * 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.model.response;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.util.Date;
+import java.util.List;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public interface AuditLogData extends CommonLogData {
+
+  @JsonProperty("logType")
+  String getLogType();
+
+  void setLogType(String logType);
+
+  @JsonProperty("policy")
+  String getPolicy();
+
+  void setPolicy(String policy);
+
+  @JsonProperty("access")
+  String getAccess();
+
+  void setAccess(String access);
+
+  @JsonProperty("action")
+  String getAction();
+
+  void setAction(String action);
+
+  @JsonProperty("agent")
+  String getAgent();
+
+  void setAgent(String agent);
+
+  @JsonProperty("agentHost")
+  String getAgentHost();
+
+  void setAgentHost(String agentHost);
+
+  @JsonProperty("cliIP")
+  String getClientIp();
+
+  void setClientIp(String clientIp);
+
+  @JsonProperty("cliType")
+  String getClientType();
+
+  public void setClientType(String clientType);
+
+  @JsonProperty("reqContext")
+  String getRequestContext();
+
+  void setRequestContext(String requestContext);
+
+  @JsonProperty("enforcer")
+  String getEnforcer();
+
+  void setEnforcer(String enforcer);
+
+  @JsonProperty("evtTime")
+  Date getEventTime();
+
+  void setEventTime(Date eventTime);
+
+  @JsonProperty("reason")
+  String getReason();
+
+  void setReason(String reason);
+
+  @JsonProperty("proxyUsers")
+  List<String> getProxyUsers();
+
+  void setProxyUsers(List<String> proxyUsers);
+
+  @JsonProperty("repo")
+  String getRepo();
+
+  void setRepo(String repo);
+
+  @JsonProperty("repoType")
+  String getRepoType();
+
+  void setRepoType(String repoType);
+
+  @JsonProperty("reqData")
+  String getRequestData();
+
+  void setRequestData(String requestData);
+
+  @JsonProperty("reqUser")
+  String getRequestUser();
+
+  void setRequestUser(String requestUser);
+
+  @JsonProperty("resType")
+  String getResponseType();
+
+  void setResponseType(String requestType);
+
+  @JsonProperty("resource")
+  String getResource();
+
+  void setResource(String resource);
+
+  @JsonProperty("result")
+  Integer getResult();
+
+  void setResult(Integer result);
+
+  @JsonProperty("sess")
+  String getSession();
+
+  void setSession(String session);
+
+  @JsonProperty("tags")
+  List<String> getTags();
+
+  void setTags(List<String> tags);
+
+  @JsonProperty("tags_str")
+  String getTagsStr();
+
+  void setTagsStr(String tagsStr);
+
+  @JsonProperty("text")
+  String getText();
+
+  void setText(String text);
+}

+ 48 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/AuditLogResponse.java

@@ -0,0 +1,48 @@
+/*
+ * 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.model.response;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+
+@ApiModel
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class AuditLogResponse extends LogSearchResponse<AuditLogData> {
+
+  @ApiModelProperty
+  private List<AuditLogData> logList;
+
+  @Override
+  public List<AuditLogData> getLogList() {
+    return logList;
+  }
+
+  @Override
+  public void setLogList(List<AuditLogData> logList) {
+    this.logList = logList;
+  }
+
+  @Override
+  public int getListSize() {
+    return logList == null ? 0 : logList.size();
+  }
+}

+ 17 - 14
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VBarGraphData.java → ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/BarGraphData.java

@@ -16,35 +16,38 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+package org.apache.ambari.logsearch.model.response;
 
-package org.apache.ambari.logsearch.view;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 
+import java.io.Serializable;
+import java.util.ArrayList;
 import java.util.Collection;
 
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlRootElement;
+@ApiModel
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class BarGraphData implements Serializable {
 
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.FIELD)
-public class VBarGraphData {
-  protected Collection<VNameValue> dataCount = null;
-  protected String name;
+  @ApiModelProperty
+  private Collection<NameValueData> dataCount = new ArrayList<>();
+  @ApiModelProperty
+  private String name;
 
   public String getName() {
     return name;
   }
 
-  public void setName(String level) {
-    this.name = level;
+  public void setName(String name) {
+    this.name = name;
   }
 
-  public Collection<VNameValue> getDataCount() {
+  public Collection<NameValueData> getDataCount() {
     return dataCount;
   }
 
-  public void setDataCounts(Collection<VNameValue> dateValueCounts) {
+  public void setDataCount(Collection<NameValueData> dateValueCounts) {
     this.dataCount = dateValueCounts;
   }
-
 }

+ 12 - 16
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VBarDataList.java → ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/BarGraphDataListResponse.java

@@ -16,31 +16,27 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+package org.apache.ambari.logsearch.model.response;
 
-package org.apache.ambari.logsearch.view;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 
 import java.util.ArrayList;
 import java.util.Collection;
 
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlRootElement;
+@ApiModel
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class BarGraphDataListResponse {
 
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.FIELD)
-public class VBarDataList {
-  protected  Collection<VBarGraphData> graphData;
+  @ApiModelProperty
+  protected Collection<BarGraphData> graphData = new ArrayList<>();
 
-  public VBarDataList() {
-    graphData = new ArrayList<VBarGraphData>();
-  }
-
-  public Collection<VBarGraphData> getGraphData() {
+  public Collection<BarGraphData> getGraphData() {
     return graphData;
   }
 
-  public void setGraphData(Collection<VBarGraphData> histogramData) {
-    this.graphData = histogramData;
+  public void setGraphData(Collection<BarGraphData> graphData) {
+    this.graphData = graphData;
   }
-
 }

+ 113 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/CommonLogData.java

@@ -0,0 +1,113 @@
+/*
+ * 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.model.response;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.util.Date;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public interface CommonLogData extends LogData {
+
+  @JsonProperty("id")
+  String getId();
+
+  void setId(String id);
+
+  @JsonProperty("case_id")
+  String getCaseId();
+
+  void setCaseId(String caseId);
+
+  @JsonProperty("log_message")
+  String getLogMessage();
+
+  void setLogMessage(String logMessage);
+
+  @JsonProperty("bundle_id")
+  String getBundleId();
+
+  void setBundleId(String bundleId);
+
+  @JsonProperty("logfile_line_number")
+  Integer getLogFileLineNumber();
+
+  void setLogFileLineNumber(Integer logFileLineNumber);
+
+  @JsonProperty("file")
+  String getFile();
+
+  void setFile(String file);
+
+  @JsonProperty("type")
+  String getType();
+
+  void setType(String type);
+
+  @JsonProperty("seq_num")
+  Long getSeqNum();
+
+  void setSeqNum(Long seqNum);
+
+  @JsonProperty("message_md5")
+  String getMessageMd5();
+
+  void setMessageMd5(String messageMd5);
+
+  @JsonProperty("cluster")
+  String getCluster();
+
+  void setCluster(String cluster);
+
+  @JsonProperty("event_count")
+  Long getEventCount();
+
+  void setEventCount(Long eventCount);
+
+  @JsonProperty("event_md5")
+  public String getEventMd5();
+
+  public void setEventMd5(String eventMd5);
+
+  @JsonProperty("event_dur_ms")
+  public Long getEventDurationMs();
+
+  public void setEventDurationMs(Long eventDurationMs);
+
+  @JsonProperty("_ttl_")
+  String getTtl();
+
+  void setTtl(String ttl);
+
+  @JsonProperty("_expire_at_")
+  Date getExpire();
+
+  void setExpire(Date expire);
+
+  @JsonProperty("_version_")
+  Long getVersion();
+
+  void setVersion(Long version);
+
+  @JsonProperty("_router_field_")
+  Integer getRouterField();
+
+  void setRouterField(Integer routerField);
+}

+ 32 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/ComponentTypeLogData.java

@@ -0,0 +1,32 @@
+/*
+ * 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.model.response;
+
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public interface ComponentTypeLogData extends LogData {
+
+  @JsonProperty("type")
+  String getType();
+
+  void setType(String type);
+}

+ 11 - 23
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VCount.java → ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/CountData.java

@@ -16,24 +16,21 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+package org.apache.ambari.logsearch.model.response;
 
-package org.apache.ambari.logsearch.view;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 
-import javax.xml.bind.annotation.XmlRootElement;
+@ApiModel
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class CountData {
 
-@XmlRootElement
-public class VCount implements java.io.Serializable {
-  private static final long serialVersionUID = 1L;
+  @ApiModelProperty
+  private String name;
 
-  protected String name;
-
-  protected Long count;
-
-  /**
-   * Default constructor. This will set all the attributes to default value.
-   */
-  public VCount() {
-  }
+  @ApiModelProperty
+  private Long count;
 
   public String getName() {
     return name;
@@ -50,13 +47,4 @@ public class VCount implements java.io.Serializable {
   public void setCount(Long count) {
     this.count = count;
   }
-
-  public String toString() {
-    String str = "VLogLevel={";
-    str += super.toString();
-    str += "name={" + name + "} ";
-    str += "count={" + count + "} ";
-    str += "}";
-    return str;
-  }
 }

+ 48 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/CountDataListResponse.java

@@ -0,0 +1,48 @@
+/*
+ * 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.model.response;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+
+@ApiModel
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class CountDataListResponse extends SearchResponse {
+
+  @ApiModelProperty
+  private List<CountData> vCounts;
+
+  public List<CountData> getvCounts() {
+    return vCounts;
+  }
+
+  public void setvCounts(List<CountData> vCounts) {
+    this.vCounts = vCounts;
+  }
+
+  @Override
+  public int getListSize() {
+    if (vCounts != null)
+      return vCounts.size();
+    return 0;
+  }
+}

+ 26 - 28
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VSummaryCount.java → ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/GraphData.java

@@ -16,51 +16,49 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+package org.apache.ambari.logsearch.model.response;
 
-package org.apache.ambari.logsearch.view;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 
+import java.io.Serializable;
 import java.util.List;
 
-public class VSummaryCount {
+@ApiModel
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class GraphData implements Serializable {
 
-  protected String level;
+  @ApiModelProperty
+  private String name;
 
-  protected List<String> cricticalMsg;
+  @ApiModelProperty
+  private Long count;
 
-  protected List<String> compName;
+  @ApiModelProperty
+  private List<GraphData> dataList;
 
-  protected List<Long> countMsg;
-
-  public String getLevel() {
-    return level;
-  }
-
-  public void setLevel(String level) {
-    this.level = level;
+  public String getName() {
+    return name;
   }
 
-  public List<String> getCricticalMsg() {
-    return cricticalMsg;
+  public void setName(String name) {
+    this.name = name;
   }
 
-  public void setCricticalMsg(List<String> cricticalMsg) {
-    this.cricticalMsg = cricticalMsg;
+  public Long getCount() {
+    return count;
   }
 
-  public List<String> getCompName() {
-    return compName;
+  public void setCount(Long count) {
+    this.count = count;
   }
 
-  public void setCompName(List<String> compName) {
-    this.compName = compName;
+  public List<GraphData> getDataList() {
+    return dataList;
   }
 
-  public List<Long> getCountMsg() {
-    return countMsg;
+  public void setDataList(List<GraphData> dataList) {
+    this.dataList = dataList;
   }
-
-  public void setCountMsg(List<Long> countMsg) {
-    this.countMsg = countMsg;
-  }
-
 }

+ 39 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/GraphDataListResponse.java

@@ -0,0 +1,39 @@
+/*
+ * 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.model.response;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+
+@ApiModel
+public class GraphDataListResponse {
+
+  @ApiModelProperty
+  protected List<GraphData> graphData;
+
+  public List<GraphData> getGraphData() {
+    return graphData;
+  }
+
+  public void setGraphData(List<GraphData> graphData) {
+    this.graphData = graphData;
+  }
+}

+ 48 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/GroupListResponse.java

@@ -0,0 +1,48 @@
+/*
+ * 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.model.response;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@ApiModel
+public class GroupListResponse extends SearchResponse {
+
+  @ApiModelProperty
+  private List<LogData> groupList = new ArrayList<>();
+
+  public List<LogData> getGroupList() {
+    return groupList;
+  }
+
+  public void setGroupList(List<LogData> groupList) {
+    this.groupList = groupList;
+  }
+
+  @Override
+  public int getListSize() {
+    if (groupList != null){
+      return groupList.size();
+    }
+    return 0;
+  }
+}

+ 30 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/HostLogData.java

@@ -0,0 +1,30 @@
+/*
+ * 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.model.response;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public interface HostLogData extends LogData {
+  @JsonProperty("host")
+  String getHost();
+
+  void setHost(String host);
+}

+ 25 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/LogData.java

@@ -0,0 +1,25 @@
+/*
+ * 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.model.response;
+
+import org.apache.ambari.logsearch.common.Marker;
+
+@Marker
+public interface LogData {
+}

+ 7 - 15
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VLogFile.java → ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/LogFileData.java

@@ -16,28 +16,20 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+package org.apache.ambari.logsearch.model.response;
 
-package org.apache.ambari.logsearch.view;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlRootElement;
-
-import org.codehaus.jackson.annotate.JsonAutoDetect;
-import org.codehaus.jackson.annotate.JsonAutoDetect.Visibility;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-@JsonAutoDetect(getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, fieldVisibility = Visibility.ANY)
-@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.FIELD)
-public class VLogFile {
+@ApiModel
+public class LogFileData {
 
+  @ApiModelProperty
   private String name;
 
+  @ApiModelProperty
   private String path;
 
- 
   public String getName() {
     return name;
   }

+ 48 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/LogFileDataListResponse.java

@@ -0,0 +1,48 @@
+/*
+ * 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.model.response;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@ApiModel
+public class LogFileDataListResponse extends SearchResponse {
+
+  @ApiModelProperty
+  private List<LogFileData> logFiles = new ArrayList<LogFileData>();
+
+  @Override
+  public int getListSize() {
+    if (logFiles == null) {
+      return 0;
+    }
+    return logFiles.size();
+  }
+
+  public List<LogFileData> getLogFiles() {
+    return logFiles;
+  }
+
+  public void setLogFiles(List<LogFileData> logFiles) {
+    this.logFiles = logFiles;
+  }
+}

+ 27 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/LogListResponse.java

@@ -0,0 +1,27 @@
+/*
+ * 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.model.response;
+
+import java.util.List;
+
+public interface LogListResponse<T extends LogData> {
+  List<T> getLogList();
+
+  void setLogList(List<T> logList);
+}

+ 22 - 0
ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/LogSearchResponse.java

@@ -0,0 +1,22 @@
+/*
+ * 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.model.response;
+
+abstract public class LogSearchResponse<T extends LogData> extends SearchResponse implements LogListResponse<T> {
+}

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio