Remote Systems
v6.4.1

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

java.lang.Object
  extended byEObjectImpl
      extended bycom.ibm.etools.systems.references.impl.SystemReferencedObjectImpl
          extended bycom.ibm.etools.systems.references.impl.SystemPersistableReferencedObjectImpl
              extended bycom.ibm.etools.systems.filters.impl.SystemFilterPoolImpl
All Implemented Interfaces:
IAdaptable, ISystemPersistableReferencedObject, ISystemReferencedObject, SystemFilterConstants, SystemFilterContainer, SystemFilterPool, SystemFilterSavePolicies, SystemPersistableReferencedObject, SystemReferencedObject

public class SystemFilterPoolImpl
extends SystemPersistableReferencedObjectImpl
implements SystemFilterPool, SystemFilterSavePolicies, SystemFilterConstants, SystemFilterContainer, IAdaptable

See Also:
Serialized Form

Field Summary
static String copyright
           
protected  boolean default_
           
protected static boolean DEFAULT_EDEFAULT
          The default value of the 'Default' attribute
protected  boolean deletable
           
protected static boolean DELETABLE_EDEFAULT
          The default value of the 'Deletable' attribute
protected static String DELIMITER
           
protected  EList filters
           
protected static String NAME_EDEFAULT
          The default value of the 'Name' attribute
protected static boolean NON_RENAMABLE_EDEFAULT
          The default value of the 'Non Renamable' attribute
protected  boolean nonRenamable
          The cached value of the 'Non Renamable' attribute
protected static String OWNING_PARENT_NAME_EDEFAULT
          The default value of the 'Owning Parent Name' attribute
protected  String owningParentName
          The cached value of the 'Owning Parent Name' attribute
protected  int release
           
protected static int RELEASE_EDEFAULT
          The default value of the 'Release' attribute
protected static boolean SINGLE_FILTER_STRING_ONLY_EDEFAULT
          The default value of the 'Single Filter String Only' attribute
protected  boolean singleFilterStringOnly
          The cached value of the 'Single Filter String Only' attribute
protected  boolean singleFilterStringOnlyESet
          This is true if the Single Filter String Only attribute has been set
protected  boolean specialCaseNoDataRestored
           
protected static boolean STRINGS_CASE_SENSITIVE_EDEFAULT
          The default value of the 'Strings Case Sensitive' attribute
protected  boolean stringsCaseSensitive
           
protected  boolean stringsCaseSensitiveESet
          This is true if the Strings Case Sensitive attribute has been set
protected static boolean SUPPORTS_DUPLICATE_FILTER_STRINGS_EDEFAULT
          The default value of the 'Supports Duplicate Filter Strings' attribute
protected static boolean SUPPORTS_NESTED_FILTERS_EDEFAULT
          The default value of the 'Supports Nested Filters' attribute
protected  boolean supportsDuplicateFilterStrings
           
protected  boolean supportsNestedFilters
           
protected  String type
           
protected static String TYPE_EDEFAULT
          The default value of the 'Type' attribute
 
Fields inherited from interface com.ibm.etools.systems.filters.SystemFilterSavePolicies
SAVE_POLICY_NONE, SAVE_POLICY_ONE_FILE_PER_FILTER, SAVE_POLICY_ONE_FILE_PER_MANAGER, SAVE_POLICY_ONE_FILE_PER_POOL_SAME_FOLDER, SAVE_POLICY_ONE_FILEANDFOLDER_PER_POOL
 
Fields inherited from interface com.ibm.etools.systems.filters.SystemFilterConstants
DEFAULT_TYPE, SAVEFILE_SUFFIX, TRY_TO_RESTORE_NO, TRY_TO_RESTORE_YES
 
Constructor Summary
protected SystemFilterPoolImpl()
          Default constructor
 
Method Summary
 boolean addSystemFilter(SystemFilter filter)
          Adds given filter to the list.
 boolean areStringsCaseSensitive()
          Same as isStringsCaseSensitive()
 SystemFilter cloneSystemFilter(SystemFilter filter, String aliasName)
          Duplicates a given filter in the list.
 void cloneSystemFilterPool(SystemFilterPool targetPool)
          Clone this filter pools' attributes and filters into another filter pool.
 SystemFilter copySystemFilter(SystemFilterPool targetPool, SystemFilter oldFilter, String newName)
          Copy a system filter to this or another filter pool.
protected static SystemFilterPoolImpl createPool()
           
 SystemFilter createSystemFilter(String aliasName, Vector filterStrings)
          Creates a new system filter within this pool.
