Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.remotebuild
Class RBResource

java.lang.Object
  extended by com.ibm.etools.iseries.remotebuild.RBResource
Direct Known Subclasses:
RBProject, RBQSYSResource

public abstract class RBResource
extends Object

RBResource is the abstract class of all resources that support remote build. The RB* hierarchy supports the writing of synchronization snapshots and various remote operations.

An RBResource has a gender that reflects its type on the remote system. It also has a namespace in which its name is considered unique in some sense.

An RBResource can be one of 3 general types:


Field Summary
static String Copyright
           
static int G_BINARYOBJECT
          The gender of an object is a value that represents its type on the remote system.
static int G_LIBRARY
          The gender of an object is a value that represents its type on the remote system.
static int G_MEMBER
          The gender of an object is a value that represents its type on the remote system.
static int G_PROJECT
          The gender of an object is a value that represents its type on the remote system.
static int G_SAVEFILE
          The gender of an object is a value that represents its type on the remote system.
static int G_SOURCEFILE
          The gender of an object is a value that represents its type on the remote system.
static int G_UNKNOWN
          The gender of an object is a value that represents its type on the remote system.
static int NS_LOCAL
           
static int NS_NETWORK
           
static int NS_QSYS
           
static int NS_UNKNOWN
           
static String RB_QUALIFIER
           
 
Constructor Summary
protected RBResource(AbstractISeriesResource resource)
          Constructs an RBResource from a model resource.
protected RBResource(String name, long localStamp, long targetStamp)
          Constructs an RBResource from its snapshot information.
 
Method Summary
 void accept(RBResourceVisitor visitor)
          Accepts a resource visitor.
 void addChild(RBResource child)
          Adds a child to this resource and sets the child's parent to this resource.
 boolean attach(RBResource companion)
          Attaches another resource to this one.
 RBStatus checkAuthorities(String[] authorities)
          Checks the authorities of a remote resource that is the companion of the current resource.
 RBStatus checkContentsOn(RBSystem system)
          Checks the contents of the local resource against those of the target system resource.
 RBStatus checkExistence()
          Checks the existence of a remote resource that is the companion of this resource.
 RBStatus checkName()
          Checks the name of this path for validity.
 RBStatus checkPropertiesOn(RBSystem system)
          Checks the properties of the local resource against those of the remote resource.
protected  void checkProperty(Collection<String> modified, com.ibm.etools.iseries.projects.internal.snapshots.SnapshotRecord sr, String attributeName, String propertyName)
          Adds a property name to the list of modified properties if it is modified from its snapshot value.
 void clearMark(int n)
          Clears a mark on the resource.
 void clearMarks()
          Clears all marks on the resource.
 RBResource copy()
          Returns a copy of this resource with no children.
abstract  RBStatus createOn(RBSystem system)
          Creates the corresponding resource on the system.
abstract  boolean existsOn(RBSystem system)
          Checks to see if the resource's counterpart exists on the target system.
 RBResource findResource(LinkedList resourcePath)
          Returns the resource found by following the path from this resource.
 Object getAdapter(Class targetType)
          Returns the adapter for this resource for the given class.
abstract  List getAllProperties()
          Returns a set of all the property names this resource.
 List getAncestors()
          Gets the local ancestors of a single resource up to its project resource.
 IResource getBaseResource()
          Returns the base resource associated with this resource.
 String getCCSID()
           
 RBResource getChild(String key)
          Returns a child with the given short key.
 RBResource[] getChildren()
          Returns an array of children of this resource.
 RBResource getCompanion()
          Retrieves the companion resource.
 RBResourceContext getContext()
           
 String getDBCS()
           
 List getDescendents()
          Returns a List of all local resources in the tree rooted at a particular resource.
 String getDescription()
           
abstract  int getGender()
          Returns the type of this resource -- see constants.
 RBResource getHome()
          Returns the home resource for this resource.
 RBResource getHome(int nameSpace)
          Returns the home resource for the given name space.
