com.starteam.viewcomparemerge
Class MergePreview

java.lang.Object
  extended by com.starteam.CacheRef
      extended by com.starteam.TypedResource
          extended by com.starteam.LiveObject
              extended by com.starteam.View
                  extended by com.starteam.viewcomparemerge.MergePreview
All Implemented Interfaces:
ISecurable, ISecurableContainer, java.lang.Cloneable

public final class MergePreview
extends View

Description: A MergePreview is a read-only reference View with additional properties, and some local, context specific overrides


Nested Class Summary
 
Nested classes/interfaces inherited from class com.starteam.View
View.Type, View.ViewType, View.WebCacheView
 
Nested classes/interfaces inherited from class com.starteam.LiveObject
LiveObject.WebCacheLiveObject
 
Nested classes/interfaces inherited from class com.starteam.TypedResource
TypedResource.BranchState
 
Method Summary
 Label cloneRevisionLabel(Label source, java.lang.String name, java.lang.String description, boolean frozen)
          Clones the specified "Revision" label.
 Label cloneViewLabel(Label source, java.lang.String name, java.lang.String description, boolean buildLabel, boolean frozen)
          Clones the specified "View" label.
 void close()
          Frees all cached resources associated with this view, and closes the associated view session.
 View copy()
          Creates a copy of this View object, with view properties fully populated.
 CheckinManager createCheckinManager()
          Constructs a CheckinManager with default options for this view.
 CheckinManager createCheckinManager(CheckinOptions options)
          Constructs a CheckinManager using a specific set of options.
 CheckoutManager createCheckoutManager()
          Constructs a CheckoutManager with default options for this view.
 CheckoutManager createCheckoutManager(CheckoutOptions options)
          Constructs a CheckoutManager using a specific set of options.
 Label createRevisionLabel(java.lang.String name, java.lang.String description, boolean frozen)
          Create a new "Revision" label with the specified properties.
 Label createViewLabel(java.lang.String name, java.lang.String description, DateTime time, boolean buildLabel, boolean frozen)
          Create a new "View" label with the specified properties.
 void discard()
          Discards all of the cached properties for this view.
 void discardActiveLabels()
          Discard any cached active (non-deleted) labels.
 void discardFolders()
          This implementation of refreshFolders does not affect the VCMFolder tree directly.
 Label[] fetchAllLabels()
          Returns all the active (non-deleted) labels for this view.
 Label[] fetchAllLabels(View view)
          Returns all the active (non-deleted) labels for the given project and view.
 Label[] getActiveLabels()
          Returns all the active (non-deleted) labels for this view.
 ViewConfiguration getBaseConfiguration()
          Returns the ViewConfiguration from which this View was derived.
 ViewConfiguration getConfiguration()
          Returns this view's configuration.
 Item getDisembodiedItem(Item.Type type, int itemID)
          Retrieves an Item by Item ID.
 ViewMember getDisembodiedViewMember(ViewMember.Type type, int itemID)
          Retrieves a ViewMember by VMID.
 FileBasedStatusManager getFileStatusManager()
          Get the FileBasedStatusManager that manages file status information for this View.
 java.lang.String getFullName()
          Returns the full hierarchical name of this view--that is, the concatentation of the root view and each descendent to this view.
 boolean getHaveAccessRights()
          Always returns true.
 Label[] getLabels()
          Returns the labels that exist in this view, including both active and deleted labels.
 View getParentView()
          Always returns null.
 Project getProject()
          Returns the project to which this view belongs.
 PromotionModel getPromotionModel()
          Returns the promotion model associated with this view.
 ACE[] getRights()
          Always returns an empty ACE array.
 ACE[] getRights(Type type)
          Always returns null
 Folder getRootFolder()
          Gets the root folder of this view.
 Session getSession()
          return the Session that this view belongs to
 StatusMethod getStatusMethodOverride()
          Returns the status method used to determine status for files in this view.
 java.lang.Object getValue(Property property)
          Return the value for the specified property.
 boolean hasNewNotificationItems(Item.Type type)
          Return true if any new notification items are available in this view for the specified item type.
 boolean hasPermission(PermissionCollection permissions)
          Always returns false
 boolean hasPermission(PermissionCollection permissions, Type type)
          Always returns false
 boolean isBranch()
          Always returns false.
 boolean isBranchAll()
          Always returns false.
 boolean isBranchNone()
          Always returns true.
 boolean isBranchOnShare()
          Always returns false
 boolean isDeleted()
          Always returns false.
 boolean isEqualTo(View view)
          Compares the properties of two Views.
 boolean isNonDerived()
          Always returns false.
 boolean isReadOnly()
          Returns true if the session is read only, false otherwise.
 boolean isReference()
          Always returns true
 boolean isRefreshActiveLabelsRequired()
          Always returns false.
 boolean isRefreshFoldersRequired()
          Always returns true.
 boolean isRefreshLabelsRequired()
          Always returns false.
 boolean isRefreshRequired()
          Always returns false.
 boolean isRoot()
          Always returns true
 void populate()
          Populates target view properties, if they have not already been populated.
 void refreshActiveLabels()
          Refreshes cached Label information for active (non-deleted) labels to reflect recent changes to the repository.
 void refreshFolders()
          This implementation of refreshFolders does not affect the VCMFolder tree directly.
 void remove()
          This implementation does nothing
 void setStatusMethodOverride(StatusMethod method)
          Throws an UnsupportedOperation exception.
 void update()
          Persists this view's properties to its Server.
 
