public boolean getParameterAsBoolean(String parameterKey) { ParametersType indexerParams = indexer != null ? indexer.getParameters() : null; String param = IndexerUtils.getParam(indexerParams, parameterKey); return Boolean.valueOf(param); }
/** * Set the attributes of the specified domain, getting values from the value String In case the * value contains a ";" separator, add a different attribute for each element. * * @param domain * @param values */ public static void setAttributes(DomainType domain, String values) { if (values.contains(";")) { String properties[] = values.split(";"); for (String prop : properties) { addAttribute(domain, prop); } } else { addAttribute(domain, values); } }
private static Indexer loadIndexer(File parentFolder) { Indexer defaultIndexer = IndexerUtils.createDefaultIndexer(); Indexer configuredIndexer = IndexerUtils.initializeIndexer(defaultIndexer.getParameters(), parentFolder); return configuredIndexer; }
setParam(parameters, props, Utils.Prop.NAME); coverage.setName(props.getProperty(Utils.Prop.NAME)); setParam(parameters, props, Utils.Prop.TYPENAME); coverage.setName(props.getProperty(Utils.Prop.TYPENAME)); setParam(parameters, props, Utils.Prop.ABSOLUTE_PATH); setParam(parameters, props, Utils.Prop.PATH_TYPE); setParam(parameters, props, Utils.Prop.RECURSIVE); setParam(parameters, props, Utils.Prop.WILDCARD); setParam(parameters, props, Utils.Prop.GRANULE_ACCEPTORS); setParam(parameters, props, Utils.Prop.GEOMETRY_HANDLER); IndexerUtils.setParam(parameters, props, Utils.Prop.COVERAGE_NAME_COLLECTOR_SPI); schemas.getSchema().add(schema); schema.setAttributes(props.getProperty(Utils.Prop.SCHEMA)); schema.setName(getParameter(Utils.Prop.INDEX_NAME, indexer)); addDomain(props, coverage, Utils.Prop.TIME_ATTRIBUTE, Utils.TIME_DOMAIN); addDomain(props, coverage, Utils.Prop.ELEVATION_ATTRIBUTE, Utils.ELEVATION_DOMAIN); addDomain(props, coverage, Utils.Prop.CRS_ATTRIBUTE, Utils.CRS_DOMAIN); addDomain(props, coverage, Utils.Prop.RESOLUTION_ATTRIBUTE, Utils.RESOLUTION_DOMAIN); addDomain(props, coverage, Utils.Prop.RESOLUTION_X_ATTRIBUTE, Utils.RESOLUTION_X_DOMAIN);
if (defaultIndexer != null) { params = defaultIndexer.getParameters(); rootMosaicDir = IndexerUtils.getParam(params, Prop.ROOT_MOSAIC_DIR); Indexer indexer = IndexerUtils.initializeIndexer(params, parent); if (indexer != null) { indexerFile = indexer.getIndexerFile(); IndexerUtils.getParameter(Utils.Prop.AUXILIARY_FILE, indexer); if (auxiliaryFileParam != null) { ancillaryFile = auxiliaryFileParam; IndexerUtils.getParameter(Utils.Prop.AUXILIARY_DATASTORE_FILE, indexer); if (datastoreFileParam != null) { datastoreFile = datastoreFileParam; setReader(hints, false); if (IndexerUtils.getParameterAsBoolean(Utils.Prop.USE_EXISTING_SCHEMA, indexer)) { this.useExistingSchema = true; ancillaryFile, datastoreFile, IndexerUtils.getParam(params, Prop.ROOT_MOSAIC_DIR));
CatalogBuilderConfiguration catalogConfig; Boolean heterogeneousCRS = Boolean.valueOf(IndexerUtils.getParameter(Prop.HETEROGENEOUS_CRS, indexer)); if (mosaicConfiguration == null) { catalogConfig = getRunConfiguration(); String mosaicCrs = IndexerUtils.getParameter(Utils.Prop.MOSAIC_CRS, indexer); if (mosaicCrs != null) { configBuilder.setCrs(CRS.decode(mosaicCrs, true)); String noData = IndexerUtils.getParameter(Prop.NO_DATA, indexer); if (noData != null && !noData.isEmpty()) { try { configBuilder.setName(targetCoverageName); configBuilder.setTimeAttribute( IndexerUtils.getAttribute(targetCoverageName, Utils.TIME_DOMAIN, indexer)); configBuilder.setCrsAttribute( IndexerUtils.getAttribute(targetCoverageName, Prop.CRS_ATTRIBUTE, indexer)); configBuilder.setElevationAttribute( IndexerUtils.getAttribute(targetCoverageName, Utils.ELEVATION_DOMAIN, indexer)); configBuilder.setAdditionalDomainAttributes( IndexerUtils.getAttribute( targetCoverageName, Utils.ADDITIONAL_DOMAIN, indexer)); new CatalogConfigurationBean(); catalogConfigurationBean.setCaching( IndexerUtils.getParameterAsBoolean(Prop.CACHING, indexer)); catalogConfigurationBean.setAbsolutePath(
public static Indexer initializeIndexer(ParametersType params, File parent) { File indexerFile = new File(parent, INDEXER_XML); Indexer indexer = null; if (Utils.checkFileReadable(indexerFile)) { try { indexer = Utils.unmarshal(indexerFile); if (indexer != null) { copyDefaultParams(params, indexer); } } catch (JAXBException e) { LOGGER.log(Level.WARNING, e.getMessage(), e); } } else { // Backward compatible with old indexing indexerFile = new File(parent, INDEXER_PROPERTIES); if (Utils.checkFileReadable(indexerFile)) { // load it and parse it final Properties props = CoverageUtilities.loadPropertiesFromURL(URLs.fileToUrl(indexerFile)); indexer = createIndexer(props, params); } } if (indexer != null) { indexer.setIndexerFile(indexerFile); } return indexer; }
for (DomainType domain : domainList) { DomainType currentDomain = getDomain(domain, refDomains); String currentDomainName = currentDomain.getName(); if (currentDomainName != null && currentDomainName.equalsIgnoreCase( domainName)) { return getAttributesAsString(currentDomain, false); for (DomainType domain : domainList) { DomainType currentDomain = getDomain(domain, refDomains); String domName = currentDomain.getName(); if (!domName.equalsIgnoreCase(Utils.TIME_DOMAIN) Utils.ELEVATION_DOMAIN)) { additionalDomainAttributes.append( getAttributesAsString(currentDomain, true)); additionalDomainAttributes.append(",");
if (indexer != null) { SchemasType schemas = indexer.getSchemas(); Coverage coverage = IndexerUtils.getCoverage(indexer, name); if (coverage != null) { schema = IndexerUtils.getSchema(indexer, coverage);
private void initDefaultsParam() { this.indexer = IndexerUtils.createDefaultIndexer(); }
/** * Return the parameter string value of the specified parameter name from the provided indexer * * @param parameterName * @param indexer * @return */ public static String getParameter(String parameterName, Indexer indexer) { final ParametersType params = indexer.getParameters(); return getParam(params, parameterName); }
public String getParameter(String parameterKey) { ParametersType indexerParams = indexer != null ? indexer.getParameters() : null; return IndexerUtils.getParam(indexerParams, parameterKey); }
public boolean getParameterAsBoolean(String parameterKey) { ParametersType indexerParams = indexer != null ? indexer.getParameters() : null; String param = IndexerUtils.getParam(indexerParams, parameterKey); return Boolean.valueOf(param); }
public String getParameter(String parameterKey) { ParametersType indexerParams = indexer != null ? indexer.getParameters() : null; return IndexerUtils.getParam(indexerParams, parameterKey); }