abstract  String getIFSName()
          Returns the IFS name of the object from the path.
 List<String> getKeyPath()
           
 long getLocalStamp()
          Returns the local stamp of this resource.
protected  String getLocation()
          Returns the absolute path name string to the local resource.
 String getLongKey()
          Returns a string unique to this resource that can be used to create the "canonical" ordering of local resources in the workspace.
 List getModelChildren()
           
 AbstractISeriesResource getModelParent()
           
 AbstractISeriesProject getModelProject()
          Returns the model project for this resource.
 String getModelProperty(String name)
          Returns a property of this resource maintained by the model.
 AbstractISeriesResource getModelResource()
          Returns the model resource associated with this resource.
abstract  Collection<String> getModifiedProperties(com.ibm.etools.iseries.projects.internal.snapshots.SnapshotRecord sr)
           
 String getName()
          Returns the name of this resource
abstract  int getNameSpace()
          Returns the name space for this resource -- see constants.
 int getNumberOfChildren()
          Returns the number of children this resource has.
 RBResource getParent()
          Returns the parent of this resource.
 String getPersistentProperty(String name)
          Returns a persistent property for a resource.
 RBProject getProject()
          Returns the project resource for a resource.
 String getProjectProperty(String name)
          Returns a model property on the project for this resource.
abstract  IPath getProjectRelativePath()
          Returns the project relative path of this resource.
 IISeriesPropertiesModel getPropertiesModel()
          Gets the properties model for this resource.
abstract  String getQSYSName()
          Returns the QSYS name space name of the object.
 String getRecordLength()
           
 String getRemoteName()
          Returns the displayable name for this resource on the remote system.
 LinkedList getResourcePath()
          Returns the path to this resource from its root resource.
 Object getSessionProperty(String name)
          Returns a "remote build" session property for a resource.
 String getShortKey()
          Returns a value that may be used as a key for this resource in the context of its parent.
abstract  String getSnapshotType()
          Returns the snapshot type for this class.
 String getSourceType()
           
 RBSystem getSystem()
          Returns the target system for this resource.
 String getSystemName()
          Returns the system name of the current target system for this resource.
 long getTargetStamp()
          Returns the target stamp of this resource.
 boolean hasChildren()
          Returns true if this resource has children.
 boolean hasContents()
           
 boolean hasContext()
           
 int hashCode()
          Returns the hashCode for this resource.
 boolean hasMark(int n)
          Return true if the resource has a particular mark.
 boolean isEquivalentTo(Object o)
          Returns true if and only if the resources identify the same iSeries object.
 boolean isHome()
          Returns true if this is a home resource.
 boolean isLocal()
          Returns true if the resource exists in the local workspace.
 boolean isMarked()
          Return true if the resource is marked by any mark.
 boolean isProject()
          Returns true if this is a project resource.
 boolean isRemote()
          Returns true if the resource is a remote resource.
 boolean isSnapshot()
          Returns true if the resource is a snapshot resource.
static RBResource makeFrom(AbstractISeriesResource modelResource)
          Returns a resource made from a model resource.
static RBResource makeFrom(AbstractISeriesResource modelResource, RBResourceContext context)
          Returns a resource made from a model resource with respect to the context.
static RBResource makeFrom(int gender, String snapshotName, long localStamp, long targetStamp)
          Makes a new resource from its basic information.
 RBStatus pushContentsTo(RBSystem system)
          Pushes the contents of a resource to a target system.
 RBStatus pushPropertiesTo(RBSystem system)
          Pushes the properties to a target system.
 RBStatus pushPropertiesTo(RBSystem system, Collection properties)
          Pushes the properties named in the set to the target system resource.
 RBStatus pushSourceTypeTo(RBSystem system)
          Pushes the source type of this resource to the target system.
 QualifiedName qualify(String name)
          Qualifies a name with the remote build qualifier for use as a property name.
 void removeChild(String key)
          Removes a child from a parent.
 void saveModelProperties()
          Saves the model properties.
 void setCompanion(RBResource companion)
          Sets the companion resource.
 void setContext(RBResourceContext context)
          Sets the resolution context for this resource.
 void setLocalStamp(long stamp)
          Sets the local stamp of this resource.
 void setMark(int n)
          Sets a mark on the resource.
 void setModelProperty(String name, String value)
          Sets a model property for this resource.
