RSE
Release 1.0

org.eclipse.rse.filters
Class SystemFilterPoolReferenceManager

java.lang.Object
  extended byorg.eclipse.rse.internal.references.SystemPersistableReferenceManager
      extended byorg.eclipse.rse.filters.SystemFilterPoolReferenceManager
All Implemented Interfaces:
IRSEBasePersistableReferenceManager, ISystemFilterPoolReferenceManager

public class SystemFilterPoolReferenceManager
extends org.eclipse.rse.internal.references.SystemPersistableReferenceManager
implements ISystemFilterPoolReferenceManager


Field Summary
 
Fields inherited from class org.eclipse.rse.internal.references.SystemPersistableReferenceManager
debug, EMPTY_MAP, name, NAME_EDEFAULT, referencingObjectList
 
Constructor Summary
SystemFilterPoolReferenceManager()
          Default constructor.
 
Method Summary
 ISystemFilterPoolReference addReferenceToSystemFilterPool(ISystemFilterPool filterPool)
          Given a filter pool, create a referencing object and add it to the list.
 ISystemFilterPoolReference addReferenceToSystemFilterPool(ISystemFilterPoolManager filterPoolManager, String filterPoolName)
          Given a filter pool name, create a referencing object and add it to the list.
 int addSystemFilterPoolReference(ISystemFilterPoolReference filterPoolReference)
          Add a filter pool referencing object to the list.
protected static SystemFilterPoolReferenceManager createManager()
           
static ISystemFilterPoolReferenceManager createSystemFilterPoolReferenceManager(ISystemFilterPoolReferenceManagerProvider caller, ISystemFilterPoolManagerProvider relatedPoolManagerProvider, IFolder mgrFolder, String name, int savePolicy, IRSEFilterNamingPolicy namingPolicy)
          A factory method to create a SystemFilterPoolReferenceManager instance.
 ISystemFilterPoolManager[] getAdditionalSystemFilterPoolManagers()
          Get the managers of the master list of filter pools, from which objects in this list reference, but which are not in the list of managers our pool manager supplier gives us.
 ISystemFilterPoolManager getDefaultSystemFilterPoolManager()
          Get the default manager of the master list of filter pools, from which objects in this list reference.
static ISystemFilterPool getFilterPool(ISystemFilterPoolManager[] mgrs, String mgrName, String poolName)
          Utility method to scan across all filter pools in a given named filter pool manager, for a match on a given filter pool name.
static ISystemFilterPoolManager getFilterPoolManager(ISystemFilterPoolManager[] mgrs, String mgrName)
          Utility method to scan across all filter pool managers for a match on a give name.
 IFolder getFolder()
          Return the folder that this manager is contained in.
 String getFolderPath()
           
static String getFolderPath(IFolder folder)
           
 IRSEFilterNamingPolicy getNamingPolicy()
          Get the naming policy currently used when saving data to disk.
 ISystemFilterPoolReferenceManagerProvider getProvider()
          Get the object which instantiated this instance of the filter pool reference manager.
 ISystemFilterPool[] getReferencedSystemFilterPools()
          Return array of filter pools currently referenced by this manager Result will never be null, although it may be an array of length zero.
 ISystemFilterPoolReference getReferenceToSystemFilterPool(ISystemFilterPool filterPool)
          Given a filter pool, locate the referencing object for it and return it.
protected  String getSaveFileName()
           
protected static String getSaveFileName(String fileNameNoSuffix)
          Appends the correct extension to the file name where this manager is saved.
protected  String getSaveFilePathAndName()
           