static SystemFilterPool createSystemFilterPool(SystemMOFHelpers mofHelpers, IFolder poolFolder, String name, boolean allowNestedFilters, boolean isDeletable, boolean tryToRestore, int savePolicy, SystemFilterNamingPolicy namingPolicy)
          Static factory method for creating a new filter pool.
protected static Vector deduceFilterNames(IFolder folder, SystemFilterNamingPolicy namingPolicy)
          Private helper method to deduce filter names from disk files.
 void deleteSystemFilter(SystemFilter filter)
          Removes a given filter from the list.
 Object eGet(EStructuralFeature eFeature, boolean resolve)
           
 NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs)
           
 boolean eIsSet(EStructuralFeature eFeature)
           
 void eSet(EStructuralFeature eFeature, Object newValue)
           
protected  EClass eStaticClass()
           
 void eUnset(EStructuralFeature eFeature)
           
 Object getAdapter(Class adapterType)
          This is the method required by the IAdaptable interface.
 EList getFilters()
           
 IFolder getFolder()
          Return the IFolder this pool is in
 SystemMOFHelpers getMOFHelpers()
           
static SystemMOFHelpers getMOFHelpers(SystemFilterPoolManagerImpl mgr)
           
 String getName()
           
 SystemFilterNamingPolicy getNamingPolicy()
          Get the naming policy currently used when saving data to disk.
 String getOwningParentName()
           
 SystemFilterPoolManagerProvider getProvider()
          Return the caller which instantiated the filter pool manager overseeing this filter framework instance
 String getReferenceName()
          Return the unique reference name of this object.
 int getRelease()
           
protected static String getRootSaveFileName(SystemFilterNamingPolicy namingPolicy, String poolName)
          Return the root save file name without the extension .xmi
protected static String getRootSaveFileName(SystemFilterPool pool)
          Return the root save file name without the extension .xmi
protected static String getRootSaveFileName(SystemFilterPool pool, String newName)
          Return the root save file name without the extension .xmi
 IFile getSaveFile()
          Return the save file that will be written for the given filter pool.
protected static String getSaveFileName(SystemMOFHelpers mofHelpers, SystemFilterPool pool)
          Return the unqualified save file name with the extension .xmi
protected static String getSaveFileName(SystemMOFHelpers mofHelpers, SystemFilterPool pool, String newName)
          Return the unqualified save file name with the extension .xmi
protected static String getSaveFilePathAndName(SystemMOFHelpers mofHelpers, SystemFilterPool pool)
          Return the qualified save file name with the extension .xmi
 SystemFilter getSystemFilter(String aliasName)
          Return a filter object, given its aliasname.
 int getSystemFilterCount()
          Return how many filters are defined in this filter container
 Vector getSystemFilterNames()
          Return Vector of String objects: the names of existing filters in this container.
 SystemFilterPool getSystemFilterPool()
          From SystemFilterContainer.
 Object getSystemFilterPoolData()
          Return transient data set via setFilterPoolData.
 SystemFilterPoolManager getSystemFilterPoolManager()
          Return the filter pool manager managing this collection of filter pools and their filters.
 int getSystemFilterPosition(SystemFilter filter)
          Return a given filter's zero-based location
 SystemFilter[] getSystemFilters()
          Return filters in this pool, as an array.
 Vector getSystemFiltersVector()
          Return the nested filters as a Vector
 String getType()
          Returns the type attribute.
 String getTypeGen()
           
protected  void initialize(IFolder poolFolder, String name, boolean allowNestedFilters, boolean isDeletable, int savePolicy, SystemFilterNamingPolicy namingPolicy)
           
protected  void initialize(IFolder poolFolder, String name, int savePolicy, SystemFilterNamingPolicy namingPolicy)
           
protected  void initializeFilterStrings()
          Internal use method
protected  EList internalGetFilters()
           
 boolean isDefault()
           
 boolean isDeletable()
           
 boolean isNonRenamable()
           
 boolean isSetSingleFilterStringOnly()
           
 boolean isSetStringsCaseSensitive()
           
 boolean isSingleFilterStringOnly()
          Returns true if this filter is limited to a single filter string.
 boolean isSingleFilterStringOnlyGen()
           
 boolean isStringsCaseSensitive()
           
 boolean isSupportsDuplicateFilterStrings()
           
 boolean isSupportsNestedFilters()
           
 void moveSystemFilter(int pos, SystemFilter filter)
          Move a given filter to a given zero-based location
 void orderSystemFilters(String[] names)
          Order filters according to user preferences.
 void renameSystemFilter(SystemFilter filter, String newName)
          Rename a given filter in the list.