Methods inherited from class com.starteam.View
addFolderListener, addFolderUpdateListener, addItemListener, addItemListener, addItemUpdateListener, addLabelListener, addViewListener, addViewMemberListener, addViewMemberListener, addViewMemberUpdateListener, createChildViewShareAllItems, createChildViewShareDefaultItems, createChildViewShareNoItems, createChildViewShareTheseItems, discardLabels, equals, findDerivedView, findFolder, findItem, findLabel, findLabel, findViewMember, getAlternatePath, getChangePackages, getCreatedTime, getDefaultPath, getDerivedViews, getDescription, getEndDate, getID, getName, getNewNotificationItems, getParentContainer, getPath, getProperties, getRecycleBin, getServer, getStartDate, getTraces, getViewID, getViewMembers, getViewType, getWorkflow, hashCode, hasPermissions, hasPermissions, isAccessible, refresh, refreshLabels, refreshPromotionModel, removeFolderListener, removeFolderUpdateListener, removeItemListener, removeItemUpdateListener, removeLabelListener, removeViewListener, removeViewMemberListener, removeViewMemberUpdateListener, resolveLinkEndpoint, setAlternatePath, setBranchOnShare, setDefaultPath, setDescription, setEndDate, setName, setRights, setRights, setStartDate, setValue, setViewType, toString
 
Methods inherited from class com.starteam.LiveObject
getCreatedBy
 
Methods inherited from class com.starteam.TypedResource
addToIntegerArray, getBooleanValue, getByteArrayValue, getCachedProperties, getContentValue, getDateTimeValue, getDateValue, getDisplayName, getDoubleValue, getEnumDisplayName, getEnumeratedValues, getIntegerArrayValue, getIntegerValue, getLinkValue, getLongValue, getObjectID, getPossibleValues, getStringValue, getTimeSpanValue, getType, hasCachedProperties, isCachedProperty, isDirty, isNew, removeFromIntegerArray, setBooleanValue, setByteArrayValue, setContentValue, setDateTimeValue, setDateValue, setDoubleValue, setEnumeratedValue, setEnumeratedValues, setIntegerArrayValue, setIntegerValue, setLinkValue, setLongValue, setStringValue, setTimeSpanValue
 
Methods inherited from class com.starteam.CacheRef
clone
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.starteam.ISecurable
getType
 

Method Detail

isReadOnly

public boolean isReadOnly()
Returns true if the session is read only, false otherwise. this View is simulated by the SDK, and only certain update operations are supported. In general, update operations that are supported will save changes to the view compare/merge session, rather than to the StarTeam repository. Update operations that are not supported will throw an UnsupportedOperationException

