com.sap.mdm.net
Class SimpleConnectionFactory

java.lang.Object
  extended bycom.sap.mdm.net.SimpleConnectionFactory

public class SimpleConnectionFactory
extends java.lang.Object

This class allows for creating a connection to the MDM server. A connection is needed whenever the MDM Java API needs to communicate with the MDM server. A connection is tied to a specific MDM server.

A simple connection is used, as opposed to a connection pool, in cases where there is no need for the more complex connection pool or when there exist a service that provide resource pooling.

Each call to getInstance returns a new instance.

Examples of connection tags:
localhost
The MDM server is on the local machine and the default port number of 20005.

MyMachine;40000
The MDM server is on the "MyMachine" and the port number is 40000.

See Also:
ConnectionPoolFactory

Field Summary
static int NO_TIMEOUT
          A constant for specifying no timeout.
 
Constructor Summary
SimpleConnectionFactory()
           
 
Method Summary
static SimpleConnection getInstance(java.lang.String connectionTag)
          Returns a connection to the MDM server.
static SimpleConnection getInstance(java.lang.String connectionTag, java.lang.String connectionSource)
          Returns a connection to the MDM server.
static int getTimeout()
          Returns the SO_TIMEOUT
static void setTimeout(int timeout)
          Sets the SO_TIMEOUT.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_TIMEOUT

public static final int NO_TIMEOUT
A constant for specifying no timeout.

See Also:
Constant Field Values
Constructor Detail

SimpleConnectionFactory

public SimpleConnectionFactory()
Method Detail

getInstance

public static SimpleConnection getInstance(java.lang.String connectionTag)
                                    throws ConnectionException
Returns a connection to the MDM server.

Parameters:
connectionTag - the connection tag encoding the host name and the port number
Returns:
a connection to the MDM server
Throws:
ConnectionException - if not able to create a connection to the MDM server

getInstance

public static SimpleConnection getInstance(java.lang.String connectionTag,
                                           java.lang.String connectionSource)
                                    throws ConnectionException
Returns a connection to the MDM server.

Parameters:
connectionTag - the connection tag encoding the host name and the port number
connectionSource - the connection source
Returns:
a connection to the MDM server
Throws:
ConnectionException - if not able to create a connection to the MDM server

setTimeout

public static void setTimeout(int timeout)
Sets the SO_TIMEOUT.

Parameters:
timeout - the timeout in milliseconds
See Also:
java.net.Socket

getTimeout

public static int getTimeout()
Returns the SO_TIMEOUT

Returns:
the timeout


Copyright 2004-2007 by SAP AG. All Rights Reserved.

SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies (SAP Group) for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.