protected static SystemFilterPool restore(SystemMOFHelpers mofHelpers, IFolder folder, String name, int savePolicy, SystemFilterNamingPolicy namingPolicy)
          Restore specific filter pool.
protected static SystemFilterPool restoreFromOneFile(SystemMOFHelpers mofHelpers, IFolder folder, String name, SystemFilterNamingPolicy namingPolicy, boolean restoreFilters)
          Do restore when all filters in this pool are stored in a single file.
 void save()
          Attempt to save contents of pool to disk.
protected  void saveToOneFile(boolean saveFilters)
          Save filter pool when its saved in its own file.
 void setDefault(boolean newDefault)
           
 void setDeletable(boolean newDeletable)
           
 void setFolder(IFolder folder)
          Set the IFolder this pool is in
 void setName(String name)
          Set the name of this filter pool.
 void setNamingPolicy(SystemFilterNamingPolicy namingPolicy)
          Set the naming policy used when saving data to disk.
 void setNonRenamable(boolean newNonRenamable)
           
 void setOwningParentName(String newOwningParentName)
           
 void setRelease(int newRelease)
           
 void setSavePolicy(int policy)
          Set the save file policy.
 void setSingleFilterStringOnly(boolean newSingleFilterStringOnly)
           
 void setStringsCaseSensitive(boolean supports)
          Set whether filters in this pool support case-sensitive filter strings.
 void setStringsCaseSensitiveGen(boolean newStringsCaseSensitive)
           
 void setSupportsDuplicateFilterStrings(boolean supports)
          Set whether filters in this pool support duplicate filter strings.
 void setSupportsDuplicateFilterStringsGen(boolean newSupportsDuplicateFilterStrings)
           
 void setSupportsNestedFilters(boolean supports)
          Set whether filters in this pool support nested filters.
 void setSupportsNestedFiltersGen(boolean newSupportsNestedFilters)
           
 void setSystemFilterPoolData(Object data)
          While setData is for global data to set in all objects in the filter framework, this is to set transient data that only the filter pool holds.
 void setSystemFilterPoolManager(SystemFilterPoolManager mgr)
          Set the filter pool manager.
 void setType(String newType)
           
protected  void sortFilters()
          When saving one file per filter, we store the relative order of each filter within each filter.
 boolean supportsDuplicateFilterStrings()
          Does this support duplicate filter strings?
 boolean supportsNestedFilters()
          Does this support nested filters?
 String toString()
           
 void unsetSingleFilterStringOnly()
           
 void unsetStringsCaseSensitive()
           
 void updateSystemFilter(SystemFilter filter, String newName, String[] newStrings)
          Updates a given filter in the list.
 
Methods inherited from class com.ibm.etools.systems.references.impl.SystemPersistableReferencedObjectImpl
addReference, getReferenceCount, getReferencingObjects, removeAllReferences, removeReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ibm.etools.systems.references.ISystemReferencedObject
addReference, getReferenceCount, getReferencingObjects, removeAllReferences, removeReference
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values

NAME_EDEFAULT

protected static final String NAME_EDEFAULT
The default value of the 'Name' attribute.

See Also:
getName()

TYPE_EDEFAULT

protected static final String TYPE_EDEFAULT
The default value of the 'Type' attribute.

See Also:
getType()

specialCaseNoDataRestored

protected boolean specialCaseNoDataRestored

DELIMITER

protected static final String DELIMITER
See Also:
Constant Field Values

type

protected String type

SUPPORTS_NESTED_FILTERS_EDEFAULT

protected static final boolean SUPPORTS_NESTED_FILTERS_EDEFAULT
The default value of the 'Supports Nested Filters' attribute.

See Also:
isSupportsNestedFilters(), Constant Field Values

supportsNestedFilters

protected boolean supportsNestedFilters

DELETABLE_EDEFAULT

protected static final boolean DELETABLE_EDEFAULT
The default value of the 'Deletable' attribute.

See Also:
isDeletable(), Constant Field Values

deletable

protected boolean deletable

DEFAULT_EDEFAULT

protected static final boolean DEFAULT_EDEFAULT
The default value of the 'Default' attribute.

See Also:
isDefault(), Constant Field Values

default_

protected boolean default_

STRINGS_CASE_SENSITIVE_EDEFAULT

protected static final boolean STRINGS_CASE_SENSITIVE_EDEFAULT
The default value of the 'Strings Case Sensitive' attribute.

See Also:
isStringsCaseSensitive(), Constant Field Values

stringsCaseSensitive

protected boolean stringsCaseSensitive

stringsCaseSensitiveESet

protected boolean stringsCaseSensitiveESet
This is true if the Strings Case Sensitive attribute has been set.


