public class UserCredentials
extends java.lang.Object
Constructor and Description |
---|
UserCredentials(RequestFacade req)
Creates user credentials from a request.
|
UserCredentials(java.lang.String server,
java.lang.String user,
java.lang.String password) |
UserCredentials(java.net.URI server,
java.lang.String user,
java.lang.String password) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCookies()
Returns the cookies of this user (if exist).
|
static UserCredentials |
getDefaultCredentials()
Returns the default crendentials from the configuration file.
|
java.net.URI |
getServer() |
java.lang.String |
getSessionId()
Returns the current session id (if not already existing, the
user is logged in).
|
java.lang.String |
getUser() |
void |
logout()
Closes the user's session at the server.
|
void |
refresh()
Refreshes the user's login (session).
|
public UserCredentials(java.net.URI server, java.lang.String user, java.lang.String password)
public UserCredentials(RequestFacade req)
req
- public UserCredentials(java.lang.String server, java.lang.String user, java.lang.String password)
public java.lang.String getCookies()
public java.lang.String getUser()
public java.net.URI getServer()
public java.lang.String getSessionId() throws javax.xml.parsers.ParserConfigurationException, java.net.MalformedURLException, java.io.IOException, XMLHttpRequestException, javax.xml.xpath.XPathExpressionException, InvalidUserCredentialsException
javax.xml.parsers.ParserConfigurationException
java.net.MalformedURLException
java.io.IOException
XMLHttpRequestException
javax.xml.xpath.XPathExpressionException
InvalidUserCredentialsException
public void refresh() throws XMLHttpRequestException, InvalidUserCredentialsException, java.io.IOException, javax.xml.parsers.ParserConfigurationException, java.net.MalformedURLException, javax.xml.xpath.XPathExpressionException
XMLHttpRequestException
InvalidUserCredentialsException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
java.net.MalformedURLException
javax.xml.xpath.XPathExpressionException
public void logout()
public static UserCredentials getDefaultCredentials()