You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ol...@apache.org on 2016/10/03 14:36:10 UTC

[07/16] ambari git commit: AMBARI-18310. Logsearch - Refactor solr query layer (oleewere)

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/UserConfigManager.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/UserConfigManager.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/UserConfigManager.java
index 6772138..00ae332 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/UserConfigManager.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/UserConfigManager.java
@@ -24,17 +24,14 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
-import org.apache.ambari.logsearch.common.LogSearchConstants;
 import org.apache.ambari.logsearch.common.MessageEnums;
 import org.apache.ambari.logsearch.dao.UserConfigSolrDao;
-import org.apache.ambari.logsearch.query.QueryGeneration;
-import org.apache.ambari.logsearch.util.JSONUtil;
+import org.apache.ambari.logsearch.model.common.LogFeederDataMap;
+import org.apache.ambari.logsearch.model.request.impl.UserConfigRequest;
+import org.apache.ambari.logsearch.model.response.UserConfigData;
+import org.apache.ambari.logsearch.model.response.UserConfigDataListResponse;
 import org.apache.ambari.logsearch.util.RESTErrorUtil;
 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,56 +42,66 @@ 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.stereotype.Component;
+import org.springframework.core.convert.ConversionService;
 
 import javax.inject.Inject;
+import javax.inject.Named;
 