SUPPORTS_DUPLICATE_FILTER_STRINGS_EDEFAULT

protected static final boolean SUPPORTS_DUPLICATE_FILTER_STRINGS_EDEFAULT
The default value of the 'Supports Duplicate Filter Strings' attribute.

See Also:
isSupportsDuplicateFilterStrings(), Constant Field Values

supportsDuplicateFilterStrings

protected boolean supportsDuplicateFilterStrings

RELEASE_EDEFAULT

protected static final int RELEASE_EDEFAULT
The default value of the 'Release' attribute.

See Also:
getRelease(), Constant Field Values

release

protected int release

SINGLE_FILTER_STRING_ONLY_EDEFAULT

protected static final boolean SINGLE_FILTER_STRING_ONLY_EDEFAULT
The default value of the 'Single Filter String Only' attribute.

See Also:
isSingleFilterStringOnly(), Constant Field Values

singleFilterStringOnly

protected boolean singleFilterStringOnly
The cached value of the 'Single Filter String Only' attribute.

See Also:
isSingleFilterStringOnly()

singleFilterStringOnlyESet

protected boolean singleFilterStringOnlyESet
This is true if the Single Filter String Only attribute has been set.


OWNING_PARENT_NAME_EDEFAULT

protected static final String OWNING_PARENT_NAME_EDEFAULT
The default value of the 'Owning Parent Name' attribute.

See Also:
getOwningParentName()

owningParentName

protected String owningParentName
The cached value of the 'Owning Parent Name' attribute.

See Also:
getOwningParentName()

NON_RENAMABLE_EDEFAULT

protected static final boolean NON_RENAMABLE_EDEFAULT
The default value of the 'Non Renamable' attribute.

See Also:
isNonRenamable(), Constant Field Values

nonRenamable

protected boolean nonRenamable
The cached value of the 'Non Renamable' attribute.

See Also:
isNonRenamable()

filters

protected EList filters
Constructor Detail

SystemFilterPoolImpl

protected SystemFilterPoolImpl()
Default constructor

Method Detail

eStaticClass

protected EClass eStaticClass()

Overrides:
eStaticClass in class SystemPersistableReferencedObjectImpl

createSystemFilterPool

public static SystemFilterPool createSystemFilterPool(SystemMOFHelpers mofHelpers,
                                                      IFolder poolFolder,
                                                      String name,
                                                      boolean allowNestedFilters,
                                                      boolean isDeletable,
                                                      boolean tryToRestore,
                                                      int savePolicy,
                                                      SystemFilterNamingPolicy namingPolicy)
Static factory method for creating a new filter pool. Will first try to restore it, and if that fails will create a new instance and return it.

Use this method only if you are not using a SystemFilterPoolManager, else use the createSystemFilterPool method in that class.

Parameters:
mofHelpers - SystemMOFHelpers object with helper methods for saving and restoring via mof
poolFolder - the folder that will hold the filter pool. This folder will be created if it does not already exist.
name - the name of the filter pool. Typically this is also the name of the given folder, but this is not required. For the save policy of one file per pool, the name of the file is derived from this.
allowNestedFilters - true if filters inside this filter pool are to allow nested filters.
isDeletable - true if this filter pool is allowed to be deleted by users.
tryToRestore - true to attempt a restore first, false if a pure create operation.
savePolicy - The save policy for the filter pool and filters. One of the following constants from the SystemFilterConstants interface:
  • SAVE_POLICY_ONE_FILEANDFOLDER_PER_POOL - one file and folder per pool
  • SAVE_POLICY_ONE_FILE_PER_POOL_SAME_FOLDER - one file per pool, all files in one folder
  • SAVE_POLICY_ONE_FILE_PER_FILTER - one file per filter, one folder per pool
namingPolicy - The names to use for file and folders when persisting to disk. Pass null to just use the defaults.

createPool

protected static SystemFilterPoolImpl createPool()

initialize

protected void initialize(IFolder poolFolder,
                          String name,
                          boolean allowNestedFilters,
                          boolean isDeletable,
                          int savePolicy,
                          SystemFilterNamingPolicy namingPolicy)

initialize

protected void initialize(IFolder poolFolder,
                          String name,
                          int savePolicy,
                          SystemFilterNamingPolicy namingPolicy)

internalGetFilters

protected EList internalGetFilters()

getProvider

public SystemFilterPoolManagerProvider getProvider()
Return the caller which instantiated the filter pool manager overseeing this filter framework instance

Specified by:
getProvider in interface SystemFilterPool

setSavePolicy

public void setSavePolicy(int policy)
Set the save file policy. See constants in SystemFilterConstants. One of: This method is called by the SystemFilterPoolManager.

