@Override public void execute() { List<AbstractSamplingFeature> samplingFeatures = new ArrayList<AbstractSamplingFeature>(); for (AbstractFeature abstractFeature : request.getFeatureMembers()) { if (abstractFeature instanceof AbstractSamplingFeature) { samplingFeatures.add((AbstractSamplingFeature)abstractFeature); } getCache().addFeatureOfInterest(abstractFeature.getIdentifier()); getCache().addPublishedFeatureOfInterest(abstractFeature.getIdentifier()); if (abstractFeature.isSetName()) { getCache().addFeatureOfInterestIdentifierHumanReadableName(abstractFeature.getIdentifier(), abstractFeature.getFirstName().getValue()); } } if (!samplingFeatures.isEmpty()) { final Envelope envelope = createEnvelopeFrom(samplingFeatures); getCache().updateGlobalEnvelope(envelope); } }
@Override public void execute() { List<AbstractSamplingFeature> samplingFeatures = new ArrayList<AbstractSamplingFeature>(); for (AbstractFeature abstractFeature : request.getFeatureMembers()) { if (abstractFeature instanceof AbstractSamplingFeature) { samplingFeatures.add((AbstractSamplingFeature)abstractFeature); } getCache().addFeatureOfInterest(abstractFeature.getIdentifier()); getCache().addPublishedFeatureOfInterest(abstractFeature.getIdentifier()); if (abstractFeature.isSetName()) { getCache().addFeatureOfInterestIdentifierHumanReadableName(abstractFeature.getIdentifier(), abstractFeature.getFirstName().getValue()); } } if (!samplingFeatures.isEmpty()) { final Envelope envelope = createEnvelopeFrom(samplingFeatures); getCache().updateGlobalEnvelope(envelope); } }
@Override public void execute() { LOGGER.debug("Executing FeatureOfInterestCacheUpdate"); startStopwatch(); try { Collection<FeatureEntity> features = new FeatureDao(getSession()).get(new DbQuery(IoParameters.createDefaults())); for (FeatureEntity featureEntity : features) { String identifier = featureEntity.getIdentifier(); getCache().addFeatureOfInterest(identifier); Collection<DatasetEntity> datasets = new DatasetDao<>(getSession()).get(createDatasetDbQuery(featureEntity)); if (datasets != null && !datasets.isEmpty()) { if (datasets.stream().anyMatch(d -> d.isPublished() || d instanceof NotInitializedDataset)) { getCache().addPublishedFeatureOfInterest(identifier); } getCache().setProceduresForFeatureOfInterest(identifier, getProcedures(datasets)); } if (featureEntity.isSetName()) { getCache().addFeatureOfInterestIdentifierHumanReadableName(identifier, featureEntity.getName()); } if (featureEntity.hasParents()) { getCache().addParentFeatures(identifier, getParents(featureEntity)); } } } catch (HibernateException he) { getErrors().add(new NoApplicableCodeException().causedBy(he).withMessage("Error while updating featureOfInterest cache!")); } LOGGER.debug("Finished executing FeatureOfInterestCacheUpdate ({})", getStopwatchResult()); }
cache.addFeatureOfInterestIdentifierHumanReadableName(featureOfInterest.getIdentifier(), featureOfInterest.getFirstName().getValue()); cache.addPublishedFeatureOfInterest(featureOfInterest.getIdentifier()); cache.addFeatureOfInterestIdentifierHumanReadableName(featureOfInterest.getIdentifier(), featureOfInterest.getFirstName().getValue()); cache.addPublishedFeatureOfInterest(featureOfInterest.getIdentifier()); cache.addFeatureOfInterest(featureOfInterest.getIdentifier());
cache.addFeatureOfInterestIdentifierHumanReadableName(featureOfInterest.getIdentifier(), featureOfInterest.getFirstName().getValue()); cache.addPublishedFeatureOfInterest(featureOfInterest.getIdentifier()); cache.addFeatureOfInterestIdentifierHumanReadableName(featureOfInterest.getIdentifier(), featureOfInterest.getFirstName().getValue()); cache.addPublishedFeatureOfInterest(featureOfInterest.getIdentifier()); cache.addFeatureOfInterest(featureOfInterest.getIdentifier());
getCache().setProceduresForFeatureOfInterest(feature.getIdentifier(), Sets.newHashSet(procedure)); if (feature.isSetName()) { getCache().addFeatureOfInterestIdentifierHumanReadableName(feature.getIdentifier(), feature.getFirstName().getValue());
getCache().setProceduresForFeatureOfInterest(feature.getIdentifier(), Sets.newHashSet(procedure)); if (feature.isSetName()) { getCache().addFeatureOfInterestIdentifierHumanReadableName(feature.getIdentifier(), feature.getFirstName().getValue());