- public ResponseDataObject run() {\r
- logger.info("Running " + getCommandName() + " using " + Pz2Bean.get().getSearchClient()); \r
- HttpResponseWrapper httpResponse = Pz2Bean.get().getSearchClient().executeCommand(this);\r
- logger.info("Parsing response for " + getCommandName());\r
+ /**\r
+ * Executes the command with the currently selected parameters against \r
+ * the currently selected Pazpar2 service\r
+ * \r
+ * @return Response data object based on the Pazpar2 service response. \r
+ */\r
+ public ResponseDataObject run() { \r
+ return run(Pz2Service.get().getSearchClient(),\r
+ Pz2Service.get().getPzresp());\r
+ }\r
+ \r
+ /**\r
+ * Executes the commands with the currently selected parameters, while adding\r
+ * the parameters provided\r
+ * @param parameters A list of parameters on the form [key=value]\r
+ * \r
+ * @return Response data object based on the Pazpar2 service response\r
+ */\r
+ public ResponseDataObject runWith(String... parameters) {\r
+ for (String parameter : parameters) {\r
+ StringTokenizer tokenizer = new StringTokenizer(parameter,"=");\r
+ String name = (String) tokenizer.nextElement();\r
+ String value = (String) tokenizer.nextElement();\r
+ CommandParameter commandParameter = new CommandParameter(name,"=",value);\r
+ setParameterInState(commandParameter);\r
+ }\r
+ return run();\r
+ }\r
+ \r
+ /**\r
+ * Executes the command in a thread. \r
+ * \r
+ * Note: Client and Responses must be provided because at this point \r
+ * CDI beans cannot be retrieved from within a thread.\r
+ * \r
+ * @param client\r
+ * @param pzresp\r
+ * @return\r
+ */\r
+ public ResponseDataObject run(SearchClient client,Responses pzresp) {\r
+ logger.debug("Running " + getCommandName() + " using " + client); \r
+ HttpResponseWrapper httpResponse = client.executeCommand(this);\r
+ logger.debug("Parsing response for " + getCommandName());\r