Specified by:
setSavePolicy in interface SystemFilterPool

setNamingPolicy

public void setNamingPolicy(SystemFilterNamingPolicy namingPolicy)
Set the naming policy used when saving data to disk.

Specified by:
setNamingPolicy in interface SystemFilterPool
See Also:
SystemFilterNamingPolicy

getNamingPolicy

public SystemFilterNamingPolicy getNamingPolicy()
Get the naming policy currently used when saving data to disk.

Specified by:
getNamingPolicy in interface SystemFilterPool
See Also:
SystemFilterNamingPolicy

setSupportsNestedFilters

public void setSupportsNestedFilters(boolean supports)
Set whether filters in this pool support nested filters. Important to note this is stored in every filter as well as this filter pool.

Specified by:
setSupportsNestedFilters in interface SystemFilterPool
Parameters:
supports - The new value of the SupportsNestedFilters attribute

setSupportsNestedFiltersGen

public void setSupportsNestedFiltersGen(boolean newSupportsNestedFilters)


setSupportsDuplicateFilterStrings

public void setSupportsDuplicateFilterStrings(boolean supports)
Set whether filters in this pool support duplicate filter strings. Important to note this is stored in every filter as well as this filter pool.

Specified by:
setSupportsDuplicateFilterStrings in interface SystemFilterPool
Parameters:
supports - The new value of the SupportsDuplicateFilterStrings attribute

setSupportsDuplicateFilterStringsGen

public void setSupportsDuplicateFilterStringsGen(boolean newSupportsDuplicateFilterStrings)


setStringsCaseSensitive

public void setStringsCaseSensitive(boolean supports)
Set whether filters in this pool support case-sensitive filter strings. Important to note this is stored in every filter as well as this filter pool.

Specified by:
setStringsCaseSensitive in interface SystemFilterPool
Parameters:
supports - The new value of the StringsCaseSensitive attribute

setStringsCaseSensitiveGen

public void setStringsCaseSensitiveGen(boolean newStringsCaseSensitive)


setSystemFilterPoolManager

public void setSystemFilterPoolManager(SystemFilterPoolManager mgr)
Set the filter pool manager. Called by SystemFilterPoolManager

Specified by:
setSystemFilterPoolManager in interface SystemFilterPool

getSystemFilterPoolManager

public SystemFilterPoolManager getSystemFilterPoolManager()
Return the filter pool manager managing this collection of filter pools and their filters.

Specified by:
getSystemFilterPoolManager in interface SystemFilterPool

setSystemFilterPoolData

public void setSystemFilterPoolData(Object data)
While setData is for global data to set in all objects in the filter framework, this is to set transient data that only the filter pool holds.

Specified by:
setSystemFilterPoolData in interface SystemFilterPool

getSystemFilterPoolData

public Object getSystemFilterPoolData()
Return transient data set via setFilterPoolData.

Specified by:
getSystemFilterPoolData in interface SystemFilterPool

getName

public String getName()
Specified by:
getName in interface SystemFilterPool
Returns:
The value of the Name attribute
See Also:
SystemFilterPool.getName()

setName

public void setName(String name)
Set the name of this filter pool.

Specified by:
setName in interface SystemFilterPool
Parameters:
name - The new value of the Name attribute

getType

public String getType()
Returns the type attribute. Intercepted to return SystemFilterConstants.DEFAULT_TYPE if it is currently null Allows tools to have typed filter pools

Specified by:
getType in interface SystemFilterPool
Returns:
The value of the Type attribute Allows tools to have typed filter pools

getTypeGen

public String getTypeGen()

isDeletable

public boolean isDeletable()

Specified by:
isDeletable in interface SystemFilterPool
Returns:
The value of the Deletable attribute

setDeletable

public void setDeletable(boolean newDeletable)

Specified by:
setDeletable in interface SystemFilterPool
Parameters:
newDeletable - The new value of the Deletable attribute

isDefault

public boolean isDefault()

Specified by:
isDefault in interface SystemFilterPool
Returns:
The value of the Default attribute Is this a default vendor-supplied pool versus user-created pool

setDefault

public void setDefault(boolean newDefault)

Specified by:
setDefault in interface SystemFilterPool
Parameters:
newDefault - The new value of the Default attribute

supportsNestedFilters

public boolean supportsNestedFilters()
Does this support nested filters? Calls mof-generated isSupportsNestedFilters.

Specified by:
supportsNestedFilters in interface SystemFilterPool

supportsDuplicateFilterStrings

public boolean supportsDuplicateFilterStrings()
Does this support duplicate filter strings? Calls mof-generated isSupportsDuplicateFilterStrings.

