*** This class provides Binary Compatibility only, not Source Compatibility ***
Package com.sas.services.connection
Class XMLConfigurationBuilder
java.lang.Object
com.sas.services.connection.XMLConfigurationBuilder
@SASScope("ALL")
@BinaryCompatibilityOnly
public final class XMLConfigurationBuilder
extends Object
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
ConstructorsConstructorDescriptionXMLConfigurationBuilder(File serverInfoFile) Construct aConfigurationBuilderobject with a server information XML file.XMLConfigurationBuilder(File serverInfoFile, File userInfoFile) Construct aConfigurationBuilderobject with a server information XML file and a user information XML file. -
Method Summary
Modifier and TypeMethodDescriptionGet theManualConnectionFactoryConfigurationobject created from the server information XML file.getCredentialForDomain(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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
XMLConfigurationBuilder
Construct aConfigurationBuilderobject 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 fileNullPointerException- if serverInfoFile isnull
-
XMLConfigurationBuilder
public XMLConfigurationBuilder(File serverInfoFile, File userInfoFile) throws ConnectionFactoryException Construct aConfigurationBuilderobject 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 ITConfiguserInfoFile- 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 fileNullPointerException- if serverInfoFile isnull
-
-
Method Details
-
getConfiguration
Get theManualConnectionFactoryConfigurationobject created from the server information XML file.- Returns:
- the
ManualConnectionFactoryConfigurationobject created from the server information XML file.
-
getCredentialForDomain
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
nullif no credential was specified for that domain
-