Class GitHubNotificationContext
java.lang.Object
org.jenkinsci.plugins.github_branch_source.GitHubNotificationContext
Parameter object used in notification strategies
AbstractGitHubNotificationStrategy
.
When creating a new point of notification (e.g. on build completion), populate this object with the relevant details accessible at that point. When implementing a notification strategy, be aware that some details may be absent depending on the point of notification.
- Since:
- 2.3.2
-
Method Summary
Modifier and TypeMethodDescriptionstatic GitHubNotificationContext
boolean
Run<?,
?> getBuild()
Returns the run, if any, associated with the planned notification eventgetDefaultContext
(TaskListener listener) Retrieves default contextboolean
getDefaultIgnoreError
(TaskListener listener) Retrieves whether plugin should ignore errors when updating the GitHub statusgetDefaultMessage
(TaskListener listener) Retrieves default notification messageorg.kohsuke.github.GHCommitState
getDefaultState
(TaskListener listener) Retrieves default notification stategetDefaultUrl
(TaskListener listener) Retrieves default URLjenkins.scm.api.SCMHead
getHead()
Returns the SCMHead associated with the planned notification eventJob<?,
?> getJob()
Returns the job, if any, associated with the planned notification eventjenkins.scm.api.SCMSource
Returns the SCMSource associated with the planned notification eventint
hashCode()
toString()
-
Method Details
-
build
public static GitHubNotificationContext build(@Nullable Job<?, ?> job, @Nullable Run<?, ?> build, jenkins.scm.api.SCMSource source, jenkins.scm.api.SCMHead head) -
getJob
Returns the job, if any, associated with the planned notification event- Returns:
- Job
- Since:
- 2.3.2
-
getBuild
Returns the run, if any, associated with the planned notification event- Returns:
- Run
- Since:
- 2.3.2
-
getSource
public jenkins.scm.api.SCMSource getSource()Returns the SCMSource associated with the planned notification event- Returns:
- SCMSource
- Since:
- 2.3.2
-
getHead
public jenkins.scm.api.SCMHead getHead()Returns the SCMHead associated with the planned notification event- Returns:
- SCMHead
- Since:
- 2.3.2
-
toString
-
equals
-
hashCode
public int hashCode() -
getDefaultContext
Retrieves default context- Parameters:
listener
- Listener for the build, if any- Returns:
- Default notification context
- Since:
- 2.3.2
-
getDefaultUrl
Retrieves default URL- Parameters:
listener
- Listener for the build, if any- Returns:
- Default notification URL backref
- Since:
- 2.3.2
-
getDefaultMessage
Retrieves default notification message- Parameters:
listener
- Listener for the build, if any- Returns:
- Default notification message
- Since:
- 2.3.2
-
getDefaultState
Retrieves default notification state- Parameters:
listener
- Listener for the build, if any- Returns:
- Default notification state
- Since:
- 2.3.2
-
getDefaultIgnoreError
Retrieves whether plugin should ignore errors when updating the GitHub status- Parameters:
listener
- Listener for the build, if any- Returns:
- Default ignore errors policy
- Since:
- 2.3.2
-