protected static String getSaveFilePathAndName(IFolder mgrFolder, String name, IRSEFilterNamingPolicy namingPolicy)
          If saving all info in one file, this returns the fully qualified name of that file, given the unadorned manager name and the prefix (if any) to adorn with.
 ISystemFilterPoolManagerProvider getSystemFilterPoolManagerProvider()
          Get the associated master pool manager provider.
 ISystemFilterPoolManager[] getSystemFilterPoolManagers()
          Get the managers of the master list of filter pools, from which objects in this list reference.
 int getSystemFilterPoolReferenceCount()
          Return count of referenced filter pools
 Object getSystemFilterPoolReferenceManagerData()
           
 int getSystemFilterPoolReferencePosition(ISystemFilterPoolReference filterPoolRef)
          Return the zero-based position of a SystemFilterPoolReference object within this list
 ISystemFilterPoolReference[] getSystemFilterPoolReferences()
          Return array of SystemFilterPoolReference objects.
 ISystemFilterReference getSystemFilterReference(ISubSystem subSystem, ISystemFilter filter)
          Create a single filter refererence to a given filter.
 int getSystemFilterReferencePosition(ISubSystem subSystem, ISystemFilter filter)
          Given a filter, return its position within this reference manager when you think of all filter references from all filter pool references as being concatenated.
 int getSystemFilterReferencePosition(ISystemFilterReference filterRef)
          Given a filter reference, return its position within this reference manager when you think of all filter references from all filter pool references as being concatenated.
 ISystemFilterReference[] getSystemFilterReferences(ISubSystem subSystem)
          Concatenate all filter references from all filter pools we reference, into one big list.
protected  void initialize(ISystemFilterPoolReferenceManagerProvider caller, IFolder folder, String name, int savePolicy, IRSEFilterNamingPolicy namingPolicy)
           
protected  void initialize(ISystemFilterPoolReferenceManagerProvider caller, IFolder folder, String name, int savePolicy, IRSEFilterNamingPolicy namingPolicy, ISystemFilterPoolManagerProvider relatedPoolManagerProvider)
           
 boolean isSystemFilterPoolReferenced(ISystemFilterPool filterPool)
          Return true if the given filter pool has a referencing object in this list.
 void moveSystemFilterPoolReference(ISystemFilterPoolReference filterPoolRef, int pos)
          Move a given filter pool reference to a given zero-based location.
 void moveSystemFilterPoolReferences(ISystemFilterPoolReference[] filterPoolRefs, int delta)
          Move existing filter pool references a given number of positions.
 void regenerateReferencedSystemFilterPoolNames()
          Ask each referenced pool for its name, and update it.
 int removeReferenceToSystemFilterPool(ISystemFilterPool filterPool)
          Given a filter pool, locate the referencing object for it and remove it from the list.
 int removeSystemFilterPoolReference(ISystemFilterPoolReference filterPoolReference, boolean deReference)
          Remove a filter pool referencing object from the list.
 void renameReferenceToSystemFilterPool(ISystemFilterPool pool)
          A referenced filter pool has been renamed.
 void resetManagerFolder(IFolder newFolder)
          Set the folder that this manager is contained in.
 void resetSystemFilterPoolReference(ISystemFilterPoolReference filterPoolReference, ISystemFilterPool newPool)
          Reset the filter pool a reference points to.
 Vector resolveReferencesAfterRestore(ISystemFilterPoolManagerProvider relatedPoolMgrProvider, ISystemFilterPoolReferenceManagerProvider provider)
          After restoring this from disk, there is only the referenced object name, not the referenced object pointer, for each referencing object.
static ISystemFilterPoolReferenceManager restore(ISystemFilterPoolReferenceManagerProvider caller, IFolder mgrFolder, String name)
          Restore the filter pools from disk, assuming default for a naming policy.
static ISystemFilterPoolReferenceManager restore(ISystemFilterPoolReferenceManagerProvider caller, IFolder mgrFolder, String name, IRSEFilterNamingPolicy namingPolicy)
          Restore the filter pools from disk.
protected static ISystemFilterPoolReferenceManager restoreFromOneFile(IFolder mgrFolder, String name, IRSEFilterNamingPolicy namingPolicy)
          Restore filter pools when all are stored in one file.
 void save()
          Save all the filter pools to disk.
