com.tivoli.twg.engine
Class TWGFilter

java.lang.Object
  extended bycom.tivoli.twg.engine.TWGObject
      extended bycom.tivoli.twg.engine.TWGPersistentObject
          extended bycom.tivoli.twg.engine.TWGFilter
All Implemented Interfaces:
TWGBaseShadowedObject, TWGConsoleSpecShadowedObject, TWGGetSetInterface

public class TWGFilter
extends TWGPersistentObject
implements TWGConsoleSpecShadowedObject, TWGGetSetInterface

Base filter class for Director Server.


Field Summary
static java.lang.String DEFAULT_ALL_ID
          Default 'all' filter ID string
static java.lang.String DEFAULT_NONE_ID
          Default 'none' filter ID string
static int FILTER_TYPE_FUNCTIONAL
          Filter type = functional
static int FILTER_TYPE_MOCLASS
          Filter type = managed object class
static int FILTER_TYPE_STATIC
          Filter type = static
static int FILTER_TYPE_TASK
          Filter type = task
 
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
TWGFilter()
          Default constructor : for restore
TWGFilter(TWGFilterParms parms)
          Constructor for dynamic, static, and task filters.
TWGFilter(TWGFilterParms parms, java.lang.String extensionClassName)
          Constructor for dynamic, static, and task filters.
 
Method Summary
static void attachAllAllowedFilters(TWGActiveConsole con)
          Attach console to all allowed filters
 void AttachObjectToConsole(TWGActiveConsole act_con)
          Associate the object with the given TWGActiveConsole instance.
 void changeParms(TWGFilterParms parms)
          Change the parameters for a dynamic database filter, a static filter, or a task filter
 void clearUserCustomized()
          Clear user customized flag to false;
 TWGFilter copyFrom(TWGFilter sourceFilter)
          Copies instance data from the source filter into this filter instance.
 void Delete()
          Delete method : use to remove object from list
 void Destroy()
          Object destroy - clean up persistent data for object
static void detachAllDisallowedFilters(TWGActiveConsole con)
          Detach all disallowed filters from console
 void DetachObjectFromAllConsoles()
          Disassociate the object from all TWGActiveConsoles.
 void DetachObjectFromConsole(TWGActiveConsole act_con)
          Disassociate the object from the given TWGActiveConsole instance.
static TWGFilter findByGUID(com.tivoli.twg.engine.GlobalUniqueID guid)
          Find filter instance by a Group Unique ID.
static TWGFilter findByIDString(java.lang.String id)
          Find filter instance by ID string
static TWGFilter[] findByName(java.lang.String name, java.util.Locale locale, TWGFilter filterToSkip)
          Find all filter instances by a single title.
static TWGFilter findFilterByName(java.lang.String n)
          Find filter by name
 java.lang.String[] getAttributeIDList()
          Attribute ID enumeration : this method is expected to return a List of strings containing the String names of the attributes supported for a given object.
 int getAttributeType(java.lang.String id)
          Get type of attribute value for given attribute
 DataValue getAttributeValue(java.lang.String id, java.util.Locale loc)
          Get value of attribute with given ID
 java.lang.String GetConShadowClass()
          Get name of console shadow class.
 TWGFilterConstraints getConstraints()
          Get the constraints for this filter.
 java.util.Date getDateCreated()
          Get date when filter was created.
 java.util.Date getDateLastUpdated()
          Get date when filter was last updated.
 StringValueSet getDBTableTokens()
          Get database table tokes for filter (if any)
static TWGFilter getDefault()
          Get default filter instance : this function is only valid after initBuiltInFilters() is called.
 java.lang.String getExtensionClassName()
          Get the name of the extension class that defined this filter.
 com.tivoli.twg.engine.GlobalUniqueID getGUID()
          Get group unique ID
 java.lang.String getIDString()
          Get ID string
 int getImageSet()
          Get image set.
static java.lang.String getLocalSystemName()
          Return the unique ID of the system we are executing on at the moment.
