Skip to content

Commit

Permalink
OLE-9457 : SIP2 fails on checkout using MeeScan
Browse files Browse the repository at this point in the history
  • Loading branch information
NSSuresh111975 committed Jul 12, 2021
1 parent afa80cc commit daab9af
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public OLESIP2BlockPatronRequestParser(String requestData) {

public void parseBlockPatron(String requestData) {

LOG.info("Entry OLESIP2BlockPatronRequestParser.parseBlockPatron(String requestData)");
LOG.info("Entry OLESIP2BlockPatronRequestParser.parseBlockPatron >>> " + requestData);
String[] requestDataArray = requestData.split("\\|");
try {
for (String data : requestDataArray) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public OLESIP2CheckInRequestParser(String requestData) {

public void parseCheckInRequest(String requestData) {

LOG.info("Entry OLESIP2CheckInRequestParser.parseCheckinRequest(String requestData)");
LOG.info("Entry OLESIP2CheckInRequestParser.parseCheckinRequest >>>> " + requestData);
String[] requestDataArray = requestData.split("\\|");
try {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public OLESIP2CheckOutRequestParser(String requestData) {

public void parseCheckoutRequest(String requestData) {

LOG.info("Entry OLESIP2CheckOutRequestParser.parseCheckoutRequest(String requestData)");
LOG.info("Entry OLESIP2CheckOutRequestParser.parseCheckoutRequest >>>> " + requestData);
String[] requestDataArray = requestData.split("\\|");

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public OLESIP2EndPatronSessionRequestParser(String requestData) {

public void parseEndPatronSession(String requestData) {

LOG.info("Entry OLESIP2EndPatronSessionRequestParser.parseEndPatronSession(String requestData)");
LOG.info("Entry OLESIP2EndPatronSessionRequestParser.parseEndPatronSession >>> " + requestData);

String[] requestDataArray = requestData.split("\\|");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public OLESIP2ItemInformationRequestParser(String requestData) {

public void parseItemInformationRequest(String requestData) {

LOG.info("Entry OLESIP2ItemInformationRequestParser.parseItemInformation(String requestData)");
LOG.info("Entry OLESIP2ItemInformationRequestParser.parseItemInformation >>>> " + requestData);
String[] requestDataArray = requestData.split("\\|");

for (String data : requestDataArray) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public OLESIP2LoginRequestParser(String requestData) {
public void parseLoginRequest(String requestData) {

String[] requestDataArray = requestData.split("\\|");
LOG.info("Entry OLESIP2LoginRequestParser.parseLoginRequest(String requestData)");
LOG.info("Entry OLESIP2LoginRequestParser.parseLoginRequest >>>>> " + requestData);

try {
for (String data : requestDataArray) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public OLESIP2PatronEnableRequestParser(String requestData) {


public void parsePatronEnableRequest(String requestData) {
LOG.info("Entry OLESIP2PatronEnableRequestParser.parsePatronEnable(String requestData)");
LOG.info("Entry OLESIP2PatronEnableRequestParser.parsePatronEnable >>>> " + requestData);

String[] requestDataArray = requestData.split("\\|");
for (String data : requestDataArray) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public OLESIP2PatronInformationRequestParser(String requestData) {

public void parsePatronInformationRequest(String requestData) {

LOG.info("Entry OLESIP2PatronInformationRequestParser.parsePatronInformation(String requestData)");
LOG.info("Entry OLESIP2PatronInformationRequestParser.parsePatronInformation( >>> " + requestData);

String[] requestDataArray = requestData.split("\\|");
for (String data : requestDataArray) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public OLESIP2PatronStatusRequestParser(String requestData) {

public void parsePatronStatusRequest(String requestData) {

LOG.info("Entry OLESIP2PatronStatusRequestParser.parsePatronStatusRequest(String requestData)");
LOG.info("Entry OLESIP2PatronStatusRequestParser.parsePatronStatusRequest >>>> " + requestData);
String[] requestDataArray = requestData.split("\\|");
for (String data : requestDataArray) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public OLESIP2RenewRequestParser(String requestData) {


public void parseRenewRequest(String requestData) {
LOG.info("Entry OLESIP2RenewRequestParser.parseRenewRequest(String requestData)");
LOG.info("Entry OLESIP2RenewRequestParser.parseRenewRequest >>>> " + requestData);

LOG.info(requestData);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public OLESIP2SCStatusRequestParser(String requestData) {

public void parseSCStstusRequest(String requestData) {

LOG.info("Entry OLESIP2SCStatusRequestParser.parseSCStstusRequest(String requestData)");
LOG.info("Entry OLESIP2SCStatusRequestParser.parseSCStstusRequest >>>>> " + requestData);
requestData = requestData.trim();
code = requestData.substring(0, 2);
if (String.valueOf(requestData.charAt(2)).equalsIgnoreCase("0"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import java.io.InputStream;
import java.net.SocketAddress;
import java.util.*;

import java.util.concurrent.ConcurrentHashMap;


@ChannelHandler.Sharable
Expand All @@ -26,7 +26,7 @@ public class SIP2NettyServerHandler extends NettyHandler {

private String clientIP;

private Map<String, String> lastResponseSendToClient = new HashMap<String, String>();
private Map<String, String> lastResponseSendToClient = new ConcurrentHashMap<String, String>();

private List<NettyProcessor> nettyProcessors;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import org.kuali.ole.sip2.sip2Server.MessageUtil;

import java.util.Properties;
import org.apache.log4j.Logger;


/**
* Created by chenchulakshmig on 9/28/15.
Expand All @@ -22,6 +24,7 @@ public class CheckoutNetttyProcessor extends NettyProcessor {

private final Properties properties;
private String serverURL;
private final static Logger LOG = Logger.getLogger(CheckoutNetttyProcessor.class.getName());

public CheckoutNetttyProcessor(Properties properties, String serverURL) {
this.properties = properties;
Expand All @@ -36,22 +39,25 @@ public boolean isInterested(String code) {
@Override
public String process(String requestData) {
String response = "";
LOG.info("requestData inside CheckoutNetttyProcessor >>> " + requestData);
OLESIP2CheckOutRequestParser sip2CheckOutRequestParser = new OLESIP2CheckOutRequestParser(requestData);
if(requestData.contains("|AA") && requestData.contains("|AB") && requestData.contains("|AY")) {

LOG.info("inside if >>> " + requestData);
requestData = createJSONForCheckoutItemRequest(sip2CheckOutRequestParser.getPatronIdentifier(), sip2CheckOutRequestParser.getItemIdentifier(), "SIP2_OPERATOR_ID");
response = postRequest(requestData, "/checkoutItemSIP2", serverURL);
}else{

LOG.info("inside else >>> " + requestData);
StringBuilder builder = new StringBuilder();
builder.append("96AZ");
builder.append(MessageUtil.computeChecksum(builder.toString()));
LOG.info("inside else calculated checksum >>> " + builder.toString());
response = builder.toString() + '\r';
}



if (StringUtils.isNotBlank(response)) {
LOG.info("response received >>> " + response);
if (response.contains("<renewItemList>")) {
OLERenewItemList oleRenewItemList = (OLERenewItemList) new OLERenewItemConverter().generateRenewItemListObjectForSip2(response);
OLESIP2CheckOutResponse sip2CheckOutResponseParser = new OLESIP2CheckOutResponse();
Expand Down

0 comments on commit daab9af

Please sign in to comment.