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

# Class CDORevisionCrawler.OutputStreamHandler

java.lang.Object
org.eclipse.emf.cdo.common.revision.CDORevisionCrawler.OutputStreamHandler

All Implemented Interfaces:
  `CDORevisionCrawler.Handler`

Direct Known Subclasses:
  `CDORevisionCrawler.MessageDigestHandler`

Enclosing class:
  `CDORevisionCrawler`

public static class CDORevisionCrawler.OutputStreamHandler extends Object implements CDORevisionCrawler.Handler
Handler implementation that writes crawl data to an output stream.

Author:
  Eike Stepper

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`CDORevisionCrawler.OutputStreamHandler.IDMapper`
Abstract ID mapper for mapping real IDs to local IDs.

## Constructor Summary

Constructors
Modifier
Constructor
Description
``
`OutputStreamHandler(OutputStream stream)`
Constructs an OutputStreamHandler with the given output stream.
``
`OutputStreamHandler(OutputStream stream, boolean localIDs, CDOLobLoader lobLoader)`
Constructs an OutputStreamHandler with local ID mapping and optional LOB loader.
``
`OutputStreamHandler(OutputStream stream, CDORevisionCrawler.OutputStreamHandler.IDMapper idMapper, CDOLobLoader lobLoader)`
Constructs an OutputStreamHandler with custom ID mapper and optional LOB loader.
`protected`
`OutputStreamHandler(CDODataOutput out, CDORevisionCrawler.OutputStreamHandler.IDMapper idMapper)`
Constructs an OutputStreamHandler with the given data output and ID mapper.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`begin(CDORevisionCrawler crawler)`
Called when crawling begins.
`final boolean`
`beginRevision(CDORevision revision)`
Called when a revision is about to be processed.
`protected boolean`
`doBeginRevision(CDORevision revision)`
Performs finishing logic for the given revision.
`protected void`
`doEndRevision(CDORevision revision)`
Performs ending logic for the given revision.
`protected void`
`doHandleFeature(CDORevision revision, EStructuralFeature feature)`
Performs feature handling logic for the given revision and feature.
`final void`
`endRevision(CDORevision revision)`
Called when a revision has been processed.
`final void`
`finishLocalIDs()`
Performs the second phase for local ID mapping, writing features for all mapped revisions.
`CDORevisionCrawler.OutputStreamHandler.IDMapper`
`getLocalIDMapper()`
Returns the local ID mapper used by this handler, if any.
`final void`
`handleFeature(CDORevision revision, EStructuralFeature feature)`
Called for each feature to be handled.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.eclipse.emf.cdo.common.revision.CDORevisionCrawler.Handler

`finish`

## Constructor Details

### OutputStreamHandler

public OutputStreamHandler(OutputStream stream)
Constructs an OutputStreamHandler with the given output stream.

Parameters:
  `stream` - the output stream

### OutputStreamHandler

public OutputStreamHandler(OutputStream stream, boolean localIDs, CDOLobLoader lobLoader)
Constructs an OutputStreamHandler with local ID mapping and optional LOB loader.

Parameters:
  `stream` - the output stream
  `localIDs` - true to use local IDs
  `lobLoader` - the LOB loader, may be null

### OutputStreamHandler

public OutputStreamHandler(OutputStream stream, CDORevisionCrawler.OutputStreamHandler.IDMapper idMapper, CDOLobLoader lobLoader)
Constructs an OutputStreamHandler with custom ID mapper and optional LOB loader.

Parameters:
  `stream` - the output stream
  `idMapper` - the ID mapper
  `lobLoader` - the LOB loader, may be null

### OutputStreamHandler

protected OutputStreamHandler(CDODataOutput out, CDORevisionCrawler.OutputStreamHandler.IDMapper idMapper)
Constructs an OutputStreamHandler with the given data output and ID mapper.

## Method Details

### getLocalIDMapper

public CDORevisionCrawler.OutputStreamHandler.IDMapper getLocalIDMapper()
Returns the local ID mapper used by this handler, if any.

### begin

public boolean begin(CDORevisionCrawler crawler)
Description copied from interface: `CDORevisionCrawler.Handler`
Called when crawling begins.

Specified by:
  `begin` in interface `CDORevisionCrawler.Handler`
Parameters:
  `crawler` - the crawler instance
Returns:
  true to continue crawling

### beginRevision

public final boolean beginRevision(CDORevision revision)
Description copied from interface: `CDORevisionCrawler.Handler`
Called when a revision is about to be processed.

Specified by:
  `beginRevision` in interface `CDORevisionCrawler.Handler`
Parameters:
  `revision` - the revision
Returns:
  true to continue crawling

### handleFeature

public final void handleFeature(CDORevision revision, EStructuralFeature feature)
Description copied from interface: `CDORevisionCrawler.Handler`
Called for each feature to be handled.

Specified by:
  `handleFeature` in interface `CDORevisionCrawler.Handler`
Parameters:
  `revision` - the revision
  `feature` - the feature

### endRevision

public final void endRevision(CDORevision revision)
Description copied from interface: `CDORevisionCrawler.Handler`
Called when a revision has been processed.

Specified by:
  `endRevision` in interface `CDORevisionCrawler.Handler`
Parameters:
  `revision` - the revision

### finishLocalIDs

public final void finishLocalIDs()
Performs the second phase for local ID mapping, writing features for all mapped revisions.

### doBeginRevision

protected boolean doBeginRevision(CDORevision revision)
Performs finishing logic for the given revision.

### doHandleFeature

protected void doHandleFeature(CDORevision revision, EStructuralFeature feature)
Performs feature handling logic for the given revision and feature.

### doEndRevision

protected void doEndRevision(CDORevision revision)
Performs ending logic for the given revision.