/** * Get the schema with the specified name * * @param name * @return */ public String getSchema(String name) { // return schema; SchemasType schemas = indexer.getSchemas(); if (schemas != null) { List<SchemaType> schemaList = schemas.getSchema(); for (SchemaType schema : schemaList) { if (schema.getName().equalsIgnoreCase(name)) { return schema.getAttributes(); } } } return null; }
/** Create an instance of {@link SchemasType } */ public SchemasType createSchemasType() { return new SchemasType(); }
/** * Retrieve basic indexer properties by scanning the indexer XML instance. * * @throws JAXBException */ protected void initIndexer() throws JAXBException { if (indexerFile.exists() && indexerFile.canRead()) { Unmarshaller unmarshaller = CONTEXT.createUnmarshaller(); if (unmarshaller != null) { indexer = (Indexer) unmarshaller.unmarshal(indexerFile); // indexed information about dimensions that supports multiple bands initMultipleBandsDimensionsInfo(indexer); // Parsing schemas final SchemasType schemas = indexer.getSchemas(); Map<String, String> schemaMapping = new HashMap<String, String>(); if (schemas != null) { // Map schema names to schema attributes string List<SchemaType> schemaElements = schemas.getSchema(); for (SchemaType schemaElement : schemaElements) { schemaMapping.put(schemaElement.getName(), schemaElement.getAttributes()); } } // Parsing properties collectors initPropertiesCollectors(); // Parsing coverages initCoverages(schemaMapping); } } }
private static SchemaType getSchemaRef(Indexer indexer, String schemaRef) { Utilities.ensureNonNull("schemaRef", schemaRef); Utilities.ensureNonNull("indexer", indexer); SchemasType schemas = indexer.getSchemas(); if (schemas != null) { List<SchemaType> schemaList = schemas.getSchema(); for (SchemaType schema : schemaList) { final String schemaName = schema.getName(); if (schemaName != null && schemaName.equalsIgnoreCase(schemaRef)) { return schema; } } } return null; }
SchemaType schema = Utils.OBJECT_FACTORY.createSchemaType(); indexer.setSchemas(schemas); schemas.getSchema().add(schema); schema.setAttributes(props.getProperty(Utils.Prop.SCHEMA)); schema.setName(getParameter(Utils.Prop.INDEX_NAME, indexer));
schemaAttributes = schema.getAttributes(); } else if (schemas != null) { List<SchemaType> schemaList = schemas.getSchema();
/** * Retrieve basic indexer properties by scanning the indexer XML instance. * @throws JAXBException */ private void initIndexer() throws JAXBException { if (indexerFile.exists() && indexerFile.canRead()) { Unmarshaller unmarshaller = CONTEXT.createUnmarshaller(); if (unmarshaller != null) { indexer = (Indexer) unmarshaller.unmarshal(indexerFile); // Parsing schemas final SchemasType schemas = indexer.getSchemas(); Map<String, String> schemaMapping = new HashMap<String, String>(); if (schemas != null) { // Map schema names to schema attributes string List<SchemaType> schemaElements = schemas.getSchema(); for (SchemaType schemaElement: schemaElements) { schemaMapping.put(schemaElement.getName(), schemaElement.getAttributes()); } } // Parsing properties collectors initPropertiesCollectors(); // Parsing coverages initCoverages(schemaMapping); } } }
/** * Retrieve basic indexer properties by scanning the indexer XML instance. * * @throws JAXBException */ private void initIndexer() throws JAXBException { if (indexerFile.exists() && indexerFile.canRead()) { Unmarshaller unmarshaller = CONTEXT.createUnmarshaller(); if (unmarshaller != null) { indexer = (Indexer) unmarshaller.unmarshal(indexerFile); // indexed information about dimensions that supports multiple bands initMultipleBandsDimensionsInfo(indexer); // Parsing schemas final SchemasType schemas = indexer.getSchemas(); Map<String, String> schemaMapping = new HashMap<String, String>(); if (schemas != null) { // Map schema names to schema attributes string List<SchemaType> schemaElements = schemas.getSchema(); for (SchemaType schemaElement : schemaElements) { schemaMapping.put(schemaElement.getName(), schemaElement.getAttributes()); } } // Parsing properties collectors initPropertiesCollectors(); // Parsing coverages initCoverages(schemaMapping); } } }