static long getLocalUniqueID()
          Return the unique ID ofthe server we are executing on at the moment.
 TWGManagedObjectSet getManagedObjectSet()
          Get reference to managed object set maintained by filter (if active)
 java.lang.String getMOClassName()
          Get name of managed object class for MOCLASS filter
 java.lang.String getName()
          Get name of filter (use default locale)
 java.lang.String getName(java.util.Locale loc)
          Get name of filter (using given locale)
 java.lang.Object getNameNLSString()
          Get the nlsString value to be used for a translated name.
static TWGFilter getNone()
          Get 'none' filter instance : this function is only valid after initBuiltInFilters() is called.
protected  byte[] getSaveDataBuffer()
          Method for saving persistent object data into a byte buffer.
protected  byte[] getSaveDataBuffer(boolean forPersist)
          Method for saving persistent object data into a byte buffer.
 byte[] GetShadowRecord(java.util.Locale locale)
          Get buffer containing current values of the shadowed attributes to be delivered to the console shadow class.
 long GetShadowVersion()
          Get object state version.
 StringValueSet getTaskIDs()
          Get the task IDs for this filter.
 int getType()
          Get type of filter
 boolean getUserCustomized()
          Returns user customized flag.
static void handleFilterSubscribe(Command cmd)
          Handler for external filter subscribe command
static void handleFilterUnsubscribe(Command cmd)
          Handler for external filter unsubscribe command
static boolean idStringExists(java.lang.String id)
          Determines if an id string exists in the current filter pool.
static void initBuiltInFilters()
          Initialize built-in filter instances, if needed.
static void initDefaultImages()
          Initialize default images for dynamic and static filters
static void initImportExporter()
          Initialize filter set import and export processor.
 boolean isActive()
          Return true if filter is active
static boolean isAnyTaskFilterActive()
          Test if any task based filter is active
 boolean isConsoleDeletable()
          Test if managed object is console deletable
 boolean isConsoleHidden()
          Test if filter is hidden to console
 boolean isDefault()
          Test if filter is global default ('all') filter
 boolean isFunctional()
          Test if filter is functional filter
 boolean isManagedObjectSetValid()
          Test if filter's MOS is currently valid
 boolean isMOClass()
          Test if filter is managed object class filter
 boolean isNone()
          Test if filter is global none filter
 boolean isReadOnly()
          Test if filter is read-only
 boolean isStatic()
          Test if filter is static filter
 boolean isTaskFilter()
          Test if filter is task filter
static void makeDefaultMOFFilter(TWGManagedObjectFactory mof)
          Build default filter for given MOF, if not yet created
static java.lang.String makeIDStringUnique(java.lang.String id)
          Makes the idString passed in as a parameter unique to the filter pool by appending a suffix counter to the end of the string.
 boolean makeTitleUnique(java.util.Locale locale)
          Analyse the filter title to see if it is a duplicate of an existing filter.
 void notifySubscribersOfChange(IntValueSet add_set, IntValueSet chg_set, IntValueSet del_set)
          Notify all of the subscribers of a set of adds, changes, and deletes
 void processNewChangedManagedObjects(IntValueSet obj_ids, IntValueSet ids_to_include)
          Primary processing method for TWGFilter : this method is called, and provided with set of TWGManagedObject IDs which have been added or changed.
 void processNewChangedManagedObjects(IntValueSet obj_ids, IntValueSet ids_to_include, StringValueSet db_tables)
          Primary processing method for TWGFilter : this method is called, and provided with set of TWGManagedObject IDs which have been added or changed.
static void processNewChangedManagedObjectsForAllFilters(IntValueSet new_set, IntValueSet chg_set, IntValueSet activated_flt)
          Do processing of given add and update sets for all active filters
static void processNewChangedManagedObjectsForAllFilters(IntValueSet new_set, IntValueSet chg_set, IntValueSet activated_flt, StringValueSet db_tables)
          Do processing of given add and update sets for all active filters
protected  void restoreData(TWGPersistentObjectDictionary dict, boolean do_resolve)
          Restore method for filter object
protected  void restoreDataFromBuffer(byte[] buf, boolean makePublic, boolean reportErrors, boolean makeIDStringUnique)
          Restore from data buffer method for filter object.
