|
Eclipse Platform Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.team.core.subscribers.Subscriber
org.eclipse.team.core.variants.ResourceVariantTreeSubscriber
A specialization of Subscriber that uses IResourceVariantTree
objects
to manage the base (for three-way) and remote trees. Refreshing and obtaining the subscriber
members and resource variants is delegated to the resource variant trees.
Constructor Summary | |
ResourceVariantTreeSubscriber()
|
Method Summary | |
protected abstract IResourceVariantTree |
getBaseTree()
Return the base resource variant tree. |
protected abstract IResourceVariantTree |
getRemoteTree()
Return the remote resource variant tree. |
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. |
IResource[] |
members(IResource resource)
Returns all non-transient member resources of the given resource. |
void |
refresh(IResource[] resources,
int depth,
IProgressMonitor monitor)
Refreshes the resource hierarchy from the given resources and their children (to the specified depth) from the corresponding resources in the remote location. |
Methods inherited from class org.eclipse.team.core.subscribers.Subscriber |
addListener, collectOutOfSync, fireTeamResourceChange, getName, getResourceComparator, isSupervised, removeListener, roots |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ResourceVariantTreeSubscriber()
Method Detail |
public SyncInfo getSyncInfo(IResource resource) throws TeamException
Subscriber
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.
getSyncInfo
in class Subscriber
resource
- the resource of interest
TeamException
protected SyncInfo getSyncInfo(IResource local, IResourceVariant base, IResourceVariant remote) throws TeamException
local
- the local resourcebase
- the base resource variant or null
remote
- the remote resource variant or null
SyncInfo
containing the provided resources
TeamException
public IResource[] members(IResource resource) throws TeamException
Subscriber
This is a fast operation; the repository is not contacted.
members
in class Subscriber
resource
- the resource
TeamException
public void refresh(IResource[] resources, int depth, IProgressMonitor monitor) throws TeamException
Subscriber
Typical synchronization operations use the statuses computed by this method as the basis for determining what to do. It is possible for the actual sync status of the resource to have changed since the current local sync status was refreshed. Operations typically skip resources with stale sync information. The chances of stale information being used can be reduced by running this method (where feasible) before doing other operations. Note that this will of course affect performance.
The depth parameter controls whether refreshing is performed on just the
given resource (depth= DEPTH_ZERO
), the resource and its
children (depth= DEPTH_ONE
), or recursively to the
resource and all its descendents (depth= DEPTH_INFINITE
).
Use depth DEPTH_ONE
, rather than depth
DEPTH_ZERO
, to ensure that new members of a project or
folder are detected.
This method might change resources; any changes will be reported in a subsequent subscriber resource change event indicating changes to server sync status.
This method contacts the server and is therefore long-running; progress and cancellation are provided by the given progress monitor.
refresh
in class Subscriber
resources
- the resourcesdepth
- valid values are DEPTH_ZERO
,
DEPTH_ONE
, or DEPTH_INFINITE
monitor
- progress monitor, or null
if progress
reporting and cancellation are not desired
OK
if there were no problems;
otherwise a description (possibly a multi-status) consisting of
low-severity warnings or informational messages.
TeamException
- if this method fails. Reasons include:
protected abstract IResourceVariantTree getBaseTree()
protected abstract IResourceVariantTree getRemoteTree()
|
Eclipse Platform Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.