Specified by:
supportsDuplicateFilterStrings in interface SystemFilterPool

isStringsCaseSensitive

public boolean isStringsCaseSensitive()
Specified by:
isStringsCaseSensitive in interface SystemFilterPool
Returns:
The value of the StringsCaseSensitive attribute Are filter strings in this filter case sensitive? If not set locally, queries the parent filter pool manager's atttribute.

areStringsCaseSensitive

public boolean areStringsCaseSensitive()
Same as isStringsCaseSensitive()

Specified by:
areStringsCaseSensitive in interface SystemFilterContainer
Returns:
The value of the StringsCaseSensitive attribute

cloneSystemFilterPool

public void cloneSystemFilterPool(SystemFilterPool targetPool)
                           throws Exception
Clone this filter pools' attributes and filters into another filter pool. Assumes the core attributes were already set when filter pool was created: Attributes we clone:

Specified by:
cloneSystemFilterPool in interface SystemFilterPool
Throws:
Exception

copySystemFilter

public SystemFilter copySystemFilter(SystemFilterPool targetPool,
                                     SystemFilter oldFilter,
                                     String newName)
                              throws Exception
Copy a system filter to this or another filter pool.

Specified by:
copySystemFilter in interface SystemFilterPool
Throws:
Exception

getSystemFilters

public SystemFilter[] getSystemFilters()
Return filters in this pool, as an array.

Specified by:
getSystemFilters in interface SystemFilterContainer

getSystemFilterPool

public SystemFilterPool getSystemFilterPool()
From SystemFilterContainer. Returns "this".

Specified by:
getSystemFilterPool in interface SystemFilterContainer

createSystemFilter

public SystemFilter createSystemFilter(String aliasName,
                                       Vector filterStrings)
Creates a new system filter within this pool. This filter will inherit/store the following attributes from this pool:

Specified by:
createSystemFilter in interface SystemFilterContainer
Parameters:
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()
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.

Specified by:
getSystemFilterNames in interface SystemFilterContainer

getSystemFiltersVector

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

Specified by:
getSystemFiltersVector in interface SystemFilterContainer

getSystemFilterCount

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

Specified by:
getSystemFilterCount in interface SystemFilterContainer

getSystemFilter

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

Specified by:
getSystemFilter in interface SystemFilterContainer
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(SystemFilter filter)
Adds given filter to the list.

PLEASE NOTE:

Specified by:
addSystemFilter in interface SystemFilterContainer
Parameters:
filter - SystemFilter object to add
Returns:
true if added, false if filter with this aliasname already existed.

deleteSystemFilter

public void deleteSystemFilter(SystemFilter filter)
Removes a given filter from the list.

Specified by:
deleteSystemFilter in interface SystemFilterContainer
Parameters:
filter - SystemFilter object to remove

renameSystemFilter

public void renameSystemFilter(SystemFilter filter,
                               String newName)
Rename a given filter in the list.

Specified by:
renameSystemFilter in interface SystemFilterContainer
Parameters:
filter - SystemFilter object to remove
newName - New name to assign it. Assumes unique checking already done.

updateSystemFilter

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

Specified by:
updateSystemFilter in interface SystemFilterContainer
Parameters:
filter - SystemFilter object to update
newName - New name to assign it. Assumes unique checking already done.
newStrings - New strings to assign it. Replaces current strings.

cloneSystemFilter

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

Parameters:
filter - SystemFilter object to clone

getSystemFilterPosition

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

Specified by:
getSystemFilterPosition in interface SystemFilterContainer

moveSystemFilter

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

Specified by:
moveSystemFilter in interface SystemFilterContainer

getAdapter

public Object getAdapter(Class adapterType)
This is the method required by the IAdaptable interface. Given an adapter class type, return an object castable to the type, or null if this is not possible.

Specified by:
getAdapter in interface IAdaptable

deduceFilterNames

protected static Vector deduceFilterNames(IFolder folder,
                                          SystemFilterNamingPolicy namingPolicy)
Private helper method to deduce filter names from disk files. Will populate and return a list. Only makes sense to use if the save policy is one file per filter.


setFolder

public void setFolder(IFolder folder)
Set the IFolder this pool is in

Specified by:
setFolder in interface SystemFilterPool

getFolder

public IFolder getFolder()
Return the IFolder this pool is in

Specified by:
getFolder in interface SystemFilterPool

orderSystemFilters

public void orderSystemFilters(String[] names)
Order filters according to user preferences.

While the framework has all the code necessary to arrange filters and save/restore that arrangement, you may choose to use preferences instead of this support. In this case, call this method and pass in the saved and sorted filter name list.

