Java Code Examples for com.jfinal.kit.LogKit#debug()

The following examples show how to use com.jfinal.kit.LogKit#debug() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ElasticSearcher.java    From jpress with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public void updateArticle(Article article) {
    UpdateRequest updateRequest = new UpdateRequest(index, type, article.getId().toString());
    Map<String, Object> map = new HashMap<>();
    map.putAll(CPI.getAttrs(article));
    updateRequest.doc(map);

    try {
        UpdateResponse response = client.update(updateRequest, RequestOptions.DEFAULT);
        if (LogKit.isDebugEnabled()) {
            LogKit.debug(response.toString());
        }
    } catch (Exception e) {
        LOG.error(e.toString(), e);
    }
}
 
Example 2
Source File: ElasticSearcher.java    From jpress with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public void updateProduct(Product product) {
    UpdateRequest updateRequest = new UpdateRequest(index, type, product.getId().toString());
    Map<String, Object> map = new HashMap<>();
    map.putAll(CPI.getAttrs(product));
    updateRequest.doc(map);

    try {
        UpdateResponse response = client.update(updateRequest, RequestOptions.DEFAULT);
        if (LogKit.isDebugEnabled()) {
            LogKit.debug(response.toString());
        }
    } catch (Exception e) {
        LOG.error(e.toString(), e);
    }
}
 
Example 3
Source File: ElasticSearcher.java    From jpress with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void tryCreateIndex() {
    if (checkIndexExist()) {
        return;
    }

    CreateIndexRequest request = new CreateIndexRequest(index);
    try {
        CreateIndexResponse response = client.indices().create(request, RequestOptions.DEFAULT);
        if (LogKit.isDebugEnabled()) {
            LogKit.debug(response.toString());
        }
    } catch (Exception e) {
        LOG.error(e.toString(), e);
    }
}
 
Example 4
Source File: ElasticSearcher.java    From jpress with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void addArticle(Article article) {
    IndexRequest indexRequest = new IndexRequest(index, type, article.getId().toString());
    indexRequest.source(article.toJson(), XContentType.JSON);
    try {
        IndexResponse response = client.index(indexRequest, RequestOptions.DEFAULT);
        if (LogKit.isDebugEnabled()) {
            LogKit.debug(response.toString());
        }
    } catch (Exception e) {
        LOG.error(e.toString(), e);
    }
}
 
Example 5
Source File: ElasticSearcher.java    From jpress with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void deleteArticle(Object id) {

    DeleteRequest request = new DeleteRequest(index, type, id.toString());
    try {
        DeleteResponse response = client.delete(request, RequestOptions.DEFAULT);
        if (LogKit.isDebugEnabled()) {
            LogKit.debug(response.toString());
        }
    } catch (Exception e) {
        LOG.error(e.toString(), e);
    }

}
 
Example 6
Source File: ElasticSearcher.java    From jpress with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void tryCreateIndex() {
    if (checkIndexExist()) {
        return;
    }

    CreateIndexRequest request = new CreateIndexRequest(index);
    try {
        CreateIndexResponse response = client.indices().create(request, RequestOptions.DEFAULT);
        if (LogKit.isDebugEnabled()) {
            LogKit.debug(response.toString());
        }
    } catch (Exception e) {
        LOG.error(e.toString(), e);
    }
}
 
Example 7
Source File: ElasticSearcher.java    From jpress with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void addProduct(Product product) {
    IndexRequest indexRequest = new IndexRequest(index, type, product.getId().toString());
    indexRequest.source(product.toJson(), XContentType.JSON);
    try {
        IndexResponse response = client.index(indexRequest, RequestOptions.DEFAULT);
        if (LogKit.isDebugEnabled()) {
            LogKit.debug(response.toString());
        }
    } catch (Exception e) {
        LOG.error(e.toString(), e);
    }
}
 
Example 8
Source File: ElasticSearcher.java    From jpress with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void deleteProduct(Object id) {

    DeleteRequest request = new DeleteRequest(index, type, id.toString());
    try {
        DeleteResponse response = client.delete(request, RequestOptions.DEFAULT);
        if (LogKit.isDebugEnabled()) {
            LogKit.debug(response.toString());
        }
    } catch (Exception e) {
        LOG.error(e.toString(), e);
    }

}