protected  void setName(String name)
          Sets the short name of this resource.
 void setPersistentProperty(String name, String property)
          Sets a persistent property for a resource.
 void setProjectProperty(String name, String value)
          Sets a model property on the project for this resource.
 void setSessionProperty(String name, Object property)
          Sets a session property for a resource.
 void setSourceType(String type)
          Sets the source type for this resource.
 void setTargetStamp(long stamp)
          Sets the target stamp of this resource.
 void synchronize()
          Synchronizes the properties of this resource.
 String toString()
           
 void updateFrom(RBResource r)
          Updates a resources stamps from the argument.
 boolean wasCreated()
          Returns true if the resource has been created with respect to its companion resource.
 boolean wasDeleted()
          Returns true if the resource has been deleted with respect to its companion resource.
 boolean wasModified()
          Returns true if the resource has been modified with respect to its companion resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

Copyright

public static final String Copyright
See Also:
Constant Field Values

NS_UNKNOWN

public static final int NS_UNKNOWN
See Also:
Constant Field Values

NS_LOCAL

public static final int NS_LOCAL
See Also:
Constant Field Values

NS_QSYS

public static final int NS_QSYS
See Also:
Constant Field Values

NS_NETWORK

public static final int NS_NETWORK
See Also:
Constant Field Values

RB_QUALIFIER

public static final String RB_QUALIFIER
See Also:
Constant Field Values

G_UNKNOWN

public static final int G_UNKNOWN
The gender of an object is a value that represents its type on the remote system. Each concrete subclass returns its gender. Can be used to determine type at runtime.

Gender of object is not known. Value is 0. Used if an RBResource is created in some undefined fashion.

See Also:
Constant Field Values

G_PROJECT

public static final int G_PROJECT
The gender of an object is a value that represents its type on the remote system. Each concrete subclass returns its gender. Can be used to determine type at runtime.

The resource is an RBProject. Value is 1.

See Also:
Constant Field Values

G_SOURCEFILE

public static final int G_SOURCEFILE
The gender of an object is a value that represents its type on the remote system. Each concrete subclass returns its gender. Can be used to determine type at runtime.

The resource is an RBSourceFile. Value is 2.

See Also:
Constant Field Values

G_SAVEFILE

public static final int G_SAVEFILE
The gender of an object is a value that represents its type on the remote system. Each concrete subclass returns its gender. Can be used to determine type at runtime.

The resource is an RBSaveFile. Value is 4.

See Also:
Constant Field Values

G_MEMBER

public static final int G_MEMBER
The gender of an object is a value that represents its type on the remote system. Each concrete subclass returns its gender. Can be used to determine type at runtime.

The resource is an RBMember. Value is 6.

See Also:
Constant Field Values

G_LIBRARY

public static final int G_LIBRARY
The gender of an object is a value that represents its type on the remote system. Each concrete subclass returns its gender. Can be used to determine type at runtime.

The resource is an RBLibrary. Value is 7.

See Also:
Constant Field Values

G_BINARYOBJECT

public static final int G_BINARYOBJECT
The gender of an object is a value that represents its type on the remote system. Each concrete subclass returns its gender. Can be used to determine type at runtime.

The resource is an RBBinaryObject. Value is 8.

See Also:
Constant Field Values
Constructor Detail

RBResource

protected RBResource(AbstractISeriesResource resource)
Constructs an RBResource from a model resource. This method is a framework method meant to be invoked by subclasses.

Not for use by clients.


RBResource

protected RBResource(String name,
                     long localStamp,
                     long targetStamp)
Constructs an RBResource from its snapshot information.

Used during snapshot reading.

