logger.error("Could not configure Pazpar2 client: " + io.getMessage());\r
configurationErrors.add(new ConfigurationError("Pz2Client Config","ProxyError","Could not configure Pazpar2 client: " + io.getMessage(),errorHelper));\r
}\r
- try {\r
- client = new Pazpar2ClientGeneric(cfg); \r
- } catch (ProxyErrorException pe) {\r
- logger.error("Could not instantiate Pazpar2 client: " + pe.getMessage());\r
- configurationErrors.add(new ConfigurationError("Pz2Client error","ProxyError","Could not create Pazpar2 client: " +pe.getMessage(),errorHelper)); \r
- } \r
- logger.info("Got " + configurationErrors.size() + " configuration errors");\r
+ if (cfg != null) {\r
+ try {\r
+ client = new Pazpar2ClientGeneric(cfg); \r
+ } catch (ProxyErrorException pe) {\r
+ logger.error("Could not instantiate Pazpar2 client: " + pe.getMessage());\r
+ configurationErrors.add(new ConfigurationError("Pz2Client error","ProxyError","Could not create Pazpar2 client: " +pe.getMessage(),errorHelper)); \r
+ } \r
+ logger.info("Got " + configurationErrors.size() + " configuration errors"); \r
+ }\r
resetDataObjects();\r
} else {\r
logger.warn("Attempt to configure session but it already has a configured client");\r
return queryStates.getCurrentStateKey();\r
}\r
\r
- public void setCurrentStateKey(String key) {\r
- logger.debug("************** request to set state key to: [" + key + "]"); \r
+ public void setCurrentStateKey(String key) { \r
queryStates.setCurrentStateKey(key);\r
}\r
\r
return hasConfigurationErrors() || hasCommandErrors();\r
}\r
\r
- public List<ApplicationError> getConfigurationErrors() {\r
- logger.info("Returning " + configurationErrors.size() + " configuration errors");\r
+ public List<ApplicationError> getConfigurationErrors() { \r
return configurationErrors;\r
}\r
\r
dataObjects.put("search", new SearchResponse());\r
}\r
\r
-\r
}\r