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 Changeset
s
which are added during this push/commit and gives information about changed
branches and tags.- Since:
- 1.33
-
Method Summary
Modifier and TypeMethodDescriptionReturns aHookBranchProvider
which is able to return information about changed branches during the current hook.Returns aHookChangesetBuilder
which is able to return allChangeset
's during this push/commit.Returns aHookMergeDetectionProvider
which is able to check whether two branches have been merged with the incoming changesets.Returns aHookMessageProvider
which is able to send message back to the scm client.Returns aHookChangesetBuilder
which is able to return allChangeset
's during this push/commit.Returns aHookTagProvider
which is able to return informations about changed tags during the current hook.boolean
isFeatureSupported
(HookFeature feature) Returns true if the underlying provider support the requested feature.
-
Method Details
-
getBranchProvider
Returns aHookBranchProvider
which 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 aHookTagProvider
which 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 aHookChangesetBuilder
which 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 aHookChangesetBuilder
which 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 aHookMessageProvider
which is able to send message back to the scm client. Note: TheHookMessageProvider
is only available if the underlyingHookContextProvider
supports the handling of messages and the hook is executed synchronous.- Returns:
HookMessageProvider
which is able to send message back to the scm client- Throws:
HookFeatureIsNotSupportedException
- if the feature is not supported by the underlying provider
-
getMergeDetectionProvider
Returns aHookMergeDetectionProvider
which is able to check whether two branches have been merged with the incoming changesets.- Returns:
HookMergeDetectionProvider
which 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
-