Overrides:
isReadOnly in class View
Returns:
true if the session is read only, false otherwise.
See Also:
Session.isReadOnly()

isReference

public boolean isReference()
Always returns true

Overrides:
isReference in class View
Returns:
true.

isRoot

public boolean isRoot()
Always returns true

Overrides:
isRoot in class View
Returns:
false.

isBranch

public boolean isBranch()
Always returns false.

Overrides:
isBranch in class View
Returns:
false.

isNonDerived

public boolean isNonDerived()
Always returns false.

Overrides:
isNonDerived in class View
Returns:
false.

isBranchAll

public boolean isBranchAll()
Always returns false.

Overrides:
isBranchAll in class View
Returns:
false.

isBranchNone

public boolean isBranchNone()
Always returns true.

Overrides:
isBranchNone in class View
Returns:
true.

isBranchOnShare

public boolean isBranchOnShare()
Always returns false

Overrides:
isBranchOnShare in class View
Returns:
false.

getHaveAccessRights

public boolean getHaveAccessRights()
Always returns true.

Returns:
true.

createCheckinManager

public CheckinManager createCheckinManager()
Constructs a CheckinManager with default options for this view.

Overrides:
createCheckinManager in class View
Returns:
CheckinManager created

createCheckinManager

public CheckinManager createCheckinManager(CheckinOptions options)
Constructs a CheckinManager using a specific set of options.

Note that individual options can be overridden on a file-by-file basis by registering a CheckinListener, and changing options as necessary in the onStartFile event handler.

Overrides:
createCheckinManager in class View
Parameters:
options - The specific CheckinOtions to be used.
Returns:
CheckinManager created
See Also:
CheckinOptions, CheckinListener.startFile(com.starteam.events.CheckinEvent)

createCheckoutManager

public CheckoutManager createCheckoutManager()
Constructs a CheckoutManager with default options for this view.

Overrides:
createCheckoutManager in class View
Returns:
CheckoutManager created

createCheckoutManager

public CheckoutManager createCheckoutManager(CheckoutOptions options)
Constructs a CheckoutManager using a specific set of options.

Note that individual options can be overridden on a file-by-file basis by registering a CheckoutListener, and changing options as necessary in the onStartFile event handler.

Overrides:
createCheckoutManager in class View
Parameters:
options - The specific CheckoutOtions to be used.
Returns:
CheckoutManager created
See Also:
CheckoutOptions, CheckoutListener.startFile(com.starteam.events.CheckoutEvent)

getRootFolder

public Folder getRootFolder()
Gets the root folder of this view. The Folder hierarchy is cached in the View object, until explicitly refreshed or discarded.

Overrides:
getRootFolder in class View
Returns:
The root folder of this view.
See Also:
MergePreview.refreshFolders(), MergePreview.discardFolders()

getPromotionModel

public PromotionModel getPromotionModel()
Returns the promotion model associated with this view.

Overrides:
getPromotionModel in class View
Returns:
the promotion model associated with this view.

getConfiguration

public ViewConfiguration getConfiguration()
Returns this view's configuration.

Overrides:
getConfiguration in class View
Returns:
this view's configuration.

getValue

public java.lang.Object getValue(Property property)
                          throws NoSuchPropertyException
Return the value for the specified property.

Overrides:
getValue in class View
Parameters:
property - the property to be retrieved
Returns:
the value of the specified property
Throws:
NoSuchPropertyException - if the named property does not exist

populate

public void populate()
Populates target view properties, if they have not already been populated.

Overrides:
populate in class View
See Also:
MergePreview.refresh(com.starteam.ViewMember, com.starteam.Property[])

isRefreshRequired

public boolean isRefreshRequired()
Always returns false.

Overrides:
isRefreshRequired in class View
Returns:
false
See Also:
MergePreview.refresh(com.starteam.ViewMember, com.starteam.Property[]), Server.enableMPX()

isRefreshFoldersRequired

public boolean isRefreshFoldersRequired()
Always returns true.

Overrides:
isRefreshFoldersRequired in class View
Returns:
true.
See Also:
MergePreview.refreshFolders()

