Package org.eclipse.emf.cdo.common.revision

# Interface CDORevisionCache

All Superinterfaces:
  `CDORevisionCacheAdder`, `org.eclipse.net4j.util.event.INotifier`

All Known Subinterfaces:
  `InternalCDORevisionCache`

public interface CDORevisionCache extends CDORevisionCacheAdder, org.eclipse.net4j.util.event.INotifier
Caches `revisions` and possibly `evicts` those that are no longer strongly referenced when free memory runs low.

Since:
  4.0
Author:
  Eike Stepper
No Implement
  This interface is not intended to be implemented by clients.
No Extend
  This interface is not intended to be extended by clients.

## Nested Class Summary

Nested Classes
Modifier and Type
Interface
Description
`static interface`
`CDORevisionCache.AdditionEvent`
An `event` fired from a `revision cache` when a `revision` is added to it.
`static interface`
`CDORevisionCache.EvictionEvent`
An `event` fired from a `revision cache` for `revisions` that are evicted because they are no longer strongly referenced when free memory runs low.

## Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier

`org.eclipse.net4j.util.event.INotifier.INotifier2`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final CDORevisionCache`
`NOOP`

## Method Summary

Modifier and Type
Method
Description
`void`
`addRevision(CDORevision revision)`
Deprecated.
As of 4.15 use `CDORevisionInterner.internRevision(CDORevision)`.
`void`
`forEachCurrentRevision(Consumer<CDORevision> consumer)`
Passes each `revision` that is current into the given consumer.
`void`
`forEachRevision(Consumer<CDORevision> consumer)`
Passes each `revision` into the given consumer.
`void`
`forEachValidRevision(CDOBranchPoint branchPoint, boolean considerBranchBases, Consumer<CDORevision> consumer)`
Passes each `revision` that is valid at the given `branch point` (or optionally at the base ranch points) into the given consumer.
`List<CDORevision>`
`getCurrentRevisions()`
Returns a list of `revisions` that are current.
`EClass`
`getObjectType(CDOID id)`
`CDORevision`
`getRevision(CDOID id, CDOBranchPoint branchPoint)`
`CDORevision`
`getRevisionByVersion(CDOID id, CDOBranchVersion branchVersion)`

### Methods inherited from interface org.eclipse.net4j.util.event.INotifier

`addListener, getListeners, hasListeners, removeListener`

## Field Details

### NOOP

static final CDORevisionCache NOOP

Since:
  3.0

## Method Details

### getObjectType

EClass getObjectType(CDOID id)

### getRevision

CDORevision getRevision(CDOID id, CDOBranchPoint branchPoint)

Since:
  3.0

### getRevisionByVersion

CDORevision getRevisionByVersion(CDOID id, CDOBranchVersion branchVersion)

Since:
  3.0

### getCurrentRevisions

List<CDORevision> getCurrentRevisions()
Returns a list of `revisions` that are current.

Since:
  3.0

### forEachCurrentRevision

void forEachCurrentRevision(Consumer<CDORevision> consumer)
Passes each `revision` that is current into the given consumer.

Since:
  4.9

### forEachValidRevision

void forEachValidRevision(CDOBranchPoint branchPoint, boolean considerBranchBases, Consumer<CDORevision> consumer)
Passes each `revision` that is valid at the given `branch point` (or optionally at the base ranch points) into the given consumer.

Since:
  4.15

### forEachRevision

void forEachRevision(Consumer<CDORevision> consumer)
Passes each `revision` into the given consumer.

Since:
  4.15

### addRevision

@Deprecated void addRevision(CDORevision revision)
Deprecated.
As of 4.15 use `CDORevisionInterner.internRevision(CDORevision)`.
Description copied from interface: `CDORevisionCacheAdder`
Adds the given revision to this cache.

Specified by:
  `addRevision` in interface `CDORevisionCacheAdder`