View Javadoc

1   package org.kuali.ole.serviceimpl;
2   
3   import org.kuali.ole.bo.cql.CQLResponseBO;
4   import org.kuali.ole.service.*;
5   
6   
7   /**
8    * Created with IntelliJ IDEA.
9    * User: ?
10   * Date: 7/9/12
11   * Time: 5:55 PM
12   * To change this template use File | Settings | File Templates.
13   */
14  public class OleSRUWebServiceImpl implements OleSRUWebService {
15  
16      public OleDiagnosticsService oleDiagnosticsService;
17      public OleCQLQueryParserService oleCQLQueryParserService;
18      public OleRequestOperationTypeService oleRequestOperationTypeService;
19      public OleValidateInputRequestService  oleValidateInputRequestService;
20      public OleSRUWebServiceImpl()
21      {
22          oleDiagnosticsService=new OleDiagnosticsServiceImpl();
23          oleCQLQueryParserService=new OleCQLQueryParserServiceImpl();
24          oleRequestOperationTypeService=new OleRequestOperationTypeServiceImpl();
25          oleValidateInputRequestService=new OleValidateInputRequestServiceImpl();
26      }
27      public String getOleSRUResponse(String operationType,String query,String version){
28  
29         String respXML=null;
30         boolean reqFlag=oleValidateInputRequestService.inputRequestValidation(operationType,query,version);
31         if(!reqFlag)
32           return oleDiagnosticsService.getDiagnosticResponse("Invalid request");
33         String cqlParseXml=oleCQLQueryParserService.parseCQLQuery(query);
34          if(cqlParseXml==null)
35              return oleDiagnosticsService.getDiagnosticResponse("Invalid query");
36         CQLResponseBO cqlParseBO=oleCQLQueryParserService.getCQLResponseObject(cqlParseXml);
37         respXML=oleRequestOperationTypeService.performOperationTypeService(operationType,cqlParseBO,version);
38         return respXML;
39      }
40  
41  
42  }