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 |
addRecipientsForPipelineStepExecFailure(java.lang.Long pRelDefinitionId,
OnErrorType pOnError,
java.lang.Long pPipelineDefinitionId,
java.lang.Long pPipelineStageExecId) |
protected PipelineRoleScriptResult |
evaluatePipelineRoleScript(java.lang.Long pRelDefinitionId,
java.lang.Long pPipelineDefinitionId,
java.lang.Long pPipelineStageExecId,
java.lang.String pScript) |
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.util.List<InputField> |
getInputFieldsForStep(PipelineExecutionUnitTypes pType,
java.io.Serializable pData) |
protected java.lang.Long |
getManualStepRoleByStepId(java.lang.Long pPipelineStageStepId) |
protected java.lang.String |
getPipelineRoleScriptForGate(PipelineExecutionUnitTypes pType,
java.io.Serializable pData) |
protected java.lang.String |
getPipelineRoleScriptForStep(PipelineExecutionUnitTypes pType,
java.io.Serializable pData) |
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.util.List<java.lang.Long> pPipelineRoleIds) |
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)
pNotificationEventTypeEnum
- 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 addRecipientsForPipelineStepExecFailure(java.lang.Long pRelDefinitionId, OnErrorType pOnError, java.lang.Long pPipelineDefinitionId, java.lang.Long pPipelineStageExecId) throws java.sql.SQLException
java.sql.SQLException
protected PipelineRoleScriptResult evaluatePipelineRoleScript(java.lang.Long pRelDefinitionId, java.lang.Long pPipelineDefinitionId, java.lang.Long pPipelineStageExecId, java.lang.String pScript) 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.util.List<java.lang.Long> pPipelineRoleIds) 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)
protected java.lang.String getPipelineRoleScriptForGate(PipelineExecutionUnitTypes pType, java.io.Serializable pData)
protected java.lang.String getPipelineRoleScriptForStep(PipelineExecutionUnitTypes pType, java.io.Serializable pData)
protected java.util.List<InputField> getInputFieldsForStep(PipelineExecutionUnitTypes pType, java.io.Serializable pData)