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