Not for use by clients.

Method Detail

makeFrom

public static RBResource makeFrom(AbstractISeriesResource modelResource,
                                  RBResourceContext context)
Returns a resource made from a model resource with respect to the context. This is the preferred method for making RBResources during the course of an operation as it ensures that duplicate resources are not created.

Parameters:
modelResource - the model resource from which to create a new resource
context - the context in which to check for existence of the resource prior to creation.
Returns:
the RBResource associated with a model resource.

makeFrom

public static RBResource makeFrom(AbstractISeriesResource modelResource)
Returns a resource made from a model resource. This is the preferred method for making RB* resources from their corresponding counterpart in the model. If this is run successively on a particular model resource it will return two equivalent, but distinct, RBResource instances.


makeFrom

public static RBResource makeFrom(int gender,
                                  String snapshotName,
                                  long localStamp,
                                  long targetStamp)
Makes a new resource from its basic information.

Used to make snapshot resources from their snapshot information.


getNameSpace

public abstract int getNameSpace()
Returns the name space for this resource -- see constants.


getGender

public abstract int getGender()
Returns the type of this resource -- see constants.


getSnapshotType

public abstract String getSnapshotType()
Returns the snapshot type for this class. There is a 1-1 correspondence between gender and snapshot type.


getIFSName

public abstract String getIFSName()
Returns the IFS name of the object from the path. Returns the empty string if the path is not in an IFS name space or if the name is not well-formed.


getQSYSName

public abstract String getQSYSName()
Returns the QSYS name space name of the object. If the object has no name in the QSYS name space the empty string is returned.


getSystemName

public String getSystemName()
Returns the system name of the current target system for this resource. Returns the empty string if none if found.


getProjectRelativePath

public abstract IPath getProjectRelativePath()
Returns the project relative path of this resource. May return the empty path if there is no project relative path for this resource.


getModifiedProperties

public abstract Collection<String> getModifiedProperties(com.ibm.etools.iseries.projects.internal.snapshots.SnapshotRecord sr)

setMark

public final void setMark(int n)
Sets a mark on the resource. This may be used to mark resources in the resource tree for the duration of an action. The bits that are marked are up to the marker.


clearMarks

public final void clearMarks()
Clears all marks on the resource.


clearMark

public final void clearMark(int n)
Clears a mark on the resource. Marks are numbered 0 to 31 inclusive.

Parameters:
n -

isMarked

public final boolean isMarked()
Return true if the resource is marked by any mark.


hasMark

public final boolean hasMark(int n)
Return true if the resource has a particular mark.


getAdapter

public final Object getAdapter(Class targetType)
Returns the adapter for this resource for the given class.


getBaseResource

public final IResource getBaseResource()
Returns the base resource associated with this resource. May return null. Will return null for snapshot resources.


getModelResource

public final AbstractISeriesResource getModelResource()
Returns the model resource associated with this resource. May return null. Will return null for snapshot resources.


getLocalStamp

public final long getLocalStamp()
Returns the local stamp of this resource. The local stamp is changed each time the resource is changed in the workspace.


setLocalStamp

public final void setLocalStamp(long stamp)
Sets the local stamp of this resource. This operation is ignored for real resources. Only the local stamps of snapshot resources can be set.


getTargetStamp

public final long getTargetStamp()
Returns the target stamp of this resource. This stamp is recorded each time the resource is pushed to the remote system.


setTargetStamp

public final void setTargetStamp(long stamp)
Sets the target stamp of this resource. This stamp should be recorded each time the resource contents are pushed to the remote system.


getName

public String getName()
Returns the name of this resource


getSourceType

public String getSourceType()
Returns:
the source type for this resource. This is null unless the resource supports source types. Should be overridden by subclasses that support source types.

getDescription

public String getDescription()
Returns:
the text description for this resource. This is null unless the resource supports descriptions. Should be overridden by subclasses that support descriptions.

getDBCS