protected  boolean saveToOneFile()
          Save this reference manager to disk.
 void setDefaultSystemFilterPoolManager(ISystemFilterPoolManager mgr)
          Set the default manager of the master list of filter pools, from which objects in this list reference.
 void setName(String name)
          Set the name.
 void setNamingPolicy(IRSEFilterNamingPolicy namingPolicy)
          Set the naming policy used when saving data to disk.
 void setProvider(ISystemFilterPoolReferenceManagerProvider caller)
          Set the object which instantiated this instance of the filter pool reference manager.
 void setProviderEventNotification(boolean fireEvents)
          Turn callbacks to the provider either off or on.
 void setSystemFilterPoolManagerProvider(ISystemFilterPoolManagerProvider poolMgrProvider)
          Set the associated master pool manager provider.
 void setSystemFilterPoolReferenceManagerData(Object data)
          This is to set transient data that is subsequently queryable.
 void setSystemFilterPoolReferences(ISystemFilterPool[] filterPools, boolean deReference)
          In one shot, set the filter pool references to new references to supplied filter pools.
 void setSystemFilterPoolReferences(ISystemFilterPoolReference[] filterPoolReferences, boolean deReference)
          In one shot, set the filter pool references.
 String toString()
          Return string identifying this filter
 
Methods inherited from class org.eclipse.rse.internal.references.SystemPersistableReferenceManager
addPathTerminator, addReferencingObject, getName, getReferencedObject, getReferencingObjectCount, getReferencingObjectList, getReferencingObjectPosition, getReferencingObjects, internalGetList, invalidateCache, isReferenced, moveReferencingObjectPosition, removeAllReferencingObjects, removeAndDeReferenceAllReferencingObjects, removeAndDeReferenceReferencingObject, removeReferencingObject, resolveReferencesAfterRestore, restore, save, setReferencingObjects, toStringGen
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.rse.core.references.IRSEBasePersistableReferenceManager
addReferencingObject, getName, getReferencedObject, getReferencingObjectCount, getReferencingObjectList, getReferencingObjectPosition, getReferencingObjects, isReferenced, moveReferencingObjectPosition, removeAllReferencingObjects, removeAndDeReferenceAllReferencingObjects, removeAndDeReferenceReferencingObject, removeReferencingObject, resolveReferencesAfterRestore, save, setReferencingObjects
 

Constructor Detail

SystemFilterPoolReferenceManager

public SystemFilterPoolReferenceManager()
Default constructor. Typically called by MOF factory methods.

Method Detail

createSystemFilterPoolReferenceManager

public static ISystemFilterPoolReferenceManager createSystemFilterPoolReferenceManager(ISystemFilterPoolReferenceManagerProvider caller,
                                                                                       ISystemFilterPoolManagerProvider relatedPoolManagerProvider,
                                                                                       IFolder mgrFolder,
                                                                                       String name,
                                                                                       int savePolicy,
                                                                                       IRSEFilterNamingPolicy namingPolicy)
A factory method to create a SystemFilterPoolReferenceManager instance.

Parameters:
caller - Objects which instantiate this class should implement the SystemFilterPoolReferenceManagerProvider interface, and pass "this" for this parameter. Given any filter framework object, it is possible to retrieve the caller's object via the getProvider method call.
relatedPoolManagerProvider - The managers that owns the master list of filter pools that this manager will contain references to.
mgrFolder - the folder that will hold the persisted file. This is used when the save policy is SAVE_POLICY_ONE_FILE_PER_MANAGER. For SAVE_POLICY_NONE, this is not used. If it is used, it is created if it does not already exist.
name - the name of the filter pool reference manager. This is used when the save policy is SAVE_POLICY_ONE_FILE_PER_MANAGER, to deduce the file name.
savePolicy - The save policy for the filter pool references list. One of the following from the SystemFilterConstants interface:
  • SAVE_POLICY_NONE - no files, all save/restore handled elsewhere
  • SAVE_POLICY_ONE_FILE_PER_MANAGER - one file: mgrName.xmi
namingPolicy - The names to use for file and folders when persisting to disk. Pass null to just use the defaults, or if using SAVE_POLICY_NONE.
Returns:
a filter pool reference manager

createManager

protected static SystemFilterPoolReferenceManager createManager()

initialize

protected void initialize(ISystemFilterPoolReferenceManagerProvider caller,
                          IFolder folder,
                          String name,
                          int savePolicy,
                          IRSEFilterNamingPolicy namingPolicy,
                          ISystemFilterPoolManagerProvider relatedPoolManagerProvider)

initialize

protected void initialize(ISystemFilterPoolReferenceManagerProvider caller,
                          IFolder folder,
                          String name,
                          int savePolicy,
                          IRSEFilterNamingPolicy namingPolicy)

