Change-Id: Iaaf16a8e7e30174509cfb40702185c9b2fc2961a
Issue-ID: POLICY-1432
Signed-off-by: burdziak <olaf.burdziakowski@nokia.com>
private static final String ACTIVE_VERSION = "Active Version : ";
private static final String SCOPE_POLICY_NAME = "Scope + Policy Name : ";
private static final String DELETED_TIME = "Deleted Time : ";
private static final String ACTIVE_VERSION = "Active Version : ";
private static final String SCOPE_POLICY_NAME = "Scope + Policy Name : ";
private static final String DELETED_TIME = "Deleted Time : ";
+ private static final String DELETED_BY = "Deleted By : ";
private static Logger policyLogger = FlexLogger.getLogger(PolicyNotificationMail.class);
@Bean
private static Logger policyLogger = FlexLogger.getLogger(PolicyNotificationMail.class);
@Bean
if("DeleteAll".equalsIgnoreCase(mode)){
subject = "Policy has been Deleted : "+entityItem.getPolicyName();
message = POLICY_WATCHING_MESSAGE + PolicyController.getSmtpApplicationName() + " has been Deleted with All Versions" + '\n' + '\n' + '\n'+ SCOPE_POLICY_NAME + policyName + '\n'
if("DeleteAll".equalsIgnoreCase(mode)){
subject = "Policy has been Deleted : "+entityItem.getPolicyName();
message = POLICY_WATCHING_MESSAGE + PolicyController.getSmtpApplicationName() + " has been Deleted with All Versions" + '\n' + '\n' + '\n'+ SCOPE_POLICY_NAME + policyName + '\n'
- + '\n' + '\n' + "Deleted By : " +entityItem.getModifiedBy() + '\n' + DELETED_TIME +dateFormat.format(date) + '\n' + '\n' + '\n' + '\n' + EMAIL_MESSAGE_POSTSCRIPT;
+ + '\n' + '\n' + DELETED_BY +entityItem.getModifiedBy() + '\n' + DELETED_TIME +dateFormat.format(date) + '\n' + '\n' + '\n' + '\n' + EMAIL_MESSAGE_POSTSCRIPT;
}
if("DeleteOne".equalsIgnoreCase(mode)){
subject = "Policy has been Deleted : "+entityItem.getPolicyName();
message = POLICY_WATCHING_MESSAGE + PolicyController.getSmtpApplicationName() + " has been Deleted" + '\n' + '\n' + '\n'+ SCOPE_POLICY_NAME + policyName + '\n' +"Policy Version : " +entityItem.getActiveVersion()
}
if("DeleteOne".equalsIgnoreCase(mode)){
subject = "Policy has been Deleted : "+entityItem.getPolicyName();
message = POLICY_WATCHING_MESSAGE + PolicyController.getSmtpApplicationName() + " has been Deleted" + '\n' + '\n' + '\n'+ SCOPE_POLICY_NAME + policyName + '\n' +"Policy Version : " +entityItem.getActiveVersion()
- + '\n' + '\n' + "Deleted By : " +entityItem.getModifiedBy() + '\n' + DELETED_TIME +dateFormat.format(date) + '\n' + '\n' + '\n' + '\n' + EMAIL_MESSAGE_POSTSCRIPT;
+ + '\n' + '\n' + DELETED_BY +entityItem.getModifiedBy() + '\n' + DELETED_TIME +dateFormat.format(date) + '\n' + '\n' + '\n' + '\n' + EMAIL_MESSAGE_POSTSCRIPT;
}
if("DeleteScope".equalsIgnoreCase(mode)){
subject = "Scope has been Deleted : "+entityItem.getPolicyName();
message = "The Scope Which you are watching in " + PolicyController.getSmtpApplicationName() + " has been Deleted" + '\n' + '\n' + '\n'+ "Scope + Scope Name : " + policyName + '\n'
}
if("DeleteScope".equalsIgnoreCase(mode)){
subject = "Scope has been Deleted : "+entityItem.getPolicyName();
message = "The Scope Which you are watching in " + PolicyController.getSmtpApplicationName() + " has been Deleted" + '\n' + '\n' + '\n'+ "Scope + Scope Name : " + policyName + '\n'
- + '\n' + '\n' + "Deleted By : " +entityItem.getModifiedBy() + '\n' + DELETED_TIME +dateFormat.format(date) + '\n' + '\n' + '\n' + '\n' + EMAIL_MESSAGE_POSTSCRIPT;
+ + '\n' + '\n' + DELETED_BY +entityItem.getModifiedBy() + '\n' + DELETED_TIME +dateFormat.format(date) + '\n' + '\n' + '\n' + '\n' + EMAIL_MESSAGE_POSTSCRIPT;
}
if("SwitchVersion".equalsIgnoreCase(mode)){
subject = "Policy has been SwitchedVersion : "+entityItem.getPolicyName();
}
if("SwitchVersion".equalsIgnoreCase(mode)){
subject = "Policy has been SwitchedVersion : "+entityItem.getPolicyName();
String policyFileName = findPolicyFileName(entityItem);
String query = "from WatchPolicyNotificationTable where policyName like:policyFileName";
List<Object> watchList = findWatchList(policyNotificationDao, policyFileName, query);
String policyFileName = findPolicyFileName(entityItem);
String query = "from WatchPolicyNotificationTable where policyName like:policyFileName";
List<Object> watchList = findWatchList(policyNotificationDao, policyFileName, query);
- if (watchList == null) return;
+ if (watchList == null) {
+ return;
+ }
composeAndSendMail(mode, policyNotificationDao, subject, message, checkPolicyName, watchList);
}
composeAndSendMail(mode, policyNotificationDao, subject, message, checkPolicyName, watchList);
}