com.starteam
Class LinkValue

java.lang.Object
  extended by com.starteam.LinkValue

public final class LinkValue
extends java.lang.Object

A value of a LinkProperty.


Nested Class Summary
static class LinkValue.WebCacheLinkValue
          The value of a Link Property
 
Field Summary
static LinkValue VALUE_NOT_SET
          The "not set" value.
 
Constructor Summary
LinkValue(LinkValue other)
          Create a LinkValue from another one
 
Method Summary
 boolean equals(java.lang.Object other)
          compare two LinkValue's for equality
static LinkValue forExternalLink(ViewMember vm)
          Creates a LinkValue representing an external link to the given item.
static LinkValue forURL(java.lang.String url, java.lang.String description)
          Creates a LinkValue for the given URL.
static LinkValue forViewMember(ViewMember vm, View source)
          Creates a LinkValue representing a link to the given item, relative to the given source view.
 int getClassID()
          Returns the 'raw' classID describing the Type associated with this link value Useful for applications that listen for Trace Events using the lightweight listener
 java.lang.String getDescription()
          Gets a description of the linked item.
 DotNotation getDotNotation()
          Attempts to extract version information in the form of a DotNotation from this LinkValue.
 java.lang.String getExternalID()
          Gets the ExternalID of this LinkValue, in raw form.
static LinkValue getExternalLinkTo(ViewMember vm)
          Creates a LinkValue representing an external link to the given view member.
static LinkValue getInternalLinkTo(ViewMember vm)
          return a LinkValue representing an internal link to the specified view member This linkValue has not been saved to the StarTeam server
static LinkValue getLinkTo(ViewMember vm, View source)
          Creates a LinkValue representing a link to the given view member, relative to the given source view.
 int getProjectID()
          Returns the 'raw' project ID associated with this link value Useful for applications that listen for Trace Events using the lightweight listener
 DateTime getTimeStamp()
          Gets the revision timestamp associated with this LinkValue.
 ViewMember.Type getType()
          Returns the Type of the link value for internal links
 java.lang.String getURL()
          Gets a URL that refers to the linked item.
 java.lang.String getVersion()
          Attempts to extract version information from the VersionID of this LinkValue.
 java.lang.String getVersionID()
          Gets the VersionID of this LinkValue, in raw form.
 int getViewID()
          Returns the 'raw' view ID associated with this link value Useful for applications that listen for Trace Events using the lightweight listener
 int getVMID()
          Gets the VMID of the linked item.
 int hashCode()
          return a hash key for this link value
 boolean isEqualTo(LinkValue v)
          Similar to equals().
 boolean isFloating()
          returns true if this LinkValue is floating w.r.t its Trace
 boolean isInternalLink()
          Determines whether or not this LinkValue is an internal reference to a StarTeam view member on the same server.
 boolean isInternalTo(Project project)
          Determines whether or not this is an internal link to a StarTeam item in the same project as the given one.
 boolean isInternalTo(View view)
          Determines whether or not this is an internal link to a StarTeam item in the same view as the given one.
 boolean isPinned()
          returns true if this LinkValue is pinned to its Trace
 boolean isStarTeamLink()
          Determines whether or not this LinkValue references a StarTeam view member.
 ViewMember toStarTeamItem()
          Gets a full-resolved version of the referenced item.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

VALUE_NOT_SET

public static final LinkValue VALUE_NOT_SET
The "not set" value.

Constructor Detail

LinkValue

public LinkValue(LinkValue other)
Create a LinkValue from another one

Parameters:
other - the other linkValue to use as the source
Method Detail

getLinkTo

public static LinkValue getLinkTo(ViewMember vm,
                                  View source)
Creates a LinkValue representing a link to the given view member, relative to the given source view. Creates an internal link if possible, and an external link otherwise.

Parameters:
vm - ViewMember
source - View
Returns:
LinkValue

forViewMember

public static LinkValue forViewMember(ViewMember vm,
                                      View source)
Creates a LinkValue representing a link to the given item, relative to the given source view. Creates an internal link if possible, and an external link otherwise.

Parameters:
vm - ViewMember
source - View
Returns:
LinkValue

forExternalLink

public static LinkValue forExternalLink(ViewMember vm)
Creates a LinkValue representing an external link to the given item.

Parameters:
vm - ViewMember
Returns:
LinkValue

getInternalLinkTo

public static LinkValue getInternalLinkTo(ViewMember vm)
return a LinkValue representing an internal link to the specified view member This linkValue has not been saved to the StarTeam server

Parameters:
vm - the view member
Returns:
a newly created internal link value

getExternalLinkTo

public static LinkValue getExternalLinkTo(ViewMember vm)
Creates a LinkValue representing an external link to the given view member.

Parameters:
vm - ViewMember
Returns:
LinkValue

forURL

public static LinkValue forURL(java.lang.String url,
                               java.lang.String description)
Creates a LinkValue for the given URL.

Parameters:
url - String
description - String
Returns:
LinkValue

getDescription

public java.lang.String getDescription()
Gets a description of the linked item.

Returns:
A description of the linked item.

isInternalLink