setSystemFilterPoolManagerProvider

public void setSystemFilterPoolManagerProvider(ISystemFilterPoolManagerProvider poolMgrProvider)
Set the associated master pool manager provider. Note the provider typically manages multiple pool managers and we manage references across those.

Specified by:
setSystemFilterPoolManagerProvider in interface ISystemFilterPoolReferenceManager
Parameters:
poolMgrProvider - the factory (provider) for the filter pool managers that this reference manager provides services to

getSystemFilterPoolManagerProvider

public ISystemFilterPoolManagerProvider getSystemFilterPoolManagerProvider()
Description copied from interface: ISystemFilterPoolReferenceManager
Get the associated master pool manager provider. Note the provider typically manages multiple pool managers and we manage references across those.

Specified by:
getSystemFilterPoolManagerProvider in interface ISystemFilterPoolReferenceManager
Returns:
the associated master pool manager provider. Note the provider typically manages multiple pool managers and we manage references across those.

getSystemFilterPoolManagers

public ISystemFilterPoolManager[] getSystemFilterPoolManagers()
Description copied from interface: ISystemFilterPoolReferenceManager
Get the managers of the master list of filter pools, from which objects in this list reference.

Specified by:
getSystemFilterPoolManagers in interface ISystemFilterPoolReferenceManager
Returns:
the managers of the master list of filter pools, from which objects in this list reference.

getAdditionalSystemFilterPoolManagers

public ISystemFilterPoolManager[] getAdditionalSystemFilterPoolManagers()
Description copied from interface: ISystemFilterPoolReferenceManager
Get the managers of the master list of filter pools, from which objects in this list reference, but which are not in the list of managers our pool manager supplier gives us. That is, these are references to filter pools outside the expected list.

Specified by:
getAdditionalSystemFilterPoolManagers in interface ISystemFilterPoolReferenceManager
Returns:
the managers of the master list of filter pools, from which objects in this list reference, but which are not in the list of managers our pool manager supplier gives us. That is, these are references to filter pools outside the expected list.

setDefaultSystemFilterPoolManager

public void setDefaultSystemFilterPoolManager(ISystemFilterPoolManager mgr)
Set the default manager of the master list of filter pools, from which objects in this list reference.

Specified by:
setDefaultSystemFilterPoolManager in interface ISystemFilterPoolReferenceManager
Parameters:
mgr - the filter pool manager that is the default pool manager.

getDefaultSystemFilterPoolManager

public ISystemFilterPoolManager getDefaultSystemFilterPoolManager()
Description copied from interface: ISystemFilterPoolReferenceManager
Get the default manager of the master list of filter pools, from which objects in this list reference.

Specified by:
getDefaultSystemFilterPoolManager in interface ISystemFilterPoolReferenceManager
Returns:
the default manager of the master list of filter pools, from which objects in this list reference.

getProvider

public ISystemFilterPoolReferenceManagerProvider getProvider()
Description copied from interface: ISystemFilterPoolReferenceManager
Get the object which instantiated this instance of the filter pool reference manager. This is also available from any filter reference framework object.

Specified by:
getProvider in interface ISystemFilterPoolReferenceManager
Returns:
the object (the "provider" or factory) which instantiated this instance of the filter pool reference manager. This is also available from any filter reference framework object.

setProvider

public void setProvider(ISystemFilterPoolReferenceManagerProvider caller)
Set the object which instantiated this instance of the filter pool reference manager. This makes it available to retrieve from any filter reference framework object, via the ubiquitous getProvider interface method.

Specified by:
setProvider in interface ISystemFilterPoolReferenceManager
Parameters:
caller - the factory that created this instance.

setProviderEventNotification

public void setProviderEventNotification(boolean fireEvents)
Turn callbacks to the provider either off or on.

Specified by:
setProviderEventNotification in interface ISystemFilterPoolReferenceManager
Parameters:
fireEvents - true if events are to be fired to the provider object, false if not.

setNamingPolicy

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

Parameters:
namingPolicy - the naming policy - no longer used.
See Also:
IRSEFilterNamingPolicy

getNamingPolicy

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

Returns:
the naming policy - no longer used.
See Also:
IRSEFilterNamingPolicy

