com.sap.sdm.api.remote
Class ClientSessionFactory

java.lang.Object
  |
  +--com.sap.sdm.api.remote.ClientSessionFactory

public class ClientSessionFactory
extends java.lang.Object

An entry point for a client of the SDM remote client API.

Version:
1.0

Constructor Summary
ClientSessionFactory()
           
 
Method Summary
static ClientSession createRemoteClientSession(int port, java.lang.String host)
          Deprecated.  
static ClientSession createRemoteClientSession(int port, java.lang.String host, java.lang.String password)
          Creates a client session on the specified SDM server.
static ClientSession createRemoteClientSessionIDE(int port, java.lang.String host, java.lang.String password)
          Creates a client session on the specified SDM server.
static int getAPIClientVersion()
          Returns the version information for the SDMClient.jar in use.
static int getLoginTimeout()
          Returns the timeout in ms which is used for the initial login to the SDM server.
static void setLoginTimeout(int newTimeout)
          Sets the timeout in ms which is used for the initial login to the SDM server.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientSessionFactory

public ClientSessionFactory()
Method Detail

createRemoteClientSession

public static ClientSession createRemoteClientSession(int port,
                                                      java.lang.String host)
                                               throws RemoteException
Deprecated.  

Creates a client session on the specified SDM server. This method is deprecated with API client version 3 because there is a new method with an additional third parameter for the password. To make sure you are able to connect to the SDM server you have to use the new method since this method does work only as long as the password of the SDM server was not changed after installation.
Parameters:
port - the port on which the SDM server is listening
host - the host name of the SDM server
Returns:
a ClientSession representing the client session
Throws:
RemoteException - if no session on the specified SDM server can be established
java.lang.RuntimeException - if the SDM remote client lib is not properly installed

createRemoteClientSession

public static ClientSession createRemoteClientSession(int port,
                                                      java.lang.String host,
                                                      java.lang.String password)
                                               throws RemoteException
Creates a client session on the specified SDM server. Replaces the old deprecated version of this method without the password parameter. Due to security issues only this new method should be used to create a client session. However the old method still works as long as the password for the SDM server was not changed after installation. In contrast to createRemoteClientSessionIDE(int, String, String) this method throws a RemoteException when the login failes due to a wrong password. This method is new with API client version 3.
Parameters:
port - the port on which the SDM server is listening
host - the host name of the SDM server
password - the password of the SDM server
Returns:
a ClientSession representing the client session
Throws:
RemoteException - if no session on the specified SDM server can be established
java.lang.RuntimeException - if the SDM remote client lib is not properly installed

createRemoteClientSessionIDE

public static ClientSession createRemoteClientSessionIDE(int port,
                                                         java.lang.String host,
                                                         java.lang.String password)
                                                  throws RemoteException,
                                                         WrongPasswordException
Creates a client session on the specified SDM server. Replaces the old deprecated version of this method without the password parameter. Due to security issues only this new method should be used to create a client session. However the old method still works as long as the password for the SDM server was not changed after installation. In contrast to createRemoteClientSession(int, String, String) this method throws a WrongPasswordException when the login failes due to a wrong password. With that exception it should be easier to distinguish between communication problems and password problems in case of failing login. This method is new with API client version 3.
Parameters:
port - the port on which the SDM server is listening
host - the host name of the SDM server
password - the password of the SDM server
Returns:
a ClientSession representing the client session
Throws:
RemoteException - if no session on the specified SDM server can be established
WrongPasswordException - if the wrong password was supplied
java.lang.RuntimeException - if the SDM remote client lib is not properly installed

getAPIClientVersion

public static int getAPIClientVersion()
Returns the version information for the SDMClient.jar in use. You should compare this version number with the one returned by Client.getAPIServerVersion() to check whether this client is of the same version as the server.
Returns:
an int containing the version number

getLoginTimeout

public static int getLoginTimeout()
Returns the timeout in ms which is used for the initial login to the SDM server. Any additional calls of methods of the Client API are processed without a timeout.
Returns:
an int containing the timeout in ms

setLoginTimeout

public static void setLoginTimeout(int newTimeout)
Sets the timeout in ms which is used for the initial login to the SDM server. The default timeout is 30000 ms. This method has to be called prior to createRemoteClientSession(int, String, String) to change the timeout used for the initial login. if newTimeout < 0 then the timeout is set to zero i.e. no timeout.
Parameters:
newTimeout - the timeout in ms