com.metamatrix.connector.ldap
Class IQueryToLdapSearchParser

java.lang.Object
  extended by com.metamatrix.connector.ldap.IQueryToLdapSearchParser

public class IQueryToLdapSearchParser
extends java.lang.Object

Utility class which translates a SQL query into an LDAP search.


Constructor Summary
IQueryToLdapSearchParser(ConnectorLogger logger, RuntimeMetadata rm, java.util.Properties props)
          Constructor.
 
Method Summary
 java.lang.String getNameFromElement(Element e)
          Method to get name from the supplied Element
 LDAPSearchDetails translateSQLQueryToLDAPSearch(IQuery query)
          Public entry point to the parser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IQueryToLdapSearchParser

public IQueryToLdapSearchParser(ConnectorLogger logger,
                                RuntimeMetadata rm,
                                java.util.Properties props)
Constructor.

Parameters:
logger - the connector logger
rm - the RuntimeMetadata
Method Detail

translateSQLQueryToLDAPSearch

public LDAPSearchDetails translateSQLQueryToLDAPSearch(IQuery query)
                                                throws ConnectorException
Public entry point to the parser. Parses the IQuery object, and constructs an equivalent LDAP search filter, keeping track of the attributes of interest. Here are some example SQL queries, and the equivalent LDAP search info: SQL: select cn, managerName from people_table where managerName LIKE "John%" and cn!="Mar()" Context name: [people_table's NameInSource, e.g. (ou=people,dc=company,dc=com)] LDAP attributes: (cn, String), (managerName, String) LDAP search filter: (&(managerName="John*")(!(cn="Mar\(\)")))

Parameters:
query - the query
Returns:
the LDAPSearchDetails object
Throws:
ConnectorException

getNameFromElement

public java.lang.String getNameFromElement(Element e)
                                    throws ConnectorException
Method to get name from the supplied Element

Parameters:
e - the supplied Element
Returns:
the name
Throws:
ConnectorException


Copyright © 2009. All Rights Reserved.