projects
/
mkjsf-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
ea445c5
)
Makes init doc debug response optional
author
Niels Erik G. Nielsen
<nielserik@indexdata.com>
Tue, 30 Apr 2013 15:44:14 +0000
(11:44 -0400)
committer
Niels Erik G. Nielsen
<nielserik@indexdata.com>
Tue, 30 Apr 2013 15:44:14 +0000
(11:44 -0400)
src/main/java/com/indexdata/mkjsf/pazpar2/Pz2ProxyBean.java
patch
|
blob
|
history
src/main/java/com/indexdata/mkjsf/pazpar2/sp/ServiceProxyClient.java
patch
|
blob
|
history
src/main/java/com/indexdata/mkjsf/pazpar2/sp/ServiceProxyInterface.java
patch
|
blob
|
history
diff --git
a/src/main/java/com/indexdata/mkjsf/pazpar2/Pz2ProxyBean.java
b/src/main/java/com/indexdata/mkjsf/pazpar2/Pz2ProxyBean.java
index
989cc06
..
09e500a
100644
(file)
--- a/
src/main/java/com/indexdata/mkjsf/pazpar2/Pz2ProxyBean.java
+++ b/
src/main/java/com/indexdata/mkjsf/pazpar2/Pz2ProxyBean.java
@@
-70,7
+70,10
@@
public class Pz2ProxyBean extends Pz2Bean implements ServiceProxyInterface {
}
\r
\r
public void ipAuthenticate (ServiceProxyUser user) {
\r
}
\r
\r
public void ipAuthenticate (ServiceProxyUser user) {
\r
- if (!user.isAuthenticated()) {
\r
+ if (!user.isIpAuthenticated()) {
\r
+ if (user.isAuthenticated()) {
\r
+ user.clear();
\r
+ }
\r
((ServiceProxyClient)searchClient).ipAuthenticate(user);
\r
}
\r
}
\r
((ServiceProxyClient)searchClient).ipAuthenticate(user);
\r
}
\r
}
\r
@@
-125,14
+128,13
@@
public class Pz2ProxyBean extends Pz2Bean implements ServiceProxyInterface {
}
\r
\r
@Override
\r
}
\r
\r
@Override
\r
- public String postInit(byte[] initDoc) throws UnsupportedEncodingException, IOException {
\r
+ public String postInit(byte[] initDoc, boolean includeDebug) throws UnsupportedEncodingException, IOException {
\r
pzresp.reset();
\r
pzresp.reset();
\r
- byte[] response = ((ServiceProxyClient)searchClient).postInitDoc(initDoc);
\r
+ byte[] response = ((ServiceProxyClient)searchClient).postInitDoc(initDoc,includeDebug);
\r
initDocResponse = new String(response,"UTF-8");
\r
return initDocResponse;
\r
}
\r
\r
initDocResponse = new String(response,"UTF-8");
\r
return initDocResponse;
\r
}
\r
\r
-
\r
@Override
\r
public String getInitResponse() {
\r
return initDocResponse;
\r
@Override
\r
public String getInitResponse() {
\r
return initDocResponse;
\r
diff --git
a/src/main/java/com/indexdata/mkjsf/pazpar2/sp/ServiceProxyClient.java
b/src/main/java/com/indexdata/mkjsf/pazpar2/sp/ServiceProxyClient.java
index
14bec03
..
fb3c867
100644
(file)
--- a/
src/main/java/com/indexdata/mkjsf/pazpar2/sp/ServiceProxyClient.java
+++ b/
src/main/java/com/indexdata/mkjsf/pazpar2/sp/ServiceProxyClient.java
@@
-293,8
+293,8
@@
public class ServiceProxyClient implements SearchClient {
return initDocPaths;
\r
}
\r
\r
return initDocPaths;
\r
}
\r
\r
- public byte[] postInitDoc(byte[] initDoc) throws IOException {
\r
- HttpPost post = new HttpPost(selectedServiceUrl+"?command=init&includeDebug=yes");
\r
+ public byte[] postInitDoc(byte[] initDoc, boolean includeDebug) throws IOException {
\r
+ HttpPost post = new HttpPost(selectedServiceUrl+"?command=init" + (includeDebug? "&includeDebug=yes" : ""));
\r
post.setEntity(new ByteArrayEntity(initDoc));
\r
byte[] response = client.execute(post, handler);
\r
logger.debug("Response on POST was: " + new String(response,"UTF-8"));
\r
post.setEntity(new ByteArrayEntity(initDoc));
\r
byte[] response = client.execute(post, handler);
\r
logger.debug("Response on POST was: " + new String(response,"UTF-8"));
\r
diff --git
a/src/main/java/com/indexdata/mkjsf/pazpar2/sp/ServiceProxyInterface.java
b/src/main/java/com/indexdata/mkjsf/pazpar2/sp/ServiceProxyInterface.java
index
46d4e77
..
abbb1ec
100644
(file)
--- a/
src/main/java/com/indexdata/mkjsf/pazpar2/sp/ServiceProxyInterface.java
+++ b/
src/main/java/com/indexdata/mkjsf/pazpar2/sp/ServiceProxyInterface.java
@@
-10,7
+10,7
@@
public interface ServiceProxyInterface extends Pz2Interface {
public void setInitFileName (String fileName);
\r
public String getInitFileName();
\r
public String postInit() throws UnsupportedEncodingException, IOException;
\r
public void setInitFileName (String fileName);
\r
public String getInitFileName();
\r
public String postInit() throws UnsupportedEncodingException, IOException;
\r
- public String postInit(byte[] initDoc) throws UnsupportedEncodingException, IOException;
\r
+ public String postInit(byte[] initDoc, boolean includeDebug) throws UnsupportedEncodingException, IOException;
\r
public String getInitResponse();
\r
public void setServiceProxyUrl(String url);
\r
public String getServiceProxyUrl();
\r
public String getInitResponse();
\r
public void setServiceProxyUrl(String url);
\r
public String getServiceProxyUrl();
\r