protected  void saveData(TWGPersistentObjectDictionary dict)
          Method for saving persistent object data.
 boolean setAttributeValue(java.lang.String id, DataValue val)
          Set value of attribute with given ID
 void setConsoleDeletable(boolean flg)
          Set managed object 'console deletable' flag (default is deletable)
 void setConsoleHidden(boolean flg)
          Set filter 'console hidden' flag (default is not hidden)
 void setExtensionClassName(java.lang.String extensionClassName)
          Set the name of the extension class that defined this filter.
 void setGUID(com.tivoli.twg.engine.GlobalUniqueID newID)
          Set Global unique ID
 boolean setIDString(java.lang.String new_id)
          Set ID string
 void setImageSet(int oid)
          Set image set.
 void setMOClassName(java.lang.String new_mo)
          Set managed object class for MOCLASS filters
 void setName(java.lang.String n)
          Set name of filter
 void setName(java.lang.String nameid, java.lang.String namerb)
          Set name of filter using resouce bundle name and ID
 void SetObjectID(long oid)
          Set object ID.
 void setReadOnly(boolean flg)
          Set read-only flag
 void setSubName(java.lang.String n)
          Set sub-name of filter : used for parm '{0}' in name string
 void setType(int new_t)
          Set type of filter
 void setUserCustomized()
          Set user customized flag to true;
 void subscribeConsoleToFilter(TWGActiveConsole con)
          Subscribe console to filter
 void subscribeToFilter(TWGFilterSubscriber sub)
          Subscribe to filter
 java.lang.String toString()
          Returns a string representation of the object.
 void touchDateLastUpdated()
          Set "dateLastUpdated" to current time.
 void unsubscribeAllFilterSubscribers()
          Remove all subscribers from filter
 void unsubscribeConsoleFromFilter(TWGActiveConsole con)
          Unsubscribe console from filter
 void unsubscribeFromFilter(TWGFilterSubscriber sub)
          Unsubscribe from filter
 void UpdateShadowVersion()
          Update object state version.
protected static void verifyAll()
          This method should be by the Director Server engine during server initialization.
 
Methods inherited from class com.tivoli.twg.engine.TWGPersistentObject
enableAsyncWrites, fromPersistID, initialize, isNewPersistentStore, isSaveRequired, PersistID, restore, restoreAll, save, save, setSaveRequired, terminate, toPersistID
 
Methods inherited from class com.tivoli.twg.engine.TWGObject
AllObjects, AllObjects, DumpTWGObjects, FindObject, isDeleted, isNewObject, isPersistent, isPersistent, isValid, isValid, ObjectID, setDistinctObjectID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FILTER_TYPE_FUNCTIONAL

public static final int FILTER_TYPE_FUNCTIONAL
Filter type = functional

See Also:
Constant Field Values

FILTER_TYPE_STATIC

public static final int FILTER_TYPE_STATIC
Filter type = static

See Also:
Constant Field Values

FILTER_TYPE_MOCLASS

public static final int FILTER_TYPE_MOCLASS
Filter type = managed object class

See Also:
Constant Field Values

FILTER_TYPE_TASK

public static final int FILTER_TYPE_TASK
Filter type = task

See Also:
Constant Field Values

DEFAULT_ALL_ID

public static final java.lang.String DEFAULT_ALL_ID
Default 'all' filter ID string

See Also:
Constant Field Values

DEFAULT_NONE_ID

public static final java.lang.String DEFAULT_NONE_ID
Default 'none' filter ID string

See Also:
Constant Field Values
Constructor Detail

TWGFilter

public TWGFilter()
Default constructor : for restore


TWGFilter

public TWGFilter(TWGFilterParms parms)
          throws TWGFilterException
Constructor for dynamic, static, and task filters.

Parameters:
parms - - the parameters for the filter
Throws:
TWGFilterException - for any error creating the filter
See Also:
TWGFilterParms

TWGFilter

public TWGFilter(TWGFilterParms parms,
                 java.lang.String extensionClassName)
          throws TWGFilterException
Constructor for dynamic, static, and task filters.

Parameters:
parms - - the parameters for the filter
extensionClassName - - the name of the extension class instantiating this filter
Throws:
TWGFilterException - for any error creating the filter
See Also:
TWGFilterParms
Method Detail

changeParms

public void changeParms(TWGFilterParms parms)
                 throws TWGFilterException
Change the parameters for a dynamic database filter, a static filter, or a task filter

