Renames variable
authorNiels Erik G. Nielsen <nielserik@indexdata.com>
Thu, 9 May 2013 17:44:22 +0000 (13:44 -0400)
committerNiels Erik G. Nielsen <nielserik@indexdata.com>
Thu, 9 May 2013 17:44:22 +0000 (13:44 -0400)
src/main/java/com/indexdata/mkjsf/pazpar2/ServiceProxyClient.java

index 1f68715..ca76a6a 100644 (file)
@@ -48,7 +48,7 @@ public class ServiceProxyClient implements SearchClient {
   public static final String MODULENAME = "proxyclient";\r
   \r
   public static final String SP_INIT_DOC_PATHS = "SP_INIT_DOC_PATHS";\r
-  private String selectedServiceUrl = "";\r
+  private String serviceUrl = "";\r
   \r
   private List<String> initDocPaths = null;\r
   private Configuration config = null;\r
@@ -70,7 +70,7 @@ public class ServiceProxyClient implements SearchClient {
     logger.info(Utils.objectId(this) + " is configuring using the provided " + Utils.objectId(configReader));\r
     try {\r
       config = configReader.getConfiguration(this);      \r
-      selectedServiceUrl = config.get("SERVICE_PROXY_URL");\r
+      serviceUrl = config.get("SERVICE_PROXY_URL");\r
       this.initDocPaths = config.getMultiProperty(SP_INIT_DOC_PATHS,",");\r
       checkAuth = new AuthCommand(null);\r
       checkAuth.setParameterInState(new CommandParameter("action","=","check"));\r
@@ -147,7 +147,7 @@ public class ServiceProxyClient implements SearchClient {
    */\r
   private ClientCommandResponse send(Pazpar2Command command) {\r
     ClientCommandResponse commandResponse = null;\r
-    String url = selectedServiceUrl + "?" + command.getEncodedQueryString(); \r
+    String url = serviceUrl + "?" + command.getEncodedQueryString(); \r
     logger.info("Sending request "+url);    \r
     HttpGet httpget = new HttpGet(url);     \r
     byte[] response = null;\r
@@ -213,7 +213,7 @@ public class ServiceProxyClient implements SearchClient {
     logger.debug("Cloning Pz2Client");\r
     ServiceProxyClient clone = new ServiceProxyClient();\r
     clone.client = this.client;\r
-    clone.selectedServiceUrl = this.selectedServiceUrl;\r
+    clone.serviceUrl = this.serviceUrl;\r
     clone.initDocPaths = this.initDocPaths;\r
     return clone;\r
   }\r
@@ -231,13 +231,13 @@ public class ServiceProxyClient implements SearchClient {
   @Override\r
   public List<String> documentConfiguration () {\r
     List<String> doc = new ArrayList<String>();\r
-    doc.add(nl+ MODULENAME + " was configured to access the Pazpar2 service proxy at: " + (selectedServiceUrl.length()>0 ? selectedServiceUrl : "[not defined yet]"));\r
+    doc.add(nl+ MODULENAME + " was configured to access the Pazpar2 service proxy at: " + (serviceUrl.length()>0 ? serviceUrl : "[not defined yet]"));\r
     return null;\r
   }\r
   \r
   public ClientCommandResponse postInitDoc (String filePath) throws IOException {\r
     logger.info("Looking to post the file in : [" + filePath +"]");\r
-    HttpPost post = new HttpPost(selectedServiceUrl+"?command=init&includeDebug=yes");\r
+    HttpPost post = new HttpPost(serviceUrl+"?command=init&includeDebug=yes");\r
     File initDoc = new File(filePath);\r
     logger.info("Posting to SP: ");\r
     if (logger.isDebugEnabled()) {\r
@@ -261,7 +261,7 @@ public class ServiceProxyClient implements SearchClient {
   }\r
   \r
   public ClientCommandResponse postInitDoc(byte[] initDoc, boolean includeDebug) throws IOException {\r
-    HttpPost post = new HttpPost(selectedServiceUrl+"?command=init" + (includeDebug? "&includeDebug=yes" : ""));\r
+    HttpPost post = new HttpPost(serviceUrl+"?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
@@ -269,7 +269,7 @@ public class ServiceProxyClient implements SearchClient {
   }\r
   \r
   public void setServiceUrl (String url) {    \r
-    selectedServiceUrl = url;\r
+    serviceUrl = url;\r
   }\r
           \r
   public Configuration getConfiguration () {\r
@@ -278,12 +278,12 @@ public class ServiceProxyClient implements SearchClient {
 \r
   @Override\r
   public String getServiceUrl() {    \r
-    return selectedServiceUrl;\r
+    return serviceUrl;\r
   }\r
 \r
   @Override\r
   public boolean hasServiceUrl() {\r
-    return selectedServiceUrl != null && selectedServiceUrl.length()>0;\r
+    return serviceUrl != null && serviceUrl.length()>0;\r
   }\r
   \r
 }\r