Class BaseNotificationPayload

java.lang.Object
flexagon.ff.common.core.pojos.BasePOJO
flexagon.fd.model2.notification.payload.BaseNotificationPayload
All Implemented Interfaces:
NotificationPayload, Serializable
Direct Known Subclasses:
BaseHumanTaskPayload, PipelineNotificationStepPayload, PipelineStepExecFailedPayload, ProjectWorkflowRequestPayload

public abstract class BaseNotificationPayload extends BasePOJO implements NotificationPayload
Abstract class from which all Notification Payloads inherit.
See Also:
  • Field Details

  • Constructor Details

    • BaseNotificationPayload

      public BaseNotificationPayload(NotificationEventTypeEnum pNotificationEventTypeEnum)
      Creates an instance of the payload.
      Parameters:
      pNotificationEventTypeEnum - The event type for the payload
  • Method Details

    • getRecipients

      public List<NotificationRecipient> getRecipients()
      Specified by:
      getRecipients in interface NotificationPayload
    • addRecipientsByCommittersIfEligible

      protected void addRecipientsByCommittersIfEligible(List<NotifScmCommit> pNotifScmCommits, String pStatus, String pAttributeGroupName) throws SQLException
      Throws:
      SQLException
    • addRecipientsForPipelineStepExecFailure

      protected void addRecipientsForPipelineStepExecFailure(Long pRelDefinitionId, OnErrorType pOnError, Long pPipelineDefinitionId, Long pPipelineStageExecId) throws SQLException
      Throws:
      SQLException
    • evaluatePipelineRoleScript

      protected PipelineRoleScriptResult evaluatePipelineRoleScript(Long pRelDefinitionId, Long pPipelineDefinitionId, Long pPipelineStageExecId, String pScript) throws SQLException
      Throws:
      SQLException
    • addRecipientsByPipelineRoleMember

      protected void addRecipientsByPipelineRoleMember(List<Long> pPipelineRoleIdList, Long pRelDefinitionId) throws SQLException
      Throws:
      SQLException
    • addRecipientsByPipelineRoleUserOrEmailMember

      protected void addRecipientsByPipelineRoleUserOrEmailMember(Long pPipelineRoleId, Long pRelDefinitionId, String pMemberType) throws SQLException
      Throws:
      SQLException
    • addRecipientsByUserNameIfEligible

      protected void addRecipientsByUserNameIfEligible(String pUserName, String pUserAttributeName, String pAttributeGroupName) throws SQLException
      Throws:
      SQLException
    • addRecipientsByUserIdIfEligible

      protected void addRecipientsByUserIdIfEligible(Long pUserId, String pUserAttributeName, String pAttributeGroupName) throws SQLException
      Throws:
      SQLException
    • addRecipientsByGroupNameIfEligible

      protected void addRecipientsByGroupNameIfEligible(String pGroupName, String pUserAttributeName, String pAttributeGroupName)
      This methods select active users for a group who has their attribute selected
      Parameters:
      pGroupName -
      pUserAttributeName -
    • addRecipientsByGroupIdIfEligible

      protected void addRecipientsByGroupIdIfEligible(Long pGroupId, String pUserAttributeName, String pAttributeGroupName)
      This methods select active users for a group who has their attribute selected
      Parameters:
      pGroupId -
      pUserAttributeName -
    • addRecipientsByGroupId

      protected void addRecipientsByGroupId(Long pGroupId)
    • isGroupMemberOfPipelineRole

      protected boolean isGroupMemberOfPipelineRole(Long pRelDefinitionId, Long pGroupId, List<Long> pPipelineRoleIds) throws SQLException
      Throws:
      SQLException
    • getApprovalGateRoleByGateId

      protected Long getApprovalGateRoleByGateId(Long pPipelineGateId) throws SQLException
      Throws:
      SQLException
    • getManualStepRoleByStepId

      protected Long getManualStepRoleByStepId(Long pPipelineStageStepId) throws SQLException
      Throws:
      SQLException
    • addRecipientsBySubscriptions

      protected void addRecipientsBySubscriptions(Long pEnvironmentId, String pRequestStatus, Long pFolderId, String pAttributeGroupName) throws SQLException
      Throws:
      SQLException
    • getApprovalTaskUrlPath

      public String getApprovalTaskUrlPath()
      Returns the URI of the approval tasks page.
      Returns:
      The URI of the approval tasks page.
    • getHumanTaskUrlPath

      public String getHumanTaskUrlPath()
      Returns the URI of the human tasks page.
      Returns:
      The URI of the human tasks page.
    • sendLogAttachments

      public void sendLogAttachments(boolean pSendLogAttachments)
      Sets whether plugin logs should be attached to the notification.
      Parameters:
      pSendLogAttachments - Whether plugin logs should be attached to the notification.
    • getFolderWithHierarchy

      protected NotifFolder getFolderWithHierarchy(Long pFolderId)
    • getUserFullName

      protected String getUserFullName(String pUserName)
    • showTextForMissingUrlSetup

      public String showTextForMissingUrlSetup()
      Returns a warning message if Base Server URL is not configured in System Settings.
      Returns:
      A warning message if Base Server URL is not configured in System Settings.
    • getHumanTaskIdentityUuid

      public String getHumanTaskIdentityUuid()
      Specified by:
      getHumanTaskIdentityUuid in interface NotificationPayload
    • isSendLogAttachments

      public boolean isSendLogAttachments()
      Returns whether plugin log attachments should be included in notification.
      Returns:
      Whether plugin log attachments should be included in notification.
    • showNotesAndSendAttachments

      public void showNotesAndSendAttachments(boolean pShowNotesAndSendAttachments)
      Sets whether notes and notes attachments should be included in notification.
      Parameters:
      pShowNotesAndSendAttachments - Whether notes and notes attachments should be included in notification.
    • isShowNotesAndSendAttachments

      public boolean isShowNotesAndSendAttachments()
      Returns whether notes and notes attachments should be included in notification.
      Returns:
      Whether notes and notes attachments should be included in notification.
    • hasAttachments

      public boolean hasAttachments()
      Description copied from interface: NotificationPayload
      Whether the payload has attachments to be delivered with the notification.
      Specified by:
      hasAttachments in interface NotificationPayload
      Returns:
      Whether the payload has attachments to be delivered with the notification.
    • addAttachment

      public void addAttachment(Serializable pAttachmentData, String pAttachmentName)
      Adds an email attachment with the given name for any Serlizable type data to the Template
      Parameters:
      pAttachmentName - The name of the attachment.
      pAttachmentData - The attachment data.
    • addAttachment

      public void addAttachment(Serializable pAttachmentData)
      Adds an email attachment with a generated name for any Serlizable type data to the Template
      Parameters:
      pAttachmentData - The attachment data.
    • addAttachment

      public void addAttachment(Serializable pAttachmentData, String pAttachmentName, String pContentType)
      Adds an email attachment with the given name and content type for any Serlizable type data to the Template
      Parameters:
      pAttachmentData - The attachment data.
      pAttachmentName - The attachment name.
      pContentType - The attachment content type.
    • addAttachment

      public void addAttachment(byte[] pAttachmentData, String pAttachmentName, String pContentType)
      Adds an email attachment with the given name and content type for byte array type data to the Template.
      Parameters:
      pAttachmentData - The attachment data.
      pAttachmentName - The attachment name.
      pContentType - The attachment content type.
    • getAttachments

      public List<EmailAttachment> getAttachments() throws SQLException
      Description copied from interface: NotificationPayload
      Returns a list of email attachments pertaining to the event which has occurred.
      Specified by:
      getAttachments in interface NotificationPayload
      Returns:
      A list of email attachements.
      Throws:
      SQLException
    • toString

      public String toString()
      Description copied from class: BasePOJO
      Returns custom String representation implemented by walking complete object structure.
      Overrides:
      toString in class BasePOJO
      Returns:
      a String representation of this object
    • populatePipelineAttachmentsAndNotes

      protected void populatePipelineAttachmentsAndNotes(Long pGateOrStepId, String pObjectType) throws SQLException
      Throws:
      SQLException
    • getPipelineStageExecutionSnapshotQueryResultRow

      protected PipelineStageExecutionSnapshotQueryResultRow getPipelineStageExecutionSnapshotQueryResultRow(Long pPipelineStageExecId) throws SQLException
      Throws:
      SQLException
    • toNotifScmCommits

      protected List<NotifScmCommit> toNotifScmCommits(List<ScmCommitDataObject> pScmCommitDataObjects)
    • getPipelineRoleScriptForGate

      protected String getPipelineRoleScriptForGate(PipelineExecutionUnitTypes pType, Serializable pData)
    • getPipelineRoleScriptForStep

      protected String getPipelineRoleScriptForStep(PipelineExecutionUnitTypes pType, Serializable pData)
    • getInputFieldsForStep

      protected List<InputField> getInputFieldsForStep(PipelineExecutionUnitTypes pType, Serializable pData)