com.infoengine.schema.client
Class SchemaUtils

java.lang.Object
  extended bycom.infoengine.schema.client.SchemaUtils

public class SchemaUtils
extends Object

SOAP client utility class that allows non Info*Engine clients to retrieve object schema from Windchill/Info*Engine. This class requires all jars contained in the released ie.rar (Info*Engine connector) and a j2ee.jar (may be supplied by a 3rdparty j2ee vendor).


Nested Class Summary
(package private)  class SchemaUtils.CacheEntry
           
 
Field Summary
private  javax.resource.cci.ConnectionFactory cxFactory
           
private  IeConnectionSpec cxSpec
           
private  String endpoint
           
private  String generator
           
private  IeManagedConnectionFactory managedCxFactory
           
private static String NULL
           
private static Hashtable schemaCache
           
private static long timeToLive
           
 
Constructor Summary
SchemaUtils()
          Create a new SchemaUtils
SchemaUtils(javax.resource.cci.ConnectionFactory cxFactory)
          Create a new SchemaUtils with a previously configured ConnectionFactory
 
Method Summary
 Principal getAuthUser()
          Get the "trusted" user
 String getEndpoint()
          Get the SOAP endpoint
 String getGenerator()
          Get the SchemaGenerator that will be used to create schema.
 Locale getLocale()
          Get the local that is being sent with requests for schema
 String getPassword()
          Get the password to be used when connecting to the SOAP endpoint
static long getTimeToLive()
          Get the time to live for cahced object
 String getUser()
          Get the username to be used when connecting to the SOAP endpoint
 boolean isDescendedFrom(SchemaObject ancestor, SchemaObject descendant)
          Checks to see if one SchemaObject is the ancestor of another.
 SchemaObject querySchema(String type)
          Request the schema definition for a type.
 void setAuthUser(Principal p)
          Set the "trusted" user
 void setEndpoint(String s)
          Set the SOAP endpoint.
 void setGenerator(String s)
          Set the SchemaGenerator that should be use to create schema.
 void setLocale(Locale l)
          Set the locale that should be sent with requests for schema
 void setPassword(String s)
          Set the password to be used when connecting to the SOAP endpoint
static void setTimeToLive(long ttl)
          Set the time to live for cached objects
 void setUser(String s)
          Set the username to be used when connecting to the SOAP endpoint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL

private static final String NULL
See Also:
Constant Field Values

timeToLive

private static long timeToLive

schemaCache

private static Hashtable schemaCache

endpoint

private String endpoint

generator

private String generator

cxFactory

private javax.resource.cci.ConnectionFactory cxFactory

cxSpec

private IeConnectionSpec cxSpec

managedCxFactory

private IeManagedConnectionFactory managedCxFactory
Constructor Detail

SchemaUtils

public SchemaUtils()
Create a new SchemaUtils


SchemaUtils

public SchemaUtils(javax.resource.cci.ConnectionFactory cxFactory)
Create a new SchemaUtils with a previously configured ConnectionFactory

Parameters:
cxFactory -
Method Detail

setTimeToLive

public static void setTimeToLive(long ttl)
Set the time to live for cached objects

Parameters:
ttl - the new time to live value in milliseconds

getTimeToLive

public static long getTimeToLive()
Get the time to live for cahced object

Returns:
the time to live in milliseconds

setEndpoint

public void setEndpoint(String s)
Set the SOAP endpoint.

Example: "http://host/Windchill/servlet/RPC"

Parameters:
s - the new endpoint

getEndpoint

public String getEndpoint()
Get the SOAP endpoint

Returns:
the current SOAP endpoint

setUser

public void setUser(String s)
Set the username to be used when connecting to the SOAP endpoint

Parameters:
s - the username

getUser

public String getUser()
Get the username to be used when connecting to the SOAP endpoint

Returns:
the username

setPassword

public void setPassword(String s)
Set the password to be used when connecting to the SOAP endpoint

Parameters:
s - the password

getPassword

public String getPassword()
Get the password to be used when connecting to the SOAP endpoint

Returns:
the password

setGenerator

public void setGenerator(String s)
Set the SchemaGenerator that should be use to create schema.

The value of this property must be the fully qualified classname of a java class that implements the com.infoengine.schema.SchemaGenerator interface.

Parameters:
s - the generator classname to use

getGenerator

public String getGenerator()
Get the SchemaGenerator that will be used to create schema.

Returns:
the generator classname

setLocale

public void setLocale(Locale l)
Set the locale that should be sent with requests for schema

Parameters:
l - the locale

getLocale

public Locale getLocale()
Get the local that is being sent with requests for schema

Returns:
the locale

setAuthUser

public void setAuthUser(Principal p)
Set the "trusted" user

Parameters:
p - the user principal

getAuthUser

public Principal getAuthUser()
Get the "trusted" user


querySchema

public SchemaObject querySchema(String type)
                         throws Exception
Request the schema definition for a type.

This method may returned previously retrieved and cached information. Objects are cached based on type and locale.

Parameters:
type - the type to retrieve
Returns:
the SchemaObject retrieved or null
Throws:
Exception - in the case of an error

isDescendedFrom

public boolean isDescendedFrom(SchemaObject ancestor,
                               SchemaObject descendant)
Checks to see if one SchemaObject is the ancestor of another. This is done by examining the type hierarchy of the descendant searching to see if it contains the ancestor's type.

Parameters:
ancestor - the ancestor type descendant the descendant type
Returns:
true if ancestor's type is found in descendant's type hierarchy