Package com.esri.gpt.server.assertion

Examples of com.esri.gpt.server.assertion.AsnConfig


   */
  public void handle(AsnContext context) throws Exception {
       
    // initialize
    context.getAuthorizer().authorizeQuery(context);
    AsnConfig config = context.getAssertionFactory().getConfiguration();
    PrintWriter writer = null;
    context.getOperationResponse().setOutputFormat("text/plain");
    try {
      String msg;
      StringWriter sw = new StringWriter();
      writer = new PrintWriter(sw);
     
      // header
      writer.println("Assertion Operations");
      writer.println("  enabled="+config.getAreAssertionsEnabled());
      writer.println();
      writer.flush();
     
      // request patterns
      writer.println("Service Request Patterns");
      msg = "[contextPath]/assertion/operations";
      writer.println("  "+msg);
      msg = "[contextPath]/assertion?s=[subject]&p=[predicate]&v=[value]&f=[format]";
      msg += "&start=[start]&max=[max]";
      writer.println("  "+msg);
      writer.println();
      writer.flush();
     
      // request parameters
      writer.println("Service Request Parameters");
      msg = "  s=[subject]   - always required";
      writer.println(msg);
      msg = "  p=[predicate] - always required";
      writer.println(msg);
      msg = "  v=[value]     - only required for operations that have a defined valueType,";
      writer.println(msg);
      msg = "                  a value can be posted in the HTTP request body";
      writer.println(msg);
      msg = "  f=[format]    - response format (optional, xml|json|pjson)";
      writer.println(msg);
      msg = "  start=[start] - starting record";
      msg += " (optional, for queries that return multiple records)";
      writer.println(msg);     
      msg = "  max=[max]     - max records to return";
      msg += " (optional, for queries that return multiple records)";
      writer.println(msg);
      writer.println();
      writer.flush();
     
      // list all operations
      for (AsnOperation op: config.getOperations().values()) {
        String subject = op.getSubject().getURNPrefix();
        if (op.getSubject().getRequiresValuePart()) {
          subject = subject+":[identifier]";
        }
        String predicate = op.getPredicate().getURN();
View Full Code Here


      }
    }
 
    // optimize the assertion indexes
    AsnFactory asnFactory = AsnFactory.newFactory(null);
    AsnConfig asnConfig = asnFactory.getConfiguration();
    if (asnConfig.getAreAssertionsEnabled()) {
      AsnIndexReferences asnIndexRefs = asnConfig.getIndexReferences();
      if (asnIndexRefs != null) {
        for (AsnIndexReference asnIndexRef: asnIndexRefs.values()) {
          if ((asnIndexRef != null) && asnIndexRef.getEnabled()) {
            String asnLoc = asnIndexRef.getIndexLocation();
            LOGGER.fine("Optimizing assertion index: "+asnLoc);
View Full Code Here

TOP

Related Classes of com.esri.gpt.server.assertion.AsnConfig

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.