Ignore:
Timestamp:
11/17/15 17:14:53 (9 years ago)
Author:
Oliver Schonefeld
Message:
  • implement basic SRU 2.0 query handling ... kind of ...
File:
1 edited

Legend:

Unmodified
Added
Removed
  • SRUServer/trunk/src/main/java/eu/clarin/sru/server/SRUServerConfig.java

    r6816 r6821  
    637637    private final IndexInfo indexInfo;
    638638    private final List<SchemaInfo> schemaInfo;
     639    private final List<SRUQueryParser<?>> queryParsers;
    639640
    640641
     
    659660            DatabaseInfo databaseinfo,
    660661            IndexInfo indexInfo,
    661             List<SchemaInfo> schemaInfo) {
     662            List<SchemaInfo> schemaInfo,
     663            List<SRUQueryParser<?>> queryParsers) {
    662664        this.minVersion                  = minVersion;
    663665        this.maxVersion                  = maxVersion;
     
    685687            this.schemaInfo = null;
    686688        }
     689        this.queryParsers = Collections.unmodifiableList(queryParsers);
    687690
    688691        // build baseUrl
     
    853856                        return schema;
    854857                    }
     858                }
     859            }
     860        }
     861        return null;
     862    }
     863
     864
     865    public SRUQueryParser<?> findQueryParser(String queryType) {
     866        if (queryType != null) {
     867            for (SRUQueryParser<?> queryParser : queryParsers) {
     868                if (queryParser.getQueryType().equals(queryType)) {
     869                    return queryParser;
    855870                }
    856871            }
     
    10791094                    SRU_RESPONSE_BUFFER_SIZE, false,
    10801095                    DEFAULT_RESPONSE_BUFFER_SIZE, 0, -1);
     1096
     1097            /*
     1098             * FIXME: add interface to register additional query parsers
     1099             */
     1100            List<SRUQueryParser<?>> queryParsers =
     1101                    new ArrayList<SRUQueryParser<?>>();
     1102            queryParsers.add(new CQLQueryParser());
    10811103
    10821104            return new SRUServerConfig(minVersion,
     
    11001122                    databaseInfo,
    11011123                    indexInfo,
    1102                     schemaInfo);
     1124                    schemaInfo,
     1125                    queryParsers);
    11031126        } catch (IOException e) {
    11041127            throw new SRUConfigException("error reading configuration file", e);
Note: See TracChangeset for help on using the changeset viewer.