Remote Systems
v6.4.1

com.ibm.etools.systems.references
Interface SystemPersistableReferenceManager

All Known Subinterfaces:
SystemFilterPoolReferenceManager
All Known Implementing Classes:
SystemFilterPoolReferenceManagerImpl, SystemPersistableReferenceManagerImpl

public interface SystemPersistableReferenceManager


Field Summary
static String copyright
           
 
Method Summary
 int addReferencingObject(ISystemPersistableReferencingObject object)
          Add a referencing object to the managed list.
 String getName()
           
 ISystemPersistableReferencingObject getReferencedObject(ISystemPersistableReferencedObject object)
          Search list of referencing objects to see if one of them references the given referencable object.
 int getReferencingObjectCount()
          Return how many referencing objects are currently in the list.
 EList getReferencingObjectList()
           
 int getReferencingObjectPosition(ISystemPersistableReferencingObject object)
          Return the zero-based position of the given referencing object within the list.
 ISystemPersistableReferencingObject[] getReferencingObjects()
          Return an array of the referencing objects currently being managed.
 boolean isReferenced(ISystemPersistableReferencedObject object)
          Return true if the given referencable object is indeed referenced by a referencing object in the current list.
 void moveReferencingObjectPosition(int newPosition, ISystemPersistableReferencingObject object)
          Move the given referencing object to a new zero-based position in the list.
 void removeAllReferencingObjects()
          Remove all objects from the list.
 void removeAndDeReferenceAllReferencingObjects()
          Remove and dereference all objects from the list.
 int removeAndDeReferenceReferencingObject(ISystemPersistableReferencingObject object)
          Remove and dereferences a referencing object from the managed list.
 int removeReferencingObject(ISystemPersistableReferencingObject object)
          Remove a referencing object from the managed list.
 boolean resolveReferencesAfterRestore()
          After restoring this from disk, there is only the referenced object name, not the referenced object pointer, for each referencing object.
 void save(IFolder folder, String fileName)
          Attempt to save contents of manager to disk.
 void setName(String value)
           
 void setReferencingObjects(ISystemPersistableReferencingObject[] objects, boolean deReference)
          Set in one shot the list of referencing objects.
 

Field Detail

copyright

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

getReferencingObjects

public ISystemPersistableReferencingObject[] getReferencingObjects()
Return an array of the referencing objects currently being managed.


setReferencingObjects

public void setReferencingObjects(ISystemPersistableReferencingObject[] objects,
                                  boolean deReference)
Set in one shot the list of referencing objects. Replaces current list.

Parameters:
objects - An array of referencing objects which is to become the new list.
deReference - true to first de-reference all objects in the existing list.

addReferencingObject

public int addReferencingObject(ISystemPersistableReferencingObject object)
Add a referencing object to the managed list.

Returns:
new count of referenced objects being managed.

removeReferencingObject

public int removeReferencingObject(ISystemPersistableReferencingObject object)
Remove a referencing object from the managed list.

Does NOT call removeReference on the master referenced object.

Returns:
new count of referenced objects being managed.

removeAndDeReferenceReferencingObject

public int removeAndDeReferenceReferencingObject(ISystemPersistableReferencingObject object)
Remove and dereferences a referencing object from the managed list.

DOES call removeReference on the master referenced object.

Returns:
new count of referenced objects being managed.

removeAllReferencingObjects

public void removeAllReferencingObjects()
Remove all objects from the list.

Does NOT call removeReference on the master referenced objects.


removeAndDeReferenceAllReferencingObjects

public void removeAndDeReferenceAllReferencingObjects()
Remove and dereference all objects from the list.

DOES call removeReference on the master referenced objects.


getReferencingObjectCount

public int getReferencingObjectCount()
Return how many referencing objects are currently in the list.

Returns:
current count of referenced objects being managed.

getReferencingObjectPosition

public int getReferencingObjectPosition(ISystemPersistableReferencingObject object)
Return the zero-based position of the given referencing object within the list. Does a memory address comparison (==) to find the object.

Parameters:
object - The referencing object to find position of.
Returns:
zero-based position within the list. If not found, returns -1

moveReferencingObjectPosition

public void moveReferencingObjectPosition(int newPosition,
                                          ISystemPersistableReferencingObject object)
Move the given referencing object to a new zero-based position in the list.

Parameters:
newPosition - New zero-based position
object - The referencing object to move

isReferenced

public boolean isReferenced(ISystemPersistableReferencedObject object)
Return true if the given referencable object is indeed referenced by a referencing object in the current list. This is done by comparing the reference names of each, not the in-memory pointers.

Parameters:
object - The referencable object to which to search for a referencing object within this list
Returns:
true if found in list, false otherwise.

getReferencedObject

public ISystemPersistableReferencingObject getReferencedObject(ISystemPersistableReferencedObject object)
Search list of referencing objects to see if one of them references the given referencable object. This is done by comparing the reference names of each, not the in-memory pointers.

Parameters:
object - The referencable object to which to search for a referencing object within this list
Returns:
the referencing object within this list which references the given referencable object, or null if no reference found.

save

public void save(IFolder folder,
                 String fileName)
          throws Exception
Attempt to save contents of manager to disk. Only call if not doing your own save from your own model that uses a subclass of this.

Parameters:
folder - The folder in which to save the manager.
fileName - The unqualified file name to save to. Should include extension, such as .xmi
Throws:
Exception

resolveReferencesAfterRestore

public boolean resolveReferencesAfterRestore()
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.

Returns:
true if resolved successfully. False if some references were not found and hence those referencing objects removed from the restored list.

getName

public String getName()
Returns:
The value of the Name attribute

setName

public void setName(String value)
Parameters:
value - The new value of the Name attribute

getReferencingObjectList

public EList getReferencingObjectList()
Returns:
The list of ReferencingObjectList references

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.