com.tivoli.twg.engine
Class TWGFilterFactory

java.lang.Object
  extended bycom.tivoli.twg.engine.TWGObject
      extended bycom.tivoli.twg.engine.TWGPersistentObject
          extended bycom.tivoli.twg.engine.TWGFilterFactory

public class TWGFilterFactory
extends TWGPersistentObject

A TWGFilterFactory instance defines a list of database tables that appear on the edit dynamic groups panel. TWGFilterFactoryInstances are created during extension initialization in the initClassInstances method of the extension's TWGExtension subclass.

See Also:
TWGExtension

Field Summary
 
Fields inherited from class com.tivoli.twg.engine.TWGPersistentObject
CLASS_NAME, SIZEOF_BYTE, SIZEOF_CHAR, SIZEOF_DOUBLE, SIZEOF_FLOAT, SIZEOF_INT, SIZEOF_LONG, SIZEOF_SHORT
 
Constructor Summary
TWGFilterFactory()
          Default constructor for persistent data restore
TWGFilterFactory(java.lang.String id, TWGFilterFactoryParms parms)
          Constructor for TWGFilterFactory
 
Method Summary
 boolean addTable(java.lang.String table_class)
          Class method to add a table to the list of tables for this filter factory
protected  java.lang.String createFilterSQL(TWGFilterConstraint con, boolean full)
          Instance method to generate the SQL for a filter constraint.
 void delete()
          This method is protected as an implementation side effect.
static TWGFilterFactory findByIdString(java.lang.String id)
          Find a particular filter factory by its id string.
 void flatten(TWGByteArrayOutputStream data)
          Write table contents to a byte array.
 java.lang.String getBundleString(java.lang.String bundleKey, java.util.Locale loc)
          Look up a value in a resource bundle
 java.lang.String getDisplayName(java.util.Locale loc)
          Instance method to get the filter factory display name.
protected  MultiLocaleBundle getFactoryMultiLocaleBundle(java.lang.String bundleName)
          Get the multiLocaleBundle used for translating factory titles
static com.tivoli.twg.engine.TWGFilterFactoriesInfo getFilterFactories(java.util.Locale loc, boolean doColumnInfo)
          Class method to get the filter factory information for all known factories.
 java.lang.String getId()
          Instance method to get the id string for this factory
 com.tivoli.twg.engine.TWGFilterFactoryInfo getInfo(java.util.Locale loc, boolean doColumnInfo)
          Instance method to get the filter factory information for display on console
 com.tivoli.twg.engine.TWGFilterFactoryTableInfo getTableInfo(java.lang.String token, java.util.Locale loc)
          Instance method to get the table information for a specific table in the factory
 void removeTable(java.lang.String table_class)
          Class method to remove table to the list of tables for this filter factory
protected  void restoreData(TWGPersistentObjectDictionary dict, boolean do_resolve)
          Restore method for filter factory object
protected  void saveData(TWGPersistentObjectDictionary dict)
          Method for saving persistent object data.
protected static void setFactoryList(com.tivoli.twg.engine.TWGFilterFactoryList list)
          Class method set factories with the factory list object.
 java.lang.String toString()
          Convert object to String for debug
 
Methods inherited from class com.tivoli.twg.engine.TWGPersistentObject
Destroy, enableAsyncWrites, fromPersistID, initialize, isNewPersistentStore, isSaveRequired, PersistID, restore, restoreAll, save, save, setSaveRequired, terminate, toPersistID
 
Methods inherited from class com.tivoli.twg.engine.TWGObject
AllObjects, AllObjects, Delete, DumpTWGObjects, FindObject, isDeleted, isNewObject, isPersistent, isPersistent, isValid, isValid, ObjectID, setDistinctObjectID, SetObjectID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TWGFilterFactory

public TWGFilterFactory()
Default constructor for persistent data restore


TWGFilterFactory

public TWGFilterFactory(java.lang.String id,
                        TWGFilterFactoryParms parms)
                 throws TWGDbException
Constructor for TWGFilterFactory

Parameters:
id - - unique id string for the filter factory instance idea to put your company's prefix as part of the factory id e.g. com.BobCo.FactoryId.1 to keep it unique.
parms - - a TWGFilterFactoryParms object
Throws:
TWGDbException
See Also:
TWGFilterFactoryParms
Method Detail

setFactoryList

protected static void setFactoryList(com.tivoli.twg.engine.TWGFilterFactoryList list)
Class method set factories with the factory list object. To be used only by persistent restore in the TWGFilterFactoryList class.

Parameters:
list - - the TWGFilterFactoryList object

findByIdString

public static TWGFilterFactory findByIdString(java.lang.String id)
Find a particular filter factory by its id string.

This method should be run only in the Director engine.

