com.infoengine.schema.client
Class SchemaUtils

java.lang.Object
  extended by com.infoengine.schema.client.SchemaUtils

public class SchemaUtils
extends java.lang.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).


Constructor Summary
SchemaUtils()
          Create a new SchemaUtils
SchemaUtils(javax.resource.cci.ConnectionFactory cxFactory)
          Create a new SchemaUtils with a previously configured ConnectionFactory
 
Method Summary
 java.security.Principal getAuthUser()
          Get the "trusted" user
 java.lang.String getEndpoint()
          Get the SOAP endpoint
 java.lang.String getGenerator()
          Get the SchemaGenerator that will be used to create schema.
 java.util.Locale getLocale()
          Get the local that is being sent with requests for schema
 java.lang.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
 java.lang.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(java.lang.String type)
          Request the schema definition for a type.
 void setAuthUser(java.security.Principal p)
          Set the "trusted" user
 void setEndpoint(java.lang.String s)
          Set the SOAP endpoint.
 void setGenerator(java.lang.String s)
          Set the SchemaGenerator that should be use to create schema.
 void setLocale(java.util.Locale l)
          Set the locale that should be sent with requests for schema
 void setPassword(java.lang.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(java.lang.String s)
          Set the username to be used when connecting to the SOAP endpoint
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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(java.lang.String s)
Set the SOAP endpoint.

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

Parameters:
s - the new endpoint

getEndpoint

public java.lang.String getEndpoint()
Get the SOAP endpoint

Returns:
the current SOAP endpoint

setUser

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

Parameters:
s - the username

getUser

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

Returns:
the username

setPassword

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

Parameters:
s - the password

getPassword

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

Returns:
the password

setGenerator

public void setGenerator(java.lang.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 java.lang.String getGenerator()
Get the SchemaGenerator that will be used to create schema.

Returns:
the generator classname

setLocale

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

Parameters:
l - the locale

getLocale

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

Returns:
the locale

setAuthUser

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

Parameters:
p - the user principal

getAuthUser

public java.security.Principal getAuthUser()
Get the "trusted" user

Parameters:
the - user

querySchema

public SchemaObject querySchema(java.lang.String type)
                         throws java.lang.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:
java.lang.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