isRefreshActiveLabelsRequired

public boolean isRefreshActiveLabelsRequired()
Always returns false.

Overrides:
isRefreshActiveLabelsRequired in class View
Returns:
false.
See Also:
MergePreview.refreshActiveLabels(), Server.enableMPX()

isRefreshLabelsRequired

public boolean isRefreshLabelsRequired()
Always returns false.

Overrides:
isRefreshLabelsRequired in class View
Returns:
false.
See Also:
View.refreshLabels(), Server.enableMPX()

getLabels

public Label[] getLabels()
Returns the labels that exist in this view, including both active and deleted labels. The labels are cached until explicitly refreshed.

Overrides:
getLabels in class View
Returns:
The labels (both active and deleted) that exist in this view.
See Also:
View.refreshLabels(), MergePreview.getActiveLabels()

getActiveLabels

public Label[] getActiveLabels()
Returns all the active (non-deleted) labels for this view. The labels are cached until explicitly refreshed.

Overrides:
getActiveLabels in class View
Returns:
The active (non-deleted) labels for this view.
See Also:
MergePreview.refreshActiveLabels(), MergePreview.getLabels()

fetchAllLabels

public Label[] fetchAllLabels()
Returns all the active (non-deleted) labels for this view.

The labels are not cached in the View object. Each call to fetchAllLabels() returns an up-to-date list consisting of newly allocated Label objects.

If MPX is enabled, fetchAllLabels() is optimized to avoid unnecessary server commands.

Overrides:
fetchAllLabels in class View
Returns:
The active (non-deleted) labels for this view. May be empty (but is never null).

fetchAllLabels

public Label[] fetchAllLabels(View view)
Returns all the active (non-deleted) labels for the given project and view. This method is only available for 4.1 and later servers.

The labels are not cached. Each call to fetchAllLabels() returns an up-to-date list consisting of newly allocated Label objects.

fetchAllLabelsFromView() is not MPX-enabled; the labels are always retrieved directly from the repository.

Overrides:
fetchAllLabels in class View
Parameters:
view - the view whose labels are to be fetched
Returns:
The active (non-deleted) labels for the given project and view. May be empty (but is never null).

refreshActiveLabels

public void refreshActiveLabels()
Refreshes cached Label information for active (non-deleted) labels to reflect recent changes to the repository. Modifies existing Label objects in place whenever possible. If MPX is enabled, refreshActiveLabels() is optimized to avoid unnecessary server commands.

Overrides:
refreshActiveLabels in class View
See Also:
MergePreview.isRefreshActiveLabelsRequired(), MergePreview.getActiveLabels(), MergePreview.discardActiveLabels(), View.refreshLabels(), Server.enableMPX()

discardActiveLabels

public void discardActiveLabels()
Discard any cached active (non-deleted) labels. Subsequent calls to getActiveLabels() will fetch the label information from the StarTeam Server (even when MPX is enabled).

Overrides:
discardActiveLabels in class View
See Also:
MergePreview.getActiveLabels(), MergePreview.refreshActiveLabels(), Server.enableMPX()

createViewLabel

public Label createViewLabel(java.lang.String name,
                             java.lang.String description,
                             DateTime time,
                             boolean buildLabel,
                             boolean frozen)
Create a new "View" label with the specified properties. This method creates the label on the server so a call to update() is not needed. Use a DateTime created with the special value 0.0 to create the label as of the current server time.

Overrides:
createViewLabel in class View
Parameters:
name - the label name (may not be null)
description - the label description (may not be null)
time - the view configuration time (may not be null)
buildLabel - true if the label is to be a "Build Label"
frozen - true if the label is "frozen" (a frozen label can not be moved from one revision to another)
Returns:
created view label

createRevisionLabel

public Label createRevisionLabel(java.lang.String name,
                                 java.lang.String description,
                                 boolean frozen)
Create a new "Revision" label with the specified properties. This method creates the label on the server so a call to update() is not needed.

Overrides:
createRevisionLabel in class View
Parameters:
name - the label name (may not be null)
description - the label description (may not be null)
frozen - true if the label is "frozen" (a frozen label can not be moved from one revision to another)
Returns:
created revision label

