Examples of RestQuery


Examples of com.esri.gpt.catalog.discovery.rest.RestQuery

   * Processes request.
   * @throws IOException if error processing request
   */
  private void process() throws IOException {
    LOGGER.info("Starting DCAT cache update process...");
    RestQuery query = new RestQuery();
    query.setResponseFormat("dcat");
    RequestContext context = RequestContext.extract(null);
    MessageBroker msgBroker = new MessageBroker();
    msgBroker.setBundleBaseName(MessageBroker.DEFAULT_BUNDLE_BASE_NAME);
   
    String baseContextPath = Val.chkStr(RequestContext.resolveBaseContextPath(null));
    if (baseContextPath.isEmpty()) {
      StringAttributeMap params = ApplicationContext.getInstance().getConfiguration().getCatalogConfiguration().getParameters();
      baseContextPath = Val.chkStr(params.getValue("reverseProxy.baseContextPath"));;
    }
   
    FeedLinkBuilder linkBuilder = new FeedLinkBuilder(context, baseContextPath, msgBroker);
   
    DcatCache cache = DcatCache.getInstance();
    OutputStream cacheStream = null;
    PrintWriter writer = null;
   
    try {
      cacheStream = cache.createOutputCacheStream();
      writer = new PrintWriter(new OutputStreamWriter(cacheStream, "UTF-8"));
     
      DcatJsonFeedWriter feedWriter = new DcatJsonFeedWriter(context, writer, query);
      feedWriter.setMessageBroker(msgBroker);
     
      query.setReturnables(new CoreQueryables(context).getFull());
     
      DcatJsonSearchEngine.DcatRecordsAdapter discoveredRecordsAdapter = new DcatJsonSearchEngine.DcatRecordsAdapter(msgBroker, linkBuilder, context, query);
     
      feedWriter.write(discoveredRecordsAdapter);
    } finally {
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.