Eclipse Platform v3.1

org.eclipse.team.internal.ccvs.core
Class CVSSyncTreeSubscriber

java.lang.Object
  extended by org.eclipse.team.core.subscribers.Subscriber
      extended by org.eclipse.team.core.variants.ResourceVariantTreeSubscriber
          extended by org.eclipse.team.internal.ccvs.core.CVSSyncTreeSubscriber
Direct Known Subclasses:
CVSCompareSubscriber, CVSMergeSubscriber, CVSWorkspaceSubscriber

public abstract class CVSSyncTreeSubscriber
extends ResourceVariantTreeSubscriber

This class provides common funtionality for three way sychronizing for CVS.


Field Summary
static String SYNC_KEY_QUALIFIER
           
 
Method Summary
protected  boolean getCacheFileContentsHint()
           
 QualifiedName getId()
           
 String getName()
          Return the name of this subscription, in a format that is suitable for display to an end user.
 IResourceVariantComparator getResourceComparator()
          Returns the comparison criteria that will be used by the sync info created by this subscriber.
 SyncInfo getSyncInfo(IResource resource)
          Returns synchronization info for the given resource, or null if there is no synchronization info because the subscriber does not apply to this resource.
protected  SyncInfo getSyncInfo(IResource local, IResourceVariant base, IResourceVariant remote)
          Method that creates an instance of SyncInfo for the provided local, base and remote resource variants.
 boolean isSupervised(IResource resource)
          Returns true if this resource is supervised by this subscriber.
protected  boolean isThreeWay()
           
protected  boolean rootsEqual(Subscriber other)
           
 
Methods inherited from class org.eclipse.team.core.variants.ResourceVariantTreeSubscriber
getBaseTree, getRemoteTree, members, refresh
 
Methods inherited from class org.eclipse.team.core.subscribers.Subscriber
addListener, collectOutOfSync, fireTeamResourceChange, removeListener, roots
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SYNC_KEY_QUALIFIER

public static final String SYNC_KEY_QUALIFIER
See Also:
Constant Field Values
Method Detail

getId

public QualifiedName getId()

getName

public String getName()
Description copied from class: Subscriber
Return the name of this subscription, in a format that is suitable for display to an end user.

Specified by:
getName in class Subscriber
Returns:
String representing the name of this subscription.

getSyncInfo

public SyncInfo getSyncInfo(IResource resource)
                     throws TeamException
Description copied from class: Subscriber
Returns synchronization info for the given resource, or null if there is no synchronization info because the subscriber does not apply to this resource.

Note that sync info may be returned for non-existing or for resources which have no corresponding remote resource.

This method will be quick. If synchronization calculation requires content from the server it must be cached when the subscriber is refreshed. A client should call refresh before calling this method to ensure that the latest information is available for computing the sync state.

Overrides:
getSyncInfo in class ResourceVariantTreeSubscriber
Parameters:
resource - the resource of interest
Returns:
sync info
Throws:
TeamException

isSupervised

public boolean isSupervised(IResource resource)
                     throws TeamException
Description copied from class: Subscriber
Returns true if this resource is supervised by this subscriber. A supervised resource is one for which this subscriber maintains the synchronization state. Supervised resources are the only resources returned when members(IResource) was invoked with the parent of the resource. Returns false in all other cases.

Specified by:
isSupervised in class Subscriber
Returns:
true if this resource is supervised, and false otherwise
Throws:
TeamException

getResourceComparator

public IResourceVariantComparator getResourceComparator()
Description copied from class: Subscriber
Returns the comparison criteria that will be used by the sync info created by this subscriber.

Specified by:
getResourceComparator in class Subscriber
Returns:
the comparator to use when computing sync states for this subscriber.

getSyncInfo

protected SyncInfo getSyncInfo(IResource local,
                               IResourceVariant base,
                               IResourceVariant remote)
                        throws TeamException
Description copied from class: ResourceVariantTreeSubscriber
Method that creates an instance of SyncInfo for the provided local, base and remote resource variants. Can be overridden by subclasses.

Overrides:
getSyncInfo in class ResourceVariantTreeSubscriber
Parameters:
local - the local resource
base - the base resource variant or null
remote - the remote resource variant or null
Returns:
the SyncInfo containing the provided resources
Throws:
TeamException

getCacheFileContentsHint

protected boolean getCacheFileContentsHint()

isThreeWay

protected boolean isThreeWay()

rootsEqual

protected boolean rootsEqual(Subscriber other)

Eclipse Platform v3.1