Class GitHubNotificationContext
- java.lang.Object
-
- org.jenkinsci.plugins.github_branch_source.GitHubNotificationContext
-
public final class GitHubNotificationContext extends Object
Parameter object used in notification strategiesAbstractGitHubNotificationStrategy
.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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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 eventString
getDefaultContext(TaskListener listener)
Retrieves default contextboolean
getDefaultIgnoreError(TaskListener listener)
Retrieves whether plugin should ignore errors when updating the GitHub statusString
getDefaultMessage(TaskListener listener)
Retrieves default notification messageorg.kohsuke.github.GHCommitState
getDefaultState(TaskListener listener)
Retrieves default notification stateString
getDefaultUrl(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
getSource()
Returns the SCMSource associated with the planned notification eventint
hashCode()
String
toString()
-
-
-
Method Detail
-
build
public static GitHubNotificationContext build(@Nullable Job<?,?> job, @Nullable Run<?,?> build, jenkins.scm.api.SCMSource source, jenkins.scm.api.SCMHead head)
-
getJob
public Job<?,?> getJob()
Returns the job, if any, associated with the planned notification event- Returns:
- Job
- Since:
- 2.3.2
-
getBuild
public Run<?,?> 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
-
getDefaultContext
public String getDefaultContext(TaskListener listener)
Retrieves default context- Parameters:
listener
- Listener for the build, if any- Returns:
- Default notification context
- Since:
- 2.3.2
-
getDefaultUrl
public String getDefaultUrl(TaskListener listener)
Retrieves default URL- Parameters:
listener
- Listener for the build, if any- Returns:
- Default notification URL backref
- Since:
- 2.3.2
-
getDefaultMessage
public String getDefaultMessage(TaskListener listener)
Retrieves default notification message- Parameters:
listener
- Listener for the build, if any- Returns:
- Default notification message
- Since:
- 2.3.2
-
getDefaultState
public org.kohsuke.github.GHCommitState getDefaultState(TaskListener listener)
Retrieves default notification state- Parameters:
listener
- Listener for the build, if any- Returns:
- Default notification state
- Since:
- 2.3.2
-
getDefaultIgnoreError
public boolean getDefaultIgnoreError(TaskListener listener)
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
-
-