RSE
Release 1.0

org.eclipse.rse.filters
Class SystemFilterReference

java.lang.Object
  extended byorg.eclipse.rse.core.model.PropertySetContainer
      extended byorg.eclipse.rse.core.model.RSEModelObject
          extended byorg.eclipse.rse.internal.references.SystemReferencingObject
              extended byorg.eclipse.rse.filters.SystemFilterReference
All Implemented Interfaces:
IAdaptable, IPropertySetContainer, IRSEBaseReferencingObject, IRSEModelObject, org.eclipse.rse.core.persistance.IRSEPersistableContainer, IRSEReferencingObject, ISystemContainer, ISystemFilterContainerReference, ISystemFilterReference

public class SystemFilterReference
extends org.eclipse.rse.internal.references.SystemReferencingObject
implements IAdaptable, ISystemFilterReference, IRSEReferencingObject


Field Summary
protected  ISubSystem _subSystem
           
protected  HashMap cachedContents
           
protected  boolean isStale
           
protected  boolean persistent
           
static boolean PERSISTENT_NO
           
static boolean PERSISTENT_YES
           
 
Fields inherited from class org.eclipse.rse.internal.references.SystemReferencingObject
referenceBroken
 
Fields inherited from class org.eclipse.rse.core.model.RSEModelObject
_isDirty, _wasRestored
 
Constructor Summary
protected SystemFilterReference()
          Constructor.
 
Method Summary
 boolean commit()
          Request a persistence manager to persist this object.
