|
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.ResourceVariantByteStore
org.eclipse.team.core.variants.PersistantResourceVariantByteStore
A ResourceVariantByteStore
that caches the variant bytes using
the org.eclipse.core.resources.ISynchronizer
so that
the tree is cached across workbench invocations.
This class is not intended to be subclassed by clients.
Constructor Summary | |
---|---|
PersistantResourceVariantByteStore(QualifiedName name)
Create a persistent tree that uses the given qualified name as the key in the org.eclipse.core.resources.ISynchronizer .
|
Method Summary | |
---|---|
boolean |
deleteBytes(IResource resource)
This method should be invoked by a client to indicate that it is known that there is no remote resource associated with the local resource. |
void |
dispose()
Dispose of any cached sync bytes when this cache is no longer needed. |
boolean |
flushBytes(IResource resource,
int depth)
Remove the bytes from the tree for the resource variants corresponding to the given local resource and its descendants to the given depth. |
byte[] |
getBytes(IResource resource)
Return the bytes for the variant corresponding the given local resource. |
QualifiedName |
getSyncName()
Return the qualified name that uniquely identifies this tree. |
boolean |
isVariantKnown(IResource resource)
Return whether the resource variant state for this resource is known. |
IResource[] |
members(IResource resource)
Return the children of the given resource that have resource variants in this tree. |
void |
run(IResource root,
IWorkspaceRunnable runnable,
IProgressMonitor monitor)
Run the given action which may contain multiple modifications to the byte store. |
boolean |
setBytes(IResource resource,
byte[] bytes)
Set the bytes for the variant corresponding the given local resource. |
Methods inherited from class org.eclipse.team.core.variants.ResourceVariantByteStore |
---|
equals |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PersistantResourceVariantByteStore(QualifiedName name)
org.eclipse.core.resources.ISynchronizer
.
It must be unique and should use the plugin as the local name
and a unique id within the plugin as the qualifier name.
name
- the key used in the Core synchronizerMethod Detail |
public void dispose()
ResourceVariantByteStore
dispose
in class ResourceVariantByteStore
public QualifiedName getSyncName()
public byte[] getBytes(IResource resource) throws TeamException
ResourceVariantByteStore
null
means that no bytes have been stored
for the resource variant. It is up to the client to determine whether
this means that the resource variant does not exist or that it has not been
fetched or otherwise determined yet.
getBytes
in class ResourceVariantByteStore
resource
- the local resource
TeamException
public boolean setBytes(IResource resource, byte[] bytes) throws TeamException
ResourceVariantByteStore
null
. If it is known that the remote
does not exist, deleteBytes(IResource)
should be used instead.
If the sync bytes for the remote are stale and should be removed,
flushBytes(IResouce, int)
should be called.
setBytes
in class ResourceVariantByteStore
resource
- the local resourcebytes
- the bytes that represent the resource's variant
true
if the bytes changed
TeamException
public boolean flushBytes(IResource resource, int depth) throws TeamException
ResourceVariantByteStore
getBytes(resource)
will
return null
for the affected resources.
flushBytes
in class ResourceVariantByteStore
resource
- the local resourcedepth
- the depth of the operation (one of IResource.DEPTH_ZERO
,
IResource.DEPTH_ONE
, or IResource.DEPTH_INFINITE
)
true
if there were bytes present which were removed
TeamException
public boolean isVariantKnown(IResource resource) throws TeamException
true
while getBytes
returns null
resource
- the local resource
TeamException
public boolean deleteBytes(IResource resource) throws TeamException
isVariantKnown(resource)
will return true
and
getBytes(resource)
will return null
.
deleteBytes
in class ResourceVariantByteStore
resource
- the local resource
true
if this changes the remote sync bytes
TeamException
public IResource[] members(IResource resource) throws TeamException
ResourceVariantByteStore
members
in class ResourceVariantByteStore
resource
- the parent resource
TeamException
public void run(IResource root, IWorkspaceRunnable runnable, IProgressMonitor monitor) throws TeamException
ResourceVariantByteStore
run
in class ResourceVariantByteStore
root
- the root resource for all modificationsrunnable
- the action to performmonitor
- a progress monitor.
TeamException
- if the operation failed.
|
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.