use of org.polymap.core.data.feature.GetFeatureTypeResponse in project polymap4-core by Polymap4.
the class FeatureRenameProcessor method featureTypeResponse.
@Produces(GetFeatureTypeResponse.class)
public void featureTypeResponse(GetFeatureTypeResponse response, ProcessorContext context) throws Exception {
assert this.srcSchema == null;
this.srcSchema = response.getFeatureType();
SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder();
builder.init((SimpleFeatureType) srcSchema);
builder.setName(name);
schema = builder.buildFeatureType();
context.sendResponse(new GetFeatureTypeResponse(schema));
}
use of org.polymap.core.data.feature.GetFeatureTypeResponse in project polymap4-core by Polymap4.
the class PipelineFeatureSource method buildFeatureType.
@Override
protected SimpleFeatureType buildFeatureType() throws IOException {
// FIXME caching schema is not allowed since the pipeline and/or processors
// may change; maybe we could add a listener API to the pipeline
// avoid synchronize; doing this in parallel is ok
GetFeatureTypeRequest request = new GetFeatureTypeRequest();
try {
final FeatureType[] type = new FeatureType[1];
newExecutor().execute(pipeline, request, (ProcessorResponse r) -> {
GetFeatureTypeResponse response = (GetFeatureTypeResponse) r;
type[0] = response.getFeatureType();
});
return (SimpleFeatureType) type[0];
} catch (Exception e) {
Throwables.propagateIfInstanceOf(e, IOException.class);
throw Throwables.propagate(e);
}
}
use of org.polymap.core.data.feature.GetFeatureTypeResponse in project polymap4-core by Polymap4.
the class FeatureRenameProcessor method featureTypeRequest.
@Produces(GetFeatureTypeRequest.class)
public void featureTypeRequest(GetFeatureTypeRequest request, ProcessorContext context) throws Exception {
// and init target schema on response
if (schema == null) {
context.sendRequest(request);
} else {
context.sendResponse(new GetFeatureTypeResponse(schema));
context.sendResponse(ProcessorResponse.EOP);
}
}
Aggregations