static ISystemFilterReference createSystemFilterReference(ISubSystem subSystem, ISystemFilterContainerReference parent, ISystemFilter filter, boolean persistent)
          Create a new instance of this class.
 Object getAdapter(Class adapterType)
          This is the method required by the IAdaptable interface.
 Object[] getContents(ISystemContentsType contentsType)
          Returns all the contents of the object (combining results of all filters
 ISystemFilterReference getExistingSystemFilterReference(ISubSystem subSystem, ISystemFilter filter)
          Return an existing reference to a given system filter.
 int getFilterCount()
          Return count of the number of filters in the referenced pool or filter
 ISystemFilterPoolReferenceManager getFilterPoolReferenceManager()
          Return the reference manager which is managing this filter reference framework object.
 String getName()
          Return the name of the SystemFilter or SystemFilterPool that we reference.
 ISystemFilterContainerReference getParent()
          The parent will either by a SystemFilterPoolReference or a SystemFilterReference.
 ISystemFilterPoolReference getParentSystemFilterReferencePool()
          If this is a reference to a nested filter, the parent is the reference to the nested filter's parent.
 ISystemFilterPoolReferenceManagerProvider getProvider()
          Return the object which instantiated the pool reference manager object.
 ISystemFilter getReferencedFilter()
          Return the filter to which we reference...
 IRSEBaseReferencedObject getReferencedObject()
          Get the object which we reference.
 ISystemFilterContainer getReferencedSystemFilterContainer()
          Return the object to which we hold a reference.
 ISubSystem getSubSystem()
          Gets the subsystem that contains this reference
 ISystemFilterReference getSystemFilterReference(ISubSystem subSystem, ISystemFilter filter)
          Create a single filter refererence to a given filter.
 ISystemFilterReference[] getSystemFilterReferences(ISubSystem subSystem)
          Build and return an array of SystemFilterReference objects.
 int getSystemFilterStringCount()
          Return the number of filter strings in the referenced filter
 ISystemFilterStringReference getSystemFilterStringReference(ISystemFilterString filterString)
          Create a single filter string refererence to a given filter string
 ISystemFilterStringReference[] getSystemFilterStringReferences()
          Get the filter strings contained by this filter.
 boolean hasContents(ISystemContentsType contentsType)
          Returns whether the object has contents of a particular type.
 boolean hasFilters()
          Return true if the referenced pool or filter has filters.
 boolean isStale()
          Indicates whether the cached object is stale
 void markStale(boolean isStale)
          Marks the object as stale or not
 void markStale(boolean isStale, boolean clearCache)
          Marks the object as stale or not
 int removeReference()
          Fastpath to getReferencedObject().removeReference(this).
 void setContents(ISystemContentsType type, Object[] cachedContents)
           
 void setParent(ISystemFilterContainerReference parent)
          If this is a reference to a nested filter, the parent is the reference to the nested filter's parent.
 void setReferencedFilter(ISystemFilter filter)
          Set the filter to which we reference...
 void setReferencedObject(IRSEBaseReferencedObject obj)
          Set the object to which we reference.
 void setSubSystem(ISubSystem subSystem)
          Sets the subsystem that contains this reference
 String toString()
          Override of Object method.
 
Methods inherited from class org.eclipse.rse.internal.references.SystemReferencingObject
getDescription, getHelper, isReferenceBroken, setReferenceBroken
 
Methods inherited from class org.eclipse.rse.core.model.RSEModelObject
compareStrings, isDirty, setDirty, setWasRestored, wasRestored
 
Methods inherited from class org.eclipse.rse.core.model.PropertySetContainer
addPropertySet, addPropertySets, createPropertySet, createPropertySet, getPropertySet, getPropertySets, removePropertySet
 
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.IRSEBaseReferencingObject
isReferenceBroken, setReferenceBroken
 
Methods inherited from interface org.eclipse.rse.core.model.IPropertySetContainer
addPropertySet, addPropertySets, createPropertySet, createPropertySet, getPropertySet, getPropertySets, removePropertySet
 

Field Detail

persistent

protected boolean persistent

isStale

protected boolean isStale

_subSystem

protected ISubSystem _subSystem

cachedContents

protected HashMap cachedContents

PERSISTENT_YES

public static final boolean PERSISTENT_YES
See Also:
Constant Field Values

PERSISTENT_NO

public static final boolean PERSISTENT_NO
See Also:
Constant Field Values
Constructor Detail

SystemFilterReference

protected SystemFilterReference()
Constructor. Typically called by MOF.

Method Detail

createSystemFilterReference

public static ISystemFilterReference createSystemFilterReference(ISubSystem subSystem,
                                                                 ISystemFilterContainerReference parent,
                                                                 ISystemFilter filter,
                                                                 boolean persistent)
Create a new instance of this class.

Parameters:
parent - The SystemFilterReference or SystemFilterPoolReference object that we are a child of.
filter - The master object to be referenced.
persistent - Whether we should formally register our reference with the target filter or not.

getSubSystem

public ISubSystem getSubSystem()
Gets the subsystem that contains this reference

Specified by:
getSubSystem in interface ISystemFilterReference
Returns:
the subsystem

setSubSystem

public void setSubSystem(ISubSystem subSystem)
Sets the subsystem that contains this reference

Specified by:
setSubSystem in interface ISystemFilterReference
Parameters:
subSystem -

getFilterPoolReferenceManager

public ISystemFilterPoolReferenceManager getFilterPoolReferenceManager()
Return the reference manager which is managing this filter reference framework object.

Specified by:
getFilterPoolReferenceManager in interface ISystemFilterReference

getProvider

public ISystemFilterPoolReferenceManagerProvider getProvider()
Return the object which instantiated the pool reference manager object. Makes it easy to get back to the point of origin, given any filter reference framework object

Specified by:
getProvider in interface ISystemFilterReference

setParent

public void setParent(ISystemFilterContainerReference parent)
If this is a reference to a nested filter, the parent is the reference to the nested filter's parent. Else, it is the reference to the parent filter pool


getParent

public ISystemFilterContainerReference getParent()
The parent will either by a SystemFilterPoolReference or a SystemFilterReference.

Specified by:
getParent in interface ISystemFilterReference

getReferencedFilter

public ISystemFilter getReferencedFilter()
Return the filter to which we reference...

Specified by:
getReferencedFilter in interface ISystemFilterReference

setReferencedFilter

public void setReferencedFilter(ISystemFilter filter)
Set the filter to which we reference...

Specified by:
setReferencedFilter in interface ISystemFilterReference

getParentSystemFilterReferencePool

public ISystemFilterPoolReference getParentSystemFilterReferencePool()
If this is a reference to a nested filter, the parent is the reference to the nested filter's parent. Else, it is the reference to the parent filter pool

Specified by:
getParentSystemFilterReferencePool in interface ISystemFilterReference

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

getReferencedSystemFilterContainer

public ISystemFilterContainer getReferencedSystemFilterContainer()
Return the object to which we hold a reference. This is either SystemFilter or SystemFilterPool. Since both implement SystemFilterContainer, that is what we return.

Of course, this is a generic method, and in our case it is always true that we only hold a SystemFilter. Hence, this is the same as calling getReferenceFilter and casting the result.

Specified by:
getReferencedSystemFilterContainer in interface ISystemFilterContainerReference

getSystemFilterReferences

public ISystemFilterReference[] getSystemFilterReferences(ISubSystem subSystem)
Build and return an array of SystemFilterReference objects. Each object is created new. There is one for each of the filters in the reference SystemFilter or SystemFilterPool. For performance reasons, we will cache this array and only return a fresh one if something changes in the underlying filter list.

Specified by:
getSystemFilterReferences in interface ISystemFilterContainerReference

getSystemFilterReference

public ISystemFilterReference getSystemFilterReference(ISubSystem subSystem,
                                                       ISystemFilter filter)
Create a single filter refererence to a given filter. If there already is a reference to this filter, it is returned. If not, a new reference is created and appended to the end of the existing filter reference array.

Specified by:
getSystemFilterReference in interface ISystemFilterContainerReference
See Also:
#getExistingSystemFilterReference(ISystemFilter)

getExistingSystemFilterReference

public ISystemFilterReference getExistingSystemFilterReference(ISubSystem subSystem,
                                                               ISystemFilter filter)
Return an existing reference to a given system filter. If no reference currently exists to this filter, returns null.

Specified by:
getExistingSystemFilterReference in interface ISystemFilterContainerReference
See Also:
#getSystemFilterReference(ISystemFilter)

hasFilters

public boolean hasFilters()
Return true if the referenced pool or filter has filters.

Specified by:
hasFilters in interface ISystemFilterContainerReference

getFilterCount

public int getFilterCount()
Return count of the number of filters in the referenced pool or filter

Specified by:
getFilterCount in interface ISystemFilterContainerReference

getName

public String getName()
Return the name of the SystemFilter or SystemFilterPool that we reference. For such objects this is what we show in the GUI.

Specified by:
getName in interface ISystemFilterContainerReference

toString

public String toString()
Override of Object method. Turn this filter in an outputable string


getSystemFilterStringCount

public int getSystemFilterStringCount()
Return the number of filter strings in the referenced filter

Specified by:
getSystemFilterStringCount in interface ISystemFilterReference

getSystemFilterStringReferences

public ISystemFilterStringReference[] getSystemFilterStringReferences()
Get the filter strings contained by this filter. But get references to each, not the masters.

Specified by:
getSystemFilterStringReferences in interface ISystemFilterReference

getSystemFilterStringReference

public ISystemFilterStringReference getSystemFilterStringReference(ISystemFilterString filterString)
Create a single filter string refererence to a given filter string

Specified by:
getSystemFilterStringReference in interface ISystemFilterReference

setReferencedObject

public void setReferencedObject(IRSEBaseReferencedObject obj)
Set the object to which we reference. Override of inherited

Specified by:
setReferencedObject in interface IRSEBaseReferencingObject
See Also:
IRSEBaseReferencingObject.setReferencedObject(IRSEBaseReferencedObject)

getReferencedObject

public IRSEBaseReferencedObject getReferencedObject()
Get the object which we reference. Override of inherited

Specified by:
getReferencedObject in interface IRSEBaseReferencingObject
See Also:
IRSEBaseReferencingObject.getReferencedObject()

removeReference

public int removeReference()
Fastpath to getReferencedObject().removeReference(this).

Specified by:
removeReference in interface IRSEBaseReferencingObject
Returns:
new reference count of master object
See Also:
IRSEBaseReferencingObject.removeReference()

hasContents

public boolean hasContents(ISystemContentsType contentsType)
Description copied from interface: ISystemContainer
Returns whether the object has contents of a particular type.

Specified by:
hasContents in interface ISystemContainer
Parameters:
contentsType - type of contents
Returns:
true if the object has contents, false otherwise.

getContents

public Object[] getContents(ISystemContentsType contentsType)
Description copied from interface: ISystemContainer
Returns all the contents of the object (combining results of all filters

Specified by:
getContents in interface ISystemContainer
Parameters:
contentsType - type of contents
Returns:
an array of contents.

setContents

public void setContents(ISystemContentsType type,
                        Object[] cachedContents)
Specified by:
setContents in interface ISystemFilterReference

isStale

public boolean isStale()
Description copied from interface: ISystemContainer
Indicates whether the cached object is stale

Specified by:
isStale in interface ISystemContainer
Returns:
whether the container is stale

markStale

public void markStale(boolean isStale)
Description copied from interface: ISystemContainer
Marks the object as stale or not

Specified by:
markStale in interface ISystemContainer
Parameters:
isStale - whether the object is to be marked stale or not

markStale

public void markStale(boolean isStale,
                      boolean clearCache)
Description copied from interface: ISystemContainer
Marks the object as stale or not

Specified by:
markStale in interface ISystemContainer
Parameters:
isStale - whether the object is to be marked stale or not

commit

public boolean commit()
Description copied from interface: org.eclipse.rse.core.persistance.IRSEPersistableContainer
Request a persistence manager to persist this object.

Specified by:
commit in interface org.eclipse.rse.core.persistance.IRSEPersistableContainer
Returns:
true if the object was persisted.

RSE
Release 1.0

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