public interface

MirrorSyncCallback

com.atlassian.bitbucket.scm.mirror.MirrorSyncCallback

Class Overview

Describes a callback for receiving streaming ref changes.

Implementations of this callback performing internal paging may return false from onRefChange(RefChange) to indicate no more ref changes are desired. Such implementations are encouraged to also implement the PagedCallback interface to allow the system to optimise output handling, where possible, based on the page being requested.

Summary

Public Methods
void onEnd(MirrorSyncSummary summary)
Called after the final ref change has been streamed.
boolean onFailedRef(MinimalRef ref)
Called when a ref failed to synchronize.
boolean onRefChange(RefChange refChange)
Provides a ref change to the callback for processing.
void onStart(MirrorSyncContext context)
Called before the first ref change is streamed.

Public Methods

public void onEnd (MirrorSyncSummary summary)

Called after the final ref change has been streamed.

Note: If there were no ref changes, this method may be called immediately after onStart(MirrorSyncContext) without any calls to onRefChange(RefChange).

Parameters
summary summarizes the request and the streamed changes
Throws
IOException May be thrown by implementations which perform I/O.

public boolean onFailedRef (MinimalRef ref)

Called when a ref failed to synchronize.

If the callback is performing internal paging, it may signal the end of the page by returning false here.

Parameters
ref the ref that failed
Returns
  • true if additional ref changes should be provided; otherwise, false if the callback has received as many ref changes as desired
Throws
IOException
IOException

public boolean onRefChange (RefChange refChange)

Provides a ref change to the callback for processing.

If the callback is performing internal paging, it may signal the end of the page by returning false here.

Parameters
refChange the ref change to process
Returns
  • true if additional ref changes should be provided; otherwise, false if the callback has received as many ref changes as desired
Throws
IOException may be thrown by implementations which perform I/O

public void onStart (MirrorSyncContext context)

Called before the first ref change is streamed.

Parameters
context provides details about the request for which ref changes are being streamed
Throws
IOException May be thrown by implementations which perform I/O.