|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.team.core.variants.ThreeWaySynchronizer
This class manages the synchronization between local resources and their corresponding resource variants. It provides the following:
Constructor Summary | |
---|---|
ThreeWaySynchronizer(QualifiedName name)
Create a three-way synchronizer that uses a persistent byte store with the given qualified name as its unique identifier. |
|
ThreeWaySynchronizer(ResourceVariantByteStore store)
Create a three-way synchronizer that uses the given byte store as its underlying byte cache. |
Method Summary | |
---|---|
void |
addListener(ISynchronizerChangeListener listener)
Adds a listener to this synchronizer. |
void |
flush(org.eclipse.team.internal.core.subscribers.BatchingLock.ThreadInfo info,
IProgressMonitor monitor)
|
void |
flush(IResource resource,
int depth)
Flush any cached bytes for the given resource to the depth specified. |
byte[] |
getBaseBytes(IResource resource)
Return the base bytes that are cached for the given resource or null if no base is cached. |
byte[] |
getRemoteBytes(IResource resource)
Return the remote bytes that are cached for the given resource or null if no remote is cached. |
boolean |
hasSyncBytes(IResource resource)
Return whether the given resource has sync bytes in the synchronizer. |
boolean |
isIgnored(IResource resource)
Returns whether the resource has been marked as ignored using setIgnored(IResource) . |
boolean |
isLocallyModified(IResource resource)
Return whether the local resource has been modified since the last time the base bytes were set. |
IResource[] |
members(IResource resource)
Return the members of the local resource that either have sync bytes or exist locally and are not ignored. |
void |
removeListener(ISynchronizerChangeListener listener)
Removes a listener previously registered with this synchronizer. |
boolean |
removeRemoteBytes(IResource resource)
Remove the remote bytes associated with the resource. |
void |
run(IResource resourceRule,
IWorkspaceRunnable runnable,
IProgressMonitor monitor)
Perform multiple sync state modifications and fire only a single change notification at the end. |
void |
setBaseBytes(IResource resource,
byte[] baseBytes)
Set the base bytes for the given resource. |
void |
setIgnored(IResource resource)
Mark the resource as being ignored. |
boolean |
setRemoteBytes(IResource resource,
byte[] remoteBytes)
Set the remote bytes for the given resource. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ThreeWaySynchronizer(QualifiedName name)
name
- the unique identifier for the persistent storepublic ThreeWaySynchronizer(ResourceVariantByteStore store)
store
- the byte store this synchronizer uses to cache its bytesMethod Detail |
public void addListener(ISynchronizerChangeListener listener)
IResource
delta mechanism if they
need to know about local modifications.
Has no effect if an identical listener is already registered.
Team resource change listeners are informed about state changes that affect the resources supervised by this subscriber.
listener
- a synchronizer change listenerpublic void removeListener(ISynchronizerChangeListener listener)
listener
- a synchronizer change listenerpublic byte[] getBaseBytes(IResource resource) throws TeamException
null
if no base is cached. The returned bytes
should uniquely identify the resource variant that is the base
for the given local resource.
resource
- the resource
null
TeamException
public void setBaseBytes(IResource resource, byte[] baseBytes) throws TeamException
resource
- the resourcebaseBytes
- the base bytes that identify the base resource variant
TeamException
public boolean isLocallyModified(IResource resource) throws TeamException
false
for ignored resources and true
for non-existant resources
that have base bytes cached.
resource
- the resource
true
if the resource has been modified since the
last time the base bytes were set.
TeamException
public byte[] getRemoteBytes(IResource resource) throws TeamException
null
if no remote is cached. The returned bytes
should uniquely identify the resource variant that is the remote
for the given local resource.
resource
- the resource
null
TeamException
public boolean setRemoteBytes(IResource resource, byte[] remoteBytes) throws TeamException
removeRemoteBytes(IResource)
should be called.
resource
- the resourceremoteBytes
- the base bytes that identify the remote resource variant
true
if the remote bytes changed as a result of the set
TeamException
public boolean removeRemoteBytes(IResource resource) throws TeamException
resource
- the resource
true
if the remote bytes changed as a result of the removal
TeamException
public boolean hasSyncBytes(IResource resource) throws TeamException
resource
- the local resource
TeamException
public boolean isIgnored(IResource resource) throws TeamException
setIgnored(IResource)
.
resource
- the resource
true
if the resource is ignored.
TeamException
public void setIgnored(IResource resource) throws TeamException
members
method,
are never dirty (see isLocallyModified
) and
do not have base or remote bytes cached for them.
resource
- the resource to be ignored
TeamException
public IResource[] members(IResource resource) throws TeamException
resource
- the local resource
TeamException
public void flush(IResource resource, int depth) throws TeamException
resource
- the resourcedepth
- the depth of the flush (one of IResource.DEPTH_ZERO
,
IResource.DEPTH_ONE
, or IResource.DEPTH_INFINITE
)
TeamException
public void run(IResource resourceRule, IWorkspaceRunnable runnable, IProgressMonitor monitor) throws TeamException
resourceRule
- the scheduling rule that encompasses all modificationsrunnable
- the runnable that performs the sync state modificationsmonitor
- a progress monitor
TeamException
public void flush(org.eclipse.team.internal.core.subscribers.BatchingLock.ThreadInfo info, IProgressMonitor monitor) throws TeamException
flush
in interface org.eclipse.team.internal.core.subscribers.BatchingLock.IFlushOperation
TeamException
|
Eclipse Platform Release 3.1 |
|||||||||||
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, 2005. All rights reserved.