Throws:
TWGFilterException - for any error updating the filter
See Also:
TWGFilterParms

getExtensionClassName

public final java.lang.String getExtensionClassName()
Get the name of the extension class that defined this filter.

Returns:
the name of the extension class that defined this filter.

setExtensionClassName

public final void setExtensionClassName(java.lang.String extensionClassName)
Set the name of the extension class that defined this filter.


Delete

public void Delete()
Delete method : use to remove object from list

Overrides:
Delete in class TWGObject

Destroy

public void Destroy()
             throws TWGObjectDestroyException
Object destroy - clean up persistent data for object

Overrides:
Destroy in class TWGPersistentObject
Throws:
TWGObjectDestroyException - if error during destroy

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.

getSaveDataBuffer

protected byte[] getSaveDataBuffer()
                            throws TWGPersistentObjectSaveException
Method for saving persistent object data into a byte buffer. The resulting byte buffer can then be used for saving into the persistent data store or for filter exporting.

Returns:
byte[] buffer containing flattened object persistent data.
Throws:
TWGPersistentObjectSaveException

getSaveDataBuffer

protected byte[] getSaveDataBuffer(boolean forPersist)
                            throws TWGPersistentObjectSaveException
Method for saving persistent object data into a byte buffer. The resulting byte buffer can then be used for saving into the persistent data store or for filter exporting.

Returns:
byte[] buffer containing flattened object persistent data.
Throws:
TWGPersistentObjectSaveException

restoreData

protected void restoreData(TWGPersistentObjectDictionary dict,
                           boolean do_resolve)
                    throws TWGPersistentObjectRestoreException
Restore method for filter 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

restoreDataFromBuffer

protected void restoreDataFromBuffer(byte[] buf,
                                     boolean makePublic,
                                     boolean reportErrors,
                                     boolean makeIDStringUnique)
                              throws TWGPersistentObjectRestoreException
Restore from data buffer method for filter object. This is a helper method that is used for both filter restoration from presistent data store and from filter importing.

Parameters:
buf - - buffer containing saved filter to be restored. This buffer must have been created using the "getDataSaveBuffer" method.
makePublic - - boolean indicating if instanciated filter will be made public to the server community. true=make the filter public. Not making the filter public is used when you want to instanciate a filter to test for errors before making the filter public. This "non public" function is used by the filter import to test for filter correctness before the filter is actually imported. Normally however, you will set the paraeter to "true" hence making the filter public to the server.
reportErrors - - boolean indicating if you desire exceptions to be thrown when erors are found. Exceptions are expected when filters are instanciated and made public to the server such as during persistance data store processing at server launch time. Hence, if an error is found (for example,name space collision) all further processing is stopped, the exception is thrown and the filter instance is not fully instanciated. During filter importing however, the filter must be instanciated but not made public so analysis can be performed on the filter prior to actually making the filter public. So that the filter can be instanciated and tested, these exceptions must be disabled.
makeIDStringUnique - - boolean indicating if you desire that the filter's IDString be made unique by appending a numeric suffix onto its end. true= make the id strinf unique. False = do not make the id unique. If there is a duplicate, an exception s thrown. Typically this parameter should be false. It is set true during filter import processing.
Throws:
TWGPersistentObjectRestoreException - if restore aborted and "reportErrors" is true

UpdateShadowVersion

public void UpdateShadowVersion()
Update object state version. This method must call the TWGActiveConsole.nextShadowVersion() to update its internal state_version attribute (a 'long' instance variable). This method should be called by any methods of the object's class or subclasses which modify attributes which are send to the shadow objects on the console).

Specified by:
UpdateShadowVersion in interface TWGBaseShadowedObject

GetShadowVersion

public long GetShadowVersion()
Get object state version. This returns value of state_version.

Specified by:
GetShadowVersion in interface TWGBaseShadowedObject
Returns:
state_version attribute value

GetConShadowClass

public java.lang.String GetConShadowClass()
Get name of console shadow class. This returns the name of TWGConObject subclass which is used to hold the attributes shadowed to the console.

Specified by:
GetConShadowClass in interface TWGBaseShadowedObject
Returns:
com.tivoli.twg.engine.TWGConObject subclass which object shadows to

GetShadowRecord