public boolean isInternalLink()
Determines whether or not this LinkValue is an internal reference to a StarTeam view member on the same server.

Returns:
boolean true if this LinkValue is an internal reference to a StarTeam view member on the same server; false otherwise.

getVMID

public int getVMID()
Gets the VMID of the linked item. Returns -1 if this LinkValue does not refer to an internal StarTeam item.

Returns:
int the VMID of the item or -1

isStarTeamLink

public boolean isStarTeamLink()
Determines whether or not this LinkValue references a StarTeam view member. If this link value reference a StarTeam link, then the type of reference has a value of 0. If it references an external (non StarTeam) link, such as Caliber or SCTM or an html page, then the type of reference has a value of -1.

Returns:
boolean true if this LinkValue references a StarTeam item, either on this server or some other one.

isInternalTo

public boolean isInternalTo(View view)
Determines whether or not this is an internal link to a StarTeam item in the same view as the given one.

Parameters:
view - the View to test
Returns:
boolean true if internal to this view
See Also:
LinkValue.isInternalLink(), LinkValue.isInternalTo(Project)

isInternalTo

public boolean isInternalTo(Project project)
Determines whether or not this is an internal link to a StarTeam item in the same project as the given one.

Parameters:
project - the Project to test
Returns:
boolean true if internal to this project
See Also:
LinkValue.isInternalLink(), LinkValue.isInternalTo(View)

getURL

public java.lang.String getURL()
Gets a URL that refers to the linked item.

Returns:
A URL that refers to the linked item.

getTimeStamp

public DateTime getTimeStamp()
Gets the revision timestamp associated with this LinkValue. The revision timestamp is only relevant for StarTeam links

Returns:
DateTime the revision timestamp
Throws:
java.lang.UnsupportedOperationException - If this LinkValue does not refer to an internal StarTeam item.

isPinned

public boolean isPinned()
returns true if this LinkValue is pinned to its Trace

Returns:
true if this LinkValue is pinned to its Trace

isFloating

public boolean isFloating()
returns true if this LinkValue is floating w.r.t its Trace

Returns:
true if this LinkValue is floating w.r.t. its Trace

getVersionID

public java.lang.String getVersionID()
Gets the VersionID of this LinkValue, in raw form. The VersionID identifies a specific version of the referenced artifact.

Returns:
String the versionID
See Also:
LinkValue.getVersion(), LinkValue.getDotNotation()

getExternalID

public java.lang.String getExternalID()
Gets the ExternalID of this LinkValue, in raw form. For StarTeam artifact, the ExternalID identifies the parameters of the referenced artifact, in a URL syntax of the form ?.... For non Starteam artifacts, the external ID represents the entire URL.

Returns:
String the versionID
See Also:
LinkValue.getVersion(), LinkValue.getDotNotation()

getVersion

public java.lang.String getVersion()
Attempts to extract version information from the VersionID of this LinkValue.

This method assumes that the VersionID is formatted as a set of attribute value pairs, as would appear in a URI; for example, "?v=10". This method generally returns the first value, although special provision if made for StarTeam LinkValues that contain a DotNotation of the form "?dot=1.0".

Returns:
String the link version
See Also:
LinkValue.getVersionID(), LinkValue.getDotNotation()

getType

public ViewMember.Type getType()
Returns the Type of the link value for internal links

Returns:
the Type of the link value for internal links

getDotNotation

public DotNotation getDotNotation()
Attempts to extract version information in the form of a DotNotation from this LinkValue. StarTeam LinkValues always specify version information in the form "?dot=1.0".

Returns:
A DotNotation, or null if the VersionID is not in the above format.
See Also:
LinkValue.getVersion(), LinkValue.getVersionID()

getClassID

public int getClassID()
Returns the 'raw' classID describing the Type associated with this link value Useful for applications that listen for Trace Events using the lightweight listener

Returns:
the 'raw' classID describing the Type associated with this link value

isEqualTo

public boolean isEqualTo(LinkValue v)
Similar to equals().

Parameters:
v - LinkValue
Returns:
boolean

equals

public boolean equals(java.lang.Object other)
compare two LinkValue's for equality

Overrides:
equals in class java.lang.Object
Parameters:
other - the other LinkValue to compare
Returns:
true if the two are equal

hashCode

public int hashCode()
return a hash key for this link value

Overrides:
hashCode in class java.lang.Object
Returns:
a hash key for this link value

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toStarTeamItem

public ViewMember toStarTeamItem()
Gets a full-resolved version of the referenced item. Throws an exception if this LinkValue does not reference a StarTeam item, or if the referenced item cannot be resolved.


getProjectID

public int getProjectID()
Returns the 'raw' project ID associated with this link value Useful for applications that listen for Trace Events using the lightweight listener

Returns:
the 'raw' project ID associated with this link value

getViewID

public int getViewID()
Returns the 'raw' view ID associated with this link value Useful for applications that listen for Trace Events using the lightweight listener

Returns:
the 'raw' view ID associated with this link value


StarTeam SDK 14.0, Build 21
Copyright © 2003-2012 Borland Software Corporation. All rights reserved.