public abstract class BaseNotificationPayload extends BasePOJO implements NotificationPayload
Modifier and Type | Field and Description |
---|---|
protected NotificationEventTypeEnum |
mNotificationEventTypeEnum |
protected java.util.List<EmailAttachment> |
mPipelineAttachments |
protected java.util.List<java.lang.String> |
mPipelineNotes |
DATE_FORMAT
Constructor and Description |
---|
BaseNotificationPayload(NotificationEventTypeEnum pNotificationEventTypeEnum)
Creates an instance of the payload.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttachment(byte[] pAttachmentData,
java.lang.String pAttachmentName,
java.lang.String pContentType)
Adds an email attachment with the given name and content type for byte array type data to the Template.
|
void |
addAttachment(java.io.Serializable pAttachmentData)
Adds an email attachment with a generated name for any Serlizable type data to the Template
|
void |
addAttachment(java.io.Serializable pAttachmentData,
java.lang.String pAttachmentName)
Adds an email attachment with the given name for any Serlizable type data to the Template
|
void |
addAttachment(java.io.Serializable pAttachmentData,
java.lang.String pAttachmentName,
java.lang.String pContentType)
Adds an email attachment with the given name and content type for any Serlizable type data to the Template
|
protected void |
addRecipientsByCommittersIfEligible(java.util.List<NotifScmCommit> pNotifScmCommits,
java.lang.String pStatus,
java.lang.String pAttributeGroupName) |
protected void |
addRecipientsByGroupId(java.lang.Long pGroupId) |
protected void |
addRecipientsByGroupIdIfEligible(java.lang.Long pGroupId,
java.lang.String pUserAttributeName,
java.lang.String pAttributeGroupName)
This methods select active users for a group who has their attribute selected
|
protected void |
addRecipientsByGroupNameIfEligible(java.lang.String pGroupName,
java.lang.String pUserAttributeName,
java.lang.String pAttributeGroupName)
This methods select active users for a group who has their attribute selected
|
protected void |
addRecipientsByPipelineRoleMember(java.util.List<java.lang.Long> pPipelineRoleIdList,
java.lang.Long pRelDefinitionId) |
protected void |
addRecipientsByPipelineRoleUserOrEmailMember(java.lang.Long pPipelineRoleId,
java.lang.Long pRelDefinitionId,
java.lang.String pMemberType) |
protected void |
addRecipientsBySubscriptions(java.lang.Long pEnvironmentId,
java.lang.String pRequestStatus,
java.lang.Long pFolderId,
java.lang.String pAttributeGroupName) |
protected void |
addRecipientsByUserIdIfEligible(java.lang.Long pUserId,
java.lang.String pUserAttributeName,
java.lang.String pAttributeGroupName) |
protected void |
addRecipientsByUserNameIfEligible(java.lang.String pUserName,
java.lang.String pUserAttributeName,
java.lang.String pAttributeGroupName) |
protected void |
addRecipientsForPiplelineGateByPipelineRoleUserOrEmailMember(java.lang.Long pPipelineGateId,
java.lang.Long pRelDefinitionId,
java.lang.String pMemberType) |
protected void |
addRecipientsForPiplelineStepExecution(java.lang.Long pRelDefinitionId,
OnErrorType pOnError) |
protected java.lang.Long |
getApprovalGateRoleByGateId(java.lang.Long pPipelineGateId) |
java.lang.String |
getApprovalTaskUrlPath()
Returns the URI of the approval tasks page.
|
java.util.List<EmailAttachment> |
getAttachments()
Returns a list of email attachments pertaining to the event which has occurred.
|
protected NotifFolder |
getFolderWithHierarchy(java.lang.Long pFolderId) |
java.lang.String |
getHumanTaskIdentityUuid() |
java.lang.String |
getHumanTaskUrlPath()
Returns the URI of the human tasks page.
|
protected java.lang.Long |
getManualStepRoleByStepId(java.lang.Long pPipelineStageStepId) |
protected PipelineStageExecutionSnapshotQueryResultRow |
getPipelineStageExecutionSnapshotQueryResultRow(java.lang.Long pPipelineStageExecId) |
java.util.List<NotificationRecipient> |
getRecipients() |
protected java.lang.String |
getUserFullName(java.lang.String pUserName) |
boolean |
hasAttachments()
Whether the payload has attachments to be delivered with the notification.
|
protected boolean |
isGroupMemberOfPipelineRole(java.lang.Long pRelDefinitionId,
java.lang.Long pGroupId,
java.lang.Long pPipelineRoleId) |
boolean |
isSendLogAttachments()
Returns whether plugin log attachments should be included in notification.
|
boolean |
isShowNotesAndSendAttachments()
Returns whether notes and notes attachments should be included in notification.
|
protected void |
populatePipelineAttachmentsAndNotes(java.lang.Long pGateOrStepId,
java.lang.String pObjectType) |
void |
sendLogAttachments(boolean pSendLogAttachments)
Sets whether plugin logs should be attached to the notification.
|
void |
showNotesAndSendAttachments(boolean pShowNotesAndSendAttachments)
Sets whether notes and notes attachments should be included in notification.
|
java.lang.String |
showTextForMissingUrlSetup()
Returns a warning message if Base Server URL is not configured in System Settings.
|
protected java.util.List<NotifScmCommit> |
toNotifScmCommits(java.util.List<ScmCommitDataObject> pScmCommitDataObjects) |
java.lang.String |
toString()
Returns custom String representation implemented by walking complete object structure.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addRecipients, getId
protected NotificationEventTypeEnum mNotificationEventTypeEnum
protected transient java.util.List<java.lang.String> mPipelineNotes
protected transient java.util.List<EmailAttachment> mPipelineAttachments
public BaseNotificationPayload(NotificationEventTypeEnum pNotificationEventTypeEnum)
pAttributeGroupName
- Name of the attribute containing the medium settingspMediumEnum
- The medium type for the payloadpNotificationEventTypeEnum
- The event type for the payloadpublic java.util.List<NotificationRecipient> getRecipients()
getRecipients
in interface NotificationPayload
protected void addRecipientsByCommittersIfEligible(java.util.List<NotifScmCommit> pNotifScmCommits, java.lang.String pStatus, java.lang.String pAttributeGroupName) throws java.sql.SQLException
java.sql.SQLException
protected void addRecipientsForPiplelineGateByPipelineRoleUserOrEmailMember(java.lang.Long pPipelineGateId, java.lang.Long pRelDefinitionId, java.lang.String pMemberType) throws java.sql.SQLException
java.sql.SQLException
protected void addRecipientsForPiplelineStepExecution(java.lang.Long pRelDefinitionId, OnErrorType pOnError) throws java.sql.SQLException
java.sql.SQLException
protected void addRecipientsByPipelineRoleMember(java.util.List<java.lang.Long> pPipelineRoleIdList, java.lang.Long pRelDefinitionId) throws java.sql.SQLException
java.sql.SQLException
protected void addRecipientsByPipelineRoleUserOrEmailMember(java.lang.Long pPipelineRoleId, java.lang.Long pRelDefinitionId, java.lang.String pMemberType) throws java.sql.SQLException
java.sql.SQLException
protected void addRecipientsByUserNameIfEligible(java.lang.String pUserName, java.lang.String pUserAttributeName, java.lang.String pAttributeGroupName) throws java.sql.SQLException
java.sql.SQLException
protected void addRecipientsByUserIdIfEligible(java.lang.Long pUserId, java.lang.String pUserAttributeName, java.lang.String pAttributeGroupName) throws java.sql.SQLException
java.sql.SQLException
protected void addRecipientsByGroupNameIfEligible(java.lang.String pGroupName, java.lang.String pUserAttributeName, java.lang.String pAttributeGroupName)
pGroupName
- pUserAttributeName
- protected void addRecipientsByGroupIdIfEligible(java.lang.Long pGroupId, java.lang.String pUserAttributeName, java.lang.String pAttributeGroupName)
pGroupId
- pUserAttributeName
- protected void addRecipientsByGroupId(java.lang.Long pGroupId)
protected boolean isGroupMemberOfPipelineRole(java.lang.Long pRelDefinitionId, java.lang.Long pGroupId, java.lang.Long pPipelineRoleId) throws java.sql.SQLException
java.sql.SQLException
protected java.lang.Long getApprovalGateRoleByGateId(java.lang.Long pPipelineGateId) throws java.sql.SQLException
java.sql.SQLException
protected java.lang.Long getManualStepRoleByStepId(java.lang.Long pPipelineStageStepId) throws java.sql.SQLException
java.sql.SQLException
protected void addRecipientsBySubscriptions(java.lang.Long pEnvironmentId, java.lang.String pRequestStatus, java.lang.Long pFolderId, java.lang.String pAttributeGroupName) throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getApprovalTaskUrlPath()
public java.lang.String getHumanTaskUrlPath()
public void sendLogAttachments(boolean pSendLogAttachments)
pSendLogAttachments
- Whether plugin logs should be attached to the notification.protected NotifFolder getFolderWithHierarchy(java.lang.Long pFolderId)
protected java.lang.String getUserFullName(java.lang.String pUserName)
public java.lang.String showTextForMissingUrlSetup()
public java.lang.String getHumanTaskIdentityUuid()
getHumanTaskIdentityUuid
in interface NotificationPayload
public boolean isSendLogAttachments()
public void showNotesAndSendAttachments(boolean pShowNotesAndSendAttachments)
pShowNotesAndSendAttachments
- Whether notes and notes attachments should be included in notification.public boolean isShowNotesAndSendAttachments()
public boolean hasAttachments()
NotificationPayload
hasAttachments
in interface NotificationPayload
public void addAttachment(java.io.Serializable pAttachmentData, java.lang.String pAttachmentName)
pAttachmentName
- The name of the attachment.pAttachmentData
- The attachment data.public void addAttachment(java.io.Serializable pAttachmentData)
pAttachmentData
- The attachment data.public void addAttachment(java.io.Serializable pAttachmentData, java.lang.String pAttachmentName, java.lang.String pContentType)
pAttachmentData
- The attachment data.pAttachmentName
- The attachment name.pContentType
- The attachment content type.public void addAttachment(byte[] pAttachmentData, java.lang.String pAttachmentName, java.lang.String pContentType)
pAttachmentData
- The attachment data.pAttachmentName
- The attachment name.pContentType
- The attachment content type.public java.util.List<EmailAttachment> getAttachments() throws java.sql.SQLException
NotificationPayload
getAttachments
in interface NotificationPayload
java.sql.SQLException
public java.lang.String toString()
BasePOJO
protected void populatePipelineAttachmentsAndNotes(java.lang.Long pGateOrStepId, java.lang.String pObjectType) throws java.sql.SQLException
java.sql.SQLException
protected PipelineStageExecutionSnapshotQueryResultRow getPipelineStageExecutionSnapshotQueryResultRow(java.lang.Long pPipelineStageExecId) throws java.sql.SQLException
java.sql.SQLException
protected java.util.List<NotifScmCommit> toNotifScmCommits(java.util.List<ScmCommitDataObject> pScmCommitDataObjects)