X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fcom%2Findexdata%2Fmkjsf%2Fpazpar2%2FServiceProxyClient.java;fp=src%2Fmain%2Fjava%2Fcom%2Findexdata%2Fmkjsf%2Fpazpar2%2FServiceProxyClient.java;h=ca76a6a213a3c5c0a83223c21bb3df3ca25aadf4;hb=752d17396ab3de88156763d4cda636e2eaa44086;hp=1f6871577e46e03b14a048c1704aed7ab9f12d55;hpb=d2b59a536f051628ebda91102209c0bc14c2890e;p=mkjsf-moved-to-github.git diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/ServiceProxyClient.java b/src/main/java/com/indexdata/mkjsf/pazpar2/ServiceProxyClient.java index 1f68715..ca76a6a 100644 --- a/src/main/java/com/indexdata/mkjsf/pazpar2/ServiceProxyClient.java +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/ServiceProxyClient.java @@ -48,7 +48,7 @@ public class ServiceProxyClient implements SearchClient { public static final String MODULENAME = "proxyclient"; public static final String SP_INIT_DOC_PATHS = "SP_INIT_DOC_PATHS"; - private String selectedServiceUrl = ""; + private String serviceUrl = ""; private List initDocPaths = null; private Configuration config = null; @@ -70,7 +70,7 @@ public class ServiceProxyClient implements SearchClient { logger.info(Utils.objectId(this) + " is configuring using the provided " + Utils.objectId(configReader)); try { config = configReader.getConfiguration(this); - selectedServiceUrl = config.get("SERVICE_PROXY_URL"); + serviceUrl = config.get("SERVICE_PROXY_URL"); this.initDocPaths = config.getMultiProperty(SP_INIT_DOC_PATHS,","); checkAuth = new AuthCommand(null); checkAuth.setParameterInState(new CommandParameter("action","=","check")); @@ -147,7 +147,7 @@ public class ServiceProxyClient implements SearchClient { */ private ClientCommandResponse send(Pazpar2Command command) { ClientCommandResponse commandResponse = null; - String url = selectedServiceUrl + "?" + command.getEncodedQueryString(); + String url = serviceUrl + "?" + command.getEncodedQueryString(); logger.info("Sending request "+url); HttpGet httpget = new HttpGet(url); byte[] response = null; @@ -213,7 +213,7 @@ public class ServiceProxyClient implements SearchClient { logger.debug("Cloning Pz2Client"); ServiceProxyClient clone = new ServiceProxyClient(); clone.client = this.client; - clone.selectedServiceUrl = this.selectedServiceUrl; + clone.serviceUrl = this.serviceUrl; clone.initDocPaths = this.initDocPaths; return clone; } @@ -231,13 +231,13 @@ public class ServiceProxyClient implements SearchClient { @Override public List documentConfiguration () { List doc = new ArrayList(); - doc.add(nl+ MODULENAME + " was configured to access the Pazpar2 service proxy at: " + (selectedServiceUrl.length()>0 ? selectedServiceUrl : "[not defined yet]")); + doc.add(nl+ MODULENAME + " was configured to access the Pazpar2 service proxy at: " + (serviceUrl.length()>0 ? serviceUrl : "[not defined yet]")); return null; } public ClientCommandResponse postInitDoc (String filePath) throws IOException { logger.info("Looking to post the file in : [" + filePath +"]"); - HttpPost post = new HttpPost(selectedServiceUrl+"?command=init&includeDebug=yes"); + HttpPost post = new HttpPost(serviceUrl+"?command=init&includeDebug=yes"); File initDoc = new File(filePath); logger.info("Posting to SP: "); if (logger.isDebugEnabled()) { @@ -261,7 +261,7 @@ public class ServiceProxyClient implements SearchClient { } public ClientCommandResponse postInitDoc(byte[] initDoc, boolean includeDebug) throws IOException { - HttpPost post = new HttpPost(selectedServiceUrl+"?command=init" + (includeDebug? "&includeDebug=yes" : "")); + HttpPost post = new HttpPost(serviceUrl+"?command=init" + (includeDebug? "&includeDebug=yes" : "")); post.setEntity(new ByteArrayEntity(initDoc)); byte[] response = client.execute(post, handler); logger.debug("Response on POST was: " + new String(response,"UTF-8")); @@ -269,7 +269,7 @@ public class ServiceProxyClient implements SearchClient { } public void setServiceUrl (String url) { - selectedServiceUrl = url; + serviceUrl = url; } public Configuration getConfiguration () { @@ -278,12 +278,12 @@ public class ServiceProxyClient implements SearchClient { @Override public String getServiceUrl() { - return selectedServiceUrl; + return serviceUrl; } @Override public boolean hasServiceUrl() { - return selectedServiceUrl != null && selectedServiceUrl.length()>0; + return serviceUrl != null && serviceUrl.length()>0; } }