Class Notification

java.lang.Object
io.jenkins.plugins.batchcontrol.ops.Notification

public final class Notification extends Object
Immutable description of one notification (SPEC item 13, D-36), handed to every BatchControlNotifier. All values are plain text; a notifier that renders HTML must escape them.
  • Field Details

  • Constructor Details

    • Notification

      public Notification(String kind, String requestId, String subject, String requester, String reason, List<String> recipients, String url)
    • Notification

      public Notification(String kind, String requestId, String subject, String requester, String reason, List<String> recipients, String url, String action)
      Parameters:
      action - for an activation request the requested action (ACTIVATE or HOLD, security-13 S-13-08); null for other kinds
    • Notification

      public Notification(String kind, String requestId, String subject, String requester, String reason, List<String> recipients, String url, String action, List<String> details)
      Parameters:
      details - plain-text lines describing what is decided on, each Label: value (for a change request its actions, duration and name restriction, e2e-03 DEF-24); null for none
    • Notification

      public Notification(String kind, String requestId, String subject, String requester, String reason, List<String> recipients, String url, String action, List<String> details, List<String> notices)
      Parameters:
      notices - plain-text sentences the approver must notice (D-38a: the requester does not have Build permission on the job); null for none
  • Method Details

    • getAction

      public String getAction()
      ACTIVATE or HOLD for an activation request; null for other kinds.
    • getNotices

      public List<String> getNotices()
      Plain-text sentences the recipient must notice, for example "The requester does not have Build permission on this job." (D-38a, run requests, REQUEST_CREATED and APPROVERS_CHANGED); never null, possibly empty.
    • getDetails

      public List<String> getDetails()
      Plain-text Label: value lines describing what the request asks for (for a change request: actions, duration and name restriction); never null, possibly empty.
    • getKind

      public String getKind()
      "RUN" for a run request, "GRANT" for a change request or window, "ACTIVATION" for an activation or hold request.
    • getRequestId

      public String getRequestId()
      The request id (for a window, the id of the change request it came from).
    • getSubject

      public String getSubject()
      The job full name (run, activation) or the scope full name (grant).
    • getRequester

      public String getRequester()
    • getReason

      public String getReason()
    • getRecipients

      public List<String> getRecipients()
      Jenkins user ids to notify; never null.
    • getUrl

      public String getUrl()
      Absolute link to the request page from the configured Jenkins URL, or null when none is configured.
    • toString

      public String toString()
      Overrides:
      toString in class Object