Package org.eclipse.team.core.variants
Class SessionResourceVariantByteStore
java.lang.Object
org.eclipse.team.core.variants.ResourceVariantByteStore
org.eclipse.team.core.variants.SessionResourceVariantByteStore
A
ResourceVariantByteStore that caches the variant bytes in
memory and does not persist them over workbench invocations.- Since:
- 3.0
- Restriction:
- This class is not intended to be subclassed by clients.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleandeleteBytes(IResource resource) Method called to indicate that it is known that there is no variant associated with the local resource.voiddispose()Dispose of any cached sync bytes when this cache is no longer needed.booleanflushBytes(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[]Return the bytes for the variant corresponding the given local resource.booleanisEmpty()Returntrueif no bytes are contained in this tree.Return the children of the given resource that have resource variants in this tree.booleanSet the bytes for the variant corresponding the given local resource.Methods inherited from class org.eclipse.team.core.variants.ResourceVariantByteStore
equals, run
-
Constructor Details
-
SessionResourceVariantByteStore
public SessionResourceVariantByteStore()
-
-
Method Details
-
deleteBytes
Description copied from class:ResourceVariantByteStoreMethod called to indicate that it is known that there is no variant associated with the local resource. Subclasses may handle this information in different ways. Theflush(IResource, int)method should be used in the cases where a client wishes to remove bytes for other reason.- Specified by:
deleteBytesin classResourceVariantByteStore- Parameters:
resource- the local resource- Returns:
trueif this changes the bytes for the variant- Throws:
TeamException- if an error occurs
-
dispose
public void dispose()Description copied from class:ResourceVariantByteStoreDispose of any cached sync bytes when this cache is no longer needed.- Specified by:
disposein classResourceVariantByteStore
-
flushBytes
Description copied from class:ResourceVariantByteStoreRemove the bytes from the tree for the resource variants corresponding to the given local resource and its descendants to the given depth. After the bytes are removed,getBytes(resource)will returnnullfor the affected resources.- Specified by:
flushBytesin classResourceVariantByteStore- Parameters:
resource- the local resourcedepth- the depth of the operation (one ofIResource.DEPTH_ZERO,IResource.DEPTH_ONE, orIResource.DEPTH_INFINITE)- Returns:
trueif there were bytes present which were removed- Throws:
TeamException- if an error occurs
-
getBytes
Description copied from class:ResourceVariantByteStoreReturn the bytes for the variant corresponding the given local resource. A return value ofnullmeans 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.- Specified by:
getBytesin classResourceVariantByteStore- Parameters:
resource- the local resource- Returns:
- the bytes that represent the resource's variant
- Throws:
TeamException- if an error occurs
-
isEmpty
public boolean isEmpty()Returntrueif no bytes are contained in this tree.- Returns:
trueif no bytes are contained in this tree.
-
members
Description copied from class:ResourceVariantByteStoreReturn the children of the given resource that have resource variants in this tree.- Specified by:
membersin classResourceVariantByteStore- Parameters:
resource- the parent resource- Returns:
- the members who have resource variants in this tree.
-
setBytes
Description copied from class:ResourceVariantByteStoreSet the bytes for the variant corresponding the given local resource. The bytes should never benull. 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.- Specified by:
setBytesin classResourceVariantByteStore- Parameters:
resource- the local resourcebytes- the bytes that represent the resource's variant- Returns:
trueif the bytes changed- Throws:
TeamException- if an error occurs
-