Package com.ikanow.infinit.e.data_model.api

Examples of com.ikanow.infinit.e.data_model.api.ResponsePojo


  {
    try {
      String address = apiRoot + "config/source/save/" + communityId + "/";
      String saveResult;
      saveResult = sendRequest(address, new Gson().toJson(source));
      ResponsePojo internal_responsePojo = ResponsePojo.fromApi(saveResult, ResponsePojo.class, SourcePojo.class, new SourcePojoApiMap(null));
      ResponseObject internal_ro = internal_responsePojo.getResponse();
      responseObject = shallowCopy(responseObject, internal_ro);
      return (SourcePojo)internal_responsePojo.getData();
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
View Full Code Here


  public String deleteSource(String sourceId, String communityId, ResponseObject responseObject)
  {
    try {
      String address = apiRoot + "config/source/delete/" + sourceId + "/" + communityId;
      String deleteResult = sendRequest(address, null);
      ResponsePojo internal_responsePojo = ResponsePojo.fromApi(deleteResult, ResponsePojo.class);
      ResponseObject internal_ro = internal_responsePojo.getResponse();
      responseObject = shallowCopy(responseObject, internal_ro);
     
      return responseObject.getMessage();
    }
    catch (Exception e)
View Full Code Here

      theUrl.append("returnFullText=true");
    }
    String map = ApiManager.mapToApi(testSrc, null);   
    String testResult = sendRequest(theUrl.toString(), map);
   
    ResponsePojo internal_response = ResponsePojo.fromApi(testResult, ResponsePojo.class);
    shallowCopy(response, internal_response.getResponse());
    List<DocumentPojo> docs = null;
    if (response.isSuccess()) {
      docs = ApiManager.mapListFromApi((JsonElement)internal_response.getData(),
                                  DocumentPojo.listType(), new DocumentPojoApiMap());
    }
   
    return docs;
  }
View Full Code Here

      theUrl.append(commId.toString());
      bFirstComm = false;
    }
    String testResult = sendRequest(theUrl.toString(), query.toApi());
   
    ResponsePojo internal_response = ResponsePojo.fromApi(testResult, ResponsePojo.class);
    shallowCopy(response, internal_response.getResponse());
   
    return internal_response;
  }
View Full Code Here

      theUrl.append(docid);
      theUrl.append("?returnFullText=").append(returnFullText);
      theUrl.append("?returnRawData=").append(returnRawData);
     
      String getResult = sendRequest(theUrl.toString(), null);
      ResponsePojo internal_responsePojo = ResponsePojo.fromApi(getResult, ResponsePojo.class, DocumentPojo.class, new DocumentPojoApiMap())
      ResponseObject internal_ro = internal_responsePojo.getResponse();
      responseObject = shallowCopy(responseObject, internal_ro);
      return (DocumentPojo)internal_responsePojo.getData();
    }
    catch (Exception ex)
    {
      ex.printStackTrace();
    }
View Full Code Here

      theUrl.append(sourceKey).append("/").append(url);
      theUrl.append("?returnFullText=").append(returnFullText);
      theUrl.append("?returnRawData=").append(returnRawData);
     
      String getResult = sendRequest(theUrl.toString(), null);
      ResponsePojo internal_responsePojo = ResponsePojo.fromApi(getResult, ResponsePojo.class, DocumentPojo.class, new DocumentPojoApiMap())
      ResponseObject internal_ro = internal_responsePojo.getResponse();
      responseObject = shallowCopy(responseObject, internal_ro);
      return (DocumentPojo)internal_responsePojo.getData();
    }
    catch (Exception ex)
    {
      ex.printStackTrace();
    }
View Full Code Here

      if (null != taskConfig.firstSchedule) {
        taskConfig.nextRunTime = taskConfig.firstSchedule.getTime();
      }
     
      String json = sendRequest(url.toString(), ApiManager.mapToApi(taskConfig, null));
      ResponsePojo internal_responsePojo = ResponsePojo.fromApi(json, ResponsePojo.class);
      ResponseObject internal_ro = internal_responsePojo.getResponse();
      response = shallowCopy(response, internal_ro);
     
      if (response.isSuccess()) {
        JsonPrimitive retValObj = (JsonPrimitive)internal_responsePojo.getData();
        retVal = new ObjectId(retValObj.getAsString());
      }     
    }
    catch (Exception e) {
      response.setSuccess(false);
View Full Code Here

      {
        url.append(jobtitle);
      }
       
      String json = sendRequest(url.toString(), null);
      ResponsePojo internal_responsePojo = ResponsePojo.fromApi(json, ResponsePojo.class, CustomMapReduceResultPojo.class, new CustomMapReduceResultPojoApiMap());
     
      ResponseObject internal_ro = internal_responsePojo.getResponse();
      response = shallowCopy(response, internal_ro);
     
      if (response.isSuccess())
      {
        //JsonElement js = (JsonElement)internal_responsePojo.getData();
        //retVal = ApiManager.mapFromApi(js, CustomMapReduceResultPojo.class, null);
        retVal = (CustomMapReduceResultPojo)internal_responsePojo.getData();
       
      }
    }
    catch (Exception e)
    {
View Full Code Here

        url.append(jobtitle);
      }
      // (else get all)
     
      String json = sendRequest(url.toString(), null);
      ResponsePojo internal_responsePojo = ResponsePojo.fromApi(json, ResponsePojo.class);
      ResponseObject internal_ro = internal_responsePojo.getResponse();
      response = shallowCopy(response, internal_ro);
     
      if (response.isSuccess()) {
        retVal = ApiManager.mapListFromApi((JsonElement)internal_responsePojo.getData(),
                          CustomMapReduceJobPojo.listType(), null);
      }
    }
    catch (Exception e) {
      response.setSuccess(false);
View Full Code Here

    try {
      StringBuilder url = new StringBuilder(apiRoot).append("custom/mapreduce/removejob/");
      url.append(jobtitle);
     
      String json = sendRequest(url.toString(), null);
      ResponsePojo internal_responsePojo = ResponsePojo.fromApi(json, ResponsePojo.class);
      ResponseObject internal_ro = internal_responsePojo.getResponse();
      response = shallowCopy(response, internal_ro);
    }
    catch (Exception e) {
      response.setSuccess(false);
      response.setMessage(e.getMessage());
View Full Code Here

TOP

Related Classes of com.ikanow.infinit.e.data_model.api.ResponsePojo

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.