com.softwareag.entirex.aci
Class LocationTransparencyService

java.lang.Object
  extended by com.softwareag.entirex.aci.LocationTransparencyService

public final class LocationTransparencyService
extends java.lang.Object

Connects to the LDAP directory via JNDI to retrieve Broker and BrokerService objects. Broker objects and BrokerService objects are configured with attributes in a directory. This locator service retrieves the objects with the help of com.softwareag.entirex.aci.ExxObjectFactory. Broker objects are named by logical Broker IDs. A broker object is returned with a real Broker ID and a dummy user ID, if the KERNELVERScall to this Broker was successful. BrokerService objects have, in addition to Broker objects, a server address in the form class/server/service.

This locator service is initialized implicitly with the file XDS.ini. Specify the location of this file in the system property 'entirex.location.transparency.ini'. Example: entirex.location.transparency.ini =C:\SoftwareAG\webMethods8\EntireX\config\XDS.ini.

An alternative is to specify the connection to the LDAP directory in a string. This string is read from the system property 'entirex.location.transparency.config'. It has the form 'ldap://<host>:<port>/<base DN> ?<key>=<value>&<key>=<value>&...'. The pairs key=value may contain any property for JNDI, i.e. 'java.naming.security.authentication=simple'. Two special keys 'AuthDN' and 'AuthPass' are mapped to 'java.naming.security.principal' and 'java.naming.security.credentials', respectively.

Only one of the system properties 'entirex.location.transparency.ini' and 'entirex.location.transparency.config' may be used. In both cases, "java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory" and "java.naming.factory.object=com.softwareag.entirex.aci.ExxObjectFactory" are included automatically.

This class is a Service Locator in the sense of the locator pattern of J2EE. For direct use of the JNDI lookup the following names for logical services or logical brokers have to be used. For a logical service use "sag-key=LogService=<logical service name>, sag-key=<set name>, sag-key=200, sag-key=LocTrans, sag-key=EntireX, sag-key=Software AG" below your base name. Here <logical service name> is the name of the logical service and <set name> is the name of the set of rules for location transparency. For a logical broker use "sag-key=LogBroker=<logical broker name>, sag-key=<set name>, sag-key=200, sag-key=LocTrans, sag-key=EntireX, sag-key=Software AG" below your base name. Here <logical broker name> is the name of the logical Broker and <set name> is the name of the set of rules for location transparency. Initialize the context for JNDI with properties including "java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory" and "java.naming.factory.object=com.softwareag.entirex.aci.ExxObjectFactory".

Since:
6.2.1

Method Summary
static void init(java.util.Properties jndiProperties)
          Initializes the JNDI directory context from the properties.
static void init(java.lang.String jndiPropsFilename)
          Initializes the JNDI directory context.
static Broker lookupBroker(java.lang.String logicalBrokerName)
          Retrieves the Broker bound to this logical Broker ID in the set 'DefaultSet'.
static Broker lookupBroker(java.lang.String logicalBrokerName, java.lang.String locTransSetName)
          Retrieves the Broker bound to this logical Broker ID in the given set.
static BrokerService lookupBrokerService(java.lang.String logicalServiceName)
          Retrieves the BrokerService bound to this logical service in the set 'DefaultSet'.
static BrokerService lookupBrokerService(java.lang.String logicalServiceName, java.lang.String locTransSetName)
          Retrieves the BrokerService bound to this logical service in the given set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

lookupBrokerService

public static BrokerService lookupBrokerService(java.lang.String logicalServiceName)
                                         throws BrokerException
Retrieves the BrokerService bound to this logical service in the set 'DefaultSet'.

Parameters:
logicalServiceName - the name of the logical service.
Returns:
BrokerService bound to this logical service in the set 'DefaultSet'.
Throws:
BrokerException - All Exceptions are wrapped into BrokerExceptions.

lookupBrokerService

public static BrokerService lookupBrokerService(java.lang.String logicalServiceName,
                                                java.lang.String locTransSetName)
                                         throws BrokerException
Retrieves the BrokerService bound to this logical service in the given set.

Parameters:
logicalServiceName - the name of the logical service.
locTransSetName - the name of the set of rules for Location Transparency. If the name is null or has length 0, the name is set to 'DefaultSet'.
Returns:
BrokerService bound to this logical service in the given set.
Throws:
BrokerException - All Exceptions are wrapped into BrokerExceptions.

lookupBroker

public static Broker lookupBroker(java.lang.String logicalBrokerName)
                           throws BrokerException
Retrieves the Broker bound to this logical Broker ID in the set 'DefaultSet'.

Parameters:
logicalBrokerName - the name of the logical Broker.
Returns:
Broker bound to this logical Broker in the set 'DefaultSet'.
Throws:
BrokerException - All Exceptions are wrapped into BrokerExceptions.

lookupBroker

public static Broker lookupBroker(java.lang.String logicalBrokerName,
                                  java.lang.String locTransSetName)
                           throws BrokerException
Retrieves the Broker bound to this logical Broker ID in the given set.

Parameters:
logicalBrokerName - the name of the logical Broker.
locTransSetName - the name of the set of rules for Location Transparency. If the name is null or has length 0, the name is set to 'DefaultSet'.
Returns:
Broker bound to this logical Broker in the given set.
Throws:
BrokerException - All Exceptions are wrapped into BrokerExceptions.

init

public static void init(java.lang.String jndiPropsFilename)
                 throws BrokerException
Initializes the JNDI directory context. Use this only if the configuration with 'XDS.ini' is not possible.

Parameters:
jndiPropsFilename - the name of the file with the JNDI properties. If null is used, 'JNDI.properties' is read.
Throws:
BrokerException - on errors in configuration.

init

public static void init(java.util.Properties jndiProperties)
                 throws BrokerException
Initializes the JNDI directory context from the properties. Use this only if the configuration with 'XDS.ini' is not possible, i.e. from an applet.

Parameters:
jndiProperties - the properties object with the JNDI properties.
Throws:
BrokerException - on errors in configuration.