Package org.elasticsearch.action.get

Examples of org.elasticsearch.action.get.GetResponse


      throw new IllegalStateException("Remote River must be stopped to reconfigure it!");

    logger.info("reconfiguring Remote River");
    String riverIndexName = getRiverIndexName();
    refreshSearchIndex(riverIndexName);
    GetResponse resp = client.prepareGet(riverIndexName, riverName().name(), "_meta").execute().actionGet();
    if (resp.isExists()) {
      if (logger.isDebugEnabled()) {
        logger.debug("Configuration document: {}", resp.getSourceAsString());
      }
      Map<String, Object> newset = resp.getSource();
      configure(newset);
    } else {
      throw new IllegalStateException("Configuration document not found to reconfigure remote river "
          + riverName().name());
    }
View Full Code Here


    if (logger.isDebugEnabled())
      logger.debug("Going to read datetime value from {} property for space {}. Document name is {}.", propertyName,
          spaceKey, documentName);

    refreshSearchIndex(getRiverIndexName());
    GetResponse lastSeqGetResponse = client.prepareGet(getRiverIndexName(), riverName.name(), documentName).execute()
        .actionGet();
    if (lastSeqGetResponse.isExists()) {
      Object timestamp = lastSeqGetResponse.getSourceAsMap().get(STORE_FIELD_VALUE);
      if (timestamp != null) {
        lastDate = DateTimeUtils.parseISODateTime(timestamp.toString());
      }
    } else {
      if (logger.isDebugEnabled())
View Full Code Here

  public String loadPassword(String username) {
    logger.info("loading password for username {}", username);
    String ret = null;
    String riverIndexName = getRiverIndexName();
    refreshSearchIndex(riverIndexName);
    GetResponse resp = client.prepareGet(riverIndexName, riverName().name(), "_pwd").execute().actionGet();
    if (resp.isExists()) {
      if (logger.isDebugEnabled()) {
        logger.debug("Password document: {}", resp.getSourceAsString());
      }
      Map<String, Object> newset = resp.getSource();
      ret = XContentMapValues.nodeStringValue(newset.get("pwd"), null);
    }
    return ret;
  }
View Full Code Here

        mgr.add(i);
      }

      MultiGetResponse response = mgr.execute().actionGet();
      for (MultiGetItemResponse multiGetItemResponse : response.getResponses()) {
        GetResponse res = multiGetItemResponse.getResponse();
        if (res.isExists() && !res.isSourceEmpty()) {
          list.add(Utils.setAnnotatedFields(res.getSource()));
        }
      }
    } catch (Exception e) {
      logger.warn(null, e);
    }
View Full Code Here

      return list;
    }
    try {
      MultiGetResponse response = client().prepareMultiGet().add(appid, null, ids).execute().actionGet();
      for (MultiGetItemResponse multiGetItemResponse : response.getResponses()) {
        GetResponse res = multiGetItemResponse.getResponse();
        if (res.isExists() && !res.isSourceEmpty()) {
          list.add(Utils.setAnnotatedFields(res.getSource()));
        }
      }
    } catch (Exception e) {
      logger.warn(null, e);
    }
View Full Code Here

        return null;
    }

    public User findByUsername(String username) {
        GetResponse getResponse = node.client().prepareGet("users", "user", username).execute().actionGet();
        if (getResponse.exists()) {
            return toUser(getResponse.sourceAsString());
        }

        return null;
    }
View Full Code Here

        DeleteResponse deleteResponse = node.client().prepareDelete(INDEX, TYPE, slug).execute().actionGet();
        return !deleteResponse.notFound();
    }

    public Article findBySlug(String slug) {
        GetResponse response = node.client().prepareGet(INDEX, TYPE, slug).execute().actionGet();
        if (response.exists()) {
            try {
                return json.readValue(response.sourceAsString(), Article.class);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
View Full Code Here

      throw new IllegalStateException("Remote River must be stopped to reconfigure it!");

    logger.info("reconfiguring Remote River");
    String riverIndexName = getRiverIndexName();
    refreshSearchIndex(riverIndexName);
    GetResponse resp = client.prepareGet(riverIndexName, riverName().name(), "_meta").execute().actionGet();
    if (resp.isExists()) {
      if (logger.isDebugEnabled()) {
        logger.debug("Configuration document: {}", resp.getSourceAsString());
      }
      Map<String, Object> newset = resp.getSource();
      configure(newset);
    } else {
      throw new IllegalStateException("Configuration document not found to reconfigure remote river "
          + riverName().name());
    }
View Full Code Here

    if (logger.isDebugEnabled())
      logger.debug("Going to read datetime value from {} property for space {}. Document name is {}.", propertyName,
          spaceKey, documentName);

    refreshSearchIndex(getRiverIndexName());
    GetResponse lastSeqGetResponse = client.prepareGet(getRiverIndexName(), riverName.name(), documentName).execute()
        .actionGet();
    if (lastSeqGetResponse.isExists()) {
      Object timestamp = lastSeqGetResponse.getSourceAsMap().get(STORE_FIELD_VALUE);
      if (timestamp != null) {
        lastDate = DateTimeUtils.parseISODateTime(timestamp.toString());
      }
    } else {
      if (logger.isDebugEnabled())
View Full Code Here

  public String loadPassword(String username) {
    logger.info("loading password for username {}", username);
    String ret = null;
    String riverIndexName = getRiverIndexName();
    refreshSearchIndex(riverIndexName);
    GetResponse resp = client.prepareGet(riverIndexName, riverName().name(), "_pwd").execute().actionGet();
    if (resp.isExists()) {
      if (logger.isDebugEnabled()) {
        logger.debug("Password document: {}", resp.getSourceAsString());
      }
      Map<String, Object> newset = resp.getSource();
      ret = XContentMapValues.nodeStringValue(newset.get("pwd"), null);
    }
    return ret;
  }
View Full Code Here

TOP

Related Classes of org.elasticsearch.action.get.GetResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.