Called by someone after restore.

Specified by:
orderSystemFilters in interface SystemFilterPool

getSaveFile

public IFile getSaveFile()
Return the save file that will be written for the given filter pool. Will depend on this manager's save policy.


save

public void save()
          throws Exception
Attempt to save contents of pool to disk. How the save is done is defined by the current save policy for this object.

Specified by:
save in interface SystemFilterPool
Throws:
Exception
See Also:

If anything bad happens, an exception is thrown.


saveToOneFile

protected void saveToOneFile(boolean saveFilters)
                      throws Exception
Save filter pool when its saved in its own file.

Throws:
Exception

restore

protected static SystemFilterPool restore(SystemMOFHelpers mofHelpers,
                                          IFolder folder,
                                          String name,
                                          int savePolicy,
                                          SystemFilterNamingPolicy namingPolicy)
                                   throws Exception
Restore specific filter pool. You should not call this directly, as it is possible that certain data is not restored if the save policy is one file per filter. Rather, you should call the createSystemFilterPoolMethod.

Parameters:
mofHelpers - SystemMOFHelpers object with helper methods for saving and restoring via mof
folder - The filter pool folder.
name - name of pool to restore. Used to deduce file name for save policy of one file per pool.
savePolicy - policy used to save the pool. One of the following from SystemFilterPoolManager:
  • SAVE_POLICY_ONE_FILEANDFOLDER_PER_POOL - one file and folder per pool
  • SAVE_POLICY_ONE_FILE_PER_POOL_SAME_FOLDER - one file per pool, all files in one folder
  • SAVE_POLICY_ONE_FILE_PER_FILTER - one file per filter, one folder per pool
namingPolicy - The names to use for file and folders when persisting to disk. Pass null to just use the defaults.
Returns:
SystemFilterPool object if restored ok, null if error encountered. If null, call getLastException().
Throws:
Exception
See Also:
SystemFilterConstants

restoreFromOneFile

protected static SystemFilterPool restoreFromOneFile(SystemMOFHelpers mofHelpers,
                                                     IFolder folder,
                                                     String name,
                                                     SystemFilterNamingPolicy namingPolicy,
                                                     boolean restoreFilters)
                                              throws Exception
Do restore when all filters in this pool are stored in a single file.

Throws:
Exception

initializeFilterStrings

protected void initializeFilterStrings()
Internal use method


sortFilters

protected void sortFilters()
When saving one file per filter, we store the relative order of each filter within each filter. After restoring, the filters are ordered by their file system existence, and so we must now re-order the internal list according to the relative order given in each filter


getSaveFilePathAndName

protected static String getSaveFilePathAndName(SystemMOFHelpers mofHelpers,
                                               SystemFilterPool pool)
Return the qualified save file name with the extension .xmi


getSaveFileName

protected static String getSaveFileName(SystemMOFHelpers mofHelpers,
                                        SystemFilterPool pool)
Return the unqualified save file name with the extension .xmi


getSaveFileName

protected static String getSaveFileName(SystemMOFHelpers mofHelpers,
                                        SystemFilterPool pool,
                                        String newName)
Return the unqualified save file name with the extension .xmi


getRootSaveFileName

protected static String getRootSaveFileName(SystemFilterPool pool)
Return the root save file name without the extension .xmi


getRootSaveFileName

protected static String getRootSaveFileName(SystemFilterPool pool,
                                            String newName)
Return the root save file name without the extension .xmi


getRootSaveFileName

protected static String getRootSaveFileName(SystemFilterNamingPolicy namingPolicy,
                                            String poolName)
Return the root save file name without the extension .xmi


getReferenceName

public String getReferenceName()
Return the unique reference name of this object.

As required by the ISystemPersistableReferencedObject interface.

Specified by:
getReferenceName in interface ISystemPersistableReferencedObject
Overrides:
getReferenceName in class SystemPersistableReferencedObjectImpl

getMOFHelpers

public static SystemMOFHelpers getMOFHelpers(SystemFilterPoolManagerImpl mgr)

getMOFHelpers

public SystemMOFHelpers getMOFHelpers()

toString

public String toString()

setType

public void setType(String newType)
Specified by:
setType in interface SystemFilterPool
Parameters:
newType - The new value of the Type attribute

isSupportsNestedFilters

public boolean isSupportsNestedFilters()
Specified by:
isSupportsNestedFilters in interface SystemFilterPool
Returns:
The value of the SupportsNestedFilters attribute

unsetStringsCaseSensitive

public void unsetStringsCaseSensitive()
Specified by:
unsetStringsCaseSensitive in interface SystemFilterPool