-@Component
+import static org.apache.ambari.logsearch.solr.SolrConstants.UserConfigConstants.ID;
+import static org.apache.ambari.logsearch.solr.SolrConstants.UserConfigConstants.USER_NAME;
+import static org.apache.ambari.logsearch.solr.SolrConstants.UserConfigConstants.VALUES;
+import static org.apache.ambari.logsearch.solr.SolrConstants.UserConfigConstants.FILTER_NAME;
+import static org.apache.ambari.logsearch.solr.SolrConstants.UserConfigConstants.ROW_TYPE;
+import static org.apache.ambari.logsearch.solr.SolrConstants.UserConfigConstants.SHARE_NAME_LIST;
+import static org.apache.ambari.logsearch.solr.SolrConstants.UserConfigConstants.COMPOSITE_KEY;
+
+@Named
 public class UserConfigManager extends JsonManagerBase {
 
   private static final Logger logger = Logger.getLogger(UserConfigManager.class);
+
   @Inject
   private UserConfigSolrDao userConfigSolrDao;
   @Inject
-  private QueryGeneration queryGenerator;
+  private ConversionService conversionService;
 
-  public String saveUserConfig(VUserConfig vHistory) {
+  public String saveUserConfig(UserConfigData userConfig) {
 
     SolrInputDocument solrInputDoc = new SolrInputDocument();
-    if (!isValid(vHistory)) {
+    if (!isValid(userConfig)) {
       throw RESTErrorUtil.createRESTException("No FilterName Specified", MessageEnums.INVALID_INPUT_DATA);
     }
 
-    if (isNotUnique(vHistory) && !vHistory.isOverwrite()) {
-      throw RESTErrorUtil.createRESTException( "Name '" + vHistory.getFiltername() + "' already exists", MessageEnums.INVALID_INPUT_DATA);
+    if (isNotUnique(userConfig) && !userConfig.isOverwrite()) {
+      throw RESTErrorUtil.createRESTException( "Name '" + userConfig.getFiltername() + "' already exists", MessageEnums.INVALID_INPUT_DATA);
     }
-    String loggedInUserName = vHistory.getUserName();
-    String filterName = vHistory.getFiltername();
-
-    solrInputDoc.addField(LogSearchConstants.ID, vHistory.getId());
-    solrInputDoc.addField(LogSearchConstants.USER_NAME, loggedInUserName);
-    solrInputDoc.addField(LogSearchConstants.VALUES, vHistory.getValues());
-    solrInputDoc.addField(LogSearchConstants.FILTER_NAME, filterName);
-    solrInputDoc.addField(LogSearchConstants.ROW_TYPE, vHistory.getRowType());
-    List<String> shareNameList = vHistory.getShareNameList();
+    String loggedInUserName = userConfig.getUserName();
+    String filterName = userConfig.getFiltername();
+
+    solrInputDoc.addField(ID, userConfig.getId());
+    solrInputDoc.addField(USER_NAME, loggedInUserName);
+    solrInputDoc.addField(VALUES, userConfig.getValues());
+    solrInputDoc.addField(FILTER_NAME, filterName);
+    solrInputDoc.addField(ROW_TYPE, userConfig.getRowType());
+    List<String> shareNameList = userConfig.getShareNameList();
     if (shareNameList != null && !shareNameList.isEmpty()) {
-      solrInputDoc.addField(LogSearchConstants.SHARE_NAME_LIST, shareNameList);
+      solrInputDoc.addField(SHARE_NAME_LIST, shareNameList);
     }
     // Check whether the Filter Name exists in solr
     SolrQuery solrQuery = new SolrQuery();
-    SolrUtil.setMainQuery(solrQuery, null);
-    queryGenerator.setSingleIncludeFilter(solrQuery, LogSearchConstants.FILTER_NAME, SolrUtil.makeSearcableString(filterName));
-    queryGenerator.setSingleIncludeFilter(solrQuery, LogSearchConstants.USER_NAME, loggedInUserName);
+    solrQuery.setQuery("*:*");
+    solrQuery.addFilterQuery(String.format("%s:%s", FILTER_NAME, SolrUtil.makeSearcableString(filterName)));
+    solrQuery.addFilterQuery(String.format("%s:%s", USER_NAME, loggedInUserName));
     try {
       QueryResponse queryResponse = userConfigSolrDao.process(solrQuery);
       if (queryResponse != null) {
         SolrDocumentList documentList = queryResponse.getResults();
-        if (documentList != null && !documentList.isEmpty() && !vHistory.isOverwrite()) {
+        if (documentList != null && !documentList.isEmpty() && !userConfig.isOverwrite()) {
           logger.error("Filtername is already present");
           throw RESTErrorUtil.createRESTException("Filtername is already present", MessageEnums.INVALID_INPUT_DATA);
         }
       }
-    } catch (SolrException | SolrServerException | IOException e) {
+    } catch (SolrException e) {
       logger.error("Error in checking same filtername config", e);
       throw RESTErrorUtil.createRESTException(MessageEnums.SOLR_ERROR.getMessage().getMessage(), MessageEnums.ERROR_SYSTEM);
     }
@@ -108,28 +115,28 @@ public class UserConfigManager extends JsonManagerBase {
     }
   }
 
-  private boolean isNotUnique(VUserConfig vHistory) {
-    String filterName = vHistory.getFiltername();
-    String rowType = vHistory.getRowType();
+  private boolean isNotUnique(UserConfigData userConfig) {
+    String filterName = userConfig.getFiltername();
+    String rowType = userConfig.getRowType();
 
     if (filterName != null && rowType != null) {
       SolrQuery solrQuery = new SolrQuery();
       filterName = SolrUtil.makeSearcableString(filterName);
-      solrQuery.setQuery(LogSearchConstants.COMPOSITE_KEY + ":" + filterName + "-" + rowType);
+      solrQuery.setQuery(COMPOSITE_KEY + ":" + filterName + "-" + rowType);
       SolrUtil.setRowCount(solrQuery, 0);
       try {
         Long numFound = userConfigSolrDao.process(solrQuery).getResults().getNumFound();
         if (numFound > 0) {
           return true;
         }
-      } catch (SolrException | SolrServerException | IOException e) {
+      } catch (SolrException e) {
         logger.error("Error while checking if userConfig is unique.", e);
       }
     }
     return false;
   }
 
-  private boolean isValid(VUserConfig vHistory) {
+  private boolean isValid(UserConfigData vHistory) {
     return !StringUtils.isBlank(vHistory.getFiltername())
         && !StringUtils.isBlank(vHistory.getRowType())
         && !StringUtils.isBlank(vHistory.getUserName())
@@ -145,131 +152,99 @@ public class UserConfigManager extends JsonManagerBase {
   }
 
   @SuppressWarnings("unchecked")
-  public String getUserConfig(SearchCriteria searchCriteria) {
-
-    SolrDocumentList solrList = new SolrDocumentList();
-    VUserConfigList userConfigList = new VUserConfigList();
-
-    String rowType = (String) searchCriteria.getParamValue(LogSearchConstants.ROW_TYPE);
+  public UserConfigDataListResponse getUserConfig(UserConfigRequest request) {
+    UserConfigDataListResponse response = new UserConfigDataListResponse();
+    String rowType = request.getRowType();
     if (StringUtils.isBlank(rowType)) {
       throw RESTErrorUtil.createRESTException("row type was not specified", MessageEnums.INVALID_INPUT_DATA);
     }
 
-    String userName = (String) searchCriteria.getParamValue(LogSearchConstants.USER_NAME);
+    String userName = request.getUserId();
     if (StringUtils.isBlank(userName)) {
       throw RESTErrorUtil.createRESTException("user name was not specified", MessageEnums.INVALID_INPUT_DATA);
     }
-    String filterName = (String) searchCriteria.getParamValue(LogSearchConstants.FILTER_NAME);
-    filterName = StringUtils.isBlank(filterName) ? "*" : "*" + filterName + "*";
 
-    try {
+    SolrQuery userConfigQuery = conversionService.convert(request, SolrQuery.class);
+    SolrDocumentList solrList = userConfigSolrDao.process(userConfigQuery).getResults();
 
-      SolrQuery userConfigQuery = new SolrQuery();
-      SolrUtil.setMainQuery(userConfigQuery, null);
-      queryGenerator.setPagination(userConfigQuery, searchCriteria);
-      queryGenerator.setSingleIncludeFilter(userConfigQuery, LogSearchConstants.ROW_TYPE, rowType);
-      queryGenerator.setSingleORFilter(userConfigQuery, LogSearchConstants.USER_NAME, userName, LogSearchConstants.SHARE_NAME_LIST, userName);
-      queryGenerator.setSingleIncludeFilter(userConfigQuery, LogSearchConstants.FILTER_NAME, SolrUtil.makeSearcableString(filterName));
+    Collection<UserConfigData> configList = new ArrayList<>();
 
-      if (StringUtils.isBlank(searchCriteria.getSortBy())) {
-        searchCriteria.setSortBy(LogSearchConstants.FILTER_NAME);
-      }
-      if (StringUtils.isBlank(searchCriteria.getSortType())) {
-        searchCriteria.setSortType("" + SolrQuery.ORDER.asc);
+    for (SolrDocument solrDoc : solrList) {
+      UserConfigData userConfig = new UserConfigData();
+      userConfig.setFiltername("" + solrDoc.get(FILTER_NAME));
+      userConfig.setId("" + solrDoc.get(ID));
+      userConfig.setValues("" + solrDoc.get(VALUES));
+      userConfig.setRowType("" + solrDoc.get(ROW_TYPE));
+      try {
+        List<String> shareNameList = (List<String>) solrDoc.get(SHARE_NAME_LIST);
+        userConfig.setShareNameList(shareNameList);
+      } catch (Exception e) {
+        // do nothing
       }
 
-      queryGenerator.setSingleSortOrder(userConfigQuery, searchCriteria);
-      solrList = userConfigSolrDao.process(userConfigQuery).getResults();
-
-      Collection<VUserConfig> configList = new ArrayList<VUserConfig>();
-
-      for (SolrDocument solrDoc : solrList) {
-        VUserConfig userConfig = new VUserConfig();
-        userConfig.setFiltername("" + solrDoc.get(LogSearchConstants.FILTER_NAME));
-        userConfig.setId("" + solrDoc.get(LogSearchConstants.ID));
-        userConfig.setValues("" + solrDoc.get(LogSearchConstants.VALUES));
-        userConfig.setRowType("" + solrDoc.get(LogSearchConstants.ROW_TYPE));
-        try {
-          List<String> shareNameList = (List<String>) solrDoc.get(LogSearchConstants.SHARE_NAME_LIST);
-          userConfig.setShareNameList(shareNameList);
-        } catch (Exception e) {
-          // do nothing
-        }
+      userConfig.setUserName("" + solrDoc.get(USER_NAME));
 
-        userConfig.setUserName("" + solrDoc.get(LogSearchConstants.USER_NAME));
+      configList.add(userConfig);
+    }
 
-        configList.add(userConfig);
-      }
+    response.setName("historyList");
+    response.setUserConfigList(configList);
 
-      userConfigList.setName("historyList");
-      userConfigList.setUserConfigList(configList);
+    response.setStartIndex(Integer.parseInt(request.getStartIndex()));
+    response.setPageSize(Integer.parseInt(request.getPageSize()));
 
-      userConfigList.setStartIndex(searchCriteria.getStartIndex());
-      userConfigList.setPageSize((int) searchCriteria.getMaxRows());
+    response.setTotalCount((long) solrList.getNumFound());
 
-      userConfigList.setTotalCount((long) solrList.getNumFound());
-    } catch (SolrException | SolrServerException | IOException e) {
-      // do nothing
-      logger.error(e);
-      throw RESTErrorUtil.createRESTException(MessageEnums.SOLR_ERROR.getMessage().getMessage(), MessageEnums.ERROR_SYSTEM);
-    }
-
-    return convertObjToString(userConfigList);
+    return response;
 
   }
 
-  public String updateUserConfig(VUserConfig vuserConfig) {
-    return saveUserConfig(vuserConfig);
+  public String updateUserConfig(UserConfigData userConfig) {
+    return saveUserConfig(userConfig);
   }
 
   // ////////////////////////////LEVEL FILTER/////////////////////////////////////
 
-  public String getUserFilter() {
-    VLogfeederFilterWrapper userFilter;
+  public LogFeederDataMap getUserFilter() {
+    LogFeederDataMap userFilter;
     try {
       userFilter = userConfigSolrDao.getUserFilter();
     } catch (SolrServerException | IOException e) {
       logger.error(e);
       throw RESTErrorUtil.createRESTException(MessageEnums.SOLR_ERROR.getMessage().getMessage(), MessageEnums.ERROR_SYSTEM);
     }
-    return convertObjToString(userFilter);
+    return userFilter;
   }
 
-  public String saveUserFiter(String json) {
-    if (!StringUtils.isBlank(json)) {
-      VLogfeederFilterWrapper logfeederFilterWrapper = (VLogfeederFilterWrapper) JSONUtil.jsonToObj(json, VLogfeederFilterWrapper.class);
-      try {
-        if (logfeederFilterWrapper == null) {
-          logger.error(json + " is a invalid json");
-        }
-        userConfigSolrDao.saveUserFilter(logfeederFilterWrapper);
-      } catch (SolrException | SolrServerException | IOException e) {
-        logger.error("user config not able to save", e);
-        throw RESTErrorUtil.createRESTException(MessageEnums.SOLR_ERROR.getMessage().getMessage(), MessageEnums.ERROR_SYSTEM);
-      }
+  public LogFeederDataMap saveUserFiter(LogFeederDataMap logfeederFilters) {
+    try {
+      userConfigSolrDao.saveUserFilter(logfeederFilters);
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error("user config not able to save", e);
+      throw RESTErrorUtil.createRESTException(MessageEnums.SOLR_ERROR.getMessage().getMessage(), MessageEnums.ERROR_SYSTEM);
     }
     return getUserFilter();
   }
 
-  public String getAllUserName() {
+  public List<String> getAllUserName() {
     List<String> userList = new ArrayList<String>();
     try {
       SolrQuery userListQuery = new SolrQuery();
-      SolrUtil.setMainQuery(userListQuery, null);
-      SolrUtil.setFacetField(userListQuery, LogSearchConstants.USER_NAME);
+      userListQuery.setQuery("*:*");
+      SolrUtil.setFacetField(userListQuery, USER_NAME);
       QueryResponse queryResponse = userConfigSolrDao.process(userListQuery);
       if (queryResponse == null) {
-        return convertObjToString(userList);
+        return userList;
       }
-      List<Count> counList = queryResponse.getFacetField(LogSearchConstants.USER_NAME).getValues();
+      List<Count> counList = queryResponse.getFacetField(USER_NAME).getValues();
       for (Count cnt : counList) {
         String userName = cnt.getName();
         userList.add(userName);
       }
-    } catch (SolrException | SolrServerException | IOException e) {
+    } catch (SolrException e) {
       logger.warn("Error getting all users.", e);
       throw RESTErrorUtil.createRESTException(MessageEnums.SOLR_ERROR.getMessage().getMessage(), MessageEnums.ERROR_SYSTEM);
     }
-    return convertObjToString(userList);
+    return userList;
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/common/LogFeederDataMap.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/common/LogFeederDataMap.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/common/LogFeederDataMap.java
new file mode 100644
index 0000000..b09610c
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/common/LogFeederDataMap.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.common;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.HashMap;
+
+@ApiModel
+public class LogFeederDataMap {
+
+  @ApiModelProperty
+  private String id;
+
+  @ApiModelProperty
+  private HashMap<String, LogfeederFilterData> filter;
+
+  public HashMap<String, LogfeederFilterData> getFilter() {
+    return filter;
+  }
+
+  public void setFilter(HashMap<String, LogfeederFilterData> filter) {
+    this.filter = filter;
+  }
+
+  public String getId() {
+    return id;
+  }
+
+  public void setId(String id) {
+    this.id = id;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/common/LogfeederFilterData.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/common/LogfeederFilterData.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/common/LogfeederFilterData.java
new file mode 100644
index 0000000..e0f8013
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/common/LogfeederFilterData.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.model.common;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@ApiModel
+public class LogfeederFilterData {
+
+  @ApiModelProperty
+  private String label;
+
+  @ApiModelProperty
+  private List<String> hosts = new ArrayList<>();
+
+  @ApiModelProperty
+  private List<String> defaultLevels = new ArrayList<>();
+
+  @ApiModelProperty
+  private List<String> overrideLevels = new ArrayList<>();
+
+  @ApiModelProperty
+  private String expiryTime;
+
+  public LogfeederFilterData() {
+  }
+
+  public String getLabel() {
+    return label;
+  }
+
+  public void setLabel(String label) {
+    this.label = label;
+  }
+
+  public List<String> getHosts() {
+    return hosts;
+  }
+
+  public void setHosts(List<String> hosts) {
+    this.hosts = hosts;
+  }
+
+  public List<String> getDefaultLevels() {
+    return defaultLevels;
+  }
+
+  public void setDefaultLevels(List<String> defaultLevels) {
+    this.defaultLevels = defaultLevels;
+  }
+
+  public List<String> getOverrideLevels() {
+    return overrideLevels;
+  }
+
+  public void setOverrideLevels(List<String> overrideLevels) {
+    this.overrideLevels = overrideLevels;
+  }
+
+  public String getExpiryTime() {
+    return expiryTime;
+  }
+
+  public void setExpiryTime(String expiryTime) {
+    this.expiryTime = expiryTime;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/FieldParamDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/FieldParamDefinition.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/FieldParamDefinition.java
index 396fa93..66b3eeb 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/FieldParamDefinition.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/FieldParamDefinition.java
@@ -27,6 +27,6 @@ public interface FieldParamDefinition {
 
   String getField();
 
-  @ApiParam(value = FIELD_D, name = LogSearchConstants.REQUEST_PARAM_FIELD)
+  @ApiParam(value = FIELD_D, name = LogSearchConstants.REQUEST_PARAM_FIELD, required = true)
   void setField(String field);
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/LogParamDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/LogParamDefinition.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/LogParamDefinition.java
index e44de35..4840eaa 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/LogParamDefinition.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/LogParamDefinition.java
@@ -20,6 +20,8 @@ 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.E_MESSAGE_D;
 import static org.apache.ambari.logsearch.doc.DocConstants.CommonDescriptions.I_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;
@@ -33,6 +35,11 @@ public interface LogParamDefinition {
   @ApiParam(value = I_MESSAGE_D, name = LogSearchConstants.REQUEST_PARAM_I_MESSAGE)
   void setiMessage(String iMessage);
 
+  String geteMessage();
+
+  @ApiParam(value = E_MESSAGE_D, name = LogSearchConstants.REQUEST_PARAM_E_MESSAGE)
+  void seteMessage(String eMessage);
+
   String getMustBe();
 
   @ApiParam(value = MUST_BE_D, name = LogSearchConstants.REQUEST_PARAM_MUST_BE)

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/LogTruncatedParamDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/LogTruncatedParamDefinition.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/LogTruncatedParamDefinition.java
index c3e2998..d3832c1 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/LogTruncatedParamDefinition.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/LogTruncatedParamDefinition.java
@@ -37,8 +37,8 @@ public interface LogTruncatedParamDefinition {
   @ApiParam(value = SCROLL_TYPE_D, name = LogSearchConstants.REQUEST_PARAM_SCROLL_TYPE)
   void setScrollType(String scrollType);
 
-  String getNumberRows();
+  Integer getNumberRows();
 
   @ApiParam(value = NUMBER_ROWS_D, name = LogSearchConstants.REQUEST_PARAM_NUMBER_ROWS)
-  void setNumberRows(String numberRows);
+  void setNumberRows(Integer numberRows);
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/QueryParamDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/QueryParamDefinition.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/QueryParamDefinition.java
deleted file mode 100644
index 3fcdbc0..0000000
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/QueryParamDefinition.java
+++ /dev/null
@@ -1,32 +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.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);
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/ServiceLogParamDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/ServiceLogParamDefinition.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/ServiceLogParamDefinition.java
index abc1f08..1783a8d 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/ServiceLogParamDefinition.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/ServiceLogParamDefinition.java
@@ -22,12 +22,9 @@ 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.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 {
 
@@ -36,11 +33,6 @@ public interface ServiceLogParamDefinition {
   @ApiParam(value = LEVEL_D, name = LogSearchConstants.REQUEST_PARAM_LEVEL)
   void setLevel(String level);
 
-  String geteMessage();
-
-  @ApiParam(value = E_MESSAGE_D, name = LogSearchConstants.REQUEST_PARAM_E_MESSAGE)
-  void seteMessage(String eMessage);
-
   String getHostName();
 
   @ApiParam(value = HOST_NAME_D, name = LogSearchConstants.REQUEST_PARAM_HOST_NAME)
@@ -55,9 +47,4 @@ public interface ServiceLogParamDefinition {
 
   @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);
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/TopParamDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/TopParamDefinition.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/TopParamDefinition.java
new file mode 100644
index 0000000..97d9543
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/TopParamDefinition.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.TOP;
+
+public interface TopParamDefinition {
+  Integer getTop();
+
+  @ApiParam(value = TOP, name = LogSearchConstants.REQUEST_PARAM_TOP, required = true)
+  void setTop(Integer top);
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AnyGraphRequest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AnyGraphRequest.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AnyGraphRequest.java
deleted file mode 100644
index 41da712..0000000
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AnyGraphRequest.java
+++ /dev/null
@@ -1,109 +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.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;
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AuditBarGraphRequest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AuditBarGraphRequest.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AuditBarGraphRequest.java
index 91e7d1e..03ca32d 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AuditBarGraphRequest.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AuditBarGraphRequest.java
@@ -23,7 +23,7 @@ import org.apache.ambari.logsearch.model.request.UnitParamDefinition;
 
 import javax.ws.rs.QueryParam;
 
-public class AuditBarGraphRequest extends BaseAuditLogRequest implements UnitParamDefinition {
+public class AuditBarGraphRequest extends BaseLogRequest implements UnitParamDefinition {
 
   @QueryParam(LogSearchConstants.REQUEST_PARAM_UNIT)
   private String unit;

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AuditComponentRequest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AuditComponentRequest.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AuditComponentRequest.java
new file mode 100644
index 0000000..94cb255
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AuditComponentRequest.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.impl;
+
+import org.apache.ambari.logsearch.common.Marker;
+
+@Marker
+public class AuditComponentRequest extends CommonSearchRequest {
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AuditLogRequest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AuditLogRequest.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AuditLogRequest.java
index 8dd13dc..36fa378 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AuditLogRequest.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AuditLogRequest.java
@@ -23,7 +23,7 @@ import org.apache.ambari.logsearch.model.request.LastPageParamDefinition;
 
 import javax.ws.rs.QueryParam;
 
-public class AuditLogRequest extends BaseAuditLogRequest implements LastPageParamDefinition {
+public class AuditLogRequest extends BaseLogRequest implements LastPageParamDefinition {
 
   @QueryParam(LogSearchConstants.REQUEST_PARAM_LAST_PAGE)
   private boolean isLastPage;

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AuditServiceLoadRequest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AuditServiceLoadRequest.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AuditServiceLoadRequest.java
new file mode 100644
index 0000000..64ee2d2
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/AuditServiceLoadRequest.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.impl;
+
+import org.apache.ambari.logsearch.common.Marker;
+
+@Marker
+public class AuditServiceLoadRequest extends BaseLogRequest {
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/BaseAuditLogRequest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/BaseAuditLogRequest.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/BaseAuditLogRequest.java
deleted file mode 100644
index 74b4ab7..0000000
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/BaseAuditLogRequest.java
+++ /dev/null
@@ -1,53 +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.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;
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/BaseLogRequest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/BaseLogRequest.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/BaseLogRequest.java
index 1371350..5da2e83 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/BaseLogRequest.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/BaseLogRequest.java
@@ -18,28 +18,37 @@
  */
 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.DateRangeParamDefinition;
 import org.apache.ambari.logsearch.model.request.LogParamDefinition;
 
 import javax.ws.rs.QueryParam;
 
-public class BaseLogRequest extends QueryRequest implements LogParamDefinition {
+public class BaseLogRequest extends CommonSearchRequest implements LogParamDefinition, DateRangeParamDefinition {
 
   @QueryParam(LogSearchConstants.REQUEST_PARAM_I_MESSAGE)
   private String iMessage;
 
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_E_MESSAGE)
+  private String eMessage;
+
   @QueryParam(LogSearchConstants.REQUEST_PARAM_MUST_BE)
   private String mustBe;
 
   @QueryParam(LogSearchConstants.REQUEST_PARAM_MUST_NOT)
   private String mustNot;
 
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_INCLUDE_QUERY)
+  private String includeQuery;
+
   @QueryParam(LogSearchConstants.REQUEST_PARAM_EXCLUDE_QUERY)
   private String excludeQuery;
 
-  @QueryParam(LogSearchConstants.REQUEST_PARAM_INCLUDE_QUERY)
-  private String includeQuery;
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_FROM)
+  private String from;
+
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_TO)
+  private String to;
 
   @Override
   public String getiMessage() {
@@ -52,6 +61,16 @@ public class BaseLogRequest extends QueryRequest implements LogParamDefinition {
   }
 
   @Override
+  public String geteMessage() {
+    return eMessage;
+  }
+
+  @Override
+  public void seteMessage(String eMessage) {
+    this.eMessage = eMessage;
+  }
+
+  @Override
   public String getMustBe() {
     return mustBe;
   }
@@ -90,4 +109,24 @@ public class BaseLogRequest extends QueryRequest implements LogParamDefinition {
   public void setExcludeQuery(String excludeQuery) {
     this.excludeQuery = excludeQuery;
   }
+
+  @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;
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/BaseServiceLogRequest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/BaseServiceLogRequest.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/BaseServiceLogRequest.java
index 5770ba6..edd7563 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/BaseServiceLogRequest.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/BaseServiceLogRequest.java
@@ -26,14 +26,11 @@ import org.apache.ambari.logsearch.model.request.ServiceLogParamDefinition;
 import javax.ws.rs.QueryParam;
 
 public class BaseServiceLogRequest extends BaseLogRequest
-  implements ServiceLogParamDefinition, BundleIdParamDefinition, DateRangeParamDefinition {
+  implements ServiceLogParamDefinition, BundleIdParamDefinition {
 
   @QueryParam(LogSearchConstants.REQUEST_PARAM_LEVEL)
   private String level;
 
-  @QueryParam(LogSearchConstants.REQUEST_PARAM_E_MESSAGE)
-  private String eMessage;
-
   @QueryParam(LogSearchConstants.REQUEST_PARAM_HOST_NAME)
   private String hostName;
 
@@ -46,15 +43,6 @@ public class BaseServiceLogRequest extends BaseLogRequest
   @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;
@@ -66,16 +54,6 @@ public class BaseServiceLogRequest extends BaseLogRequest
   }
 
   @Override
-  public String geteMessage() {
-    return eMessage;
-  }
-
-  @Override
-  public void seteMessage(String eMessage) {
-    this.eMessage = eMessage;
-  }
-
-  @Override
   public String getHostName() {
     return hostName;
   }
@@ -114,34 +92,4 @@ public class BaseServiceLogRequest extends BaseLogRequest
   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;
-  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/FieldAuditLogRequest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/FieldAuditLogRequest.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/FieldAuditLogRequest.java
index 67502fa..0bdcddf 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/FieldAuditLogRequest.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/FieldAuditLogRequest.java
@@ -18,17 +18,21 @@
  */
 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 org.apache.ambari.logsearch.model.request.TopParamDefinition;
 
+import javax.ws.rs.PathParam;
 import javax.ws.rs.QueryParam;
 
-public class FieldAuditLogRequest extends BaseAuditLogRequest implements FieldParamDefinition {
+public class FieldAuditLogRequest extends BaseLogRequest implements FieldParamDefinition, TopParamDefinition {
 
   @QueryParam(LogSearchConstants.REQUEST_PARAM_FIELD)
   private String field;
 
+  @PathParam(LogSearchConstants.REQUEST_PARAM_TOP)
+  private Integer top;
+
   @Override
   public String getField() {
     return field;
@@ -38,4 +42,14 @@ public class FieldAuditLogRequest extends BaseAuditLogRequest implements FieldPa
   public void setField(String field) {
     this.field = field;
   }
+
+  @Override
+  public Integer getTop() {
+    return top;
+  }
+
+  @Override
+  public void setTop(Integer top) {
+    this.top = top;
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/QueryRequest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/QueryRequest.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/QueryRequest.java
deleted file mode 100644
index 0ce788c..0000000
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/QueryRequest.java
+++ /dev/null
@@ -1,40 +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.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;
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceAnyGraphRequest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceAnyGraphRequest.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceAnyGraphRequest.java
index a6aadbb..1fb4bf6 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceAnyGraphRequest.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceAnyGraphRequest.java
@@ -27,7 +27,7 @@ import org.apache.ambari.logsearch.model.request.UnitParamDefinition;
 import javax.ws.rs.QueryParam;
 
 public class ServiceAnyGraphRequest extends ServiceLogRequest
-  implements AnyGraphParamDefinition, DateRangeParamDefinition, UnitParamDefinition {
+  implements AnyGraphParamDefinition, UnitParamDefinition {
 
   @QueryParam(LogSearchConstants.REQUEST_PARAM_XAXIS)
   private String xAxis;
@@ -41,12 +41,6 @@ public class ServiceAnyGraphRequest extends ServiceLogRequest
   @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;
@@ -86,24 +80,4 @@ public class ServiceAnyGraphRequest extends ServiceLogRequest
   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;
-  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceExtremeDatesRequest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceExtremeDatesRequest.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceExtremeDatesRequest.java
deleted file mode 100644
index 8207c5d..0000000
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceExtremeDatesRequest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.ambari.logsearch.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;
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogAggregatedInfoRequest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogAggregatedInfoRequest.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogAggregatedInfoRequest.java
new file mode 100644
index 0000000..84955d8
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogAggregatedInfoRequest.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.impl;
+
+import org.apache.ambari.logsearch.common.Marker;
+
+@Marker
+public class ServiceLogAggregatedInfoRequest extends BaseServiceLogRequest {
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogComponentHostRequest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogComponentHostRequest.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogComponentHostRequest.java
new file mode 100644
index 0000000..6d0b3b1
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogComponentHostRequest.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.impl;
+
+import org.apache.ambari.logsearch.common.Marker;
+
+@Marker
+public class ServiceLogComponentHostRequest extends ServiceLogRequest {
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogComponentLevelRequest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogComponentLevelRequest.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogComponentLevelRequest.java
new file mode 100644
index 0000000..dd2b8af
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogComponentLevelRequest.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.impl;
+
+import org.apache.ambari.logsearch.common.Marker;
+
+@Marker
+public class ServiceLogComponentLevelRequest extends ServiceLogRequest {
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogHostComponentRequest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogHostComponentRequest.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogHostComponentRequest.java
new file mode 100644
index 0000000..6242362
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogHostComponentRequest.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.request.impl;
+
+import io.swagger.annotations.ApiParam;
+
+import javax.ws.rs.QueryParam;
+
+public class ServiceLogHostComponentRequest extends ServiceLogRequest {
+  @QueryParam("hostName")
+  @ApiParam
+  String hostName;
+
+  @Override
+  public String getHostName() {
+    return hostName;
+  }
+
+  @Override
+  public void setHostName(String hostName) {
+    this.hostName = hostName;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogLevelCountRequest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogLevelCountRequest.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogLevelCountRequest.java
new file mode 100644
index 0000000..7f0805f
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogLevelCountRequest.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.impl;
+
+import org.apache.ambari.logsearch.common.Marker;
+
+@Marker
+public class ServiceLogLevelCountRequest extends BaseServiceLogRequest {
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogTruncatedRequest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogTruncatedRequest.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogTruncatedRequest.java
index 8067896..c4b0049 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogTruncatedRequest.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/ServiceLogTruncatedRequest.java
@@ -32,7 +32,7 @@ public class ServiceLogTruncatedRequest extends ServiceLogRequest implements Log
   private String scrollType;
 
   @QueryParam(LogSearchConstants.REQUEST_PARAM_NUMBER_ROWS)
-  private String numberRows;
+  private Integer numberRows;
 
   @Override
   public String getId() {
@@ -55,12 +55,12 @@ public class ServiceLogTruncatedRequest extends ServiceLogRequest implements Log
   }
 
   @Override
-  public String getNumberRows() {
+  public Integer getNumberRows() {
     return numberRows;
   }
 
   @Override
-  public void setNumberRows(String numberRows) {
+  public void setNumberRows(Integer numberRows) {
     this.numberRows = numberRows;
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/SimpleQueryRequest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/SimpleQueryRequest.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/SimpleQueryRequest.java
deleted file mode 100644
index eec4379..0000000
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/SimpleQueryRequest.java
+++ /dev/null
@@ -1,42 +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.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;
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/TemplateData.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/TemplateData.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/TemplateData.java
new file mode 100644
index 0000000..05deebd
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/TemplateData.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.model.response;
+
+public class TemplateData {
+
+  private String data;
+
+  public TemplateData(String data) {
+    this.data = data;
+  }
+
+  public String getData() {
+    return data;
+  }
+
+  public void setData(String data) {
+    this.data = data;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/UserConfigData.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/UserConfigData.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/UserConfigData.java
new file mode 100644
index 0000000..1fca3ba
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/UserConfigData.java
@@ -0,0 +1,108 @@
+/*
+ * 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.ApiModelProperty;
+
+import java.util.Date;
+import java.util.List;
+
+public class UserConfigData {
+
+  @ApiModelProperty
+  private String id;
+
+  @ApiModelProperty
+  private String userName;
+
+  @ApiModelProperty
+  private String filtername;
+
+  @ApiModelProperty
+  private String values;
+
+  @ApiModelProperty
+  private List<String> shareNameList;
+
+  @ApiModelProperty
+  private String rowType;
+
+  @ApiModelProperty
+  private boolean isOverwrite = false;
+
+  public UserConfigData() {
+    id = String.valueOf(new Date().getTime());
+  }
+
+  public String getId() {
+    return id;
+  }
+
+  public void setId(String id) {
+    this.id = id;
+  }
+
+  public String getUserName() {
+    return userName;
+  }
+
+  public void setUserName(String userName) {
+    this.userName = userName;
+  }
+
+  public String getFiltername() {
+    return filtername;
+  }
+
+  public void setFiltername(String filtername) {
+    this.filtername = filtername;
+  }
+
+  public List<String> getShareNameList() {
+    return shareNameList;
+  }
+
+  public void setShareNameList(List<String> shareNameList) {
+    this.shareNameList = shareNameList;
+  }
+
+  public String getValues() {
+    return values;
+  }
+
+  public void setValues(String values) {
+    this.values = values;
+  }
+
+  public String getRowType() {
+    return rowType;
+  }
+
+  public void setRowType(String rowType) {
+    this.rowType = rowType;
+  }
+
+  public boolean isOverwrite() {
+    return isOverwrite;
+  }
+
+  public void setOverwrite(boolean overwrite) {
+    isOverwrite = overwrite;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c7f1e707/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/UserConfigDataListResponse.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/UserConfigDataListResponse.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/UserConfigDataListResponse.java
new file mode 100644
index 0000000..5c445b2
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/UserConfigDataListResponse.java
@@ -0,0 +1,55 @@
+/*
+ * 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.Collection;
+
+@ApiModel
+public class UserConfigDataListResponse extends SearchResponse{
+
+  @ApiModelProperty
+  private String name;
+
+  @ApiModelProperty
+  private Collection<UserConfigData> userConfigList;
+
+  public String getName() {
+    return name;
+  }
+
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  public Collection<UserConfigData> getUserConfigList() {
+    return userConfigList;
+  }
+
+  public void setUserConfigList(Collection<UserConfigData> userConfigList) {
+    this.userConfigList = userConfigList;
+  }
+
+  @Override
+  public int getListSize() {
+    return userConfigList != null ? userConfigList.size() : 0;
+  }
+}