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
+import com.indexdata.pz2utils4jsf.pazpar2.state.StateManager;\r
import com.indexdata.pz2utils4jsf.utils.Utils;\r
\r
@Named @SessionScoped \r
try { \r
logger.info("Authenticating [" + user.getProperty("name") + "]");\r
this.user = (ServiceProxyUser) user;\r
- Pazpar2Command auth = new Pazpar2Command("auth",null);\r
- auth.setParameter(new CommandParameter("action","=","login"));\r
- auth.setParameter(new CommandParameter("username","=",user.getProperty("name")));\r
- auth.setParameter(new CommandParameter("password","=",user.getProperty("password")));\r
+ Pazpar2Command auth = new Pazpar2Command("auth",new StateManager());\r
+ auth.setParameters(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
\r
public boolean checkAuthentication () {\r
try {\r
- Pazpar2Command check = new Pazpar2Command("auth",null);\r
+ Pazpar2Command check = new Pazpar2Command("auth",new StateManager());\r
check.setParameter(new CommandParameter("action","=","check"));\r
byte[] response = send(check);\r
logger.info(new String(response,"UTF-8"));\r