public class

AbstractChangeCallback

extends Object
implements ChangeCallback2
java.lang.Object
   ↳ com.atlassian.stash.content.AbstractChangeCallback

Class Overview

Convenience implementation of ChangeCallback that provides no-op implementations for all methods.

Summary

Public Constructors
AbstractChangeCallback()
Public Methods
boolean onChange(Change change)
Discards the provided Change and returns true to continue streaming.
void onEnd(boolean truncated)
Informs the callback that no more changes are available.
void onEnd(ChangeSummary summary)
Delegates to onEnd(boolean) to retain backwards compatibility with ChangeCallback.
void onStart()
Informs the callback that the system has begun processing changes and may begin streaming them.
void onStart(ChangeContext context)
Delegates to onStart() to retain backwards compatibility with ChangeCallback.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.stash.content.ChangeCallback
From interface com.atlassian.stash.content.ChangeCallback2

Public Constructors

public AbstractChangeCallback ()

Public Methods

public boolean onChange (Change change)

Discards the provided Change and returns true to continue streaming.

Parameters
change ignored
Returns
  • true
Throws
IOException may be thrown by derived classes

public void onEnd (boolean truncated)

Informs the callback that no more changes are available.

Note: The system applies a hard cap to the number of changes it is willing to stream, regardless of how many the callback is willing to consume. If that cap is reached, truncated will be set to true to indicate that there are more changes available than have been streamed, but the system is unwilling to provide them. Note that if onChange(Change) returns false, that is not considered truncation.

Parameters
truncated true if the changes were truncated by the system and at least one change was not streamed to the callback; otherwise, false if all available changes have been streamed or if the callback requested streaming end
Throws
IOException

public void onEnd (ChangeSummary summary)

Delegates to onEnd(boolean) to retain backwards compatibility with ChangeCallback.

Parameters
summary used to pass isTruncated() to onEnd(boolean)
Throws
IOException propagated if thrown by onEnd(boolean)

public void onStart ()

Informs the callback that the system has begun processing changes and may begin streaming them. If there are no changes available, this method may be followed immediately by onEnd(boolean).

This method will always be invoked before onChange(Change) is invoked for the first time.

onStart(ChangeContext) will replace this method in Stash 3.0.

Throws
IOException

public void onStart (ChangeContext context)

Delegates to onStart() to retain backwards compatibility with ChangeCallback.

Parameters
context ignored
Throws
IOException propagated if thrown by onStart()