isSetStringsCaseSensitive

public boolean isSetStringsCaseSensitive()
Specified by:
isSetStringsCaseSensitive in interface SystemFilterPool
Returns:
true if the StringsCaseSensitive attribute has been set

getFilters

public EList getFilters()
Specified by:
getFilters in interface SystemFilterPool
Returns:
The list of Filters references

eInverseRemove

public NotificationChain eInverseRemove(InternalEObject otherEnd,
                                        int featureID,
                                        Class baseClass,
                                        NotificationChain msgs)


eGet

public Object eGet(EStructuralFeature eFeature,
                   boolean resolve)


eIsSet

public boolean eIsSet(EStructuralFeature eFeature)

eSet

public void eSet(EStructuralFeature eFeature,
                 Object newValue)

eUnset

public void eUnset(EStructuralFeature eFeature)

isSupportsDuplicateFilterStrings

public boolean isSupportsDuplicateFilterStrings()
Specified by:
isSupportsDuplicateFilterStrings in interface SystemFilterPool
Returns:
The value of the SupportsDuplicateFilterStrings attribute

getRelease

public int getRelease()
Specified by:
getRelease in interface SystemFilterPool
Returns:
The value of the Release attribute In what release was this created? Typically, will be the version and release times 10, as in 40 or 51.

setRelease

public void setRelease(int newRelease)
Specified by:
setRelease in interface SystemFilterPool
Parameters:
newRelease - The new value of the Release attribute

isSingleFilterStringOnly

public boolean isSingleFilterStringOnly()
Returns true if this filter is limited to a single filter string. If not set here, it is queried from the parent manager.

Specified by:
isSingleFilterStringOnly in interface SystemFilterPool
Returns:
the value of the 'Single Filter String Only' attribute.
See Also:
SystemFilterPool.isSetSingleFilterStringOnly(), SystemFilterPool.unsetSingleFilterStringOnly(), SystemFilterPool.setSingleFilterStringOnly(boolean), FiltersPackage.getSystemFilterPool_SingleFilterStringOnly()

isSingleFilterStringOnlyGen

public boolean isSingleFilterStringOnlyGen()


setSingleFilterStringOnly

public void setSingleFilterStringOnly(boolean newSingleFilterStringOnly)

Specified by:
setSingleFilterStringOnly in interface SystemFilterPool
Parameters:
newSingleFilterStringOnly - the new value of the 'Single Filter String Only' attribute.
See Also:
SystemFilterPool.isSetSingleFilterStringOnly(), SystemFilterPool.unsetSingleFilterStringOnly(), SystemFilterPool.isSingleFilterStringOnly()

unsetSingleFilterStringOnly

public void unsetSingleFilterStringOnly()

Specified by:
unsetSingleFilterStringOnly in interface SystemFilterPool
See Also:
SystemFilterPool.isSetSingleFilterStringOnly(), SystemFilterPool.isSingleFilterStringOnly(), SystemFilterPool.setSingleFilterStringOnly(boolean)

isSetSingleFilterStringOnly

public boolean isSetSingleFilterStringOnly()

Specified by:
isSetSingleFilterStringOnly in interface SystemFilterPool
Returns:
whether the value of the 'Single Filter String Only' attribute is set.
See Also:
SystemFilterPool.unsetSingleFilterStringOnly(), SystemFilterPool.isSingleFilterStringOnly(), SystemFilterPool.setSingleFilterStringOnly(boolean)

getOwningParentName

public String getOwningParentName()

Specified by:
getOwningParentName in interface SystemFilterPool
Returns:
the value of the 'Owning Parent Name' attribute.
See Also:
SystemFilterPool.setOwningParentName(String), FiltersPackage.getSystemFilterPool_OwningParentName()

setOwningParentName

public void setOwningParentName(String newOwningParentName)

Specified by:
setOwningParentName in interface SystemFilterPool
Parameters:
newOwningParentName - the new value of the 'Owning Parent Name' attribute.
See Also:
SystemFilterPool.getOwningParentName()

isNonRenamable

public boolean isNonRenamable()

Specified by:
isNonRenamable in interface SystemFilterPool
Returns:
the value of the 'Non Renamable' attribute.
See Also:
SystemFilterPool.setNonRenamable(boolean), FiltersPackage.getSystemFilterPool_NonRenamable()

setNonRenamable

public void setNonRenamable(boolean newNonRenamable)

Specified by:
setNonRenamable in interface SystemFilterPool
Parameters:
newNonRenamable - the new value of the 'Non Renamable' attribute.
See Also:
SystemFilterPool.isNonRenamable()

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.