@Override public boolean canHandle(Operation operation) { String requestedSchema = getRequestedSchema(operation); if (requestedSchema == null) { requestedSchema = CSW.NAMESPACE; } return requestedSchema.equals(schema); }
@Override public void write(Object value, OutputStream output, Operation operation) throws IOException, ServiceException { CSWRecordsResult result = (CSWRecordsResult) value; RequestBaseType request = (RequestBaseType) operation.getParameters()[0]; CSWInfo csw = gs.getService(CSWInfo.class); // check the output schema is valid if (result.getRecords() != null) { FeatureType recordSchema = result.getRecords().getSchema(); if (recordSchema != null && !recordType.equals(recordSchema)) { throw new IllegalArgumentException("Cannot encode this kind of record " + recordSchema.getName() + " into schema " + schema); } } if (getResultType(request) == ResultType.VALIDATE) { // this one is output schema independent transformAcknowledgement(output, request, csw); } else { transformResponse(output, result, request, csw); } }
@Override public void write(Object value, OutputStream output, Operation operation) throws IOException, ServiceException { CSWRecordsResult result = (CSWRecordsResult) value; RequestBaseType request = (RequestBaseType) operation.getParameters()[0]; CSWInfo csw = gs.getService(CSWInfo.class); // check the output schema is valid if (result.getRecords() != null) { FeatureType recordSchema = result.getRecords().getSchema(); if (recordSchema != null && !recordType.equals(recordSchema)) { throw new IllegalArgumentException( "Cannot encode this kind of record " + recordSchema.getName() + " into schema " + schema); } } if (getResultType(request) == ResultType.VALIDATE) { // this one is output schema independent transformAcknowledgement(output, request, csw); } else { transformResponse(output, result, request, csw); } }
@Override public boolean canHandle(Operation operation) { String requestedSchema = getRequestedSchema(operation); if (requestedSchema == null) { requestedSchema = CSW.NAMESPACE; } return requestedSchema.equals(schema); }