***  This class provides Binary Compatibility only, not Source Compatibility  ***

com.sas.services.connection
Class XMLConfigurationBuilder

com.sas.services.connection.XMLConfigurationBuilder

public final class XMLConfigurationBuilder

Converts XML configuration files produced by the Integration Technologies Configuration tool (ITConfig) into a ManualConnectionFactoryConfiguration object. ITConfig produces a server information XML file that describes connection parameters for an IOM server or a cluster of servers. Typically the server information XML file describes connection parameters for a SAS Metadata Server.

The server information XML file may also describe one or more credentials that can be used to connect to the IOM server. Alternately, ITConfig can produce a user information XML file that describes one or more credentials that can be used to connect to an IOM Server. Typically, the server information XML file and user information XML file each describe no more than one credential. In all cases, no more than one credential per authentication domain is allowed.

This class extracts the connection parameters for the IOM server and, if specified, the credentials that can be used to connect to the server.

Since:
9.2

Constructor Summary
XMLConfigurationBuilder(java.io.File serverInfoFile)
          Construct a ConfigurationBuilder object with a server information XML file.
XMLConfigurationBuilder(java.io.File serverInfoFile, java.io.File userInfoFile)
          Construct a ConfigurationBuilder object with a server information XML file and a user information XML file.
 
Method Summary
 ManualConnectionFactoryConfiguration getConfiguration()
          Get the ManualConnectionFactoryConfiguration object created from the server information XML file.
 Credential getCredentialForDomain(java.lang.String domain)
          Get the credential for a desired domain created from the user information XML file or from user information in the server information XML file.
 

Constructor Detail

XMLConfigurationBuilder

public XMLConfigurationBuilder(java.io.File serverInfoFile)
                        throws ConnectionFactoryException
Construct a ConfigurationBuilder object with a server information XML file.

Parameters:
serverInfoFile - a server information XML file produced by ITConfig
Throws:
ConnectionFactoryException - if there is a problem accessing or processing the server information XML file
java.lang.NullPointerException - if serverInfoFile is null

XMLConfigurationBuilder

public XMLConfigurationBuilder(java.io.File serverInfoFile,
                               java.io.File userInfoFile)
                        throws ConnectionFactoryException
Construct a ConfigurationBuilder object with a server information XML file and a user information XML file. If both the server information XML file and the user information XML file contain a credential for the same authentication domain, the one from the user information XML file will take precedence.

Parameters:
serverInfoFile - a server information XML file produced by ITConfig
userInfoFile - a user information XML file produced by ITConfig
Throws:
ConnectionFactoryException - if there is a problem accessing or processing the server information XML file or the user information XML file
java.lang.NullPointerException - if serverInfoFile is null
Method Detail

getConfiguration

public ManualConnectionFactoryConfiguration getConfiguration()
Get the ManualConnectionFactoryConfiguration object created from the server information XML file.

Returns:
the ManualConnectionFactoryConfiguration object created from the server information XML file.

getCredentialForDomain

public Credential getCredentialForDomain(java.lang.String domain)
Get the credential for a desired domain created from the user information XML file or from user information in the server information XML file.

This code shows an example of how to determine which domain to ask for:

 ConfigurationBuilder builder = new ConfigurationBuilder(...);
 ManualConnectionFactoryConfiguration cxfConfig = builder.getConfiguration();
 Cluster[] clusterArr = cxfConfig.getClusterArray();
 String domain = clusterArr[0].getDomain();
 Credential cred = builder.getCredentialForDomain(domain);
 
Here is a different example:
 ConfigurationBuilder builder = new ConfigurationBuilder(...);
 ManualConnectionFactoryConfiguration cxfConfig = builder.getConfiguration();
 ConnectionFactoryManager cxfManager = new ConnectionFactoryManager();
 ConnectionFactoryInterface cxf = cxfManager.getFactory(cxfConfig);
 List domainLst = cxf.getDomains();
 String domain = (String)domainLst.get(0);
 Credential cred = builder.getCredentialForDomain(domain);
 ConnectionInterface cx = cxf.getConnection(cred);
 

Parameters:
domain - the desired domain for the credential
Returns:
the credential for a desired domain or null if no credential was specified for that domain

***  This class provides Binary Compatibility only, not Source Compatibility  ***




Copyright © 2009 SAS Institute Inc. All Rights Reserved.