public abstract class ThreeWaySubscriber extends ResourceVariantTreeSubscriber implements ISynchronizerChangeListener
ThreeWaySynchronizer
to store and manage the
synchronization state for the local workspace. Subclasses need to
provide a subclass of ThreeWayRemoteTree
and a method
to create resource variant handles from the bytes cached in the
ThreeWaySynchronizer
.ThreeWaySynchronizer
,
ThreeWayRemoteTree
,
CachedResourceVariant
Modifier | Constructor and Description |
---|---|
protected |
ThreeWaySubscriber(ThreeWaySynchronizer synchronizer)
Create a three-way subscriber that uses the given synchronizer
to manage the synchronization state of local resources
and their variants
|
Modifier and Type | Method and Description |
---|---|
protected abstract ThreeWayRemoteTree |
createRemoteTree()
Create the three-way remote tree which provides access to the
remote bytes in the three-way synchronizer.
|
protected IResourceVariantTree |
getBaseTree()
Return the base resource variant tree.
|
protected IResourceVariantTree |
getRemoteTree()
Return the remote resource variant tree.
|
IResourceVariantComparator |
getResourceComparator()
Returns the comparison criteria that will be used by the sync info
created by this subscriber.
|
abstract IResourceVariant |
getResourceVariant(IResource resource,
byte[] bytes)
Create the resource variant for the given local resource from the
given bytes.
|
ThreeWaySynchronizer |
getSynchronizer()
Return the three-way synchronizer of this subscriber.
|
protected void |
handleRootChanged(IResource resource,
boolean added)
Convenience method that can be used by subclasses to notify listeners
when a root is added or removed from the subscriber.
|
boolean |
isSupervised(IResource resource)
Returns
false for resources that are not children
of a subscriber root, are ignored by the subscriber's synchronizer
or are ignored by the Team.ignoreHist(IResource) . |
void |
syncStateChanged(IResource[] resources)
Notification of synchronization state changes for the given resources.
|
getSyncInfo, getSyncInfo, members, refresh
accept, accept, addListener, collectOutOfSync, fireTeamResourceChange, getDiff, getName, getState, refresh, removeListener, roots
protected ThreeWaySubscriber(ThreeWaySynchronizer synchronizer)
synchronizer
- the three-way synchronizer for this subscriberprotected final IResourceVariantTree getBaseTree()
ResourceVariantTreeSubscriber
getBaseTree
in class ResourceVariantTreeSubscriber
protected final IResourceVariantTree getRemoteTree()
ResourceVariantTreeSubscriber
getRemoteTree
in class ResourceVariantTreeSubscriber
public final IResourceVariantComparator getResourceComparator()
Subscriber
getResourceComparator
in class Subscriber
public void syncStateChanged(IResource[] resources)
ISynchronizerChangeListener
ThreeWaySynchronizer
that generated
this event to determine the new synchronization state.syncStateChanged
in interface ISynchronizerChangeListener
resources
- the resources whose synchronization state has changedpublic boolean isSupervised(IResource resource) throws TeamException
false
for resources that are not children
of a subscriber root, are ignored by the subscriber's synchronizer
or are ignored by the Team.ignoreHist(IResource)
. Returns
true
otherwise.isSupervised
in class Subscriber
resource
- the resource being testedtrue
if this resource is supervised, and false
otherwiseTeamException
Subscriber.isSupervised(IResource)
public ThreeWaySynchronizer getSynchronizer()
public abstract IResourceVariant getResourceVariant(IResource resource, byte[] bytes) throws TeamException
IResourceVariant#asBytes()
.resource
- the local resourcebytes
- the bytes that identify a variant of the resourceTeamException
protected abstract ThreeWayRemoteTree createRemoteTree()
protected void handleRootChanged(IResource resource, boolean added)
true
if the root was added and false
if it was removed.resource
- the added or removed rootadded
- true
if the root was added and false
if it was removed.
Copyright (c) 2000, 2016 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.