public void execute(JobExecutionContext context) throws JobExecutionException { try { CollectionManager manager = (CollectionManager) context.getJobDetail().getJobDataMap().get(DCM_NAME); org.slf4j.Logger loggerfc = (org.slf4j.Logger) context.getJobDetail().getJobDataMap().get(LOGGER); if (manager == null) { loggerfc.error("Update resetProto failed: no manager object on {}", context); return; } logger.info("ResetProto for {}", manager.getCollectionName()); manager.resetProto(); } catch (Throwable e) { logger.error("ChangeProtoJob.execute failed", e); } } }
public void execute(JobExecutionContext context) throws JobExecutionException { try { CollectionManager manager = (CollectionManager) context.getJobDetail().getJobDataMap().get(DCM_NAME); org.slf4j.Logger loggerfc = (org.slf4j.Logger) context.getJobDetail().getJobDataMap().get(LOGGER); String groupName = context.getTrigger().getKey().getGroup(); if (groupName.equals("nocheck")) { loggerfc.info("UpdateCollection {} nocheck", manager.getCollectionName()); manager.updateNocheck(); // update(CollectionManager.Force.nocheck) } else { loggerfc.debug("UpdateCollection {} scan(true)", manager.getCollectionName()); manager.scan(true); } } catch (Throwable e) { logger.error("UpdateCollectionJob.execute failed", e); } } }
String jobName = manager.getCollectionName(); map.put(LOGGER, org.slf4j.LoggerFactory.getLogger("fc."+manager.getCollectionName())); JobDetail updateJob = JobBuilder.newJob(UpdateCollectionJob.class) .withIdentity(jobName, "UpdateCollection") org.quartz.JobDataMap pmap = new org.quartz.JobDataMap(); pmap.put(DCM_NAME, manager); map.put(LOGGER, org.slf4j.LoggerFactory.getLogger("fc."+manager.getCollectionName())); JobDetail protoJob = JobBuilder.newJob(ChangeProtoJob.class) .withIdentity(jobName, "UpdateProto")
return new FmrcInv("fmrc:"+manager.getCollectionName(), fmrList, config.fmrcConfig.regularize);
static public FeatureDataset factory(String location, FeatureType wantFeatureType, CollectionManager dcm, Formatter errlog) throws IOException { TimedCollection collection = new TimedCollection(dcm, errlog); if (collection.getDatasets().size() == 0) { throw new FileNotFoundException("Collection is empty; spec="+dcm); } if (wantFeatureType == FeatureType.ANY_POINT) { TimedCollection.Dataset d = collection.getPrototype(); FeatureDatasetPoint proto = (FeatureDatasetPoint) FeatureDatasetFactoryManager.open(FeatureType.ANY_POINT, d.getLocation(), null, errlog); wantFeatureType = proto.getFeatureType(); proto.close(); // LOOK - try to use } //LatLonRect bb = null; FeatureCollection fc = null; switch (wantFeatureType) { case POINT: CompositePointCollection pfc = new CompositePointCollection(dcm.getCollectionName(), collection); //bb = pfc.getBoundingBox(); fc = pfc; break; case STATION: CompositeStationCollection sfc = new CompositeStationCollection(dcm.getCollectionName(), collection, null, null); //bb = sfc.getBoundingBox(); fc = sfc; break; default: return null; } return new CompositePointDataset(location, wantFeatureType, fc, collection, null); }