return response;
}
public void setEchoedScanRequestType(ScanRequestType request, ScanResponseType response) {
EchoedScanRequestType ert=new EchoedScanRequestType();
if(request.getVersion()!=null)
ert.setVersion(request.getVersion());
else
ert.setVersion("1.1");
ert.setMaximumTerms(request.getMaximumTerms());
ert.setResponsePosition(request.getResponsePosition());
String scanClause=request.getScanClause();
log.info("scanClause="+scanClause);
if(scanClause!=null) {
ert.setScanClause(scanClause);
try {
CQLTermNode node=Utilities.getFirstTerm(new CQLParser(CQLParser.V1POINT1).parse(scanClause));
if(node!=null) {
SearchClauseType sct=new SearchClauseType();
sct.setTerm(node.getTerm());
RelationType rt=new RelationType();
rt.setValue(node.getRelation().getBase());
sct.setRelation(rt);
sct.setIndex(getQualifier(node));
ert.setXScanClause(sct);
}
else {
SearchClauseType sct=new SearchClauseType();
sct.setTerm("Unrecognized node");
RelationType rt=new RelationType();
rt.setValue("");
sct.setRelation(rt);
sct.setIndex("");
ert.setXScanClause(sct);
}
}
catch(java.io.IOException e) {
log.error(e);
}
catch(org.z3950.zing.cql.CQLParseException e) {
log.error(e);
SearchClauseType sct=new SearchClauseType();
sct.setTerm("CQLParseException");
RelationType rt=new RelationType();
rt.setValue("");
sct.setRelation(rt);
sct.setIndex("");
ert.setXScanClause(sct);
}
}
else {
SearchClauseType sct=new SearchClauseType();
sct.setTerm("");
RelationType rt=new RelationType();
rt.setValue("");
sct.setRelation(rt);
sct.setIndex("");
ert.setXScanClause(sct);
}
response.setEchoedScanRequest(ert);
}