MigrateObject

The class com.telelogic.cm.migrate.MigrateObject represents each object found in the source migrate path during migrate, or the work area path during work area conflict detection, or the relative path in the project for an object to be created.

The following are descriptions of the available methods.

setName

void setName(String name)
Sets the name of the object.

Parameters: name - the name of the object.

getType

String getType()
Returns the type of the object.

Returns: the name of the Rational® Synergy type for this object (not the four-part full name of the type, just its component name). This method cannot return null or an empty string.

Also see setType(String).

setType

void setType(String type)
throws MigrateException
Sets the type of the object.

Parameters: type - the type of the object.

Throws: MigrateException - if it is encountered.

Also see getType().

version

String version()
Returns the version of the object.

Returns: the version of the object.

Also see setVersion(String).

setVersion

void setVersion(String version)
Sets the version of the object.

Parameters: version - the version of the object.

Also see version().

setDirectory

void setDirectory(boolean isDirectory)
Sets whether the object is a directory or not.

Parameters: isDirectory - the Boolean value indicating whether the object is a directory or not.

setProject

void setProject(boolean isProject)
Sets whether the object is a project or not.

Parameters: isProject - the Boolean value indicating whether the object is a project or not.

getAllMembers

Collection<Member<MigrateObject>> getAllMembers()
Returns the members of a project object.

A member of a project is an object that is a child of that project, or a child of a non-project member of that project. By this definition, projects can be members of another project, but the members of a project are not necessarily members of the parent project.

Returns: an unordered collection of the members of this project, with no duplicates. The collection is empty if the project has no members, or if this object is not a project. That is, RelatedObject.isProject() would return false.

getMembers

Collection<Member<MigrateObject>> getMembers(MigrateObject directory)
Return the members (bindings) in this project for the parent directory. If the current object is not a project, the list is empty.

Parameters: directory - the parent directory whose bindings need to be determined.

Returns: a collection of the members of this project in a directory, with no duplicates, ordered by the name of the child object. The collection is empty if the project has no members, or if this source object is not a project (that is, RelatedObject.isProject() would return false) or the specified directory has no members or if the specified object is not a directory. That is, RelatedObject.isDirectory() would return false.

getSubprojects

Collection<MigrateObject> getSubprojects()
Returns the subprojects of this migrate project. A subproject is a member that is a project.

Returns: an unordered collection of project objects, with no duplicates. The collection is empty if this project has no members that are projects, or if this object is not a project. That is, RelatedObject.isProject() would return false.

getAttributes

Map<String,Attribute> getAttributes()
throws MigrateException
Get the attributes of this object.

Returns: an unmodifiable map with attribute name as the key and attribute itself as the value.

Throws: MigrateException - if it is encountered.

getAttribute

Attribute getAttribute(String name)
throws MigrateException
Gets the attribute of this object.

Parameters: name - the name of the attribute.

Returns: the attribute corresponding to the specified name.

Throws: MigrateException - if it is encountered.

getAttributeValue

Object getAttributeValue(String name)
throws MigrateException
Gets the attribute value for the specified name.

Parameters: name - the name of the attribute.

Returns: the value of the attribute.

Throws: MigrateException - if it is encountered.

setAttributes

void setAttributes(Collection<Attribute> attributes)
Sets the attributes of this object.

Parameters: attributes - the attributes of this object.

setAttribute

void setAttribute(Attribute attribute)
throws MigrateException
Sets the attribute on this object.

Parameters: attribute - the attributes on this object.

Throws: MigrateException - if it is encountered.

setAttribute

void setAttribute(String name, String value)
throws MigrateException
Sets the specified attribute of type string on this object.
Parameters:
  • name - the name of the attribute.
  • value - the value of the attribute.

Throws: MigrateException - if it is encountered.

setAttribute

void setAttribute(String name, Date value)
throws MigrateException
Sets the specified attribute of type date on this object.
Parameters:
  • name - the name of the attribute.
  • value - the value of the attribute.

Throws: MigrateException - if it is encountered.

setAttribute

void setAttribute(String name, boolean value)
throws MigrateException
Sets the specified attribute of Boolean type on this object.
Parameters:
  • name - the name of the attribute.
  • value - the value of the attribute.