setSystemFilterPoolReferenceManagerData

public void setSystemFilterPoolReferenceManagerData(Object data)
This is to set transient data that is subsequently queryable.

Parameters:
data - the data associated with this pool reference manager.

getSystemFilterPoolReferenceManagerData

public Object getSystemFilterPoolReferenceManagerData()
Returns:
transient data set via setFilterPoolData.

setName

public void setName(String name)
Set the name. This is an override of mof-generated method in order to potentially rename the disk file for a save policy of SAVE_POLICY_ONE_FILE_PER_MANAGER. No longer used.

Specified by:
setName in interface IRSEBasePersistableReferenceManager
Parameters:
name - the name of this reference manager.

regenerateReferencedSystemFilterPoolNames

public void regenerateReferencedSystemFilterPoolNames()
Ask each referenced pool for its name, and update it. Called after the name of the pool or its manager changes.

Specified by:
regenerateReferencedSystemFilterPoolNames in interface ISystemFilterPoolReferenceManager

getSystemFilterPoolReferences

public ISystemFilterPoolReference[] getSystemFilterPoolReferences()
Description copied from interface: ISystemFilterPoolReferenceManager
Return array of SystemFilterPoolReference objects. Result will never be null, although it may be an array of length zero.

Specified by:
getSystemFilterPoolReferences in interface ISystemFilterPoolReferenceManager
Returns:
array of SystemFilterPoolReference objects. Result will never be null, although it may be an array of length zero.

setSystemFilterPoolReferences

public void setSystemFilterPoolReferences(ISystemFilterPoolReference[] filterPoolReferences,
                                          boolean deReference)
In one shot, set the filter pool references. Calls back to inform provider.

Specified by:
setSystemFilterPoolReferences in interface ISystemFilterPoolReferenceManager
Parameters:
filterPoolReferences - an array of filter pool reference objects to set the list to.
deReference - true to first de-reference all objects in the existing list.

addSystemFilterPoolReference

public int addSystemFilterPoolReference(ISystemFilterPoolReference filterPoolReference)
Add a filter pool referencing object to the list.

Specified by:
addSystemFilterPoolReference in interface ISystemFilterPoolReferenceManager
Parameters:
filterPoolReference - a reference to add to this manager
Returns:
the new count of referencing objects

resetSystemFilterPoolReference

public void resetSystemFilterPoolReference(ISystemFilterPoolReference filterPoolReference,
                                           ISystemFilterPool newPool)
Reset the filter pool a reference points to. Called on a move-filter-pool operation

Specified by:
resetSystemFilterPoolReference in interface ISystemFilterPoolReferenceManager
Parameters:
filterPoolReference - the reference to fix up
newPool - the new pool to reference

removeSystemFilterPoolReference

public int removeSystemFilterPoolReference(ISystemFilterPoolReference filterPoolReference,
                                           boolean deReference)
Remove a filter pool referencing object from the list.

Specified by:
removeSystemFilterPoolReference in interface ISystemFilterPoolReferenceManager
Parameters:
filterPoolReference - the reference to remove
deReference - true if we want to dereference the referenced object (call removeReference on it)
Returns:
the new count of referencing objects

getSystemFilterPoolReferenceCount

public int getSystemFilterPoolReferenceCount()
Description copied from interface: ISystemFilterPoolReferenceManager
Return count of referenced filter pools

Specified by:
getSystemFilterPoolReferenceCount in interface ISystemFilterPoolReferenceManager
Returns:
count of referenced filter pools

getSystemFilterPoolReferencePosition

public int getSystemFilterPoolReferencePosition(ISystemFilterPoolReference filterPoolRef)
Description copied from interface: ISystemFilterPoolReferenceManager
Return the zero-based position of a SystemFilterPoolReference object within this list

Specified by:
getSystemFilterPoolReferencePosition in interface ISystemFilterPoolReferenceManager
Parameters:
filterPoolRef - the filter pool reference to search for
Returns:
the zero-based position of the reference within this manager

moveSystemFilterPoolReference

public void moveSystemFilterPoolReference(ISystemFilterPoolReference filterPoolRef,
                                          int pos)
Move a given filter pool reference to a given zero-based location. Calls back to inform provider of the event.

