Package sonia.scm.repository.api
Class HookContext
java.lang.Object
sonia.scm.repository.api.HookContext
The context for all repository hooks. With the
HookContext class it
is able to send messages back to the client, retrieve Changesets
which are added during this push/commit and gives information about changed
branches and tags.- Since:
- 1.33
-
Method Summary
Modifier and TypeMethodDescriptionReturns aHookBranchProviderwhich is able to return information about changed branches during the current hook.Returns aHookChangesetBuilderwhich is able to return allChangeset's during this push/commit.Returns aHookMergeDetectionProviderwhich is able to check whether two branches have been merged with the incoming changesets.Returns aHookMessageProviderwhich is able to send message back to the scm client.Returns aHookChangesetBuilderwhich is able to return allChangeset's during this push/commit.Returns aHookTagProviderwhich is able to return informations about changed tags during the current hook.booleanisFeatureSupported(HookFeature feature) Returns true if the underlying provider support the requested feature.
-
Method Details
-
getBranchProvider
Returns aHookBranchProviderwhich is able to return information about changed branches during the current hook.- Returns:
HookBranchProvider- Throws:
HookFeatureIsNotSupportedException- if the feature is not supported by the underlying provider- Since:
- 1.45
-
getTagProvider
Returns aHookTagProviderwhich is able to return informations about changed tags during the current hook.- Returns:
HookTagProvider- Throws:
HookFeatureIsNotSupportedException- if the feature is not supported by the underlying provider- Since:
- 1.50
-
getChangesetProvider
Returns aHookChangesetBuilderwhich is able to return allChangeset's during this push/commit.- Returns:
HookChangesetBuilder- Throws:
HookFeatureIsNotSupportedException- if the feature is not supported by the underlying provider
-
getModificationsProvider
Returns aHookChangesetBuilderwhich is able to return allChangeset's during this push/commit.- Returns:
HookChangesetBuilder- Throws:
HookFeatureIsNotSupportedException- if the feature is not supported by the underlying provider
-
getMessageProvider
Returns aHookMessageProviderwhich is able to send message back to the scm client. Note: TheHookMessageProvideris only available if the underlyingHookContextProvidersupports the handling of messages and the hook is executed synchronous.- Returns:
HookMessageProviderwhich is able to send message back to the scm client- Throws:
HookFeatureIsNotSupportedException- if the feature is not supported by the underlying provider
-
getMergeDetectionProvider
Returns aHookMergeDetectionProviderwhich is able to check whether two branches have been merged with the incoming changesets.- Returns:
HookMergeDetectionProviderwhich is able to detect merges.- Throws:
HookFeatureIsNotSupportedException- if the feature is not supported by the underlying provider
-
isFeatureSupported
Returns true if the underlying provider support the requested feature.- Parameters:
feature- feature to check if it is supported- Returns:
- true if the feature is supported
-