View Javadoc
1   package org.kuali.ole.sip2.requestParser;
2   
3   import org.apache.log4j.Logger;
4   import org.kuali.ole.sip2.constants.OLESIP2Constants;
5   
6   /**
7    * Created by gayathria on 2/12/14.
8    */
9   public class OLESIP2ItemStatusUpdateRequestParser extends OLESIP2RequestParser {
10  
11  
12      private static final Logger LOG = Logger.getLogger(OLESIP2ItemStatusUpdateRequestParser.class);
13  
14      public OLESIP2ItemStatusUpdateRequestParser(String requestData) {
15          this.parseItemStatusUpdateRequest(requestData);
16      }
17  
18      public void parseItemStatusUpdateRequest(String requestData) {
19  
20          LOG.info("Entry OLESIP2ItemStatusUpdateRequestParser.parseItemStatusUpdate(String requestData)");
21          String[] requestDataArray = requestData.split("\\|");
22          for (String data : requestDataArray) {
23              LOG.info(data);
24              if (data.startsWith(OLESIP2Constants.CHECKOUT_REQUEST)) {
25                  code = data.substring(0, 2);
26                  transactionDate = data.substring(2, 20);
27                  institutionId = data.substring(22);
28              }
29              if (data.startsWith(OLESIP2Constants.ITEM_IDENTIFIER_CODE)) {
30                  itemIdentifier = (data.replaceFirst(OLESIP2Constants.ITEM_IDENTIFIER_CODE, "")).trim();
31              }
32              if (data.startsWith(OLESIP2Constants.TERMINAL_PWD_CODE)) {
33                  terminalPassword = (data.replaceFirst(OLESIP2Constants.TERMINAL_PWD_CODE, "")).trim();
34              }
35              if (data.startsWith(OLESIP2Constants.ITEM_PROPERTIES_CODE)) {
36                  itemProperties = (data.replaceFirst(OLESIP2Constants.ITEM_PROPERTIES_CODE, "")).trim();
37              }
38              if (data.startsWith(OLESIP2Constants.SEQUENCE_NUM_CODE)) {
39                  sequenceNum = data.substring(2, 5);
40                  checkSum = data.substring(5);
41              }
42          }
43          LOG.info("Exit OLESIP2ItemStatusUpdateRequestParser.parseItemStatusUpdate(String requestData)");
44      }
45  
46  
47  }