com.starteam
Class Link

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

public final class Link
extends java.lang.Object

Represents an association between two view members. From StarTeam Server 11.0 onwards, application should use Traces to create associations between view members.

See Also:
Trace

Nested Class Summary
static class Link.Endpoint
          Represents a link reference to a viewMember.
 
Constructor Summary
Link(ViewMember parent, int parentRevision, ViewMember child, int childRevision)
          Creates a new link object.
Link(ViewMember parent, ViewMember child)
          Creates a new link object.
 
Method Summary
 Link copy()
          Copies this link, creating a new one with the same content.
 void delete()
          Terminates the association of the linked items.
 Link.Endpoint getChildEndpoint()
          Returns a reference to the "child" viewMember in this link.
 java.lang.String getComment()
          Returns the comment associated with this link.
 User getCreatedBy()
          Returns the User object who created this link.
 DateTime getCreatedTime()
          Returns the time at which this link was created.
 java.lang.String getDebugString()
          Returns the debug string associated this link
 ViewMember getDisembodiedChild()
          Resolves the child endpoint of this link.
 ViewMember getDisembodiedParent()
          Resolves the parent endpoint of this link.
 int getID()
          Returns an integer that identifies this link.
 Link.Endpoint getParentEndpoint()
          Returns a reference to the "parent" viewMember in this link.
 int getParentFolderItemID()
          Returns the ItemID of the linked item's parent folder if the item is in the current view, otherwise -1.
 Server getServer()
          Returns the server object to which the parent endpoint of this link belongs.
 View getView()
          Returns the view to which the parent endpoint of this link belongs.
 boolean isEqualTo(Link other)
          Determines whether or not the contents of two links are the same.
 void pinChild(ViewMember newChild)
          Pin the child endpoint of the link.
 void pinParent(ViewMember newParent)
          Pin the parent endpoint of the link.
 ViewMember resolveChild()
          Gets a fully resolved version of the child viewMember.
 ViewMember resolveParent()
          Gets a fully resolved version of the parent viewMember.
 void setComment(java.lang.String comment)
          Sets the comment associated with this link
 void unpinChild()
          Unpin the child endpoint of the link.
 void unpinParent()
          Unpin the parent endpoint of the link.
 void update()
          Persists the link.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Link

public Link(ViewMember parent,
            int parentRevision,
            ViewMember child,
            int childRevision)
Creates a new link object.

Parameters:
parent - The parent end of the link.
parentRevision - The revision number of the first revision in the parent item's history for which this link is visible. If the value is -1, defaults to the first revision in the parent item's branch.
child - The child end of the link.
childRevision - The revision number of the first revision in the child item's history for which this link is visible. If the value is -1, defaults to the first revision in the child item's branch.

Link

public Link(ViewMember parent,
            ViewMember child)
Creates a new link object.

Parameters:
parent - The parent end of the link. The link becomes visible at the first revision of this item's branch.
child - The child end of the link. The link becomes visible at the first revision of this item's branch.
Method Detail

getParentEndpoint

public Link.Endpoint getParentEndpoint()
Returns a reference to the "parent" viewMember in this link. Since links are not directional, the terms parent and child are arbitrary. Parent refers to the viewMember from which this link was enumerated.

Returns:
a reference to the "parent" viewMember in this link. Since links are not directional, the terms parent and child are arbitrary. Parent refers to the viewMember from which this link was enumerated.

getChildEndpoint

public Link.Endpoint getChildEndpoint()
Returns a reference to the "child" viewMember in this link. Since links are not directional, the terms parent and child are arbitrary. Parent refers to the viewMember from which this link was enumerated.

Returns:
a reference to the "child" viewMember in this link. Since links are not directional, the terms parent and child are arbitrary. Parent refers to the viewMember from which this link was enumerated.

getID

public int getID()
Returns an integer that identifies this link.

Returns:
an integer that identifies this link.

getParentFolderItemID

public int getParentFolderItemID()
Returns the ItemID of the linked item's parent folder if the item is in the current view, otherwise -1. Only available for server api revision 1.16 and later; earlier revisions will always return -1.

Returns:
the ItemID of the linked Item's parent Folder or -1 if unavailable.

getCreatedTime

public DateTime getCreatedTime()
Returns the time at which this link was created.

Returns:
the time at which this link was created.

getCreatedBy

public User getCreatedBy()
Returns the User object who created this link.

Returns:
the User object who who created this link.

getView

public View getView()
Returns the view to which the parent endpoint of this link belongs.

Returns:
the view to which the parent endpoint of this link belongs.

getServer

public Server getServer()
Returns the server object to which the parent endpoint of this link belongs.

Returns:
the server object to which the parent endpoint of this link belongs.

getComment

public java.lang.String getComment()
Returns the comment associated with this link.

Returns:
the comment associated with this link.

setComment

public void setComment(java.lang.String comment)
Sets the comment associated with this link

Parameters:
comment - the comment associated with this link

getDisembodiedParent

public ViewMember getDisembodiedParent()
Resolves the parent endpoint of this link. The referenced ViewMember may reside in any view on the server. However, the returned ViewMember is always a disembodied ViewMember. Many normal ViewMember operations are not supported on disembodied ViewMembers.

Returns:
A disembodied item representing the resolved parent endpoint.
See Also:
Link.getChildEndpoint(), View.getDisembodiedViewMember(com.starteam.ViewMember.Type, int), ViewMember.isDisembodied()

getDisembodiedChild

public ViewMember getDisembodiedChild()
Resolves the child endpoint of this link. The referenced ViewMember may reside in any view on the server. However, the returned ViewMember is always a disembodied ViewMember. Many normal ViewMember operations are not supported on disembodied ViewMembers.

Returns:
A disembodied item representing the resolved child endpoint.
See Also:
Link.getParentEndpoint(), View.getDisembodiedViewMember(com.starteam.ViewMember.Type, int), ViewMember.isDisembodied()

resolveParent

public ViewMember resolveParent()
Gets a fully resolved version of the parent viewMember. This is a potentially expensive API, possibly involving the execution of several server commands

Returns:
a fully resolved version of the parent viewMember.

resolveChild

public ViewMember resolveChild()
Gets a fully resolved version of the child viewMember. This is a potentially expensive API, possibly involving the execution of several server commands

Returns:
a fully resolved version of the child viewMember

isEqualTo

public boolean isEqualTo(Link other)
Determines whether or not the contents of two links are the same.

Parameters:
other - The link to be compared to this one.
Returns:
true if the links are the same; false otherwise.

pinParent

public void pinParent(ViewMember newParent)
Pin the parent endpoint of the link.

Parameters:
newParent - the ViewMember to which this endpoint should be pinned. Note that this item must lie in the history path of the original item for the endpoint, and cannot be an earlier revision than the earliest revision for the endpoint.

unpinParent

public void unpinParent()
Unpin the parent endpoint of the link.


pinChild

public void pinChild(ViewMember newChild)
Pin the child endpoint of the link.

Parameters:
newChild - the ViewMember to which this endpoint should be pinned. Note that this item must lie in the history path of the original item for the endpoint, and cannot be an earlier revision than the earliest revision for the endpoint.

unpinChild

public void unpinChild()
Unpin the child endpoint of the link.


delete

public void delete()
Terminates the association of the linked items.


copy

public Link copy()
Copies this link, creating a new one with the same content.

Returns:
A new copy of this link.

update

public void update()
Persists the link.


getDebugString

public java.lang.String getDebugString()
Returns the debug string associated this link

Returns:
the debug string associated this link


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