rapture.common.client.HttpIndexApi Maven / Gradle / Ivy
/**
* The MIT License (MIT)
*
* Copyright (C) 2011-2016 Incapture Technologies LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/**
* This file is autogenerated and any changes will be overwritten.
*/
package rapture.common.client;
import java.util.List;
import java.util.Map;
import rapture.common.api.IndexApi;
import rapture.common.api.ScriptIndexApi;
import rapture.common.CallingContext;
import rapture.common.model.GeneralResponse;
import rapture.common.model.BasePayload;
import rapture.common.exception.RaptureException;
import rapture.common.impl.jackson.JacksonUtil;
import com.fasterxml.jackson.core.type.TypeReference;
import org.apache.log4j.Logger;
import rapture.common.model.IndexConfig;
import rapture.common.TableConfig;
import rapture.common.TableQuery;
import rapture.common.TableQueryResult;
import rapture.common.TableRecord;
import rapture.common.shared.index.CreateIndexPayload;
import rapture.common.shared.index.GetIndexPayload;
import rapture.common.shared.index.DeleteIndexPayload;
import rapture.common.shared.index.CreateTablePayload;
import rapture.common.shared.index.DeleteTablePayload;
import rapture.common.shared.index.GetTablePayload;
import rapture.common.shared.index.QueryTablePayload;
import rapture.common.shared.index.FindIndexPayload;
@SuppressWarnings("all")
public class HttpIndexApi extends BaseHttpApi implements IndexApi, ScriptIndexApi {
private static final Logger log = Logger.getLogger(HttpIndexApi.class);
public HttpIndexApi(HttpLoginApi login) {
super(login, "index");
}
private static final class CreateIndexTypeReference extends TypeReference {
}
@Override
public IndexConfig createIndex(CallingContext context, String indexUri, String config) {
CreateIndexPayload requestObj = new CreateIndexPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setIndexUri(indexUri);
requestObj.setConfig(config);
return doRequest(requestObj, "CREATEINDEX", new CreateIndexTypeReference()); }
private static final class GetIndexTypeReference extends TypeReference {
}
@Override
public IndexConfig getIndex(CallingContext context, String indexUri) {
GetIndexPayload requestObj = new GetIndexPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setIndexUri(indexUri);
return doRequest(requestObj, "GETINDEX", new GetIndexTypeReference()); }
@Override
public void deleteIndex(CallingContext context, String indexUri) {
DeleteIndexPayload requestObj = new DeleteIndexPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setIndexUri(indexUri);
doRequest(requestObj, "DELETEINDEX", null); }
private static final class CreateTableTypeReference extends TypeReference {
}
@Override
public TableConfig createTable(CallingContext context, String tableUri, String config) {
CreateTablePayload requestObj = new CreateTablePayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setTableUri(tableUri);
requestObj.setConfig(config);
return doRequest(requestObj, "CREATETABLE", new CreateTableTypeReference()); }
@Override
public void deleteTable(CallingContext context, String tableUri) {
DeleteTablePayload requestObj = new DeleteTablePayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setTableUri(tableUri);
doRequest(requestObj, "DELETETABLE", null); }
private static final class GetTableTypeReference extends TypeReference {
}
@Override
public TableConfig getTable(CallingContext context, String indexURI) {
GetTablePayload requestObj = new GetTablePayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setIndexURI(indexURI);
return doRequest(requestObj, "GETTABLE", new GetTableTypeReference()); }
private static final class QueryTableTypeReference extends TypeReference> {
}
@Override
public List queryTable(CallingContext context, String indexURI, TableQuery query) {
QueryTablePayload requestObj = new QueryTablePayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setIndexURI(indexURI);
requestObj.setQuery(query);
return doRequest(requestObj, "QUERYTABLE", new QueryTableTypeReference()); }
private static final class FindIndexTypeReference extends TypeReference {
}
@Override
public TableQueryResult findIndex(CallingContext context, String indexUri, String query) {
FindIndexPayload requestObj = new FindIndexPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setIndexUri(indexUri);
requestObj.setQuery(query);
return doRequest(requestObj, "FINDINDEX", new FindIndexTypeReference()); }
@Override
public IndexConfig createIndex(String indexUri, String config) {
return createIndex(null,indexUri,config); }
@Override
public IndexConfig getIndex(String indexUri) {
return getIndex(null,indexUri); }
@Override
public void deleteIndex(String indexUri) {
deleteIndex(null,indexUri); }
@Override
public TableConfig createTable(String tableUri, String config) {
return createTable(null,tableUri,config); }
@Override
public void deleteTable(String tableUri) {
deleteTable(null,tableUri); }
@Override
public TableConfig getTable(String indexURI) {
return getTable(null,indexURI); }
@Override
public List queryTable(String indexURI, TableQuery query) {
return queryTable(null,indexURI,query); }
@Override
public TableQueryResult findIndex(String indexUri, String query) {
return findIndex(null,indexUri,query); }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy