wt.federation
Class DelegateUtilities

java.lang.Object
  extended bywt.federation.DelegateUtilities

public class DelegateUtilities
extends Object

DelegateUtilities provides class methods to retrieve delegates related information (e.g repository, repository type and Windchill type associated to the delegate ).


Field Summary
private static String CLASSNAME
           
static String DELEGATE_KEY
           
static String DELEGATE_SOURCE_URL
           
static String DESCRIPTION
           
static String DISPLAY_NAME
           
static String DN
           
private static DirectoryService ds
           
private static String provider
           
static String REPOSITORY_TYPE
           
static String repositorySearchFilter
           
static String reposTypeSearchFilter
           
private static String searchBase
           
private static boolean VERBOSE
           
static String WCTYPEID
           
static String wcTypeSearchFilter
           
 
Constructor Summary
DelegateUtilities()
           
 
Method Summary
static void debug(Group grp)
          debug for testing
static Element findObject(String dn)
          Find an object in the directory, return null instead of throwing exception if javax.naming.NameNotFoundException is caught
static String getAttValue(String searchFilter, String dspName, String att_name)
          Return the attribute value
static String getDisplayName(String dn)
          Return repository type display name
static Enumeration getDisplayNames(Group grp)
          Populates display names with 'ptcDisplayName'
static String getDN(String dspName, Group grp)
          Returns dn
static String getProvider()
          Returns the reference of default JNDI Adapter
static String getRepositoryDN(String dspName)
          Returns repository dn.
static Enumeration getRepositoryNames()
          Return all the repository display names
static String getRepositoryTypeDN(String dspName)
          return attibute value /** Returns repository type dn.
static Enumeration getRepositoryTypeNames()
          Return all the repositoryType display names
static String getReposTypeValue(String dspName, String att_name)
          To help 'jsp clients' to retrieve attribute values based on the display name from UI.
static String getReposValue(String dspName, String att_name)
          To help 'jsp clients' to retrieve attribute values based on the display name from UI.
static String getSearchBase(String jndiAdapter)
          Returns search base
private static void init()
          Initialization based on the default JNDI Adapter which is set by Info*Engine
static boolean isEntryExist(String dn)
          Checks if the object exist on the provider
static void main(String[] args)
          test driver
static Group queryRepositories()
          find all entries registered with 'objectclass=ptcRepositoryDefinition'
static Group queryRepositoryTypes()
          Find all entries registered with 'objectclass=ptcRepositoryTypeDefinition'
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reposTypeSearchFilter

public static String reposTypeSearchFilter

repositorySearchFilter

public static String repositorySearchFilter

wcTypeSearchFilter

public static String wcTypeSearchFilter

DELEGATE_KEY

public static final String DELEGATE_KEY
See Also:
Constant Field Values

DELEGATE_SOURCE_URL

public static final String DELEGATE_SOURCE_URL
See Also:
Constant Field Values

DESCRIPTION

public static final String DESCRIPTION
See Also:
Constant Field Values

DISPLAY_NAME

public static final String DISPLAY_NAME
See Also:
Constant Field Values

WCTYPEID

public static final String WCTYPEID
See Also:
Constant Field Values

REPOSITORY_TYPE

public static final String REPOSITORY_TYPE
See Also:
Constant Field Values

DN

public static final String DN
See Also:
Constant Field Values

provider

private static String provider

searchBase

private static String searchBase

ds

private static DirectoryService ds

VERBOSE

private static boolean VERBOSE

CLASSNAME

private static final String CLASSNAME
Constructor Detail

DelegateUtilities

public DelegateUtilities()
Method Detail

init

private static void init()
                  throws IOException,
                         IEException
Initialization based on the default JNDI Adapter which is set by Info*Engine

Throws:
IOException
IEException

getProvider

public static String getProvider()
                          throws IOException,
                                 IEException
Returns the reference of default JNDI Adapter

Returns:
String The directory provider
Throws:
IOException
IEException

getSearchBase

public static String getSearchBase(String jndiAdapter)
                            throws IOException,
                                   IEException
Returns search base

Parameters:
jndiAdapter - The reference of LDAP directory
Returns:
String The search base
Throws:
IOException
IEException

isEntryExist

public static boolean isEntryExist(String dn)
                            throws IOException,
                                   IEException
Checks if the object exist on the provider

Parameters:
dn - The distinguish name
Returns:
boolean
Throws:
IOException
IEException

getDN

public static String getDN(String dspName,
                           Group grp)
                    throws IOException,
                           IEException
Returns dn

Parameters:
dspName - The display name
grp - The Info*Engine Group
Returns:
String The dn
Throws:
IOException
IEException

findObject

public static Element findObject(String dn)
                          throws IOException,
                                 IEException
Find an object in the directory, return null instead of throwing exception if javax.naming.NameNotFoundException is caught

Parameters:
dn -
Returns:
Group
Throws:
IOException
IEException

getRepositoryDN

public static String getRepositoryDN(String dspName)
                              throws IOException,
                                     IEException
Returns repository dn.

Parameters:
dspName - The repository display name
Returns:
String The dn
Throws:
IOException
IEException

getReposValue

public static String getReposValue(String dspName,
                                   String att_name)
                            throws IOException,
                                   IEException
To help 'jsp clients' to retrieve attribute values based on the display name from UI.

Parameters:
dspName - The display name for the repository
att_name - The attribute name in the repository
Returns:
String The attribute value
Throws:
IOException
IEException

getReposTypeValue

public static String getReposTypeValue(String dspName,
                                       String att_name)
                                throws IOException,
                                       IEException
To help 'jsp clients' to retrieve attribute values based on the display name from UI.

Parameters:
dspName - The display name for the repository type
att_name - The attribute name in the repository type
Returns:
String The attribute value
Throws:
IOException
IEException

getAttValue

public static String getAttValue(String searchFilter,
                                 String dspName,
                                 String att_name)
                          throws IOException,
                                 IEException
Return the attribute value

Parameters:
searchFilter - The basic filter(e.g "(objectclass=ptcRepositoryDefinition)" )
dspName - The display name
att_name - The attribute name
Returns:
String The attribute value
Throws:
IOException
IEException

getRepositoryTypeDN

public static String getRepositoryTypeDN(String dspName)
                                  throws IOException,
                                         IEException
return attibute value /** Returns repository type dn.

Returns:
String The dn
Throws:
IOException
IEException

queryRepositoryTypes

public static Group queryRepositoryTypes()
                                  throws IEException,
                                         IOException
Find all entries registered with 'objectclass=ptcRepositoryTypeDefinition'

Returns:
Group The group of objects
Throws:
IEException
IOException

queryRepositories

public static Group queryRepositories()
                               throws IEException,
                                      IOException
find all entries registered with 'objectclass=ptcRepositoryDefinition'

Returns:
Group The group of objects
Throws:
IEException
IOException

getDisplayName

public static String getDisplayName(String dn)
                             throws IEException,
                                    IOException
Return repository type display name

Parameters:
dn -
Returns:
String The display name
Throws:
IEException
IOException

getDisplayNames

public static Enumeration getDisplayNames(Group grp)
                                   throws IEException,
                                          IOException
Populates display names with 'ptcDisplayName'

Parameters:
grp - The Group
Returns:
Enumeration The display names
Throws:
IEException
IOException

getRepositoryNames

public static Enumeration getRepositoryNames()
                                      throws IEException,
                                             IOException
Return all the repository display names

Returns:
Enumeration The repository names
Throws:
IEException
IOException

getRepositoryTypeNames

public static Enumeration getRepositoryTypeNames()
                                          throws IEException,
                                                 IOException
Return all the repositoryType display names

Returns:
Enumeration The repository type names
Throws:
IEException
IOException

debug

public static void debug(Group grp)
debug for testing


main

public static void main(String[] args)
test driver