Specified by:
moveSystemFilterPoolReference in interface ISystemFilterPoolReferenceManager
Parameters:
filterPoolRef - the reference to move
pos - the new position at which to move it. References at that position and beyond are moved up in the list.

moveSystemFilterPoolReferences

public void moveSystemFilterPoolReferences(ISystemFilterPoolReference[] filterPoolRefs,
                                           int delta)
Move existing filter pool references a given number of positions. If the delta is negative, they are all moved up by the given amount. If positive, they are all moved down by the given amount. Calls back to inform provider.

Specified by:
moveSystemFilterPoolReferences in interface ISystemFilterPoolReferenceManager
Parameters:
filterPoolRefs - Array of SystemFilterPoolReferences to move.
delta - the amount by which to move these references.

getReferencedSystemFilterPools

public ISystemFilterPool[] getReferencedSystemFilterPools()
Description copied from interface: ISystemFilterPoolReferenceManager
Return array of filter pools currently referenced by this manager Result will never be null, although it may be an array of length zero.

Specified by:
getReferencedSystemFilterPools in interface ISystemFilterPoolReferenceManager
Returns:
array of filter pools currently referenced by this manager. Result will never be null, although it may be an array of length zero.

isSystemFilterPoolReferenced

public boolean isSystemFilterPoolReferenced(ISystemFilterPool filterPool)
Description copied from interface: ISystemFilterPoolReferenceManager
Return true if the given filter pool has a referencing object in this list.

Specified by:
isSystemFilterPoolReferenced in interface ISystemFilterPoolReferenceManager
Parameters:
filterPool - the filter pool to test to see if we have a reference to it
Returns:
true if the given filter pool has a referencing object in this list.

getReferenceToSystemFilterPool

public ISystemFilterPoolReference getReferenceToSystemFilterPool(ISystemFilterPool filterPool)
Given a filter pool, locate the referencing object for it and return it.

Specified by:
getReferenceToSystemFilterPool in interface ISystemFilterPoolReferenceManager
Parameters:
filterPool - the filter pool we are testing for a reference
Returns:
the referencing object if found, else null

addReferenceToSystemFilterPool

public ISystemFilterPoolReference addReferenceToSystemFilterPool(ISystemFilterPool filterPool)
Description copied from interface: ISystemFilterPoolReferenceManager
Given a filter pool, create a referencing object and add it to the list.

Calls back to inform provider

Specified by:
addReferenceToSystemFilterPool in interface ISystemFilterPoolReferenceManager
Returns:
new filter pool reference

addReferenceToSystemFilterPool

public ISystemFilterPoolReference addReferenceToSystemFilterPool(ISystemFilterPoolManager filterPoolManager,
                                                                 String filterPoolName)
Description copied from interface: ISystemFilterPoolReferenceManager
Given a filter pool name, create a referencing object and add it to the list. This creates an unresolved reference to that filter pool. It will be resolved on first use.

Calls back to inform provider

Specified by:
addReferenceToSystemFilterPool in interface ISystemFilterPoolReferenceManager
Parameters:
filterPoolManager - the manager that can be used to resolve the reference.
filterPoolName - the name of the filter pool being referenced.
Returns:
new filter pool reference

removeReferenceToSystemFilterPool

public int removeReferenceToSystemFilterPool(ISystemFilterPool filterPool)
Given a filter pool, locate the referencing object for it and remove it from the list. Also removes that reference from the filterPool itself, and calls back to provider when done.

Specified by:
removeReferenceToSystemFilterPool in interface ISystemFilterPoolReferenceManager
Parameters:
filterPool - the filter pool whose references we are to remove
Returns:
the new count of referencing objects

renameReferenceToSystemFilterPool

public void renameReferenceToSystemFilterPool(ISystemFilterPool pool)
A referenced filter pool has been renamed. Update our stored name. Calls back to inform provider.

Specified by:
renameReferenceToSystemFilterPool in interface ISystemFilterPoolReferenceManager
Parameters:
pool - the pool that has just been renamed

setSystemFilterPoolReferences

public void setSystemFilterPoolReferences(ISystemFilterPool[] filterPools,
                                          boolean deReference)
In one shot, set the filter pool references to new references to supplied filter pools. Calls back to provider.