public String getDBCS()
Returns:
the DBCS property for this resource. This is null unless the resource supports a DBCS property. Should be overridden by subclasses that support a DBCS property.

getRecordLength

public String getRecordLength()
Returns:
the record length for this resource. This is null unless the resource supports record lengths. Should be overridden by subclasses that support record lengths.

getCCSID

public String getCCSID()
Returns:
the CCSID for this resource. This is null unless the resource supports CCSIDs. Should be overridden by subclasses that support CCSIDs.

setName

protected final void setName(String name)
Sets the short name of this resource. Used by subclasses.


setContext

public void setContext(RBResourceContext context)
Sets the resolution context for this resource. This context is used by this resource to find relatives of this resource. If this resource has no resolution context then relatives (parent, children) that are returned will not preserve object identity of the relatives.


getContext

public RBResourceContext getContext()
Returns:
the RBResourceContext used for resolution of relatives. This will be null if no context has been established for this resource.

hasContext

public boolean hasContext()
Returns:
true if the resources has a resolution context.

getShortKey

public String getShortKey()
Returns a value that may be used as a key for this resource in the context of its parent. This is simply the name of the resource but this can be overridden by subclasses.


getLongKey

public final String getLongKey()
Returns a string unique to this resource that can be used to create the "canonical" ordering of local resources in the workspace. This will be null if the resource is not local.


getKeyPath

public final List<String> getKeyPath()
Returns:
the list of short keys from the root resource of this resource to this resource. This will usually be a "workspace" relative path consisting of short key names. To make a project relative path, drop the first item. The elements of this path consist of short key names, not resource names so this path cannot be used to locate local resources within the eclipse workspace, but can be used to locate resources within a RBResource or RBDeltaResource tree. This will be null if the resource is not local.

checkName

public RBStatus checkName()
Checks the name of this path for validity. Should be overridden by subclasses.


hashCode

public final int hashCode()
Returns the hashCode for this resource.

Overrides:
hashCode in class Object

isProject

public final boolean isProject()
Returns true if this is a project resource.


isHome

public final boolean isHome()
Returns true if this is a home resource.


isLocal

public final boolean isLocal()
Returns true if the resource exists in the local workspace. A local resource will have both model resource and a base resource.


isSnapshot

public final boolean isSnapshot()
Returns true if the resource is a snapshot resource. Snapshot resources have no model resource. If a resource does not have a model, it cannot have a base resource.


isRemote

public final boolean isRemote()
Returns true if the resource is a remote resource. Remote resources have models, but no base resource.


wasDeleted

public final boolean wasDeleted()
Returns true if the resource has been deleted with respect to its companion resource.


wasCreated

public final boolean wasCreated()
Returns true if the resource has been created with respect to its companion resource.


wasModified

public final boolean wasModified()
Returns true if the resource has been modified with respect to its companion resource.


getModelChildren

public final List getModelChildren()
Returns:
a List of model children for this resource. Returns an empty list if there are no children. Returns null if this is a snapshot resource.

getModelParent

public final AbstractISeriesResource getModelParent()
Returns:
the parent of this resources model resource.

getModelProject

public final AbstractISeriesProject getModelProject()
Returns the model project for this resource.


addChild

public final void addChild(RBResource child)
Adds a child to this resource and sets the child's parent to this resource. It does so without checking the child's current ancestry. Only a snapshot resource can have children added to it.


removeChild

public final void removeChild(String key)
Removes a child from a parent. Only a snapshot resource can have a child removed from it.


getNumberOfChildren

public final int getNumberOfChildren()
Returns the number of children this resource has.


hasChildren

public final boolean hasChildren()
Returns true if this resource has children.


hasContents

public final boolean hasContents()
Returns:
true if this resource is capable of having contents

getChildren

public final RBResource[] getChildren()
Returns an array of children of this resource. If the resource has no children an empty array is returned. The array may be destroyed or manipulated as necessary. The arrays are guaranteed to have the children in ascending order by name using the default collating sequence for this locale.


getChild

