View Javadoc
1   package org.kuali.ole.sip2.response;
2   
3   import org.kuali.ole.sip2.sip2Server.MessageUtil;
4   import org.kuali.ole.sip2.sip2Server.StringUtil;
5   
6   /**
7    * Created by gayathria on 15/12/14.
8    */
9   public class OLESIP2ItemStatusUpdateTurnedOffResponse extends OLESIP2TurnedOffResponse {
10  
11      public OLESIP2ItemStatusUpdateTurnedOffResponse() {
12          code = "20";
13      }
14  
15      public String getOLESIP2ItemStatusUpdateTurnedOffResponse(String requestData) {
16  
17          StringBuilder builder = new StringBuilder();
18          String[] requestDataArray = requestData.split("\\|");
19          builder.append(this.code);
20          builder.append(StringUtil.bool2Int(false));
21          builder.append(MessageUtil.getSipDateTime());
22          builder.append("AB");
23          for (String data : requestDataArray) {
24              if (data.startsWith("AB")) {
25                  builder.append((data.replaceFirst("AB", "")).trim());
26              }
27          }
28          builder.append("|AF");
29          builder.append("Item Status Update Service - Not supported in OLE");
30          for (String data : requestDataArray) {
31              if (data.startsWith("AY")) {
32                  builder.append("|AY");
33                  builder.append(data.substring(2, 5));
34                  builder.append(MessageUtil.computeChecksum(builder.toString()));
35              }
36          }
37          return builder.toString() + '\r';
38      }
39  }