Specified by:
setSystemFilterPoolReferences in interface ISystemFilterPoolReferenceManager
Parameters:
filterPools - of filter pool objects to create references for
deReference - true to first de-reference all objects in the existing list.

getSystemFilterReference

public ISystemFilterReference getSystemFilterReference(ISubSystem subSystem,
                                                       ISystemFilter filter)
Create a single filter refererence to a given filter. Needed when a filter is added to a pool, and the UI is not showing pools but rather all filters in all pool references.

Specified by:
getSystemFilterReference in interface ISystemFilterPoolReferenceManager
Parameters:
subSystem - the subsystem that uses this reference manager
filter - the new filter that is being added
Returns:
the new reference

getSystemFilterReferences

public ISystemFilterReference[] getSystemFilterReferences(ISubSystem subSystem)
Concatenate all filter references from all filter pools we reference, into one big list. Used when the UI is not showing pools.

Specified by:
getSystemFilterReferences in interface ISystemFilterPoolReferenceManager
Parameters:
subSystem - the subsystem for which this manager is providing filter pool reference management
Returns:
an array of references for this subsystem

getSystemFilterReferencePosition

public int getSystemFilterReferencePosition(ISystemFilterReference filterRef)
Given a filter reference, return its position within this reference manager when you think of all filter references from all filter pool references as being concatenated. Used when the UI is not showing pools.

Specified by:
getSystemFilterReferencePosition in interface ISystemFilterPoolReferenceManager
Parameters:
filterRef - the reference to locate
Returns:
the position fo this reference or -1 if not found.

getSystemFilterReferencePosition

public int getSystemFilterReferencePosition(ISubSystem subSystem,
                                            ISystemFilter filter)
Given a filter, return its position within this reference manager when you think of all filter references from all filter pool references as being concatenated. Used when the UI is not showing pools.

Specified by:
getSystemFilterReferencePosition in interface ISystemFilterPoolReferenceManager
Parameters:
subSystem - the subsystem in which to located the filter
filter - the filter to locate
Returns:
the position of the filter within this manager.

save

public void save()
          throws Exception
Save all the filter pools to disk. Only called if the save policy is not "none". No longer used.

Specified by:
save in interface ISystemFilterPoolReferenceManager
Throws:
Exception

saveToOneFile

protected boolean saveToOneFile()
                         throws Exception
Save this reference manager to disk. Used only if using the reference manager to save a single file to disk. No longer used.

Returns:
true if the save succeeded
Throws:
Exception

restore

public static ISystemFilterPoolReferenceManager restore(ISystemFilterPoolReferenceManagerProvider caller,
                                                        IFolder mgrFolder,
                                                        String name,
                                                        IRSEFilterNamingPolicy namingPolicy)
                                                 throws Exception
Restore the filter pools from disk. After restoring, you must call resolveReferencesAfterRestore. No longer used.

Parameters:
caller - The object that is calling this, which must implement SystemFilterPoolReferenceManagerProvider
mgrFolder - folder containing filter pool references file.
name - the name of the manager to restore. File name is derived from it when saving to one file.
namingPolicy - to get file name prefix, via getFilterPoolReferenceManagerFileNamePrefix(). Pass null to use default.
Returns:
the restored manager, or null if it does not exist.
Throws:
Exception - if anything else went wrong

restore

public static ISystemFilterPoolReferenceManager restore(ISystemFilterPoolReferenceManagerProvider caller,
                                                        IFolder mgrFolder,
                                                        String name)
                                                 throws Exception
Restore the filter pools from disk, assuming default for a naming policy. No longer used.

Parameters:
caller - The object that is calling this, which must implement SystemFilterPoolReferenceManagerProvider
mgrFolder - folder containing filter pool references file.
name - the name of the manager to restore. File name is derived from it when saving to one file.
Returns:
the restored manager, or null if it does not exist.
Throws:
Exception - if anything else went wrong

restoreFromOneFile

protected static ISystemFilterPoolReferenceManager restoreFromOneFile(IFolder mgrFolder,
                                                                      String name,
                                                                      IRSEFilterNamingPolicy namingPolicy)
                                                               throws Exception
Restore filter pools when all are stored in one file. No longer used.

