public boolean addQueryInHistory(String queryText,String userId){
  boolean operationStatus=false;
  if (StringUtils.isNotNullNotEmptyNotWhiteSpace(queryText) && StringUtils.isNotNullNotEmptyNotWhiteSpace(userId)) {
    ObjectNode queries=fetchAllQueriesFromFile();
    ObjectNode userQueries=(ObjectNode)queries.get(userId);
    if (userQueries == null) {
      userQueries=mapper.createObjectNode();
    }
    userQueries.put(Long.toString(System.currentTimeMillis()),queryText);
    queries.put(userId,userQueries);
    operationStatus=storeQueriesInFile(queries);
  }
  return operationStatus;
}

public boolean addQueryInHistory ( String queryText , String userId ) { boolean operationStatus = false ; if ( StringUtils . isNotNullNotEmptyNotWhiteSpace ( queryText ) && StringUtils . isNotNullNotEmptyNotWhiteSpace ( userId ) ) { ObjectNode queries = fetchAllQueriesFromFile ( ) ; ObjectNode userQueries = ( ObjectNode ) queries . get ( userId ) ; if ( userQueries == null ) { userQueries = mapper . createObjectNode ( ) ; } userQueries . put ( Long . toString ( System . currentTimeMillis ( ) ) , queryText ) ; queries . put ( userId , userQueries ) ; operationStatus = storeQueriesInFile ( queries ) ; } return operationStatus ; }
addqueryinhistory method adds user ' s query into query history file
