Examples of CRConfigUtil


Examples of com.gentics.cr.CRConfigUtil

   * Creates instance of TagTransformer.
   * @param config configuration for the TagTransformer
   */
  public TagTransformer(final GenericConfiguration config) {
    super(config);
    CRConfigUtil crConfigUtil;
    if (config instanceof CRConfigUtil) {
      crConfigUtil = (CRConfigUtil) config;
    } else {
      crConfigUtil = new CRConfigUtil(config, "DynamicTagTransformerConfig");
    }
    crConfig = crConfigUtil;
    configName = crConfigUtil.getName();
    targetAttribute = config.getString(TARGETATTRIBUTE_KEY);
    tagNames = config.getMultipleString(TAGS_KEY, ",", new Vector<String>());
    addAttributesIfEmpty = initAttributeDefintion(ADDATTRIBUTESIFEMPTY_KEY);
    replaceAttributes = initAttributeDefintion(REPLACEATTRIBUTES_KEY);

View Full Code Here

Examples of com.gentics.cr.CRConfigUtil

    this.conf = config;
    String cxname = this.conf.getString(INDEXER_CONFIG_FILE_KEY);
    if (cxname == null) {
      cxname = "indexer";
    }
    CRConfigUtil idxConfig = new CRConfigFileLoader(cxname, null);

    String csname = this.conf.getString(SEARCH_CONFIG_FILE_KEY);
    if (csname == null) {
      csname = "searcher";
    }
    CRConfigUtil srcConfig = new CRConfigFileLoader(csname, null);

    idx = new IndexController(idxConfig);
    try {
      rp = srcConfig.getNewRequestProcessorInstance(1);
    } catch (CRException e) {
      log.error("Could not initialize searcher request processor." + "Check your searcher config.", e);
    }
  }
View Full Code Here

