com.semarchy.mdm.client
Class MDMConnectionFactory

java.lang.Object
  extended by com.semarchy.mdm.client.MDMConnectionFactory

public final class MDMConnectionFactory
extends Object

This class allows to create client connections to a Convergence for MDM instance.

Static methods are provided to create IMDMConnection instances that are used to communicate with a remote Convergence for MDM instance.

The most common way to create a connection is to use connect(String, String, String) which allows to create a connection to a Convergence For MDM instance for a given url, username and password. Usage:

 // Establish the connection
 IMDMConnection mdmConnection = MDMConnectionFactory.connect("http://localhost:8080/semarchy/", "semadmin", "semadmin")
 // Use the connection to obtain remote information 
 String version = mdmConnection.getPlatformVersion();
 String authenticatedUserName = mdmConnection.getUsername();
 ...
 

Author:
sarod

Method Summary
static IMDMConnection connect(ICacheResolver pCacheResolver, ConnectionConfig pConfig, IMDMCredential pCredentials)
          Similar to connect(String, IMDMCredential) except that the ICacheResolver parameter allows to control the scope of client side caching.
static IMDMConnection connect(String pSemarchyBaseURL, IMDMCredential pCredentials)
          Similar to connect(String, String, String) except that the client will be authenticated with the provided IMDMCredential.
static IMDMConnection connect(String pConvergenceForMDMBaseURL, String pUsername, String pPassword)
          Creates a connection to a Convergence for MDM instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

connect

public static final IMDMConnection connect(String pConvergenceForMDMBaseURL,
                                           String pUsername,
                                           String pPassword)
Creates a connection to a Convergence for MDM instance. The connection will be established to communicate with the instance at the given URL and the client will be authenticated using the provided username and password.

Parameters:
pConvergenceForMDMBaseURL - the base URL of the Semarchy Convergence For MDM instance something like http://<host-name>/semarchy/
pUsername -
pPassword -
Returns:

connect

public static final IMDMConnection connect(String pSemarchyBaseURL,
                                           IMDMCredential pCredentials)
Similar to connect(String, String, String) except that the client will be authenticated with the provided IMDMCredential.

Parameters:
pSemarchyBaseURL -
pCredentials -
Returns:
See Also:
CookieCredential, UsernamePassword

connect

public static final IMDMConnection connect(ICacheResolver pCacheResolver,
                                           ConnectionConfig pConfig,
                                           IMDMCredential pCredentials)
Similar to connect(String, IMDMCredential) except that the ICacheResolver parameter allows to control the scope of client side caching. The client side cache allows to share some static elements across several IMDMConnection connection improving performance and reduce memory footprint when a lot of connections are used.

Parameters:
pCacheResolver - if null the StaticCacheResolver.instance()) will be used which is a good for most use cases
pConfig -
pCredentials -
Returns:


Copyright © 2015. All Rights Reserved.