Parameters:
mgrFolder - The folder containing the file to restore from.
name - The name of the manager, from which the file name is derived.
namingPolicy - Naming prefix information for persisted data file names.
Returns:
the restored manager, or null if it does not exist.
Throws:
Exception - if anything else went wrong

resolveReferencesAfterRestore

public Vector resolveReferencesAfterRestore(ISystemFilterPoolManagerProvider relatedPoolMgrProvider,
                                            ISystemFilterPoolReferenceManagerProvider provider)
After restoring this from disk, there is only the referenced object name, not the referenced object pointer, for each referencing object.

This method is called after restore and for each restored object in the list must:

  1. Do what is necessary to find the referenced object, and set the internal reference pointer.
  2. Call addReference(this) on that object so it can maintain it's in-memory list of all referencing objects.
  3. Set the important transient variables

Specified by:
resolveReferencesAfterRestore in interface ISystemFilterPoolReferenceManager
Parameters:
relatedPoolMgrProvider - the filter pool manager provider that created the filter pools we reference (usually a subsystem configuration)
provider - the host of this reference manager, so you can later call getProvider
Returns:
A Vector of SystemFilterPoolReferences that were not successfully resolved, or null if all were resolved.

getFilterPool

public static ISystemFilterPool getFilterPool(ISystemFilterPoolManager[] mgrs,
                                              String mgrName,
                                              String poolName)
Utility method to scan across all filter pools in a given named filter pool manager, for a match on a given filter pool name.

Parameters:
mgrs - The list of filter pool managers to scan for the given filter pool.
mgrName - The name of the manager to restrict the search to
poolName - The name of the filter pool as stored on disk. It may be qualified somehow to incorporate the manager name too.
Returns:
the filter pool that was found.

getFilterPoolManager

public static ISystemFilterPoolManager getFilterPoolManager(ISystemFilterPoolManager[] mgrs,
                                                            String mgrName)
Utility method to scan across all filter pool managers for a match on a give name.

Parameters:
mgrs - The list of filter pool managers to scan for the given name
mgrName - The name of the manager to restrict the search to
Returns:
the filter pool manager that was found or null if not found.

getSaveFilePathAndName

protected static String getSaveFilePathAndName(IFolder mgrFolder,
                                               String name,
                                               IRSEFilterNamingPolicy namingPolicy)
If saving all info in one file, this returns the fully qualified name of that file, given the unadorned manager name and the prefix (if any) to adorn with. No longer used.

Parameters:
mgrFolder - The folder in which to save a reference manager.
name - The name of the file for a filter pool reference manager.
namingPolicy - The naming policy for a filter pool reference manager
Returns:
The name of the path to which to save the references in a filter pool reference manager.

getSaveFileName

protected static String getSaveFileName(String fileNameNoSuffix)
Appends the correct extension to the file name where this manager is saved. No longer used.

Parameters:
fileNameNoSuffix - the file name sans suffix.
Returns:
the unqualified file name used to store this to disk.

getSaveFilePathAndName

protected String getSaveFilePathAndName()
Returns:
the full path name of the file in which to save this manager.

getSaveFileName

protected String getSaveFileName()
Returns:
the simple name of the file in which to save this manager.

getFolder

public IFolder getFolder()
Description copied from interface: ISystemFilterPoolReferenceManager
Return the folder that this manager is contained in.

Specified by:
getFolder in interface ISystemFilterPoolReferenceManager
Returns:
the folder that this manager is contained in.

resetManagerFolder

public void resetManagerFolder(IFolder newFolder)
Set the folder that this manager is contained in.

Specified by:
resetManagerFolder in interface ISystemFilterPoolReferenceManager
Parameters:
newFolder - the new folder

getFolderPath

public String getFolderPath()
Returns:
the path of the folder that contains this manager.

getFolderPath

public static String getFolderPath(IFolder folder)
Parameters:
folder - the folder to find the path for
Returns:
the path of the given folder

toString

public String toString()
Description copied from class: org.eclipse.rse.internal.references.SystemPersistableReferenceManager
Return string identifying this filter


RSE
Release 1.0

Copyright (c) IBM Corporation and others 2000, 2006. All Rights Reserved.