wt.federation
Class DirectoryQuerySpecTranslator

java.lang.Object
  extended bywt.federation.DirectoryQuerySpecTranslator
All Implemented Interfaces:
QuerySpecTranslator, Serializable

public class DirectoryQuerySpecTranslator
extends Object
implements QuerySpecTranslator, Serializable

This class translates Windchill QuerySpec objects to directory search filter strings.

See Also:
Serialized Form

Field Summary
private  String classFilter
           
private  Hashtable classTable
           
private static String RESOURCE
           
private  FederatedDirectoryService service
           
private  DirectoryTranslationTable translationTable
           
private static boolean VERBOSE
           
private static String versionID
           
private  int whereCursor
           
private  Vector whereTokens
           
 
Constructor Summary
DirectoryQuerySpecTranslator()
          Constructor returning an instance initialized with a null service reference.
DirectoryQuerySpecTranslator(FederatedDirectoryService service)
          Constructor returning an instance initialized with a service reference.
 
Method Summary
 void setService(FederatedService service)
          Associate a FederatedService with the translator instance.
private  String translateIdentifier(String identifier)
          Translate an identifier of an SQL WHERE clause to an SQL-like Info*Engine search filter.
 String translateQuerySpec(QuerySpec spec)
          Translate a Windchill QuerySpec to an LDAP search expression.
private  String translateTerm()
          Translate a term of an SQL WHERE clause to an LDAP search expression.
private  String translateWhereClause()
          Translate an SQL WHERE clause to an LDAP search expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionID

private static final String versionID
See Also:
Constant Field Values

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

classFilter

private String classFilter

classTable

private Hashtable classTable

service

private FederatedDirectoryService service

translationTable

private DirectoryTranslationTable translationTable

whereCursor

private int whereCursor

whereTokens

private Vector whereTokens

VERBOSE

private static boolean VERBOSE
Constructor Detail

DirectoryQuerySpecTranslator

public DirectoryQuerySpecTranslator(FederatedDirectoryService service)
Constructor returning an instance initialized with a service reference.

Parameters:
service - FederatedDirectoryService to interface with

DirectoryQuerySpecTranslator

public DirectoryQuerySpecTranslator()
Constructor returning an instance initialized with a null service reference.

Method Detail

setService

public void setService(FederatedService service)
Associate a FederatedService with the translator instance.

Specified by:
setService in interface QuerySpecTranslator
Parameters:
service - FederatedService object to associate with this translator

translateQuerySpec

public String translateQuerySpec(QuerySpec spec)
                          throws FederationServicesException
Translate a Windchill QuerySpec to an LDAP search expression.

Specified by:
translateQuerySpec in interface QuerySpecTranslator
Parameters:
spec - QuerySpec
Returns:
String LDAP search expression, null if QuerySpec can not be translated
Throws:
FederationServicesException

translateWhereClause

private String translateWhereClause()
Translate an SQL WHERE clause to an LDAP search expression.

Returns:
String LDAP search expression, null if WHERE clause can not be translated

translateTerm

private String translateTerm()
Translate a term of an SQL WHERE clause to an LDAP search expression.

Returns:
String LDAP search expression, null if term can not be translated

translateIdentifier

private String translateIdentifier(String identifier)
Translate an identifier of an SQL WHERE clause to an SQL-like Info*Engine search filter.

Parameters:
identifier - the identifier to translate (e.g., A0.name)
Returns:
String search filter, null if term can not be translated