public final RBResource getChild(String key)
Returns a child with the given short key. If no child exists then null is returned.


getParent

public final RBResource getParent()
Returns the parent of this resource. Will return null if the parent has not been set or the model resource from which the parent can be computed does not exist.


setCompanion

public final void setCompanion(RBResource companion)
Sets the companion resource.


getCompanion

public final RBResource getCompanion()
Retrieves the companion resource.


attach

public final boolean attach(RBResource companion)
Attaches another resource to this one. Each each child resource in this resources's tree will have its companion resource set to the matching resource in the argument. Does nothing if the companion resource does not match this resource.

This does not perform the complementary attachment of this resource to the companion.

Returns true if the resource was attached, false otherwise.


getAncestors

public final List getAncestors()
Gets the local ancestors of a single resource up to its project resource. If a resource is not local it returns the empty set. The set does not includes the resource itself. Note that if a resource is local all of its ancestors must be local. Project resources return the empty set.


getDescendents

public final List getDescendents()
Returns a List of all local resources in the tree rooted at a particular resource. If a resource is not local its children are not examined since a non-local resource may not have local children. The list does not contain the resource itself.


getHome

public final RBResource getHome()
Returns the home resource for this resource. Will be non-null for any resource that is a descendant of a home resource. RBProject resources return null if they have multiple home locations as children. If there is a single home location it will return that. Home resources return themselves.


getHome

public final RBResource getHome(int nameSpace)
Returns the home resource for the given name space. Note that this is derived from the project resource. If the project resource has multiple home resources for a name space it will return the first one found.


getProject

public final RBProject getProject()
Returns the project resource for a resource. Returns null if the tree is not rooted at a project resource.


getSystem

public RBSystem getSystem()
Returns the target system for this resource. Returns null if the resources does not yet have a target system.


findResource

public final RBResource findResource(LinkedList resourcePath)
Returns the resource found by following the path from this resource. Returns null if the path cannot be followed.


getResourcePath

public final LinkedList getResourcePath()
Returns the path to this resource from its root resource. The path is relative to the root resource and does not include the root resource as an element. It always includes the key to this resource as the last element.


updateFrom

public final void updateFrom(RBResource r)
Updates a resources stamps from the argument.


synchronize

public final void synchronize()
Synchronizes the properties of this resource. Causes the children of this resource to be refreshed.


getLocation

protected String getLocation()
Returns the absolute path name string to the local resource. Return null if this cannot be determined.


copy

public RBResource copy()
Returns a copy of this resource with no children. Subclasses can override but should call super.


isEquivalentTo

public final boolean isEquivalentTo(Object o)
Returns true if and only if the resources identify the same iSeries object. That is, their "short keys" are the same and their parents are equivalent. A snapshot resource can be equivalent to a normal resource.


existsOn

public abstract boolean existsOn(RBSystem system)
Checks to see if the resource's counterpart exists on the target system. Returns true if the resource exists. Returns false if the resource does not exist or if the result cannot be determined.


createOn

public abstract RBStatus createOn(RBSystem system)
Creates the corresponding resource on the system. If the resource already exists, then the operation fails with the CODE_OBJECT_EXISTS status. If the resource has no correspondent on the target system then the operation does nothing and returns an OK status. The resource may elect to return OK for this and create the resource on write.


checkAuthorities

public RBStatus checkAuthorities(String[] authorities)
Checks the authorities of a remote resource that is the companion of the current resource. Will return a CODE_CHECK_AUTHORITY status if the object exists but the user does not have the requested authorities. Will return an CODE_OBJECT_MISSING status if the object does not exist.


checkExistence

public RBStatus checkExistence()
Checks the existence of a remote resource that is the companion of this resource. Will return a CODE_OBJECT_MISSING status if the object does not exist or if the user has no authority to discover it.


checkPropertiesOn

public RBStatus checkPropertiesOn(RBSystem system)
Checks the properties of the local resource against those of the remote resource. If there is a conflict, report it. The resource is in charge of selecting those properties that will be examined.

