Package com.esri.gpt.server.assertion.index

Examples of com.esri.gpt.server.assertion.index.AsnIndexReference


    this.operations.add(op);
   
    // root index reference
    String val = Val.chkStr(catParams.getValue("assertion.index.allowNonLocalResourceIds"));
    this.allowNonLocalResourceIds = val.equalsIgnoreCase("true");
    AsnIndexReference rootIndexRef = new AsnIndexReference();
    val = Val.chkStr(catParams.getValue("assertion.index.enabled"));
    rootIndexRef.setEnabled(!val.equalsIgnoreCase("false"));
    val = Val.chkStr(catParams.getValue("assertion.index.location"));
    rootIndexRef.setIndexLocation(val);
    rootIndexRef.setUseNativeFSLockFactory(luceneCfg.getUseNativeFSLockFactory());
    rootIndexRef.setWriteLockTimeout(luceneCfg.getWriteLockTimeout());
    if (!rootIndexRef.getEnabled()) {
      LOGGER.config("assertion.index.enabled=false");
      return;
    } else if (rootIndexRef.getIndexLocation().length() == 0) {
      String msg = "The configured assertion.index.location parameter is invalid.";
      msg += " Assertions will be disabled.";
      LOGGER.warning(msg);
      return;
    }
    this.areAssertionsEnabled = true;
    // ratings
    AsnIndexReference ratingIndexRef = this.makeIndexRef(catCfg,rootIndexRef,"rating");
    if (ratingIndexRef.getEnabled()) {
      indexRefs.add(ratingIndexRef);
      this.configureRatings(catCfg,ratingIndexRef,ratingIndexRef.getName());
    }
   
    // comments
    AsnIndexReference commentIndexRef = this.makeIndexRef(catCfg,rootIndexRef,"comment");
    if (commentIndexRef.getEnabled()) {
      indexRefs.add(commentIndexRef);
      this.configureComments(catCfg,commentIndexRef,commentIndexRef.getName());
    }

  }
View Full Code Here


   */
  private AsnIndexReference makeIndexRef(CatalogConfiguration catCfg,
                                         AsnIndexReference rootIndexRef,
                                         String name) {
    StringAttributeMap catParams = catCfg.getParameters();
    AsnIndexReference indexRef = new AsnIndexReference();
    String indexAdapterClass = "com.esri.gpt.server.assertion.index.AsnIndexAdapter";
    String val = Val.chkStr(catParams.getValue("assertion."+name+".enabled"));
    indexRef.setEnabled(!val.equalsIgnoreCase("false"));
    if (!indexRef.getEnabled()) {
      LOGGER.config("assertion."+name+".enabled=false");
    } else {
      val = Val.chkStr(catParams.getValue("assertion."+name+".location"));
      indexRef.setIndexLocation(rootIndexRef,name,val);
      indexRef.setIndexAdatperClass(indexAdapterClass);
      indexRef.setUseNativeFSLockFactory(rootIndexRef.getUseNativeFSLockFactory());
      indexRef.setWriteLockTimeout(rootIndexRef.getWriteLockTimeout());
      try {
        indexRef.makeIndexAdapter(null).touch();
        //this.indexReferences.add(indexRef);
      } catch (Exception e) {
        indexRef.setEnabled(false);
        String msg = "Problem accessing assertion."+name+".location="+indexRef.getIndexLocation();
        msg += " Assertions will be disabled.";
        LOGGER.log(Level.SEVERE,msg,e);
      }
    }
    return indexRef;
View Full Code Here

TOP

Related Classes of com.esri.gpt.server.assertion.index.AsnIndexReference

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.