public String getParameter(String parameterName) { return IndexerUtils.getParameter(parameterName, indexer); }
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;
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 { IndexerUtils.getParameter(Prop.LOCATION_ATTRIBUTE, indexer)); catalogConfigurationBean.setWrapStore( IndexerUtils.getParameterAsBoolean(Prop.WRAP_STORE, indexer)); String configuredTypeName = IndexerUtils.getParameter(Prop.TYPENAME, indexer); if (configuredTypeName != null) { catalogConfigurationBean.setTypeName(configuredTypeName);
/** * Return the parameter value (as a boolean) of the specified parameter name from the provider * indexer * * @param parameterName * @param indexer * @return */ public static boolean getParameterAsBoolean(String parameterName, Indexer indexer) { String value = getParameter(parameterName, indexer); if (value != null) { return Boolean.parseBoolean(value); } return false; }
/** * Return the parameter value (as a boolean) of the specified parameter name from the provider * indexer * * @param parameterName * @param indexer * @return */ public static <T extends Enum> T getParameterAsEnum( String parameterName, Class<T> enumClass, Indexer indexer) { String value = getParameter(parameterName, indexer); if (value != null) { return (T) Enum.valueOf(enumClass, value); } return null; }
private void initializeCoverageNameHandler(Indexer indexer) { // we initialized at construction time with the default handler // ok, do we need/want something different? if (indexer != null) { String coverageNameCollectorString = IndexerUtils.getParameter(Prop.COVERAGE_NAME_COLLECTOR_SPI, indexer); if (coverageNameCollectorString != null && coverageNameCollectorString.length() > 0) { // Override default handling machinery coverageNameHandler = new CoverageNameHandler(coverageNameCollectorString); } } }
/** * Return the parameter string value of the specified parameter name from the indexer defined in * the specified file (if exists). * * @param parameterName * @param indexerFile * @return */ public static String getParameter(String parameterName, File indexerFile) { if (indexerFile != null && indexerFile.exists()) { try { Indexer indexerInstance = Utils.unmarshal(indexerFile); if (indexerInstance != null) { String value = IndexerUtils.getParameter(parameterName, indexerInstance); if (value != null) { return value; } } } catch (JAXBException e) { throw new RuntimeException(e); } } return null; }
private void initializeGranuleHandler(Indexer indexer) { // we initialized at construction time with the default handler // ok, do we need/want something different? if (indexer != null) { String granuleHandlerString = IndexerUtils.getParameter(Prop.GEOMETRY_HANDLER, indexer); if (granuleHandlerString != null && granuleHandlerString.length() > 0) { GranuleHandlerFactorySPI factory = GranuleHandlerFactoryFinder.getGranuleHandlersSPI() .get(granuleHandlerString); if (factory != null) { granuleHandler = factory.create(); } } } }
public static String getIndexerProperty(String locationPath, String propertyName) { if (locationPath == null) { return null; } File file = new File(locationPath); if (file.isDirectory()) { File indexer = new File(file, IndexerUtils.INDEXER_PROPERTIES); if (indexer.exists()) { URL indexerUrl = URLs.fileToUrl(indexer); Properties config = CoverageUtilities.loadPropertiesFromURL(indexerUrl); if (config != null && config.get(Utils.Prop.NAME) != null) { return (String) config.get(propertyName); } } indexer = new File(file, IndexerUtils.INDEXER_XML); String name = IndexerUtils.getParameter(Utils.Prop.NAME, indexer); if (name != null) { return name; } } return null; }
/** * Initialize the list of granule collectors from the indexer. * * @param indexer the indexer configuration */ private void initializeGranuleAcceptors(Indexer indexer) { // initialized granuleAcceptors with empty list // do we wnat/need something different if (indexer != null) { String granuleAcceptorsString = IndexerUtils.getParameter(Prop.GRANULE_ACCEPTORS, indexer); if (granuleAcceptorsString != null && granuleAcceptorsString.length() > 0) { // parsing indicated granule acceptors Map<String, GranuleAcceptorFactorySPI> granuleAcceptorsMap = GranuleAcceptorFactorySPIFinder.getGranuleAcceptorFactorySPI(); Arrays.stream(granuleAcceptorsString.split(",")) .forEach( (factoryImpl) -> { if (granuleAcceptorsMap.containsKey(factoryImpl)) { granuleAcceptors.addAll( granuleAcceptorsMap.get(factoryImpl).create()); } }); } } // if we didn't find any granule acceptors in the index configuration, use the default if (granuleAcceptors.isEmpty()) { granuleAcceptors.addAll(new DefaultGranuleAcceptorFactory().create()); } }
String canBeEmpty = IndexerUtils.getParameter(Prop.CAN_BE_EMPTY, indexFile); if (canBeEmpty != null) { if (Boolean.parseBoolean(canBeEmpty)) {
final File configFile = new File( getParameter(Utils.Prop.ROOT_MOSAIC_DIR, indexer), config + ".properties");
retValue.setIndexer(indexer); String granuleCollectorFactorySPI = IndexerUtils.getParameter(Prop.GRANULE_COLLECTOR_FACTORY, indexer); if (granuleCollectorFactorySPI == null || granuleCollectorFactorySPI.length() <= 0) { boolean isHeterogeneousCRS = Boolean.parseBoolean( IndexerUtils.getParameter(Prop.HETEROGENEOUS_CRS, indexer)); if (isHeterogeneousCRS) {
Boolean.valueOf(IndexerUtils.getParameter(Prop.HETEROGENEOUS_CRS, indexer)); if (collectors == null) { if (LOGGER.isLoggable(Level.FINE)) {
/** * Setup default params to the indexer. * * @param params * @param indexer */ private static void copyDefaultParams(ParametersType params, Indexer indexer) { if (params != null) { List<Parameter> defaultParamList = params.getParameter(); if (defaultParamList != null && !defaultParamList.isEmpty()) { ParametersType parameters = indexer.getParameters(); if (parameters == null) { parameters = Utils.OBJECT_FACTORY.createParametersType(); indexer.setParameters(parameters); } List<Parameter> parameterList = parameters.getParameter(); for (Parameter defaultParameter : defaultParamList) { final String defaultParameterName = defaultParameter.getName(); if (getParameter(defaultParameterName, indexer) == null) { setParam(parameterList, defaultParameterName, defaultParameter.getValue()); } } } } }
schemas.getSchema().add(schema); schema.setAttributes(props.getProperty(Utils.Prop.SCHEMA)); schema.setName(getParameter(Utils.Prop.INDEX_NAME, indexer));
IndexerUtils.getParameter(Utils.Prop.GRANULE_COLLECTOR_FACTORY, indexer); if (submosaickerFactory != null) { SubmosaicProducerFactory submosaicProducerFactory =