diff --git a/channel/memory/src/main/java/com/blazebit/notify/channel/memory/MemoryChannel.java b/channel/memory/src/main/java/com/blazebit/notify/channel/memory/MemoryChannel.java index 18051cda..860f566d 100644 --- a/channel/memory/src/main/java/com/blazebit/notify/channel/memory/MemoryChannel.java +++ b/channel/memory/src/main/java/com/blazebit/notify/channel/memory/MemoryChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/channel/memory/src/main/java/com/blazebit/notify/channel/memory/MemoryChannelFactory.java b/channel/memory/src/main/java/com/blazebit/notify/channel/memory/MemoryChannelFactory.java index b3036195..2eb9776f 100644 --- a/channel/memory/src/main/java/com/blazebit/notify/channel/memory/MemoryChannelFactory.java +++ b/channel/memory/src/main/java/com/blazebit/notify/channel/memory/MemoryChannelFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/channel/memory/src/main/java/com/blazebit/notify/channel/memory/package-info.java b/channel/memory/src/main/java/com/blazebit/notify/channel/memory/package-info.java index 9f6f1f28..80e33dbe 100644 --- a/channel/memory/src/main/java/com/blazebit/notify/channel/memory/package-info.java +++ b/channel/memory/src/main/java/com/blazebit/notify/channel/memory/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/channel/ses/src/main/java/com/blazebit/notify/channel/ses/SesChannel.java b/channel/ses/src/main/java/com/blazebit/notify/channel/ses/SesChannel.java index 5bd076d4..335b3f15 100644 --- a/channel/ses/src/main/java/com/blazebit/notify/channel/ses/SesChannel.java +++ b/channel/ses/src/main/java/com/blazebit/notify/channel/ses/SesChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/channel/ses/src/main/java/com/blazebit/notify/channel/ses/SesChannelFactory.java b/channel/ses/src/main/java/com/blazebit/notify/channel/ses/SesChannelFactory.java index 196aeccc..cd806aa4 100644 --- a/channel/ses/src/main/java/com/blazebit/notify/channel/ses/SesChannelFactory.java +++ b/channel/ses/src/main/java/com/blazebit/notify/channel/ses/SesChannelFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/channel/ses/src/main/java/com/blazebit/notify/channel/ses/package-info.java b/channel/ses/src/main/java/com/blazebit/notify/channel/ses/package-info.java index 9d5e1216..6261cb35 100644 --- a/channel/ses/src/main/java/com/blazebit/notify/channel/ses/package-info.java +++ b/channel/ses/src/main/java/com/blazebit/notify/channel/ses/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/channel/slack/src/main/java/com/blazebit/notify/channel/slack/SlackChannel.java b/channel/slack/src/main/java/com/blazebit/notify/channel/slack/SlackChannel.java index 8f0fe740..8ca4ab2a 100644 --- a/channel/slack/src/main/java/com/blazebit/notify/channel/slack/SlackChannel.java +++ b/channel/slack/src/main/java/com/blazebit/notify/channel/slack/SlackChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/channel/slack/src/main/java/com/blazebit/notify/channel/slack/SlackChannelFactory.java b/channel/slack/src/main/java/com/blazebit/notify/channel/slack/SlackChannelFactory.java index 2c0b1d65..bb48c08c 100644 --- a/channel/slack/src/main/java/com/blazebit/notify/channel/slack/SlackChannelFactory.java +++ b/channel/slack/src/main/java/com/blazebit/notify/channel/slack/SlackChannelFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/channel/slack/src/main/java/com/blazebit/notify/channel/slack/package-info.java b/channel/slack/src/main/java/com/blazebit/notify/channel/slack/package-info.java index b43b21af..60b6e42a 100644 --- a/channel/slack/src/main/java/com/blazebit/notify/channel/slack/package-info.java +++ b/channel/slack/src/main/java/com/blazebit/notify/channel/slack/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/channel/smtp/src/main/java/com/blazebit/notify/channel/smtp/SmtpChannel.java b/channel/smtp/src/main/java/com/blazebit/notify/channel/smtp/SmtpChannel.java index d7e83fdd..cbc6f327 100644 --- a/channel/smtp/src/main/java/com/blazebit/notify/channel/smtp/SmtpChannel.java +++ b/channel/smtp/src/main/java/com/blazebit/notify/channel/smtp/SmtpChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/channel/smtp/src/main/java/com/blazebit/notify/channel/smtp/SmtpChannelFactory.java b/channel/smtp/src/main/java/com/blazebit/notify/channel/smtp/SmtpChannelFactory.java index d70f82f0..f8c2863c 100644 --- a/channel/smtp/src/main/java/com/blazebit/notify/channel/smtp/SmtpChannelFactory.java +++ b/channel/smtp/src/main/java/com/blazebit/notify/channel/smtp/SmtpChannelFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/channel/smtp/src/main/java/com/blazebit/notify/channel/smtp/SmtpChannelFilter.java b/channel/smtp/src/main/java/com/blazebit/notify/channel/smtp/SmtpChannelFilter.java index 3745f03d..743fed01 100644 --- a/channel/smtp/src/main/java/com/blazebit/notify/channel/smtp/SmtpChannelFilter.java +++ b/channel/smtp/src/main/java/com/blazebit/notify/channel/smtp/SmtpChannelFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/channel/smtp/src/main/java/com/blazebit/notify/channel/smtp/SmtpChannelRecipientPatternFilter.java b/channel/smtp/src/main/java/com/blazebit/notify/channel/smtp/SmtpChannelRecipientPatternFilter.java index 435c60de..9a2b6cf3 100644 --- a/channel/smtp/src/main/java/com/blazebit/notify/channel/smtp/SmtpChannelRecipientPatternFilter.java +++ b/channel/smtp/src/main/java/com/blazebit/notify/channel/smtp/SmtpChannelRecipientPatternFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/channel/smtp/src/main/java/com/blazebit/notify/channel/smtp/package-info.java b/channel/smtp/src/main/java/com/blazebit/notify/channel/smtp/package-info.java index 49446733..ab01793d 100644 --- a/channel/smtp/src/main/java/com/blazebit/notify/channel/smtp/package-info.java +++ b/channel/smtp/src/main/java/com/blazebit/notify/channel/smtp/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/channel/smtp/src/test/java/com/blazebit/notify/channel/smtp/AbstractSmtpChannelIntegrationTest.java b/channel/smtp/src/test/java/com/blazebit/notify/channel/smtp/AbstractSmtpChannelIntegrationTest.java index 60063e54..39cabeb3 100644 --- a/channel/smtp/src/test/java/com/blazebit/notify/channel/smtp/AbstractSmtpChannelIntegrationTest.java +++ b/channel/smtp/src/test/java/com/blazebit/notify/channel/smtp/AbstractSmtpChannelIntegrationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/channel/smtp/src/test/java/com/blazebit/notify/channel/smtp/DefaultEmailNotificationRecipient.java b/channel/smtp/src/test/java/com/blazebit/notify/channel/smtp/DefaultEmailNotificationRecipient.java index 335e7ed1..24c7b25a 100644 --- a/channel/smtp/src/test/java/com/blazebit/notify/channel/smtp/DefaultEmailNotificationRecipient.java +++ b/channel/smtp/src/test/java/com/blazebit/notify/channel/smtp/DefaultEmailNotificationRecipient.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ import java.util.Locale; import java.util.Objects; +import java.util.TimeZone; public class DefaultEmailNotificationRecipient implements EmailNotificationRecipient { @@ -50,6 +51,11 @@ public Locale getLocale() { return Locale.getDefault(); } + @Override + public TimeZone getTimeZone() { + return TimeZone.getDefault(); + } + @Override public boolean equals(Object o) { if (this == o) return true; diff --git a/channel/smtp/src/test/java/com/blazebit/notify/channel/smtp/SmtpChannelIntegrationTest.java b/channel/smtp/src/test/java/com/blazebit/notify/channel/smtp/SmtpChannelIntegrationTest.java index 31d84ddb..a479da68 100644 --- a/channel/smtp/src/test/java/com/blazebit/notify/channel/smtp/SmtpChannelIntegrationTest.java +++ b/channel/smtp/src/test/java/com/blazebit/notify/channel/smtp/SmtpChannelIntegrationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/channel/smtp/src/test/java/com/blazebit/notify/channel/smtp/james/module/MessageSearchIndexModule.java b/channel/smtp/src/test/java/com/blazebit/notify/channel/smtp/james/module/MessageSearchIndexModule.java index 152fd47c..e5b5c213 100644 --- a/channel/smtp/src/test/java/com/blazebit/notify/channel/smtp/james/module/MessageSearchIndexModule.java +++ b/channel/smtp/src/test/java/com/blazebit/notify/channel/smtp/james/module/MessageSearchIndexModule.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/channel/smtp/src/test/java/com/blazebit/notify/channel/smtp/util/ImapMailClient.java b/channel/smtp/src/test/java/com/blazebit/notify/channel/smtp/util/ImapMailClient.java index bc37fe28..2462866d 100644 --- a/channel/smtp/src/test/java/com/blazebit/notify/channel/smtp/util/ImapMailClient.java +++ b/channel/smtp/src/test/java/com/blazebit/notify/channel/smtp/util/ImapMailClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/checkstyle-rules/src/main/resources/blaze-notify/checkstyle-config.xml b/checkstyle-rules/src/main/resources/blaze-notify/checkstyle-config.xml index fca13d42..003d0801 100644 --- a/checkstyle-rules/src/main/resources/blaze-notify/checkstyle-config.xml +++ b/checkstyle-rules/src/main/resources/blaze-notify/checkstyle-config.xml @@ -1,6 +1,6 @@ - - - - - - diff --git a/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/AbstractEmailNotification.java b/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/AbstractEmailNotification.java index 39ec120b..be225ce2 100644 --- a/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/AbstractEmailNotification.java +++ b/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/AbstractEmailNotification.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,12 +25,11 @@ import com.blazebit.notify.email.message.EmailNotificationRecipient; import com.blazebit.notify.memory.model.AbstractNotification; import com.blazebit.notify.template.api.TemplateProcessor; -import com.blazebit.notify.template.api.TemplateProcessorKey; - import java.time.Instant; -import java.util.Collection; +import java.util.ArrayList; +import java.util.List; import java.util.Locale; -import java.util.Map; +import java.util.TimeZone; /** * An abstract class implementing the {@link Notification} interface for E-Mail notifications. @@ -42,33 +41,47 @@ public abstract class AbstractEmailNotification extends AbstractNotification implements ConfigurationSourceProvider { /** - * The parameter name for the template processor type {@link TemplateProcessorKey#getTemplateProcessorResultType()}. + * The parameter name for the template processor type {@link com.blazebit.notify.template.api.TemplateProcessorKey#getTemplateProcessorType()}. */ - public static final String TEMPLATE_PROCESSOR_TYPE_PARAMETER_NAME = "templateProcessorType"; + public static final String TEMPLATE_PROCESSOR_TYPE_PARAMETER = "templateProcessorType"; /** - * The parameter name for the subject which can be a plain {@link String} or a {@link TemplateProcessor}. + * The parameter name for the subject which is a plain {@link String}. + * The value represents the literal subject. */ - public static final String SUBJECT_PARAMETER_NAME = "subject"; + public static final String SUBJECT_PARAMETER = "subject"; /** - * The parameter name for the text body which can be a plain {@link String} or a {@link TemplateProcessor}. + * The parameter name for the subject template which is a plain {@link String}. + * The value refers to a template name. */ - public static final String BODY_TEXT_PARAMETER_NAME = "text"; + public static final String SUBJECT_TEMPLATE_PARAMETER = "subjectTemplate"; /** - * The parameter name for the html body which can be a plain {@link String} or a {@link TemplateProcessor}. + * The parameter name for the text body which is a plain {@link String}. + * The value refers to the literal text body. */ - public static final String BODY_HTML_PARAMETER_NAME = "html"; + public static final String BODY_TEXT_PARAMETER = "text"; /** - * The parameter name for the attachments represented by a {@link TemplateProcessor} producing a collection of {@link Attachment}. + * The parameter name for the text body template which is a plain {@link String}. + * The value refers to a template name. */ - public static final String ATTACHMENTS_PARAMETER_NAME = "attachments"; - + public static final String BODY_TEXT_TEMPLATE_PARAMETER = "textTemplate"; + /** + * The parameter name for the html body which is a plain {@link String}. + * The value refers to the literal html body. + */ + public static final String BODY_HTML_PARAMETER = "html"; + /** + * The parameter name for the html body template which is a plain {@link String}. + * The value refers to a template name. + */ + public static final String BODY_HTML_TEMPLATE_PARAMETER = "htmlTemplate"; + /** + * The parameter name for the attachments which is a collection of plain {@link String}s referring to + * template names. The templates are expected to be processed to a collection of + * {@link Attachment} by a {@link TemplateProcessor}. + */ + public static final String ATTACHMENT_TEMPLATES_PARAMETER = "attachmentTemplates"; private static final long serialVersionUID = 1L; - private static final TemplateProcessor SUBJECT_TEMPLATE_PROCESSOR = new ModelGetOrDelegateTemplateProcessor<>(SUBJECT_PARAMETER_NAME); - private static final TemplateProcessor BODY_TEXT_TEMPLATE_PROCESSOR = new ModelGetOrDelegateTemplateProcessor<>(BODY_TEXT_PARAMETER_NAME); - private static final TemplateProcessor BODY_HTML_TEMPLATE_PROCESSOR = new ModelGetOrDelegateTemplateProcessor<>(BODY_HTML_PARAMETER_NAME); - private static final TemplateProcessor> ATTACHMENTS_TEMPLATE_PROCESSOR = new ModelGetOrDelegateTemplateProcessor<>(ATTACHMENTS_PARAMETER_NAME); - private FromEmail from; private String to; @@ -100,7 +113,7 @@ public void markDone(JobInstanceProcessingContext jobProcessingContext, Objec @Override public NotificationRecipient getRecipient() { - return EmailNotificationRecipient.of(to, Locale.getDefault(), to); + return EmailNotificationRecipient.of(to, Locale.getDefault(), TimeZone.getDefault(), to); } @Override @@ -109,93 +122,39 @@ public ConfigurationSource getConfigurationSource(NotificationJobContext context } /** - * Returns the template processor type to use for subject, text body and html body. + * Returns the template processor type to use for subject, text body. html body and attachments. * * @return the template processor type */ public String getTemplateProcessorType() { - return (String) getJobConfiguration().getParameters().get(TEMPLATE_PROCESSOR_TYPE_PARAMETER_NAME); + return (String) getJobConfiguration().getParameters().get(TEMPLATE_PROCESSOR_TYPE_PARAMETER); } /** - * Sets that subject, text body and html body should be processed by a template processor with the given type. + * Sets that subject, text body, html body and attachments should be processed by a template processor with the given type. * * @param templateProcessorType The template processor type */ public void setTemplateProcessorType(String templateProcessorType) { - getJobConfiguration().getParameters().put(TEMPLATE_PROCESSOR_TYPE_PARAMETER_NAME, templateProcessorType); - } - - /** - * Returns the subject template processor. - * - * @return the subject template processor - */ - public TemplateProcessor getSubjectTemplateProcessor() { - return SUBJECT_TEMPLATE_PROCESSOR; - } - - /** - * Sets the given subject template processor. - * - * @param subjectTemplateProcessor The template processor - */ - public void setSubjectTemplateProcessor(TemplateProcessor subjectTemplateProcessor) { - getJobConfiguration().getParameters().put(SUBJECT_PARAMETER_NAME, subjectTemplateProcessor); - } - - /** - * Returns the text body template processor. - * - * @return the text body template processor - */ - public TemplateProcessor getBodyTextTemplateProcessor() { - return BODY_TEXT_TEMPLATE_PROCESSOR; - } - - /** - * Sets the given text body template processor. - * - * @param bodyTextTemplateProcessor The template processor - */ - public void setBodyTextTemplateProcessor(TemplateProcessor bodyTextTemplateProcessor) { - getJobConfiguration().getParameters().put(BODY_TEXT_PARAMETER_NAME, bodyTextTemplateProcessor); - } - - /** - * Returns the html body template processor. - * - * @return the html body template processor - */ - public TemplateProcessor getBodyHtmlTemplateProcessor() { - return BODY_HTML_TEMPLATE_PROCESSOR; - } - - /** - * Sets the given html body template processor. - * - * @param bodyHtmlTemplateProcessor The template processor - */ - public void setBodyHtmlTemplateProcessor(TemplateProcessor bodyHtmlTemplateProcessor) { - getJobConfiguration().getParameters().put(BODY_HTML_PARAMETER_NAME, bodyHtmlTemplateProcessor); + getJobConfiguration().getParameters().put(TEMPLATE_PROCESSOR_TYPE_PARAMETER, templateProcessorType); } /** - * Returns the attachment template processor. + * Returns the subject template name. * - * @return the attachment template processor + * @return the subject template name */ - public TemplateProcessor> getAttachmentProcessor() { - return ATTACHMENTS_TEMPLATE_PROCESSOR; + public String getSubjectTemplateName() { + return (String) getJobConfiguration().getParameters().get(SUBJECT_TEMPLATE_PARAMETER); } /** - * Sets the given attachment template processor. + * Sets the given subject template name. * - * @param attachmentsTemplateProcessor The template processor + * @param subjectTemplateName The subject template name */ - public void setAttachmentsTemplateProcessor(TemplateProcessor> attachmentsTemplateProcessor) { - getJobConfiguration().getParameters().put(ATTACHMENTS_PARAMETER_NAME, attachmentsTemplateProcessor); + public void setSubjectTemplateName(String subjectTemplateName) { + getJobConfiguration().getParameters().put(SUBJECT_TEMPLATE_PARAMETER, subjectTemplateName); } /** @@ -204,7 +163,7 @@ public void setAttachmentsTemplateProcessor(TemplateProcessor) getJobConfiguration().getParameters().get(SUBJECT_PARAMETER_NAME)).processTemplate(null); + return (String) getJobConfiguration().getParameters().get(SUBJECT_PARAMETER); } /** @@ -213,97 +172,97 @@ public String getSubject() { * @param subject The subject */ public void setSubject(String subject) { - getJobConfiguration().getParameters().put(SUBJECT_PARAMETER_NAME, TemplateProcessor.of(subject)); + getJobConfiguration().getParameters().put(SUBJECT_PARAMETER, subject); } /** - * Returns the text body string. + * Returns the text body template name. * - * @return the text body string + * @return the text body template name */ - public String getBodyText() { - return ((TemplateProcessor) getJobConfiguration().getParameters().get(BODY_TEXT_PARAMETER_NAME)).processTemplate(null); + public String getBodyTextTemplateName() { + return (String) getJobConfiguration().getParameters().get(BODY_TEXT_TEMPLATE_PARAMETER); } /** - * Sets the given text body. + * Sets the given text body template name. * - * @param bodyText The text body + * @param bodyTextTemplateName The text body template name */ - public void setBodyText(String bodyText) { - getJobConfiguration().getParameters().put(BODY_TEXT_PARAMETER_NAME, TemplateProcessor.of(bodyText)); + public void setBodyTextTemplateName(String bodyTextTemplateName) { + getJobConfiguration().getParameters().put(BODY_TEXT_TEMPLATE_PARAMETER, bodyTextTemplateName); } /** - * Returns the html body string. + * Returns the body text string. * - * @return the html body string + * @return the body text string */ - public String getBodyHtml() { - return ((TemplateProcessor) getJobConfiguration().getParameters().get(BODY_HTML_PARAMETER_NAME)).processTemplate(null); + public String getBodyText() { + return (String) getJobConfiguration().getParameters().get(BODY_TEXT_PARAMETER); } /** - * Sets the given html body. + * Sets the given body text. * - * @param bodyHtml The html body + * @param bodyText The body text */ - public void setBodyHtml(String bodyHtml) { - getJobConfiguration().getParameters().put(BODY_HTML_PARAMETER_NAME, TemplateProcessor.of(bodyHtml)); + public void setBodyText(String bodyText) { + getJobConfiguration().getParameters().put(BODY_TEXT_PARAMETER, bodyText); } /** - * Returns the subject template name. + * Returns the html body template name. * - * @return the subject template name + * @return the html body template name */ - public String getSubjectTemplateName() { - return (String) getJobConfiguration().getParameters().get(SUBJECT_PARAMETER_NAME); + public String getBodyHtmlTemplateName() { + return (String) getJobConfiguration().getParameters().get(BODY_HTML_TEMPLATE_PARAMETER); } /** - * Sets the given subject template name. + * Sets the given html body template name. * - * @param subjectTemplateName The subject template name + * @param bodyHtmlTemplateName The html body template name */ - public void setSubjectTemplateName(String subjectTemplateName) { - getJobConfiguration().getParameters().put(SUBJECT_PARAMETER_NAME, subjectTemplateName); + public void setBodyHtmlTemplateName(String bodyHtmlTemplateName) { + getJobConfiguration().getParameters().put(BODY_HTML_TEMPLATE_PARAMETER, bodyHtmlTemplateName); } /** - * Returns the text body template name. + * Returns the body html string. * - * @return the text body template name + * @return the body html string */ - public String getBodyTextTemplateName() { - return (String) getJobConfiguration().getParameters().get(BODY_TEXT_PARAMETER_NAME); + public String getBodyHtml() { + return (String) getJobConfiguration().getParameters().get(BODY_HTML_PARAMETER); } /** - * Sets the given text body template name. + * Sets the given body html. * - * @param bodyTextTemplateName The text body template name + * @param bodyHtml The body html */ - public void setBodyTextTemplateName(String bodyTextTemplateName) { - getJobConfiguration().getParameters().put(BODY_TEXT_PARAMETER_NAME, bodyTextTemplateName); + public void setBodyHtml(String bodyHtml) { + getJobConfiguration().getParameters().put(BODY_HTML_PARAMETER, bodyHtml); } /** - * Returns the html body template name. + * Returns the attachment template names. * - * @return the html body template name + * @return the attachment template names */ - public String getBodyHtmlTemplateName() { - return (String) getJobConfiguration().getParameters().get(BODY_HTML_PARAMETER_NAME); + public List getAttachmentTemplates() { + return (List) getJobConfiguration().getParameters().get(ATTACHMENT_TEMPLATES_PARAMETER); } /** - * Sets the given html body template name. + * Sets the attachment template names. * - * @param bodyHtmlTemplateName The html body template name + * @param attachmentTemplates The attachment template names */ - public void setBodyHtmlTemplateName(String bodyHtmlTemplateName) { - getJobConfiguration().getParameters().put(BODY_HTML_PARAMETER_NAME, bodyHtmlTemplateName); + public void setAttachmentTemplates(List attachmentTemplates) { + getJobConfiguration().getParameters().put(ATTACHMENT_TEMPLATES_PARAMETER, new ArrayList<>(attachmentTemplates)); } /** @@ -431,29 +390,4 @@ public EmailNotificationReviewState getReviewState() { public void setReviewState(EmailNotificationReviewState reviewState) { this.reviewState = reviewState; } - - /** - * A template processor delegating to a parameter of the model map. - * - * @author Christian Beikov - * @since 1.0.0 - */ - private static class ModelGetOrDelegateTemplateProcessor implements TemplateProcessor { - - private final String parameter; - - public ModelGetOrDelegateTemplateProcessor(String parameter) { - this.parameter = parameter; - } - - @Override - public T processTemplate(Map model) { - Object o = model.get(parameter); - if (o instanceof TemplateProcessor) { - return ((TemplateProcessor) o).processTemplate(model); - } else { - return (T) o; - } - } - } } diff --git a/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/EmailAddress.java b/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/EmailAddress.java deleted file mode 100644 index d97e8446..00000000 --- a/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/EmailAddress.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 2018 - 2022 Blazebit. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.blazebit.notify.email.model.memory; - -/** - * An model for the state of E-Mail addresses. - * - * @author Christian Beikov - * @since 1.0.0 - */ -public class EmailAddress { - - private static final long serialVersionUID = 1L; - - /** - * Whether the current email address is verified. - */ - private Boolean verified = false; - /** - * Email addresses can be suppressed when emails to the address bounce or - * complaints are received. - */ - private Boolean suppressed = false; - - /** - * Creates an empty E-Mail address. - */ - public EmailAddress() { - } - - /** - * Creates an E-Mail address. - * - * @param email The E-Mail address - * @param verified Whether the E-Mail address is verified - * @param suppressed Whether the E-Mail address is suppressed - */ - public EmailAddress(String email, Boolean verified, Boolean suppressed) { - this.verified = verified; - this.suppressed = suppressed; - } - - /** - * Create a verified E-Mail address. - * - * @param address The E-Mail address - * @return a verified E-Mail address - */ - public static EmailAddress verified(String address) { - return new EmailAddress(address, true, false); - } - - /** - * Create a unverified E-Mail address. - * - * @param address The E-Mail address - * @return a unverified E-Mail address - */ - public static EmailAddress unverified(String address) { - return new EmailAddress(address, false, false); - } - - /** - * Returns whether the E-Mail address is verified. - * - * @return whether the E-Mail address is verified - */ - public Boolean getVerified() { - return verified; - } - - /** - * Sets whether the E-Mail address is verified. - * - * @param verified Whether the E-Mail address is verified - */ - public void setVerified(Boolean verified) { - this.verified = verified; - } - - /** - * Returns whether the E-Mail address is suppressed. - * - * @return whether the E-Mail address is suppressed - */ - public Boolean getSuppressed() { - return suppressed; - } - - /** - * Sets whether the E-Mail address is suppressed. - * - * @param suppressed Whether the E-Mail address is suppressed - */ - public void setSuppressed(Boolean suppressed) { - this.suppressed = suppressed; - } - - -} diff --git a/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/EmailEventHandler.java b/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/EmailEventHandler.java index 343e4c2f..dd8d28e5 100644 --- a/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/EmailEventHandler.java +++ b/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/EmailEventHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/EmailNotification.java b/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/EmailNotification.java deleted file mode 100644 index 1a7ffe1a..00000000 --- a/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/EmailNotification.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2018 - 2022 Blazebit. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.blazebit.notify.email.model.memory; - -import com.blazebit.notify.ConfigurationSourceProvider; - -/** - * A simple E-Mail notification. - * - * @author Christian Beikov - * @since 1.0.0 - */ -public class EmailNotification extends AbstractEmailNotification implements ConfigurationSourceProvider { - - private static final long serialVersionUID = 1L; - - /** - * Creates a E-Mail notification with the given id. - * - * @param id The notification id - */ - public EmailNotification(Long id) { - super(id); - } - - @Override - public Long getPartitionKey() { - return getId(); - } -} diff --git a/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/EmailNotificationConfigurationSource.java b/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/EmailNotificationConfigurationSource.java index 3d84bcc9..f541a417 100644 --- a/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/EmailNotificationConfigurationSource.java +++ b/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/EmailNotificationConfigurationSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,12 +46,15 @@ public EmailNotificationConfigurationSource(AbstractEmailNotification emailNo // properties.put(EmailNotificationMessageResolver.EMAIL_MESSAGE_RESOURCE_BUNDLE_PROPERTY, null); // properties.put(EmailNotificationMessageResolver.EMAIL_TEMPLATE_CONTEXT_PROPERTY, null); - properties.put(EmailNotificationMessageResolver.EMAIL_TEMPLATE_PROCESSOR_FACTORY_PROPERTY, emailNotification.getTemplateProcessorType()); + properties.put(EmailNotificationMessageResolver.EMAIL_TEMPLATE_PROCESSOR_TYPE_PROPERTY, emailNotification.getTemplateProcessorType()); - properties.put(EmailNotificationMessageResolver.EMAIL_MESSAGE_SUBJECT_PROPERTY, emailNotification.getJobConfiguration().getParameters().get(AbstractEmailNotification.SUBJECT_PARAMETER_NAME)); - properties.put(EmailNotificationMessageResolver.EMAIL_MESSAGE_TEXT_PROPERTY, emailNotification.getJobConfiguration().getParameters().get(AbstractEmailNotification.BODY_TEXT_PARAMETER_NAME)); - properties.put(EmailNotificationMessageResolver.EMAIL_MESSAGE_HTML_PROPERTY, emailNotification.getJobConfiguration().getParameters().get(AbstractEmailNotification.BODY_HTML_PARAMETER_NAME)); - properties.put(EmailNotificationMessageResolver.EMAIL_MESSAGE_ATTACHMENT_PROCESSORS_PROPERTY, emailNotification.getAttachmentProcessor()); + properties.put(EmailNotificationMessageResolver.EMAIL_MESSAGE_SUBJECT_PROPERTY, emailNotification.getJobConfiguration().getParameters().get(AbstractEmailNotification.SUBJECT_PARAMETER)); + properties.put(EmailNotificationMessageResolver.EMAIL_MESSAGE_SUBJECT_TEMPLATE_PROPERTY, emailNotification.getJobConfiguration().getParameters().get(AbstractEmailNotification.SUBJECT_TEMPLATE_PARAMETER)); + properties.put(EmailNotificationMessageResolver.EMAIL_MESSAGE_TEXT_PROPERTY, emailNotification.getJobConfiguration().getParameters().get(AbstractEmailNotification.BODY_TEXT_PARAMETER)); + properties.put(EmailNotificationMessageResolver.EMAIL_MESSAGE_TEXT_TEMPLATE_PROPERTY, emailNotification.getJobConfiguration().getParameters().get(AbstractEmailNotification.BODY_TEXT_TEMPLATE_PARAMETER)); + properties.put(EmailNotificationMessageResolver.EMAIL_MESSAGE_HTML_PROPERTY, emailNotification.getJobConfiguration().getParameters().get(AbstractEmailNotification.BODY_HTML_PARAMETER)); + properties.put(EmailNotificationMessageResolver.EMAIL_MESSAGE_HTML_TEMPLATE_PROPERTY, emailNotification.getJobConfiguration().getParameters().get(AbstractEmailNotification.BODY_HTML_TEMPLATE_PARAMETER)); + properties.put(EmailNotificationMessageResolver.EMAIL_MESSAGE_ATTACHMENT_TEMPLATES_PROPERTY, emailNotification.getJobConfiguration().getParameters().get(AbstractEmailNotification.ATTACHMENT_TEMPLATES_PARAMETER)); this.properties = properties; } diff --git a/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/EmailNotificationDeliveryState.java b/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/EmailNotificationDeliveryState.java index 46d8cb00..8d2efc72 100644 --- a/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/EmailNotificationDeliveryState.java +++ b/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/EmailNotificationDeliveryState.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/EmailNotificationReviewState.java b/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/EmailNotificationReviewState.java index 6d787102..7436e83c 100644 --- a/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/EmailNotificationReviewState.java +++ b/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/EmailNotificationReviewState.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/FromEmail.java b/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/FromEmail.java index 41a6da91..86791845 100644 --- a/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/FromEmail.java +++ b/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/FromEmail.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/package-info.java b/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/package-info.java index 2418b1e8..d2fb6e68 100644 --- a/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/package-info.java +++ b/email/model/memory/src/main/java/com/blazebit/notify/email/model/memory/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailBounceEvent.java b/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailBounceEvent.java index a72d7289..2ec0ae4c 100644 --- a/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailBounceEvent.java +++ b/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailBounceEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailComplaintEvent.java b/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailComplaintEvent.java index 820009cb..8be6cefc 100644 --- a/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailComplaintEvent.java +++ b/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailComplaintEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailDeliveryEvent.java b/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailDeliveryEvent.java index f176aa7f..3438e6f9 100644 --- a/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailDeliveryEvent.java +++ b/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailDeliveryEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailEvent.java b/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailEvent.java index 9373ab9d..e72e0fa3 100644 --- a/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailEvent.java +++ b/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailEventBounceRecipient.java b/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailEventBounceRecipient.java index 28ba6079..5d574ad1 100644 --- a/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailEventBounceRecipient.java +++ b/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailEventBounceRecipient.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailEventBounceSubType.java b/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailEventBounceSubType.java index 481c8883..80dd4748 100644 --- a/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailEventBounceSubType.java +++ b/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailEventBounceSubType.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailEventBounceType.java b/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailEventBounceType.java index dcb48899..6720ae8b 100644 --- a/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailEventBounceType.java +++ b/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailEventBounceType.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailEventComplaintFeedbackType.java b/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailEventComplaintFeedbackType.java index 311cf397..6f4e1609 100644 --- a/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailEventComplaintFeedbackType.java +++ b/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailEventComplaintFeedbackType.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailEventNotificationType.java b/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailEventNotificationType.java index 4b4746e1..f3f0146f 100644 --- a/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailEventNotificationType.java +++ b/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/EmailEventNotificationType.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/SnsSqsFeedbackConsumerListener.java b/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/SnsSqsFeedbackConsumerListener.java index 4d94de49..25ec27c2 100644 --- a/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/SnsSqsFeedbackConsumerListener.java +++ b/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/SnsSqsFeedbackConsumerListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/package-info.java b/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/package-info.java index 9813deaf..1ef2b1f4 100644 --- a/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/package-info.java +++ b/email/sns-sqs-feedback/src/main/java/com/blazebit/notify/email/sns/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractJobInstanceBasedNotification.java b/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractJobInstanceBasedNotification.java index 2501dffb..501fb721 100644 --- a/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractJobInstanceBasedNotification.java +++ b/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractJobInstanceBasedNotification.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractNotification.java b/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractNotification.java index 58cca3e5..c51a8810 100644 --- a/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractNotification.java +++ b/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractNotification.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractNotificationId.java b/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractNotificationId.java index 7c76ec47..c176e276 100644 --- a/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractNotificationId.java +++ b/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractNotificationId.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractNotificationJob.java b/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractNotificationJob.java index 88f44c99..3214d2b9 100644 --- a/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractNotificationJob.java +++ b/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractNotificationJob.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractNotificationJobInstance.java b/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractNotificationJobInstance.java index 730242e8..ca68cb58 100644 --- a/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractNotificationJobInstance.java +++ b/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractNotificationJobInstance.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,9 +20,6 @@ import com.blazebit.job.jpa.model.AbstractJobInstance; import com.blazebit.notify.NotificationJobInstance; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; import javax.persistence.MappedSuperclass; import javax.persistence.Transient; @@ -55,12 +52,6 @@ public AbstractNotificationJobInstance(Long id) { super(id); } - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "idGenerator") - public Long getId() { - return id(); - } - @Override @Transient public R getLastProcessed() { diff --git a/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractNotificationJobTrigger.java b/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractNotificationJobTrigger.java index fd79ca54..c08d04b7 100644 --- a/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractNotificationJobTrigger.java +++ b/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractNotificationJobTrigger.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractNotificationRecipient.java b/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractNotificationRecipient.java index 56cef2f3..280f3f81 100644 --- a/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractNotificationRecipient.java +++ b/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractNotificationRecipient.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,10 +19,8 @@ import com.blazebit.job.jpa.model.BaseEntity; import com.blazebit.notify.NotificationRecipient; +import java.util.TimeZone; import javax.persistence.Column; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; import javax.persistence.MappedSuperclass; import java.util.Locale; @@ -36,6 +34,7 @@ public abstract class AbstractNotificationRecipient extends BaseEntity implements NotificationRecipient { private Locale locale; + private TimeZone timeZone; /** * Creates an empty notification recipient. @@ -52,12 +51,6 @@ public AbstractNotificationRecipient(Long id) { super(id); } - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "idGenerator") - public Long getId() { - return id(); - } - @Override @Column(nullable = false) public Locale getLocale() { @@ -72,4 +65,14 @@ public Locale getLocale() { public void setLocale(Locale locale) { this.locale = locale; } + + @Override + @Column(nullable = false) + public TimeZone getTimeZone() { + return timeZone; + } + + public void setTimeZone(TimeZone timeZone) { + this.timeZone = timeZone; + } } diff --git a/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractTriggerBasedNotificationJobInstance.java b/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractTriggerBasedNotificationJobInstance.java index 7ae2a922..b85698da 100644 --- a/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractTriggerBasedNotificationJobInstance.java +++ b/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/AbstractTriggerBasedNotificationJobInstance.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/package-info.java b/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/package-info.java index 50bafbc9..69976651 100644 --- a/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/package-info.java +++ b/jpa/model/base/src/main/java/com/blazebit/notify/jpa/model/base/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jpa/model/expression/src/main/java/com/blazebit/notify/jpa/model/expression/AbstractExpressionAwareNotificationJob.java b/jpa/model/expression/src/main/java/com/blazebit/notify/jpa/model/expression/AbstractExpressionAwareNotificationJob.java index 384f2c07..66956d80 100644 --- a/jpa/model/expression/src/main/java/com/blazebit/notify/jpa/model/expression/AbstractExpressionAwareNotificationJob.java +++ b/jpa/model/expression/src/main/java/com/blazebit/notify/jpa/model/expression/AbstractExpressionAwareNotificationJob.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jpa/model/expression/src/main/java/com/blazebit/notify/jpa/model/expression/AbstractExpressionAwareNotificationJobInstance.java b/jpa/model/expression/src/main/java/com/blazebit/notify/jpa/model/expression/AbstractExpressionAwareNotificationJobInstance.java index 02a72a9f..427151b1 100644 --- a/jpa/model/expression/src/main/java/com/blazebit/notify/jpa/model/expression/AbstractExpressionAwareNotificationJobInstance.java +++ b/jpa/model/expression/src/main/java/com/blazebit/notify/jpa/model/expression/AbstractExpressionAwareNotificationJobInstance.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jpa/model/expression/src/main/java/com/blazebit/notify/jpa/model/expression/package-info.java b/jpa/model/expression/src/main/java/com/blazebit/notify/jpa/model/expression/package-info.java index c9213ea1..584a5a5b 100644 --- a/jpa/model/expression/src/main/java/com/blazebit/notify/jpa/model/expression/package-info.java +++ b/jpa/model/expression/src/main/java/com/blazebit/notify/jpa/model/expression/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jpa/storage/src/main/java/com/blazebit/notify/jpa/storage/JpaNotificationPartitionKeyProvider.java b/jpa/storage/src/main/java/com/blazebit/notify/jpa/storage/JpaNotificationPartitionKeyProvider.java index fe5e6350..84d2833a 100644 --- a/jpa/storage/src/main/java/com/blazebit/notify/jpa/storage/JpaNotificationPartitionKeyProvider.java +++ b/jpa/storage/src/main/java/com/blazebit/notify/jpa/storage/JpaNotificationPartitionKeyProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jpa/storage/src/main/java/com/blazebit/notify/jpa/storage/JpaNotificationPartitionKeyProviderFactory.java b/jpa/storage/src/main/java/com/blazebit/notify/jpa/storage/JpaNotificationPartitionKeyProviderFactory.java index 311d627d..985f565d 100644 --- a/jpa/storage/src/main/java/com/blazebit/notify/jpa/storage/JpaNotificationPartitionKeyProviderFactory.java +++ b/jpa/storage/src/main/java/com/blazebit/notify/jpa/storage/JpaNotificationPartitionKeyProviderFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/jpa/storage/src/main/java/com/blazebit/notify/jpa/storage/package-info.java b/jpa/storage/src/main/java/com/blazebit/notify/jpa/storage/package-info.java index 1706bad2..9e6d9621 100644 --- a/jpa/storage/src/main/java/com/blazebit/notify/jpa/storage/package-info.java +++ b/jpa/storage/src/main/java/com/blazebit/notify/jpa/storage/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 - 2022 Blazebit. + * Copyright 2018 - 2023 Blazebit. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/license-header-definition.xml b/license-header-definition.xml index 5997d798..784066a0 100644 --- a/license-header-definition.xml +++ b/license-header-definition.xml @@ -1,6 +1,6 @@