cloneViewLabel

public Label cloneViewLabel(Label source,
                            java.lang.String name,
                            java.lang.String description,
                            boolean buildLabel,
                            boolean frozen)
Clones the specified "View" label. This method creates the label on the server so a call to update() is not needed.

Overrides:
cloneViewLabel in class View
Parameters:
source - the label to be cloned (it must be from the active view)
name - the label name (may not be null)
description - the label description (may not be null)
buildLabel - true if the label is to be a "Build Label"
frozen - true if the label is "frozen" (a frozen label can not be moved from one revision to another)
Returns:
clone of this view label

cloneRevisionLabel

public Label cloneRevisionLabel(Label source,
                                java.lang.String name,
                                java.lang.String description,
                                boolean frozen)
Clones the specified "Revision" label. This method creates the label on the server so a call to update() is not needed.

Overrides:
cloneRevisionLabel in class View
Parameters:
source - the label to be cloned (it must be from the active view)
name - the label name (may not be null)
description - the label description (may not be null)
frozen - true if the label is "frozen" (a frozen label can not be moved from one revision to another)
Returns:
clone of this revision label

copy

public View copy()
Creates a copy of this View object, with view properties fully populated. Useful to applications that want to save a snapshot of the View in a given state, for example, before calling refresh().

Overrides:
copy in class View
Returns:
A new copy of this View object.
See Also:
MergePreview.isEqualTo(com.starteam.View)

isEqualTo

public boolean isEqualTo(View view)
Compares the properties of two Views.

Overrides:
isEqualTo in class View
Parameters:
view - The view to be compared to this one.
Returns:
true if no differences were found.
See Also:
MergePreview.copy()

getStatusMethodOverride

public StatusMethod getStatusMethodOverride()
Returns the status method used to determine status for files in this view. This method will not return null.

Overrides:
getStatusMethodOverride in class View

setStatusMethodOverride

public void setStatusMethodOverride(StatusMethod method)
Throws an UnsupportedOperation exception. The Status Method of a MergePreview cannot be changed

Overrides:
setStatusMethodOverride in class View
Parameters:
method - the new status method to use, may not be null.
Throws:
java.lang.UnsupportedOperationException

getFileStatusManager

public FileBasedStatusManager getFileStatusManager()
Get the FileBasedStatusManager that manages file status information for this View. The corresponding StarTeam Server must support client-managed status.

Overrides:
getFileStatusManager in class View
Returns:
The FileBasedStatusManager for this View.
See Also:
StatusMethod.getStatusManager(View)

getBaseConfiguration

public ViewConfiguration getBaseConfiguration()
Returns the ViewConfiguration from which this View was derived.

Overrides:
getBaseConfiguration in class View
Returns:
the ViewConfiguration from which this View was derived.
See Also:
ViewConfiguration

getFullName

public java.lang.String getFullName()
Returns the full hierarchical name of this view--that is, the concatentation of the root view and each descendent to this view.

Overrides:
getFullName in class View
Returns:
the full hierarchical name of this view.

getProject

public Project getProject()
Returns the project to which this view belongs.

Overrides:
getProject in class View
Returns:
the project to which this view belongs.

getParentView

public View getParentView()
Always returns null.

Overrides:
getParentView in class View
Returns:
null.

hasPermission

public boolean hasPermission(PermissionCollection permissions)
Always returns false

Parameters:
permissions - the desired permissions
Returns:
false.
See Also:
Permission

hasPermission

public boolean hasPermission(PermissionCollection permissions,
                             Type type)
Always returns false

Parameters:
permissions - the desired permissions
type - the type for access to be tested on
Returns:
false.
See Also:
Permission

getRights

public ACE[] getRights()
Always returns an empty ACE array.

Specified by:
getRights in interface ISecurable
Overrides:
getRights in class View
Returns:
an empty ACE array.
See Also:
AccessRightsManager.getRights(com.starteam.ISecurable)

getRights

public ACE[] getRights(Type type)
Always returns null

