/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: EmailNotificationHelper.java,v 1.5 2009/01/28 05:34:48 ww203982 Exp $
*
* Portions Copyrighted 2011-2015 ForgeRock AS.
*/
/**
* This class has the functionality to send email notifications to the users
* listed in the notification list for create, delete & modify
*/
public class EmailNotificationHelper {
"iPlanetAMAdminConsoleService";
// notification attribute names
"iplanet-am-user-create-notification-list";
"iplanet-am-user-delete-notification-list";
"iplanet-am-user-modify-notification-list";
mailer = new AMSendMail();
}
// Populate the to string
continue;
} else {
if (debug.messageEnabled()) {
+ "Converting to array for: " + emails);
}
}
continue;
}
continue;
} else {
if (debug.messageEnabled()) {
+ "Converting to array for: " + emails);
}
}
} else {
}
// Populate locate and charset
if (stz.hasMoreTokens()) {
if (stz.hasMoreTokens()) {
}
}
// Populate the from, subject & message strings
+ entryDN;
// Send email notification
}
}
try {
// FIXME:
// TODO: Remove dependency on AMStoreConnection!
} catch (AMException ae) {
+ "Unable to get notification List for " + attributeName
} catch (SSOException e) {
+ "Unable to get notification List for " + attributeName
+ " for user: " + entryDN, e);
}
return notifyList;
}
public void setUserCreateNotificationList() {
}
public void setUserDeleteNotificationList() {
}
public void setUserModifyNotificationList() {
}
public boolean isPresentUserCreateNotificationList() {
}
public boolean isPresentUserDeleteNotificationList() {
}
public boolean isPresentUserModifyNotificationList() {
}
/**
* The proper setUser<>NotificationList method should be called before
* calling this method.
*
* @param attributes
* the attributes of the user
*/
try {
}
} catch (MessagingException e) {
if (debug.warningEnabled()) {
+ "sendUserCreateNotification() Unable to send "
+ "email for user: " + entryDN, e);
}
}
}
/**
* The proper setUser<>NotificationList method should be called before
* calling this method.
*
* @param attributes
* the attributes of the user
*/
try {
}
} catch (MessagingException e) {
if (debug.warningEnabled()) {
+ "sendUserDeleteNotification() Unable to send "
+ "email for user: " + entryDN, e);
}
}
}
// TODO: Refactor this method.
/**
* The proper setUser<>NotificationList method should be called before
* calling this method.
*
* @param token
* a valid single sign on token
* @param attributes
* the attribues of the user
* @param oldAttributes
* the previous attributes of the user
*/
Map oldAttributes) {
return;
}
// TODO: Refactor code to use maps directly
try {
if (toLen > 0) {
boolean valuesChanged = false;
if (newAttrVal != null) {
}
}
}
if (oldAttrVal != null) {
}
}
}
if (valuesChanged) {
while (stz.hasMoreTokens()) {
.nextToken(), "|");
continue;
} else {
}
if (emailAttrName == null
continue;
}
.get(emailAttrName);
continue;
} else {
}
} else {
}
if (stz2.hasMoreTokens()) {
if (stz2.hasMoreTokens()) {
}
}
.append(
.append(
.append("\n");
.append("\n");
}
}
.append("\n");
.append("\n");
}
}
charset);
}
}
}
}
} catch (MessagingException me) {
if (debug.warningEnabled()) {
+ "sendUserModifyNotification() Unable to send "
}
} catch (SSOException e) {
+ "Error occured while trying to send email for user: "
+ entryDN, e);
} catch (AMException ex) {
+ "Error occured while trying to send email for user: "
}
}
/**
* Protected method to be used to obtain organization attribute values for a
* given serviceName and attribute name. Returns a null value if a template
* value or default value for the attribute does not exist.
*/
try {
if (debug.messageEnabled()) {
+ "getOrgTypeAttributes(): "
}
} catch (AMException ame) {
// Template not found
// Get default Service attribues
try {
if (debug.messageEnabled()) {
+ "getOrgTypeAttributes(): "
+ "obtained from org defaults " + serviceName
+ attrValues);
}
+ "getOrgTypeAttributes(): "
+ "Error encountered in retrieving "
+ "default org attrs for", se);
}
}
return attrValues;
}
}