REOC-70 Change build version to 1.8 and rebuild it

This commit is contained in:
YuCheng Hu 2019-10-08 12:45:54 -04:00
parent 95d6455071
commit d15ef22e34
3 changed files with 32 additions and 42 deletions

View File

@ -1,17 +1,20 @@
package com.ossez.reoc.rets.client;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
*
*/
public class CapabilityUrls {
private final static Logger logger = LoggerFactory.getLogger(CapabilityUrls.class);
public static final String ACTION_URL = "Action";
public static final String CHANGE_PASSWORD_URL = "ChangePassword";
public static final String GET_OBJECT_URL = "GetObject";
@ -22,7 +25,6 @@ public class CapabilityUrls {
public static final String GET_METADATA_URL = "GetMetadata";
public static final String UPDATE_URL = "Update";
public static final String SERVER_INFO_URL = "ServerInformation";// for rets 1.7
private static final Log LOG = LogFactory.getLog(CapabilityUrls.class);
private final Map mCapabilityUrls;
private URL mUrl;
@ -41,13 +43,13 @@ public class CapabilityUrls {
try {
String newurl = new URL(this.mUrl, url).toString();
if (!newurl.equals(url)) {
LOG.info("qualified " + capability + " URL different: "
logger.info("qualified " + capability + " URL different: "
+ url + " -> " + newurl);
url = newurl;
}
} catch (MalformedURLException e) {
LOG.warn("Couldn't normalize URL", e);
logger.warn("Couldn't normalize URL", e);
}
}
this.mCapabilityUrls.put(capability, url);
@ -91,7 +93,7 @@ public class CapabilityUrls {
try {
this.mUrl = new URL(url);
} catch (MalformedURLException e) {
LOG.debug("java.net.URL can't parse login url: " + url);
logger.debug("java.net.URL can't parse login url: " + url);
this.mUrl = null;
}
}

View File

@ -4,14 +4,17 @@ import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.InputStream;
import java.util.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import static com.ossez.reoc.rets.client.CapabilityUrls.LOGIN_URL;
@ -20,7 +23,7 @@ import static com.ossez.reoc.rets.client.CapabilityUrls.LOGIN_URL;
*/
abstract public class KeyValueResponse {
protected static final String CRLF = "\r\n";
private static final Log LOG = LogFactory.getLog(KeyValueResponse.class);
private static final Logger logger = LoggerFactory.getLogger(KeyValueResponse.class);
protected Document mDoc;
protected int mReplyCode;
@ -85,43 +88,26 @@ abstract public class KeyValueResponse {
String[] splits = StringUtils.split(keyValueStr, "=");
if (!ArrayUtils.isEmpty(splits) && splits.length > 1) {
String key = StringUtils.trimToNull(splits[0]);
// guard against a missing value in a KeyValueResponse
String value = StringUtils.trimToEmpty(splits[1]);
// PROCESS LOGIN_URL
if (StringUtils.equalsIgnoreCase(LOGIN_URL, key))
retsResponseMap.put(LOGIN_URL, value);
else
retsResponseMap.put(key, value);
}
// // LOOP TO LOAD LOGIN URL
// tokenizeList.parallelStream().forEach(keyValueString -> {
//
// //parallelStream
// try {
// String line = StringUtils.trimToEmpty(keyValueString);
// String splits[] = StringUtils.split(line, "=");
// if (!ArrayUtils.isEmpty(splits) && splits.length > 1) {
// String key = StringUtils.trimToNull(splits[0]);
// // guard against a missing value in a KeyValueResponse
// String value = StringUtils.trimToEmpty(splits[1]);
//
// if (StringUtils.equalsIgnoreCase(LOGIN_URL, key))
// retsResponseMap.put(LOGIN_URL, value);
// else
// retsResponseMap.put(key, value);
// }
// } catch (Exception e) {
// e.printStackTrace();
// }
// });
// LOOP TO LOAD OTHERS
this.handleKeyValue(LOGIN_URL, retsResponseMap.get(LOGIN_URL));
for (String k : retsResponseMap.keySet()) {
this.handleKeyValue(k, retsResponseMap.get(k));
}
}
retsResponseMap.entrySet().parallelStream().forEach(entry -> {
try {
this.handleKeyValue(entry.getKey(), entry.getValue());
} catch (RetsException ex) {
logger.warn("Unable process rests login response value", ex);
}
});
}
protected abstract void handleKeyValue(String key, String value) throws RetsException;

View File

@ -1,8 +1,10 @@
<configuration>
<?xml version="1.0" encoding="UTF-8" ?>
<configuration debug="true">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<appender name="STDOUT"
class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned by default the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>