Specified by:
getRights in interface ISecurableContainer
Overrides:
getRights in class View
Parameters:
type - the type being controlled by the returned ACL
Returns:
the access control list for this view.
See Also:
ACE, Type

isDeleted

public boolean isDeleted()
Always returns false.

Specified by:
isDeleted in interface ISecurable
Specified by:
isDeleted in interface ISecurableContainer
Overrides:
isDeleted in class View
Returns:
false.

update

public void update()
Persists this view's properties to its Server. This implementation does nothing unless this is a compare-only session. In that case it throws an IllegalState exception.

Overrides:
update in class View

getDisembodiedItem

public Item getDisembodiedItem(Item.Type type,
                               int itemID)
Retrieves an Item by Item ID. The Item can reside anywhere in this view, or in any other view on the same server. However, the resulting Item is "disembodied"; that is, it is not attached to its normal parent Folder.

Disembodied Items are useful for resolving LinkEndpoints, which can cross project and view boundaries. However, many normal Item operations are not supported for disembodied items.

getDisembodiedItem() is not MPX-enabled; each call to getDisembodiedItem() retrieves data directly from the server.

Overrides:
getDisembodiedItem in class View
Parameters:
type - the type of disembodied item
itemID - the id of the disembodied item
Returns:
a disembodied item
See Also:
ViewMember.isDisembodied()

getDisembodiedViewMember

public ViewMember getDisembodiedViewMember(ViewMember.Type type,
                                           int itemID)
Retrieves a ViewMember by VMID. The ViewMember can reside anywhere in this view, or in any other view on the same server. However, the resulting ViewMember is "disembodied"; that is, it is not attached to its normal context.

Disembodied ViewMembers are useful for resolving LinkEndpoints, which can cross project and view boundaries. However, many normal ViewMember operations are not supported for disembodied ViewMembers.

getDisembodiedViewMember() is not MPX-enabled; each call to getDisembodiedViewMember() retrieves data directly from the server.

Overrides:
getDisembodiedViewMember in class View
Parameters:
type - the type of the disembodied view member
itemID - the id of the disembodied view member
Returns:
a disembodied view member
See Also:
ViewMember.isDisembodied()

discard

public void discard()
Description copied from class: View
Discards all of the cached properties for this view. They will be re-fetched from the server on demand (even when MPX is enabled).

If the properties of a view are changed, and discard() is called without first calling update(), the changes will be lost.

Overrides:
discard in class View
See Also:
This implementation does nothing

refreshFolders

public void refreshFolders()
This implementation of refreshFolders does not affect the VCMFolder tree directly. It does however, delete all not-in-view folders that may have been added to the VCM Folder tree

Overrides:
refreshFolders in class View
See Also:
MergePreview.isRefreshFoldersRequired(), MergePreview.getRootFolder(), MergePreview.discardFolders()

discardFolders

public void discardFolders()
This implementation of refreshFolders does not affect the VCMFolder tree directly. It does however, delete all not-in-view folders that may have been added to the VCM Folder tree

Overrides:
discardFolders in class View
See Also:
MergePreview.getRootFolder(), MergePreview.refreshFolders()

remove

public void remove()
This implementation does nothing

Overrides:
remove in class View

hasNewNotificationItems

public boolean hasNewNotificationItems(Item.Type type)
Return true if any new notification items are available in this view for the specified item type.

Overrides:
hasNewNotificationItems in class View
Parameters:
type - the desired item type
Returns:
true if any new notification items are available in this view

close

public void close()
Frees all cached resources associated with this view, and closes the associated view session.

Many view-related resources, such as the folder tree, item lists and so on, can be discarded separately. Others, however, are freed only by an explicit call to close(), or to Server.disconnect().

After a view is closed, the view object is still useful. The view session is automatically re-opened when needed, and data is re-fetched from the server on demand.

Overrides:
close in class View
See Also:
MergePreview.discard(), MergePreview.discardFolders(), View.discardLabels(), Folder.discardItems(com.starteam.Item.Type, int), Server.disconnect()

getSession

public Session getSession()
return the Session that this view belongs to

Returns:
Session the Session that this view belongs to


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