Remote Systems
v6.4.1

com.ibm.etools.systems.filters.impl
Class SystemFilterContainerCommonMethods

java.lang.Object
  extended bycom.ibm.etools.systems.filters.impl.SystemFilterContainerCommonMethods

public class SystemFilterContainerCommonMethods
extends Object

This class abstracts out some common code needed by any class that implements ISystemFilterContainer.

This class supports two overloaded version of each method. One that takes a MOF EList for the filter list, and one that takes a Vector for the filter list. This is to offer seamless flexibility in how the filters are stored internally.


Field Summary
static String copyright
           
 
Constructor Summary
protected SystemFilterContainerCommonMethods()
          Constructor
 
Method Summary
 boolean addSystemFilter(EList filters, SystemFilter filter)
          Adds given filter to the list.
 SystemFilter cloneSystemFilter(EList filters, SystemFilter filter, String aliasName)
          Duplicates a given filter in the list.
 SystemFilter createSystemFilter(EList filters, SystemFilterPool parentPool, String aliasName, Vector filterStrings)
          Creates a new system filter within this pool or filter.
 void deleteSystemFilter(EList filters, SystemFilter filter)
          Removes a given filter from the list.
static FiltersFactory getMOFfactory()
           
 SystemFilter getSystemFilter(EList filters, String aliasName)
          Return a filter object, given its aliasname.
 int getSystemFilterCount(EList filters)
          Return how many filters are defined in this filter container
 Vector getSystemFilterNames(EList filters)
          Return Vector of String objects: the names of existing filters in this container.
 int getSystemFilterPosition(EList filters, SystemFilter filter)
          Return a given filter's zero-based location
 SystemFilter[] getSystemFilters(EList filters)
          Return the nested filters as an array
 Vector getSystemFiltersVector(EList filters)
          Return the nested filters as a Vector
 boolean hasSystemFilters(EList filters)
          Return true if there are system filters
protected  boolean internalAddSystemFilter(EList filters, SystemFilter filter)
          Internally, we can skip the uniqueness checking.
 void internalAfterCloneSystemFilter(SystemFilter oldFilter, SystemFilter newFilter)
          Does core effort to populate a filter clone with non-core attributes
 void invalidateCache()
          For performance reasons we have decided to store a cache of the filters in vector and array form, so each request will not result in a new temporary vector or array.
 void moveSystemFilter(EList filters, int pos, SystemFilter filter)
          Move a given filter to a given zero-based location
 void renameSystemFilter(EList filters, SystemFilter filter, String newName)
          Renames a given filter from the list.
 void updateSystemFilter(Vector filters, SystemFilter filter, String newName, String[] newStrings)
          Updates a given filter in the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values
Constructor Detail

SystemFilterContainerCommonMethods

protected SystemFilterContainerCommonMethods()
Constructor

Method Detail

getMOFfactory

public static FiltersFactory getMOFfactory()

invalidateCache

public void invalidateCache()
For performance reasons we have decided to store a cache of the filters in vector and array form, so each request will not result in a new temporary vector or array. However, this cache can get out of date, so this method must be called religiously to invalidate it after any change in the filters.


createSystemFilter

public SystemFilter createSystemFilter(EList filters,
                                       SystemFilterPool parentPool,
                                       String aliasName,
                                       Vector filterStrings)
Creates a new system filter within this pool or filter.

Parameters:
filters - MOF list of filters the new filter is to be added to.
parentPool - pool that contains this filter (directly or indirectly).
aliasName - The name to give the new filter. Must be unique for this pool.
filterStrings - The list of String objects that represent the filter strings.

getSystemFilterNames

public Vector getSystemFilterNames(EList filters)
Return Vector of String objects: the names of existing filters in this container. Needed by name validators for New and Rename actions to verify new name is unique.


getSystemFiltersVector

public Vector getSystemFiltersVector(EList filters)
Return the nested filters as a Vector


getSystemFilters

public SystemFilter[] getSystemFilters(EList filters)
Return the nested filters as an array


getSystemFilterCount

public int getSystemFilterCount(EList filters)
Return how many filters are defined in this filter container


hasSystemFilters

public boolean hasSystemFilters(EList filters)
Return true if there are system filters


getSystemFilter

public SystemFilter getSystemFilter(EList filters,
                                    String aliasName)
Return a filter object, given its aliasname. Can be used to test if an aliasname is already used (non-null return).

Parameters:
aliasName - unique aliasName (case insensitive) to search on.
Returns:
SystemFilter object with unique aliasName, or null if no filter object with this name exists.

addSystemFilter

public boolean addSystemFilter(EList filters,
                               SystemFilter filter)
Adds given filter to the list.

PLEASE NOTE:

Parameters:
filter - SystemFilter object to add
Returns:
true if added, false if filter with this aliasname already existed.

internalAddSystemFilter

protected boolean internalAddSystemFilter(EList filters,
                                          SystemFilter filter)
Internally, we can skip the uniqueness checking.


deleteSystemFilter

public void deleteSystemFilter(EList filters,
                               SystemFilter filter)
Removes a given filter from the list. Does NOT follow references to remove them.

Parameters:
filters - MOF list to remove from
filter - SystemFilter object to remove

renameSystemFilter

public void renameSystemFilter(EList filters,
                               SystemFilter filter,
                               String newName)
Renames a given filter from the list.

Parameters:
filters - EList list
filter - SystemFilter object to rename
newName - new name to give filter

updateSystemFilter

public void updateSystemFilter(Vector filters,
                               SystemFilter filter,
                               String newName,
                               String[] newStrings)
Updates a given filter in the list.

Parameters:
filters - Vector list
filter - SystemFilter object to update
newName - new name to give filter

cloneSystemFilter

public SystemFilter cloneSystemFilter(EList filters,
                                      SystemFilter filter,
                                      String aliasName)
Duplicates a given filter in the list.

Parameters:
filters - MOF list of filters into which to place the clone
filter - SystemFilter object to clone
aliasName - New, unique, alias name to give this filter. Clone will fail if this is not unique.

internalAfterCloneSystemFilter

public void internalAfterCloneSystemFilter(SystemFilter oldFilter,
                                           SystemFilter newFilter)
Does core effort to populate a filter clone with non-core attributes

Parameters:
oldFilter - SystemFilter original filter
newFilter - SystemFilter that is new

getSystemFilterPosition

public int getSystemFilterPosition(EList filters,
                                   SystemFilter filter)
Return a given filter's zero-based location


moveSystemFilter

public void moveSystemFilter(EList filters,
                             int pos,
                             SystemFilter filter)
Move a given filter to a given zero-based location


Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.