From ad64ed12ba38b8c37f20eab2822a82a7d397195e Mon Sep 17 00:00:00 2001 From: Avarjana Date: Tue, 27 Feb 2024 10:02:42 +0530 Subject: [PATCH 1/2] Introduce application templates --- .../NotificationTemplateManager.java | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/components/org.wso2.carbon.identity.governance/src/main/java/org/wso2/carbon/identity/governance/service/notification/NotificationTemplateManager.java b/components/org.wso2.carbon.identity.governance/src/main/java/org/wso2/carbon/identity/governance/service/notification/NotificationTemplateManager.java index 7259d3bb84..953d449d6e 100644 --- a/components/org.wso2.carbon.identity.governance/src/main/java/org/wso2/carbon/identity/governance/service/notification/NotificationTemplateManager.java +++ b/components/org.wso2.carbon.identity.governance/src/main/java/org/wso2/carbon/identity/governance/service/notification/NotificationTemplateManager.java @@ -42,6 +42,24 @@ default NotificationTemplate getNotificationTemplate(String notificationChannel, return null; } + /** + * Return the notification template from the tenant registry which matches the given channel and template name. + * + * @param notificationChannel Notification Channel Name (Eg: SMS or EMAIL) + * @param templateType Display name of the template + * @param locale Locale + * @param tenantDomain Tenant Domain + * @param applicationUuid Application UUID + * @return Return {@link org.wso2.carbon.identity.governance.model.NotificationTemplate} object + * @throws NotificationTemplateManagerException If an error occurred while getting the notification template + */ + default NotificationTemplate getNotificationTemplate(String notificationChannel, String templateType, String locale, + String tenantDomain, String applicationUuid) + throws NotificationTemplateManagerException { + + return null; + } + /** * Add the notification template to the registry. * @@ -55,6 +73,19 @@ default void addNotificationTemplate(NotificationTemplate notificationTemplate, } + /** + * Add the notification template to the registry. + * + * @param notificationTemplate Notification template + * @param tenantDomain Tenant domain + * @param applicationUuid Application UUID + * @throws NotificationTemplateManagerException If an error occurred while adding the notification template. + */ + default void addNotificationTemplate(NotificationTemplate notificationTemplate, String tenantDomain, + String applicationUuid) throws NotificationTemplateManagerException { + + } + /** * Add a new notification template to the registry to the corresponding notification channel root directory. * @@ -91,4 +122,19 @@ default List getDefaultNotificationTemplates(String notifi return null; } + + /** + * Add a new notification template to the registry to the corresponding notification channel root directory. + * + * @param displayName Notification template display name + * @param notificationChannel Notification channel + * @param tenantDomain Tenant domain + * @param applicationUuid Application UUID + * @throws NotificationTemplateManagerException If an error occurred while adding the template to the registry + */ + default void addNotificationTemplateType(String displayName, String notificationChannel, + String tenantDomain, String applicationUuid) + throws NotificationTemplateManagerException { + + } } From 58587abf4c12a0b457e48a41093beb5709daa915 Mon Sep 17 00:00:00 2001 From: Avarjana Date: Mon, 4 Mar 2024 13:54:00 +0530 Subject: [PATCH 2/2] Address review comments --- .../NotificationTemplateManager.java | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/components/org.wso2.carbon.identity.governance/src/main/java/org/wso2/carbon/identity/governance/service/notification/NotificationTemplateManager.java b/components/org.wso2.carbon.identity.governance/src/main/java/org/wso2/carbon/identity/governance/service/notification/NotificationTemplateManager.java index 953d449d6e..abf5eca938 100644 --- a/components/org.wso2.carbon.identity.governance/src/main/java/org/wso2/carbon/identity/governance/service/notification/NotificationTemplateManager.java +++ b/components/org.wso2.carbon.identity.governance/src/main/java/org/wso2/carbon/identity/governance/service/notification/NotificationTemplateManager.java @@ -45,13 +45,13 @@ default NotificationTemplate getNotificationTemplate(String notificationChannel, /** * Return the notification template from the tenant registry which matches the given channel and template name. * - * @param notificationChannel Notification Channel Name (Eg: SMS or EMAIL) - * @param templateType Display name of the template - * @param locale Locale - * @param tenantDomain Tenant Domain - * @param applicationUuid Application UUID - * @return Return {@link org.wso2.carbon.identity.governance.model.NotificationTemplate} object - * @throws NotificationTemplateManagerException If an error occurred while getting the notification template + * @param notificationChannel Notification Channel Name (Eg: SMS or EMAIL). + * @param templateType Display name of the template. + * @param locale Locale. + * @param tenantDomain Tenant Domain. + * @param applicationUuid Application UUID. + * @return Return {@link org.wso2.carbon.identity.governance.model.NotificationTemplate} object. + * @throws NotificationTemplateManagerException If an error occurred while getting the notification template. */ default NotificationTemplate getNotificationTemplate(String notificationChannel, String templateType, String locale, String tenantDomain, String applicationUuid) @@ -76,9 +76,9 @@ default void addNotificationTemplate(NotificationTemplate notificationTemplate, /** * Add the notification template to the registry. * - * @param notificationTemplate Notification template - * @param tenantDomain Tenant domain - * @param applicationUuid Application UUID + * @param notificationTemplate Notification template. + * @param tenantDomain Tenant domain. + * @param applicationUuid Application UUID. * @throws NotificationTemplateManagerException If an error occurred while adding the notification template. */ default void addNotificationTemplate(NotificationTemplate notificationTemplate, String tenantDomain, @@ -126,11 +126,11 @@ default List getDefaultNotificationTemplates(String notifi /** * Add a new notification template to the registry to the corresponding notification channel root directory. * - * @param displayName Notification template display name - * @param notificationChannel Notification channel - * @param tenantDomain Tenant domain - * @param applicationUuid Application UUID - * @throws NotificationTemplateManagerException If an error occurred while adding the template to the registry + * @param displayName Notification template display name. + * @param notificationChannel Notification channel (Eg: SMS, EMAIL). + * @param tenantDomain Tenant domain. + * @param applicationUuid Application UUID. + * @throws NotificationTemplateManagerException If an error occurred while adding the template to the registry. */ default void addNotificationTemplateType(String displayName, String notificationChannel, String tenantDomain, String applicationUuid)