Skip to content

Commit

Permalink
Add deprecated tag in relevant methods and add descriptive comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaura committed Dec 6, 2024
1 parent d087f1b commit e631725
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ default List<EmailTemplate> getEmailTemplateType(String templateDisplayName, Str
}

/**
* @deprecated Use {@link #getEmailTemplateType(String, String, String, boolean)} instead.
* <p>
* Get all email templates of a specific template type for an application, from tenant registry.
*
* @param templateDisplayName Email template type displace name.
Expand All @@ -137,6 +139,7 @@ default List<EmailTemplate> getEmailTemplateType(String templateDisplayName, Str
* @return A list of email templates that matches to the provided template type.
* @throws I18nEmailMgtException if an error occurred.
*/
@Deprecated
default List<EmailTemplate> getEmailTemplateType(
String templateDisplayName, String tenantDomain, String applicationUuid) throws I18nEmailMgtException {

Expand Down Expand Up @@ -247,6 +250,8 @@ void deleteEmailTemplate(String templateTypeName,
String applicationUuid) throws I18nEmailMgtException;

/**
* @deprecated Use {@link #getEmailTemplate(String, String, String, String, boolean)} instead.
* <p>
* Get an email template from tenant registry with application UUID.
*
* @param templateType Email template type.
Expand All @@ -256,6 +261,7 @@ void deleteEmailTemplate(String templateTypeName,
* @return Email template of the application with fallback to organization template.
* @throws I18nEmailMgtException If an error occurred while getting the email template.
*/
@Deprecated
EmailTemplate getEmailTemplate(String templateType,
String locale,
String tenantDomain,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,21 +192,28 @@ public List<EmailTemplate> getAllEmailTemplates(String tenantDomain) throws I18n
public EmailTemplate getEmailTemplate(String templateDisplayName, String locale, String tenantDomain)
throws I18nEmailMgtException {

/* When resolve param is not specified, the default behavior results in resolved templates,
since resolved templates are always required when sending emails at runtime. */
return getEmailTemplate(templateDisplayName, locale, tenantDomain, null, true);
}

@Override
public List<EmailTemplate> getEmailTemplateType(String templateDisplayName, String tenantDomain)
throws I18nEmailMgtException {

/* When resolve param is not specified, the default behavior results in resolved templates,
since resolved templates are always required when sending emails at runtime. */
return getEmailTemplateType(templateDisplayName, tenantDomain, null, true);
}

@Deprecated
@Override
public List<EmailTemplate> getEmailTemplateType(String templateDisplayName, String tenantDomain,
String applicationUuid) throws I18nEmailMgtException {

return getEmailTemplateType(templateDisplayName, tenantDomain, applicationUuid, false);
/* When resolve param is not specified, the default behavior results in resolved templates,
since resolved templates are always required when sending emails at runtime. */
return getEmailTemplateType(templateDisplayName, tenantDomain, applicationUuid, true);
}

@Override
Expand Down Expand Up @@ -260,15 +267,20 @@ public NotificationTemplate getNotificationTemplate(String notificationChannel,
String tenantDomain)
throws NotificationTemplateManagerException {

/* When resolve param is not specified, the default behavior results in resolved templates,
since resolved templates are always required when sending emails at runtime. */
return getNotificationTemplate(notificationChannel, templateType, locale, tenantDomain, null, true);
}

@Deprecated
@Override
public NotificationTemplate getNotificationTemplate(String notificationChannel, String templateType, String locale,
String tenantDomain, String applicationUuid)
throws NotificationTemplateManagerException {

return getNotificationTemplate(notificationChannel, templateType, locale, tenantDomain, applicationUuid, false);
/* When resolve param is not specified, the default behavior results in resolved templates,
since resolved templates are always required when sending emails at runtime. */
return getNotificationTemplate(notificationChannel, templateType, locale, tenantDomain, applicationUuid, true);
}

@Override
Expand Down Expand Up @@ -584,11 +596,14 @@ public void deleteEmailTemplate(String templateTypeName, String localeCode, Stri
}
}

@Deprecated
@Override
public EmailTemplate getEmailTemplate(String templateType, String locale, String tenantDomain,
String applicationUuid) throws I18nEmailMgtException {

return getEmailTemplate(templateType, locale, tenantDomain, applicationUuid, false);
/* When resolve param is not specified, the default behavior results in resolved templates,
since resolved templates are always required when sending emails at runtime. */
return getEmailTemplate(templateType, locale, tenantDomain, applicationUuid, true);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,13 @@ public boolean isNotificationTemplateTypeExists(String notificationChannel, Stri
/**
* {@inheritDoc}
*/
@Deprecated
@Override
public List<NotificationTemplate> getAllNotificationTemplates(String notificationChannel, String tenantDomain)
throws NotificationTemplateManagerException {

/* When resolve param is not specified, the default behavior results in unresolved templates,
maintaining backward compatibility with the previous behavior of the method. */
return getAllNotificationTemplates(notificationChannel, tenantDomain, false);
}

Expand Down Expand Up @@ -218,12 +221,15 @@ public List<NotificationTemplate> getNotificationTemplatesOfType(String notifica
/**
* {@inheritDoc}
*/
@Deprecated
@Override
public List<NotificationTemplate> getNotificationTemplatesOfType(String notificationChannel,
String templateDisplayName, String tenantDomain,
String applicationUuid)
throws NotificationTemplateManagerException {

/* When resolve param is not specified, the default behavior results in unresolved templates,
maintaining backward compatibility with the previous behavior of the method. */
return getNotificationTemplatesOfType(notificationChannel, templateDisplayName, tenantDomain, applicationUuid,
false);
}
Expand Down Expand Up @@ -261,11 +267,14 @@ public NotificationTemplate getNotificationTemplate(String notificationChannel,
/**
* {@inheritDoc}
*/
@Deprecated
@Override
public NotificationTemplate getNotificationTemplate(String notificationChannel, String templateType, String locale,
String tenantDomain, String applicationUuid)
throws NotificationTemplateManagerException {

// When resolve param is not specified, the default behavior results in unresolved template,
// maintaining backward compatibility with the previous behavior of the method.
return getNotificationTemplate(notificationChannel, templateType, locale, tenantDomain, applicationUuid, false);
}

Expand Down

0 comments on commit e631725

Please sign in to comment.