import com.indexdata.pz2utils4jsf.pazpar2.CommandResponse;\r
import com.indexdata.pz2utils4jsf.pazpar2.SearchClient;\r
import com.indexdata.pz2utils4jsf.pazpar2.commands.CommandParameter;\r
-import com.indexdata.pz2utils4jsf.pazpar2.commands.CommandReadOnly;\r
import com.indexdata.pz2utils4jsf.pazpar2.commands.Pazpar2Command;\r
import com.indexdata.pz2utils4jsf.pazpar2.sp.auth.AuthenticationEntity;\r
import com.indexdata.pz2utils4jsf.pazpar2.sp.auth.ServiceProxyUser;\r
logger.info("Authenticating [" + user.getProperty("name") + "]");\r
this.user = (ServiceProxyUser) user;\r
Pazpar2Command auth = new Pazpar2Command("auth",null);\r
- auth.setParameters(new CommandParameter("action","=","login"), \r
- new CommandParameter("username","=",user.getProperty("name")), \r
- new CommandParameter("password","=",user.getProperty("password")));\r
+ auth.setParametersInState(new CommandParameter("action","=","login"), \r
+ new CommandParameter("username","=",user.getProperty("name")), \r
+ new CommandParameter("password","=",user.getProperty("password")));\r
byte[] response = send(auth);\r
String responseStr = new String(response,"UTF-8");\r
logger.info(responseStr); \r
* @throws ClientProtocolException\r
* @throws IOException\r
*/\r
- private byte[] send(CommandReadOnly command) throws ClientProtocolException, IOException {\r
+ private byte[] send(Pazpar2Command command) throws ClientProtocolException, IOException {\r
String url = serviceUrl + "?" + command.getEncodedQueryString(); \r
logger.info("Sending request "+url); \r
HttpGet httpget = new HttpGet(url); \r
}\r
\r
@Override\r
- public void setSearchCommand(CommandReadOnly command) {\r
+ public void setSearchCommand(Pazpar2Command command) {\r
// Do nothing, Service Proxy is handling this \r
}\r
\r
@Override\r
- public CommandResponse executeCommand(CommandReadOnly command,\r
+ public CommandResponse executeCommand(Pazpar2Command command,\r
ByteArrayOutputStream baos) throws Pazpar2ErrorException, IOException {\r
byte[] response = send(command);\r
baos.write(response);\r