The default implementation returns an OK status.


checkContentsOn

public RBStatus checkContentsOn(RBSystem system)
Checks the contents of the local resource against those of the target system resource. Reports a conflict if one exists.

The default implementation returns an OK status.


pushPropertiesTo

public final RBStatus pushPropertiesTo(RBSystem system)
Pushes the properties to a target system.


pushContentsTo

public RBStatus pushContentsTo(RBSystem system)
Pushes the contents of a resource to a target system. If the resource has no contents, nothing is pushed and and OK status is returned. The push of this resource is unconditional. Conflicts should be tested for using checkContentsOn(). This method can be overridden by subclasses.


pushPropertiesTo

public RBStatus pushPropertiesTo(RBSystem system,
                                 Collection properties)
Pushes the properties named in the set to the target system resource. The properties are pushed individually, so that some may take effect even if others are invalid. If any are invalid the CODE_PROPERTY_ERROR status is returned with the list of property names that caused the error in the status data. This method can be overridden by subclasses.


pushSourceTypeTo

public RBStatus pushSourceTypeTo(RBSystem system)
Pushes the source type of this resource to the target system. If the resource has no source type this does nothing. This method can be overridden by subclasses.


getRemoteName

public final String getRemoteName()
Returns the displayable name for this resource on the remote system. Used for display purposes only.


getSessionProperty

public final Object getSessionProperty(String name)
Returns a "remote build" session property for a resource. Returns null if the property is not found.


setSessionProperty

public final void setSessionProperty(String name,
                                     Object property)
Sets a session property for a resource.


getPersistentProperty

public final String getPersistentProperty(String name)
Returns a persistent property for a resource. Returns null if the property is not found.


setPersistentProperty

public final void setPersistentProperty(String name,
                                        String property)
Sets a persistent property for a resource.


setModelProperty

public final void setModelProperty(String name,
                                   String value)
Sets a model property for this resource.

Model property persistence is set in the plugin's XML. Model property names are dotted names, the last segment of which forms the simple name and the first series of segments form the qualifier.


setSourceType

public void setSourceType(String type)
Sets the source type for this resource. This implementation does nothing, but may be overridden by subclasses what support source types.

Parameters:
type - the source type of the resource.

getModelProperty

public final String getModelProperty(String name)
Returns a property of this resource maintained by the model. Returns the empty string if the property cannot be found. Will return null if the property has not been set or is not registered.


saveModelProperties

public final void saveModelProperties()
Saves the model properties.


setProjectProperty

public final void setProjectProperty(String name,
                                     String value)
Sets a model property on the project for this resource.


getProjectProperty

public final String getProjectProperty(String name)
Returns a model property on the project for this resource. Will return null if that property has never been initialized or if that property has not been registered. Snapshot resources always return null properties.


getPropertiesModel

public final IISeriesPropertiesModel getPropertiesModel()
Gets the properties model for this resource. Returns null if there is no model resource or there is no properties model for this resource. Only certain model resources have properties models.


getAllProperties

public abstract List getAllProperties()
Returns a set of all the property names this resource. If there are no properties this list will be empty.


checkProperty

protected void checkProperty(Collection<String> modified,
                             com.ibm.etools.iseries.projects.internal.snapshots.SnapshotRecord sr,
                             String attributeName,
                             String propertyName)
Adds a property name to the list of modified properties if it is modified from its snapshot value.

Parameters:
modified - the set of modified property names to add to
sr - the snapshot record that provides a basis for change
attributeName - the name of the attribute in the snapshot record
propertyName - the name of the property in the properties model

accept

public final void accept(RBResourceVisitor visitor)
Accepts a resource visitor. If the visitor returns true then the visitor will also visit the children of this resource.


qualify

public QualifiedName qualify(String name)
Qualifies a name with the remote build qualifier for use as a property name.


toString

public String toString()
Overrides:
toString in class Object

Rational Developer for Power Systems Software
V7.6

Copyright © 2011 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.