|
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.variants.ResourceVariantByteStore
The purpose of a ResourceVariantByteStore
is to support the caching of
the synchronization bytes for the resource variants that represent
a resource line-up of interest such as a version, baseline or branch. The
cache stores bytes in order to minimize the memory footprint of the tree. It is the
reponsibility of the client of this API to cache enough bytes to meaningfully identify
a resource variant (and possibly create an IResourceVariant
handle from them).
The bytes for a resource variant are accessed using the local IResource
handle
that corresponds to the resource variant (using the getBytes
method).
The potential children of a resource variant are also accessed
by using the local handle that corresponds to the resource variant
(using the members
method).
Constructor Summary | |
ResourceVariantByteStore()
|
Method Summary | |
abstract boolean |
deleteBytes(IResource resource)
Method called to indicate that it is known that there is no variant associated with the local resource. |
abstract void |
dispose()
Dispose of any cached sync bytes when this cache is no longer needed. |
protected boolean |
equals(byte[] syncBytes1,
byte[] syncBytes2)
Helper method to compare two byte arrays for equality |
abstract 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. |
abstract byte[] |
getBytes(IResource resource)
Return the bytes for the variant corresponding the given local resource. |
abstract 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 modfications to the byte store. |
abstract boolean |
setBytes(IResource resource,
byte[] bytes)
Set the bytes for the variant corresponding the given local resource. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ResourceVariantByteStore()
Method Detail |
public abstract void dispose()
public abstract byte[] getBytes(IResource resource) throws TeamException
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.
resource
- the local resource
TeamException
public abstract boolean setBytes(IResource resource, byte[] bytes) throws TeamException
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.
resource
- the local resourcebytes
- the bytes that represent the resource's variant
true
if the bytes changed
TeamException
public abstract boolean flushBytes(IResource resource, int depth) throws TeamException
getBytes(resource)
will
return null
for the affected resources.
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 abstract boolean deleteBytes(IResource resource) throws TeamException
flush(IResource, int)
method should be used in the cases
where a client wishes to remove bytes for other reason.
resource
- the local resource
true
if this changes the bytes for the variant
TeamException
public abstract IResource[] members(IResource resource) throws TeamException
resource
- the parent resource
TeamException
protected boolean equals(byte[] syncBytes1, byte[] syncBytes2)
syncBytes1
- the first byte array or null
syncBytes2
- the second byte array or null
public void run(IResource root, IWorkspaceRunnable runnable, IProgressMonitor monitor) throws TeamException
root
- the root resource for all modificationsmonitor
- a progress monitor.
CoreException
- if the operation failed.
OperationCanceledException
- if the operation is canceled.
TeamException
|
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.