public byte[] GetShadowRecord(java.util.Locale locale)
Get buffer containing current values of the shadowed attributes to be delivered to the console shadow class. This data is delivered along with the ObjectID (so the ObjectID shouldn't be included in the shadowed data record).

Specified by:
GetShadowRecord in interface TWGBaseShadowedObject
Parameters:
locale - - Locale of requested data
Returns:
byte array containing opaque data representation of attribute values to be delivered to the console shadow class.

getName

public java.lang.String getName()
Get name of filter (use default locale)

Returns:
name

getName

public java.lang.String getName(java.util.Locale loc)
Get name of filter (using given locale)

Parameters:
loc - - locale of request
Returns:
name

setName

public void setName(java.lang.String n)
Set name of filter

Parameters:
n - - new name

setSubName

public void setSubName(java.lang.String n)
Set sub-name of filter : used for parm '{0}' in name string

Parameters:
n - - new sub-name

setName

public void setName(java.lang.String nameid,
                    java.lang.String namerb)
Set name of filter using resouce bundle name and ID

Parameters:
nameid - - identifier for name
namerb - - name of resouce bundle containing name

getDateCreated

public java.util.Date getDateCreated()
Get date when filter was created.

Returns:
filter type

getDateLastUpdated

public java.util.Date getDateLastUpdated()
Get date when filter was last updated.

Returns:
filter type

getGUID

public com.tivoli.twg.engine.GlobalUniqueID getGUID()
Get group unique ID

Returns:
Group unique ID

getType

public int getType()
Get type of filter

Returns:
filter type

setType

public void setType(int new_t)
Set type of filter

Parameters:
new_t - - new value for type field

isReadOnly

public boolean isReadOnly()
Test if filter is read-only

Returns:
true if read-only, false if read-write

isDefault

public boolean isDefault()
Test if filter is global default ('all') filter

Returns:
true if is default, false if not

isNone

public boolean isNone()
Test if filter is global none filter

Returns:
true if is none filter, false if not

isStatic

public boolean isStatic()
Test if filter is static filter

Returns:
true if is static, false if not

isTaskFilter

public boolean isTaskFilter()
Test if filter is task filter

Returns:
true if is task, false if not

isMOClass

public boolean isMOClass()
Test if filter is managed object class filter

Returns:
true if is managed object class filter, false if not

isFunctional

public boolean isFunctional()
Test if filter is functional filter

Returns:
true if is a functional filter, false if not

isAnyTaskFilterActive

public static boolean isAnyTaskFilterActive()
Test if any task based filter is active

Returns:
true if active task filter found, false if not

getDefault

public static TWGFilter getDefault()
Get default filter instance : this function is only valid after initBuiltInFilters() is called.

Returns:
default filter

getNone

public static TWGFilter getNone()
Get 'none' filter instance : this function is only valid after initBuiltInFilters() is called.

Returns:
'none' filter

getIDString

public java.lang.String getIDString()
Get ID string

Returns:
ID string (or null if none defined)

setIDString

public boolean setIDString(java.lang.String new_id)
Set ID string

Parameters:
new_id - - new ID string (must be unique)
Returns:
true if new ID string set(and is unique)

setGUID

public void setGUID(com.tivoli.twg.engine.GlobalUniqueID newID)
Set Global unique ID

Parameters:
newID - - New GUID object. If null is specified, a new GUID is generated and assigned.

setUserCustomized

public void setUserCustomized()
Set user customized flag to true;


clearUserCustomized

public void clearUserCustomized()
Clear user customized flag to false;


getUserCustomized

public boolean getUserCustomized()
Returns user customized flag.


setMOClassName

public void setMOClassName(java.lang.String new_mo)
                    throws java.lang.ClassNotFoundException
Set managed object class for MOCLASS filters

Parameters:
new_mo - - new managed object class name
Throws:
java.lang.ClassNotFoundException - if class not loaded/supported

getMOClassName

public java.lang.String getMOClassName()
Get name of managed object class for MOCLASS filter

Returns:
name of managed object class

getConstraints

public TWGFilterConstraints getConstraints()
Get the constraints for this filter. Constraints will be null if filter is not a dynamic database filter.

Returns:
the constraints object

getTaskIDs

public StringValueSet getTaskIDs()
Get the task IDs for this filter. Task IDs will be null if filter is not a task filter.

Returns:
the constraints object

findByIDString

public static TWGFilter findByIDString(java.lang.String id)
Find filter instance by ID string

Parameters:
id - - ID string to search for
Returns:
matching filter instance, or null if none

findByName

public static TWGFilter[] findByName(java.lang.String name,
                                     java.util.Locale locale,
                                     TWGFilter filterToSkip)
Find all filter instances by a single title.

Parameters:
name - Expanded name to search for.
locale - Locale to use during match.
filterToSkip - Filter that is to be skipped in te search. Null is valid.
Returns:
Array of matching filter instances. An empty array if none found.

findByGUID

public static TWGFilter findByGUID(com.tivoli.twg.engine.GlobalUniqueID guid)
Find filter instance by a Group Unique ID.

Parameters:
guid - Group Unique ID to search for.
Returns:
Filter instance if found. Null if not found.

initBuiltInFilters

public static void initBuiltInFilters()
                               throws TWGPersistentObjectSaveException
Initialize built-in filter instances, if needed. Must be called after persistent object restore.

Throws:
TWGPersistentObjectSaveException - if error saving

makeDefaultMOFFilter

public static void makeDefaultMOFFilter(TWGManagedObjectFactory mof)
Build default filter for given MOF, if not yet created

Parameters:
mof - - Managed Object Factory to be checked

isActive

public boolean isActive()
Return true if filter is active

Returns:
true if active, false if inactive

subscribeToFilter

public void subscribeToFilter(TWGFilterSubscriber sub)
Subscribe to filter

Parameters:
sub - - reference to subscriber (which will be notified of change)

subscribeConsoleToFilter

public void subscribeConsoleToFilter(TWGActiveConsole con)
Subscribe console to filter

Parameters:
con - - active console to be subscribed

unsubscribeFromFilter

public void unsubscribeFromFilter(TWGFilterSubscriber sub)
Unsubscribe from filter

Parameters:
sub - - reference to subscriber (which will be notified of change)

unsubscribeConsoleFromFilter

public void unsubscribeConsoleFromFilter(TWGActiveConsole con)
Unsubscribe console from filter

Parameters:
con - - active console to be unsubscribed

unsubscribeAllFilterSubscribers

public void unsubscribeAllFilterSubscribers()
Remove all subscribers from filter


notifySubscribersOfChange

public void notifySubscribersOfChange(IntValueSet add_set,
                                      IntValueSet chg_set,
                                      IntValueSet del_set)
Notify all of the subscribers of a set of adds, changes, and deletes

Parameters:
add_set - - set of persistent IDs of objects added to set
chg_set - - set of persistent IDs of objects changed within set
del_set - - set of persistent IDs of objects deleted from set

getManagedObjectSet

public TWGManagedObjectSet getManagedObjectSet()
Get reference to managed object set maintained by filter (if active)

Returns:
managed object set reference, or null if not active

isManagedObjectSetValid

public boolean isManagedObjectSetValid()
Test if filter's MOS is currently valid

Returns:
true if valid, false if not valid

processNewChangedManagedObjects

public void processNewChangedManagedObjects(IntValueSet obj_ids,
                                            IntValueSet ids_to_include)
Primary processing method for TWGFilter : this method is called, and provided with set of TWGManagedObject IDs which have been added or changed. The TWGFilter code is responsible for processing these IDs, and adding any IDs which satisfy the criteria of the filter to the provided ids_to_include set.

Parameters:
obj_ids - - managed object IDs to be tested
ids_to_include - - set of IDs which the TWGFilter has determined should be included to its TWGManagedObjectSet (output)

processNewChangedManagedObjects

public void processNewChangedManagedObjects(IntValueSet obj_ids,
                                            IntValueSet ids_to_include,
                                            StringValueSet db_tables)
Primary processing method for TWGFilter : this method is called, and provided with set of TWGManagedObject IDs which have been added or changed. The TWGFilter code is responsible for processing these IDs, and adding any IDs which satisfy the criteria of the filter to the provided ids_to_include set.

Parameters:
obj_ids - - managed object IDs to be tested
ids_to_include - - set of IDs which the TWGFilter has determined should be included to its TWGManagedObjectSet (output)
db_tables - - table tokens of updated database tables (null if unknown - assume any table could have been touched)

processNewChangedManagedObjectsForAllFilters

public static void processNewChangedManagedObjectsForAllFilters(IntValueSet new_set,
                                                                IntValueSet chg_set,
                                                                IntValueSet activated_flt)
Do processing of given add and update sets for all active filters

Parameters:
new_set - - set of object IDs for new managed objects
chg_set - - set of object IDs for changed managed objects

processNewChangedManagedObjectsForAllFilters

public static void processNewChangedManagedObjectsForAllFilters(IntValueSet new_set,
                                                                IntValueSet chg_set,
                                                                IntValueSet activated_flt,
                                                                StringValueSet db_tables)
Do processing of given add and update sets for all active filters

Parameters:
new_set - - set of object IDs for new managed objects
chg_set - - set of object IDs for changed managed objects
activated_flt - - IDs of activated filters
db_tables - - Table tokens of updated database tables (null if unknown)

toString

public java.lang.String toString()
Returns a string representation of the object.

See Also:
Object.toString()

handleFilterSubscribe

public static void handleFilterSubscribe(Command cmd)
Handler for external filter subscribe command

Parameters:
cmd - - IPC command containing request

handleFilterUnsubscribe

public static void handleFilterUnsubscribe(Command cmd)
Handler for external filter unsubscribe command

Parameters:
cmd - - IPC command containing request

isConsoleDeletable

public boolean isConsoleDeletable()
Test if managed object is console deletable

Returns:
true if console deletable

setConsoleDeletable

public void setConsoleDeletable(boolean flg)
Set managed object 'console deletable' flag (default is deletable)

Parameters:
flg - - new value, true if enabling

isConsoleHidden

public boolean isConsoleHidden()
Test if filter is hidden to console

Returns:
true if hidden to console

setConsoleHidden

public void setConsoleHidden(boolean flg)
Set filter 'console hidden' flag (default is not hidden)

Parameters:
flg - - new value, true if enabling

setImageSet

public void setImageSet(int oid)
Set image set.


getImageSet

public int getImageSet()
Get image set.

Returns:
image object ID.

setReadOnly

public void setReadOnly(boolean flg)
Set read-only flag

Parameters:
flg - - new value, true if enabling

initDefaultImages

public static void initDefaultImages()
                              throws TWGPersistentObjectSaveException
Initialize default images for dynamic and static filters

Throws:
TWGPersistentObjectSaveException

verifyAll

protected static void verifyAll()
This method should be by the Director Server engine during server initialization. Run the verify method for each filter. Destroy any filters that do not verify and notify users that the filters have been deleted. Currently the verify checks only for the existence of tables and columns used in dynamic database filters. No checks are done on other types of filters -- the verify always returns true for non-database filters


getNameNLSString

public java.lang.Object getNameNLSString()
Get the nlsString value to be used for a translated name.

Returns:
the name and bundle name in a TWGNLSString, or just the name as a String if the name is not translated.

getAttributeIDList

public java.lang.String[] getAttributeIDList()
Attribute ID enumeration : this method is expected to return a List of strings containing the String names of the attributes supported for a given object. Subclasses of base classes implementing the interface should report additional attributes by adding them to the list returned by the base class.

Specified by:
getAttributeIDList in interface TWGGetSetInterface

getAttributeValue

public DataValue getAttributeValue(java.lang.String id,
                                   java.util.Locale loc)
Get value of attribute with given ID

Specified by:
getAttributeValue in interface TWGGetSetInterface
Parameters:
id - - attribute ID requested
loc - - locale to use for value, if applicable
Returns:
value object, or null if no value

setAttributeValue

public boolean setAttributeValue(java.lang.String id,
                                 DataValue val)
Set value of attribute with given ID

Specified by:
setAttributeValue in interface TWGGetSetInterface
Parameters:
id - - attribute ID to be set
val - - attribute value to be set
Returns:
true if set successful, false if not successful

getAttributeType

public int getAttributeType(java.lang.String id)
Get type of attribute value for given attribute

Specified by:
getAttributeType in interface TWGGetSetInterface
Parameters:
id - - attribute ID
Returns:
DataValue type of attribute, or DataValue.NONE_TYPE if undefined

AttachObjectToConsole

public void AttachObjectToConsole(TWGActiveConsole act_con)
Associate the object with the given TWGActiveConsole instance. This method should simply call the TWGActiveConsole.objectAddToConsole() method.

Specified by:
AttachObjectToConsole in interface TWGConsoleSpecShadowedObject
Parameters:
act_con - - Active console instance to be associated with

DetachObjectFromConsole

public void DetachObjectFromConsole(TWGActiveConsole act_con)
Disassociate the object from the given TWGActiveConsole instance. This method should simply call the TWGActiveConsole.objectRemoveFromConsole() method.

Specified by:
DetachObjectFromConsole in interface TWGConsoleSpecShadowedObject
Parameters:
act_con - - Active console instance to be disassociated from

DetachObjectFromAllConsoles

public void DetachObjectFromAllConsoles()
Disassociate the object from all TWGActiveConsoles. This method should simply call the TWGActiveConsole.objectRemoveFromAllConsoles() method.

Specified by:
DetachObjectFromAllConsoles in interface TWGConsoleSpecShadowedObject

attachAllAllowedFilters

public static void attachAllAllowedFilters(TWGActiveConsole con)
Attach console to all allowed filters

Parameters:
con - - console instance

detachAllDisallowedFilters

public static void detachAllDisallowedFilters(TWGActiveConsole con)
Detach all disallowed filters from console

Parameters:
con - - console instance

SetObjectID

public void SetObjectID(long oid)
                 throws DuplicateObjectIDException
Set object ID. This method subclasses the TWGObject class's SetObjectID.

Overrides:
SetObjectID in class TWGObject
Parameters:
oid - - new object ID, or INVALID_OBJECT_ID if none
Throws:
DuplicateObjectIDException - if ID is duplicate

findFilterByName

public static TWGFilter findFilterByName(java.lang.String n)
Find filter by name

Parameters:
n - - name to search for
Returns:
filter matching name, or null if none

getLocalUniqueID

public static long getLocalUniqueID()
Return the unique ID ofthe server we are executing on at the moment. Use "getServerUID" to extract the stored unique ID for the TOC. If the UID cannot be determined, 7777 is substituted by default.

Returns:
Operating server unique ID.

getLocalSystemName

public static java.lang.String getLocalSystemName()
Return the unique ID of the system we are executing on at the moment.

Returns:
Operating server name.

copyFrom

public TWGFilter copyFrom(TWGFilter sourceFilter)
Copies instance data from the source filter into this filter instance. Subscriber list are not copied. GUID is not copied.

Parameters:
sourceFilter - Filter to copy from.
Returns:
this pointer

makeTitleUnique

public boolean makeTitleUnique(java.util.Locale locale)
Analyse the filter title to see if it is a duplicate of an existing filter. If it is a duplicate, this filter's title is made unique by adding a numeric suffix to the title. ie: "(2)" is added. The prefixed title is again checked for duplication. This cycle is repeated up to 10000 times until a title is found. The first prefix used is the number "2".

Returns:
true = New title assigned. False=unique title could not be found.

initImportExporter

public static void initImportExporter()
Initialize filter set import and export processor.


touchDateLastUpdated

public void touchDateLastUpdated()
Set "dateLastUpdated" to current time.


getDBTableTokens

public StringValueSet getDBTableTokens()
Get database table tokes for filter (if any)

Returns:
set of table tokens

idStringExists

public static boolean idStringExists(java.lang.String id)
Determines if an id string exists in the current filter pool.

Parameters:
id - - ID string to search for.
Returns:
true ID currently exists in the filter pool. false ID does not exist in the filter pool.

makeIDStringUnique

public static java.lang.String makeIDStringUnique(java.lang.String id)
Makes the idString passed in as a parameter unique to the filter pool by appending a suffix counter to the end of the string. The suffix is the character "(" followed by decimal digits and ending with ")". The first number used is "2" and increments up to "10000". No suffix is added if the id does not exist in the filter pool and the original id is returned. An example suffix is "(2)".

Parameters:
id - - ID string to make unique. Null is considered unique and is not changed.
Returns:
unique ID string or null (if null passed in).