Parameters:
id - - the id string for the factory
Returns:
the factory, or null if the factory is not found

getFilterFactories

public static com.tivoli.twg.engine.TWGFilterFactoriesInfo getFilterFactories(java.util.Locale loc,
                                                                              boolean doColumnInfo)
                                                                       throws TWGDbException
Class method to get the filter factory information for all known factories.

This method should be run only in the Director engine.

Parameters:
loc - - the locale to be used for translations.
doColumnInfo - - boolean specifying whether to retrieve column information
Returns:
a vector of TWGFilterFactoryInfo objects
Throws:
TWGDbException

getInfo

public com.tivoli.twg.engine.TWGFilterFactoryInfo getInfo(java.util.Locale loc,
                                                          boolean doColumnInfo)
                                                   throws TWGDbException
Instance method to get the filter factory information for display on console

This method should be run only in the Director engine.

Parameters:
loc - - the locale to be used for translations.
doColumnInfo - - boolean specifying whether to retrieve column information
Returns:
a TWGFilterFactoryInfo object
Throws:
TWGDbException - if the table is not found

getTableInfo

public com.tivoli.twg.engine.TWGFilterFactoryTableInfo getTableInfo(java.lang.String token,
                                                                    java.util.Locale loc)
                                                             throws TWGDbException
Instance method to get the table information for a specific table in the factory

This method should be run only in the Director engine.

Parameters:
token - - the token name for the table
loc - - the locale to be used for translations.
Returns:
a TWGFilterFactoryTableInfo object
Throws:
TWGDbException - if the table is not found

getDisplayName

public java.lang.String getDisplayName(java.util.Locale loc)
Instance method to get the filter factory display name.

Parameters:
loc - - the locale to be used for translations.
Returns:
the display name. If not found, the filter factory id is returned

createFilterSQL

protected java.lang.String createFilterSQL(TWGFilterConstraint con,
                                           boolean full)
                                    throws TWGFilterException
Instance method to generate the SQL for a filter constraint.

Parameters:
con - - the TWGFilterConstraint object
full - - generate full SQL?
Returns:
the SQL string for this constraint, for example if full is true, this method returns: SELECT MANAGED_OBJ_ID FROM DISK WHERE (DISK.DISK_TYPE = 'CDROM') if full is false, this method returns only the partial where clause: (DISK.DISK_TYPE = 'CDROM')
Throws:
TWGFilterException

addTable

public boolean addTable(java.lang.String table_class)
                 throws TWGDbException
Class method to add a table to the list of tables for this filter factory

Parameters:
table_class - - the class name for the table
Returns:
true if table added, false if table already existed
Throws:
TWGDbException

removeTable

public void removeTable(java.lang.String table_class)
                 throws TWGDbException
Class method to remove table to the list of tables for this filter factory

Parameters:
table_class - - the class name for the table
Throws:
TWGDbException

getFactoryMultiLocaleBundle

protected MultiLocaleBundle getFactoryMultiLocaleBundle(java.lang.String bundleName)
Get the multiLocaleBundle used for translating factory titles

Parameters:
bundleName - - the name of the resource bundle
Returns:
a MultiLocaleBundle

getBundleString

public java.lang.String getBundleString(java.lang.String bundleKey,
                                        java.util.Locale loc)
                                 throws java.util.MissingResourceException
Look up a value in a resource bundle

Parameters:
loc - - locale for the bundle
Returns:
string
Throws:
java.util.MissingResourceException

getId

public java.lang.String getId()
Instance method to get the id string for this factory

Returns:
the id string for the factory

delete

public void delete()
This method is protected as an implementation side effect. Do not call or change. Its interface may be changed in a later release. Instance method to delete a factory


flatten

public void flatten(TWGByteArrayOutputStream data)
Write table contents to a byte array. Used for saveData (persistent store)

Parameters:
data - - the TWGByteArrayOutputStream

saveData

protected void saveData(TWGPersistentObjectDictionary dict)
                 throws TWGPersistentObjectSaveException
Method for saving persistent object data.

Overrides:
saveData in class TWGPersistentObject
Parameters:
dict - - dictionary used to accumulate data
Throws:
TWGPersistentObjectSaveException - thrown to abort save procedure.

restoreData

protected void restoreData(TWGPersistentObjectDictionary dict,
                           boolean do_resolve)
                    throws TWGPersistentObjectRestoreException
Restore method for filter factory object

Overrides:
restoreData in class TWGPersistentObject
Parameters:
dict - - dictionary containing data to be restored
do_resolve - - true if second pass of restore (do resolve)
Throws:
TWGPersistentObjectRestoreException - if restore aborted

toString

public java.lang.String toString()
Convert object to String for debug

Returns:
String with a textual description of this object