X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fcom%2Findexdata%2Fpz2utils4jsf%2Fpazpar2%2FPz2Session.java;h=886a0b8e88c45f4125ec528d29482a3f4046d144;hb=c3af1f841ac7d7cd350b5b9f18088e3081ef9a85;hp=29403070bad23418443ec970dd3ea9454cf60a4a;hpb=b8de1214df604ebb0485b0d4b22d28733c963933;p=mkjsf-moved-to-github.git diff --git a/src/main/java/com/indexdata/pz2utils4jsf/pazpar2/Pz2Session.java b/src/main/java/com/indexdata/pz2utils4jsf/pazpar2/Pz2Session.java index 2940307..886a0b8 100644 --- a/src/main/java/com/indexdata/pz2utils4jsf/pazpar2/Pz2Session.java +++ b/src/main/java/com/indexdata/pz2utils4jsf/pazpar2/Pz2Session.java @@ -68,13 +68,15 @@ public class Pz2Session implements Pz2Interface { logger.error("Could not configure Pazpar2 client: " + io.getMessage()); configurationErrors.add(new ConfigurationError("Pz2Client Config","ProxyError","Could not configure Pazpar2 client: " + io.getMessage(),errorHelper)); } - try { - client = new Pazpar2ClientGeneric(cfg); - } catch (ProxyErrorException pe) { - logger.error("Could not instantiate Pazpar2 client: " + pe.getMessage()); - configurationErrors.add(new ConfigurationError("Pz2Client error","ProxyError","Could not create Pazpar2 client: " +pe.getMessage(),errorHelper)); - } - logger.info("Got " + configurationErrors.size() + " configuration errors"); + if (cfg != null) { + try { + client = new Pazpar2ClientGeneric(cfg); + } catch (ProxyErrorException pe) { + logger.error("Could not instantiate Pazpar2 client: " + pe.getMessage()); + configurationErrors.add(new ConfigurationError("Pz2Client error","ProxyError","Could not create Pazpar2 client: " +pe.getMessage(),errorHelper)); + } + logger.info("Got " + configurationErrors.size() + " configuration errors"); + } resetDataObjects(); } else { logger.warn("Attempt to configure session but it already has a configured client"); @@ -293,8 +295,7 @@ public class Pz2Session implements Pz2Interface { return queryStates.getCurrentStateKey(); } - public void setCurrentStateKey(String key) { - logger.debug("************** request to set state key to: [" + key + "]"); + public void setCurrentStateKey(String key) { queryStates.setCurrentStateKey(key); } @@ -323,8 +324,7 @@ public class Pz2Session implements Pz2Interface { return hasConfigurationErrors() || hasCommandErrors(); } - public List getConfigurationErrors() { - logger.info("Returning " + configurationErrors.size() + " configuration errors"); + public List getConfigurationErrors() { return configurationErrors; } @@ -475,5 +475,4 @@ public class Pz2Session implements Pz2Interface { dataObjects.put("search", new SearchResponse()); } - }