Examples of com.gentics.cr.CRConfigUtil

   * indexIntervals.
   */
  private void initIndexIntervals() {
    ConcurrentHashMap<String, CRConfigUtil> indexParts = getCRMap();
    for (String indexPartName : indexParts.keySet()) {
      CRConfigUtil indexPartConfig = indexParts.get(indexPartName);
      int interval = indexPartConfig.getInteger(PERIODICAL_INTERVAL_KEY, -1);
      if (interval != -1) {
        if (indexIntervals == null) {
          indexIntervals = new HashMap<String, Integer>();
        }
        indexIntervals.put(indexPartName, new Integer(interval));
View Full Code Here

Examples of com.gentics.cr.CRConfigUtil

      if (indexesObject != null && indexesObject instanceof GenericConfiguration) {
        GenericConfiguration indexes = (GenericConfiguration) config.get(CRConfig.CR_KEY);
        for (Entry<String, GenericConfiguration> subConfigEntry : indexes.getSubConfigs().entrySet()) {
          String subConfigKey = subConfigEntry.getKey();
          GenericConfiguration subConfig = subConfigEntry.getValue();
          Class<? extends AbstractUpdateCheckerJob> subConfigClass = getUpdateJobImplementationClass(new CRConfigUtil(
              subConfig, config.getName() + "." + subConfigKey));
          try {
            String nextIndexLocationClassName = subConfigClass.getField("INDEXLOCATIONCLASS")
                .get(subConfigClass).toString();
            if (indexLocationClassName == null) {
View Full Code Here

Examples of com.gentics.cr.CRConfigUtil

  public final void createAllCRIndexJobs() {
    //use ConcurrentSkipListMap for alphabetical ordered IndexJob Creation
    ConcurrentSkipListMap<String, CRConfigUtil> configs = new ConcurrentSkipListMap<String, CRConfigUtil>(getCRMap());
    for (Entry<String, CRConfigUtil> e : configs.entrySet()) {

      CRConfigUtil indexJobConfiguration = e.getValue();
      String partName = indexJobConfiguration.getName();
      AbstractUpdateCheckerJob currentJob = queue.getCurrentJob();
      int partInterval = getInterval(partName);
      boolean createJob = true;
      if (currentJob != null && currentJob.identifyer.equals(partName)) {
        log.debug("skipping creation of " + partName + " because its already running.");
        createJob = false;
      } else if (partInterval != -1) {
        long now = new Date().getTime();
        if (indexJobCreationTimes.containsKey(partName)) {
          long lastRun = indexJobCreationTimes.get(partName).getTime();
          long intervalMilliseconds = (partInterval * Constants.MILLISECONDS_IN_A_SECOND);
          if (now - lastRun < intervalMilliseconds) {
            createJob = false;
          }
        }
      }
      if (createJob) {
        createCRIndexJob(new CRConfigUtil(indexJobConfiguration, partName), new ConcurrentHashMap<String, CRConfigUtil>(configs));
      }

    }

  }
View Full Code Here

Examples of com.gentics.cr.CRConfigUtil

    if (crConfigs != null) {
      ConcurrentHashMap<String, GenericConfiguration> configs = crConfigs.getSubConfigs();

      for (Entry<String, GenericConfiguration> e : configs.entrySet()) {
        try {
          map.put(config.getName() + "." + e.getKey(), new CRConfigUtil(e.getValue(), config.getName() + "."
              + e.getKey()));
        } catch (Exception ex) {
          String name = "<no config name>";
          String key = "<no key>";
          CRException cex = new CRException(ex);
View Full Code Here

Examples of com.gentics.cr.CRConfigUtil

      ConcurrentHashMap<String, GenericConfiguration> configs = extensionConfiguration.getSubConfigs();

      for (Entry<String, GenericConfiguration> e : configs.entrySet()) {
        String indexExtensionName = e.getKey();
        IndexExtension instance = null;
        CRConfig extensionConfig = new CRConfigUtil(e.getValue(), INDEX_EXTENSIONS_KEY + "."
            + indexExtensionName);
        try {
          Class<?> extensionClassGeneric = Class
              .forName(extensionConfig.getString(INDEX_EXTENSION_CLASS_KEY));
          Class<? extends IndexExtension> extensionClass = extensionClassGeneric
              .asSubclass(IndexExtension.class);
          Constructor<? extends IndexExtension> extensionConstructor = extensionClass
              .getDeclaredConstructor(new Class[] { CRConfig.class, IndexLocation.class });
          instance = extensionConstructor.newInstance(new Object[] { extensionConfig, this });
View Full Code Here

Examples of com.gentics.cr.CRConfigUtil

    if (indexConfiguration != null) {
      ConcurrentHashMap<String, GenericConfiguration> configs = indexConfiguration.getSubConfigs();

      for (Entry<String, GenericConfiguration> e : configs.entrySet()) {
        String indexLocationName = e.getKey();
        IndexLocation indexLocation = IndexLocation.getIndexLocation(new CRConfigUtil(e.getValue(), INDEX_KEY
            + "." + indexLocationName));
        if (indexLocation == null) {
          LOGGER.error("Cannot get index location for " + indexLocationName);
        } else {
          indexes.put(indexLocationName, indexLocation);
View Full Code Here

Examples of com.gentics.cr.CRConfigUtil

    tmp.delete();
  }
 
  public void testFSDirectoryWithLockFactory() throws IOException {
   
    CRConfig config = new CRConfigUtil();
    config.set("lockFactoryClass", "org.apache.lucene.store.SimpleFSLockFactory");
   
    File tmp = CRUtil.createTempDir();

    Directory fs = LuceneDirectoryFactory.getDirectory(tmp.getAbsolutePath(), config);
View Full Code Here

Examples of com.gentics.cr.CRConfigUtil

    GenericConfiguration sc = new GenericConfiguration();
    sc.set("indexLocations.1.path", "RAM_1");
    sc.set("indexLocationClass", "com.gentics.cr.lucene.indexer.index.LuceneSingleIndexLocation");

    singleConfig1 = new CRConfigUtil(sc, "sc1");

    GenericConfiguration sc2 = new GenericConfiguration();
    sc2.set("indexLocations.2.path", "RAM_1");
    sc2.set("indexLocationClass", "com.gentics.cr.lucene.indexer.index.LuceneSingleIndexLocation");

    singleConfig2 = new CRConfigUtil(sc2, "sc2");

    GenericConfiguration sc3 = new GenericConfiguration();
    sc3.set("indexLocations.3.path", "RAM_3");
    sc3.set("indexLocationClass", "com.gentics.cr.lucene.indexer.index.LuceneSingleIndexLocation");

    singleConfig3 = new CRConfigUtil(sc3, "sc3");
  }
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.