Examples of toApi()


Examples of com.ikanow.infinit.e.application.data_model.DashboardProxyResultPojo.toApi()

      deleteResult._id = command;
      for (SharePojo result: results) {
        if (command.equals(result.getTitle())) {
          _driver.removeShare(result.get_id().toString(), responseObj);
          deleteResult.found = responseObj.isSuccess();
          return new StringRepresentation(deleteResult.toApi(), MediaType.APPLICATION_JSON);
        }
      }//TESTED (7)
      deleteResult.found = false;
      return new StringRepresentation(deleteResult.toApi(), MediaType.APPLICATION_JSON);
    }//TESTED (7)
View Full Code Here

Examples of com.ikanow.infinit.e.application.data_model.DashboardProxyResultPojo.toApi()

          deleteResult.found = responseObj.isSuccess();
          return new StringRepresentation(deleteResult.toApi(), MediaType.APPLICATION_JSON);
        }
      }//TESTED (7)
      deleteResult.found = false;
      return new StringRepresentation(deleteResult.toApi(), MediaType.APPLICATION_JSON);
    }//TESTED (7)
    else if (command.equalsIgnoreCase("_search")) { // Search
     
      //Filter: (really need to start indexing)
     
View Full Code Here

Examples of com.ikanow.infinit.e.application.data_model.DashboardProxyResultPojo.toApi()

        if (command.equals(result.getTitle())) {
          getResult.found = true;
          getResult._source = new DashboardPojo("guest", "guest");
          getResult._source.title = command;
          getResult._source.dashboard = result.getShare();
          return new StringRepresentation(getResult.toApi(), MediaType.APPLICATION_JSON);
        }
      }   
      getResult.found = false;
      return new StringRepresentation(getResult.toApi(), MediaType.APPLICATION_JSON);
    }//TESTED (6)
View Full Code Here

Examples of com.ikanow.infinit.e.application.data_model.DashboardProxyResultPojo.toApi()

          getResult._source.dashboard = result.getShare();
          return new StringRepresentation(getResult.toApi(), MediaType.APPLICATION_JSON);
        }
      }   
      getResult.found = false;
      return new StringRepresentation(getResult.toApi(), MediaType.APPLICATION_JSON);
    }//TESTED (6)
    else { // We're overwriting the existing share with a new JSON file...
      DashboardProxyResultPojo putResult = new DashboardProxyResultPojo();
      putResult._id = command;
View Full Code Here

Examples of com.ikanow.infinit.e.application.data_model.DashboardProxyResultPojo.toApi()

        }//TESTED (5)
        // Update content:
        _driver.updateShareJSON(shareToUpdate.get_id().toString(), shareToUpdate.getTitle(), shareToUpdate.getDescription(),
                      shareToUpdate.getType(), dash.dashboard, responseObj);
      }//TESTED (4,5)
      return new StringRepresentation(putResult.toApi(), MediaType.APPLICATION_JSON);
    }
  }//TESTED (See below)
 
  //TEST URLs for handleDashboardSharing():
  // 1] POST http://localhost:8185/proxy/kibana-int/dashboard/_search (just check still goes via old tested path)
View Full Code Here

Examples of com.ikanow.infinit.e.application.data_model.DashboardProxySearchResultPojo.toApi()

          reply.hits.hits.add(hitEl);
          hits++;
        }
      }//TESTED (2, 3)
      reply.hits.total = hits;
      return new StringRepresentation(reply.toApi(), MediaType.APPLICATION_JSON);     
    }//TESTED (2, 3)
    else if (null == _postData) { // GET
      DashboardProxyResultPojo getResult = new DashboardProxyResultPojo();
      getResult._id = command;
      for (SharePojo result: results) {
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.api.ResponsePojo.toApi()

     if (!rp.getResponse().isSuccess()) {
       if (rp.getResponse().getMessage().contains("ermission")) { // likely to be a permissions error
         RESTTools.logRequest(this);
       }
     }//TOTEST (TODO-2194)
     return new StringRepresentation(rp.toApi(), MediaType.APPLICATION_JSON);
  }   
}
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.api.ResponsePojo.toApi()

        }
       
        if (null == rp) { // Error handling including RSS
          rp = new ResponsePojo();
          rp.setResponse(new ResponseObject("Query Format", false, errorString.toString()));         
          data = rp.toApi();
        }       
        else { // Valid response, output handle all output formats

          // Output type
          // JSON
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.api.ResponsePojo.toApi()

          // Output type
          // JSON
          //if (null != _requestDetails.output || _requestDetails.output.format.equalsIgnoreCase("json")) {
          // Modified based on logic (never able to get to xml or rss based on above logic)
          if (null == _requestDetails.output.format || _requestDetails.output.format.equalsIgnoreCase("json")) {
            data = rp.toApi();
          }
          else if (_requestDetails.output.format.equalsIgnoreCase("xml")) { // XML
            mediaType = MediaType.APPLICATION_XML;
            // Output type
            // Xml
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.api.ResponsePojo.toApi()

            data = rss.getDocs(rp);             
          }
          else { // Not pleasant after all this just to return an error :(
            rp = new ResponsePojo();
            rp.setResponse(new ResponseObject("Output Format", false, "Unsupported output.format"));           
            data = rp.toApi();
          }
        }
      }//TESTED
    }
    catch (Exception e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.