public final class GitHubNotificationContext extends Object
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.Modifier and Type | Method and Description |
---|---|
static GitHubNotificationContext |
build(Job<?,?> job,
Run<?,?> build,
jenkins.scm.api.SCMSource source,
jenkins.scm.api.SCMHead head) |
boolean |
equals(Object o) |
Run<?,?> |
getBuild()
Returns the run, if any, associated with the planned notification event
|
String |
getDefaultContext(TaskListener listener)
Retrieves default context
|
boolean |
getDefaultIgnoreError(TaskListener listener)
Retrieves whether plugin should ignore errors when updating the GitHub status
|
String |
getDefaultMessage(TaskListener listener)
Retrieves default notification message
|
org.kohsuke.github.GHCommitState |
getDefaultState(TaskListener listener)
Retrieves default notification state
|
String |
getDefaultUrl(TaskListener listener)
Retrieves default URL
|
jenkins.scm.api.SCMHead |
getHead()
Returns the SCMHead associated with the planned notification event
|
Job<?,?> |
getJob()
Returns the job, if any, associated with the planned notification event
|
jenkins.scm.api.SCMSource |
getSource()
Returns the SCMSource associated with the planned notification event
|
int |
hashCode() |
String |
toString() |
public static GitHubNotificationContext build(@Nullable Job<?,?> job, @Nullable Run<?,?> build, jenkins.scm.api.SCMSource source, jenkins.scm.api.SCMHead head)
public Job<?,?> getJob()
public Run<?,?> getBuild()
public jenkins.scm.api.SCMSource getSource()
public jenkins.scm.api.SCMHead getHead()
public String getDefaultContext(TaskListener listener)
listener
- Listener for the build, if anypublic String getDefaultUrl(TaskListener listener)
listener
- Listener for the build, if anypublic String getDefaultMessage(TaskListener listener)
listener
- Listener for the build, if anypublic org.kohsuke.github.GHCommitState getDefaultState(TaskListener listener)
listener
- Listener for the build, if anypublic boolean getDefaultIgnoreError(TaskListener listener)
listener
- Listener for the build, if anyCopyright © 2016–2020. All rights reserved.