2.17.2: 2011-06-17

net.sf.basedb.ws.client
Class SessionClient

java.lang.Object
  extended by net.sf.basedb.ws.client.AbstractRPCClient
      extended by net.sf.basedb.ws.client.SessionClient

public class SessionClient
extends AbstractRPCClient

Client for handling sessions. Session

Version:
2.5
Author:
Nicklas, Martin

Field Summary
private  String ID
           
private  String url
           
 
Constructor Summary
SessionClient(String url, String ID, String externalClientId)
          Creates a new SessionClient using the default service factory.
SessionClient(String url, String ID, String externalClientId, ServiceFactory serviceFactory)
          Creates a new SessionClient using a specific service factory.
 
Method Summary
 String getChallenge()
          Calling the getChallenge method.
 String getId()
          Gets the id of the session.
 int getSessionTimeOut()
          Gets how long time it takes before the session timeout.
 String getUrl()
          Gets the URL of the session
 VersionInfo getVersion()
           
 void login(String login, String password, String comment, boolean encrypted)
          Login to BASE
 void logout()
          Logs out from BASE
 void refreshSession(String ID)
          Refresh a session to prevent a timeout.
 
Methods inherited from class net.sf.basedb.ws.client.AbstractRPCClient
getOperation, getService, getServiceFactory, invokeBlocking, invokeBlocking, invokeBlocking, invokeFileBlocking, setServiceFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

url

private final String url

ID

private final String ID
Constructor Detail

SessionClient

public SessionClient(String url,
                     String ID,
                     String externalClientId)
              throws org.apache.axis2.AxisFault
Creates a new SessionClient using the default service factory.

Parameters:
url - The url where web services are located.
ID - Session id of a logged in session. A new session will be created if this is NULL.
externalClientId - External id of the client that is registered in BASE.
Throws:
org.apache.axis2.AxisFault - If communication with the web service fails.

SessionClient

public SessionClient(String url,
                     String ID,
                     String externalClientId,
                     ServiceFactory serviceFactory)
              throws org.apache.axis2.AxisFault
Creates a new SessionClient using a specific service factory.

Parameters:
url - The url where web services are located.
ID - Session id of a logged in session. A new session will be created if this is NULL.
externalClientId - External id of the client that is registered in BASE.
serviceFactory - The service factory to use, or null to use the default: Factories.getDefaultServiceFactory()
Throws:
org.apache.axis2.AxisFault - If communication with the web service fails
Since:
2.8
Method Detail

getUrl

public String getUrl()
Gets the URL of the session

Returns:
URL as a String

getId

public String getId()
Gets the id of the session.

Returns:
Session ID as a String

getChallenge

public String getChallenge()
                    throws org.apache.axis2.AxisFault
Calling the getChallenge method.

Returns:
Gets a random string to use with password encryption.
Throws:
org.apache.axis2.AxisFault - If communication with web service fails.

login

public void login(String login,
                  String password,
                  String comment,
                  boolean encrypted)
           throws org.apache.axis2.AxisFault
Login to BASE

Parameters:
login - Login name on BASE server
password - Password on BASE server
comment - A comment to put on the session
encrypted - If the password should be encrypted when logging in.
Throws:
org.apache.axis2.AxisFault - If something goes wrong when calling the login service

logout

public void logout()
            throws org.apache.axis2.AxisFault
Logs out from BASE

Throws:
org.apache.axis2.AxisFault - If something goes wrong calling the logout service.

getSessionTimeOut

public int getSessionTimeOut()
                      throws org.apache.axis2.AxisFault
Gets how long time it takes before the session timeout.

Returns:
Number of minutes before the session timeout
Throws:
org.apache.axis2.AxisFault - If something goes wrong calling the services.

refreshSession

public void refreshSession(String ID)
                    throws org.apache.axis2.AxisFault
Refresh a session to prevent a timeout.

Parameters:
ID - The id of the session to refresh.
Throws:
org.apache.axis2.AxisFault - If anything goes wrong calling the service.

getVersion

public VersionInfo getVersion()
                       throws org.apache.axis2.AxisFault
Returns:
A VersionInfo object
Throws:
org.apache.axis2.AxisFault

2.17.2: 2011-06-17