Throws: MigrateException - if it is encountered.

setAttribute

void setAttribute(String name, int value)
throws MigrateException
Sets the specified attribute of integer type on this object.
Parameters:
  • name - the name of the attribute.
  • value - the value of the attribute.

Throws: MigrateException - if it is encountered.

isBinary

boolean isBinary()
throws MigrateException
Specifies whether the source of this object is treated as text or binary. Text objects can be subject to keyword replacement, newline translation, and encoding translation. Binary objects are copied bit for bit, and never altered as they are copied from client to server and to or from work areas.

An object for which this method claims false may be treated as binary by Rational Synergy if it contains certain restricted characters, or too many control characters, or the migrate rules map it to a binary type.

Returns: true if the object is to be treated as binary, or false if the object is to be treated as text. If this method returns true, but the Rational Synergy type used for this object is ascii or a subtype of ascii, then the handle_as attribute is set to binary.

Throws: MigrateException - if it is encountered.

Also see setBinary(boolean).

setBinary

void setBinary(boolean isBinary)
Sets the binary property of this object.

Parameters: isBinary - the boolean value indicating whether the object contains binary content or not.

Also see isBinary().

getTextSource

Reader getTextSource()
throws MigrateException
Gets access to the source of a text object. The migrate framework uses this method to obtain the source if isBinary() returns false.

It is the responsibility of the underlying SourceObject# operation to use the correct encoding from whatever the underlying representation is in the migrate source.

Returns: a character stream to the object source.

Throws: MigrateException - if it is encountered.

setTextSource

void setTextSource(Reader textSource)
throws MigrateException
Sets the text source of this object.

Parameters: textSource - the text source of this object.

Throws: MigrateException - if it is encountered.

binarySource

InputStream binarySource()
throws MigrateException
Gets access to the source of an object. The migrate framework uses this method to obtain the source if isBinary() returns true.

Returns: a byte stream to the object source.

Throws: MigrateException - if it is encountered.

setBinarySource

void setBinarySource(InputStream binarySource)
Sets the binary source of this object.

Parameters: binarySource - the binary source of this object.

Also see binarySource() and setTextSource(Reader).

isExecutable

boolean isExecutable()
Gets executable property on the file object.

Returns: whether the file is executable or not.

setExecutable

void setExecutable(boolean isExecutable)
Sets executable property on the file object.

Parameters: isExecutable - property that determines whether the file is executable or not.

isIgnore

boolean isIgnore()
Gets ignore property on the object.

Returns: whether the object is to be ignored or not.

setIgnore

void setIgnore(boolean ignore)
Sets ignore property on the object.

Parameters: ignore - property that determines whether the object is ignored or not.

status

String status()
Gets status property.

Returns: the status property.

setStatus

void setStatus(String status)
Sets the status property.

Parameters: status - property.

getPath

String getPath()
Gets the path of the object.

Returns: path of the object.

isManualIgnore

boolean isManualIgnore()
Gets the ignore property.

Returns: the ignore property.

setManualIgnore

void setManualIgnore(boolean ignore)
Sets the ignore property.

Parameters: ignore - whether the migrate object is to be ignored.

getTaskSpec

String getTaskSpec()
Gets the task spec associated with this migrate object.

Returns: task spec associated with this migrate object.

setTaskRelease

void setTaskRelease(String taskRelease)
Sets the task release to be associated with this migrate object.

Parameters: taskRelease - the task release to be associated with this migrate object.

getTaskRelease

String getTaskRelease()
Gets the task release associated with this migrate object.

Returns: task release associated with this migrate object.

isOptionalVersion

boolean isOptionalVersion()
Gets whether the optional version is set.

Returns: true/false - based on whether the optional version is set.

setOptionalVersion

void setOptionalVersion(boolean isOptionalVersion)
Sets whether the optional version is set.

Parameters: isOptionalVersion - the optional version whether set or not.

getTargetPathRelativeToTopProject

String getTargetPathRelativeToTopProject()
Gets target path relative to the top project.

Returns: the target path relative to top project in the Rational Synergy repository.


Feedback