2266N/A/*
2266N/A * CDDL HEADER START
2266N/A *
2266N/A * The contents of this file are subject to the terms of the
2266N/A * Common Development and Distribution License, Version 1.0 only
2266N/A * (the "License"). You may not use this file except in compliance
2266N/A * with the License.
2266N/A *
2266N/A * You can obtain a copy of the license at
2266N/A * trunk/opends/resource/legal-notices/OpenDS.LICENSE
2266N/A * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
2266N/A * See the License for the specific language governing permissions
2266N/A * and limitations under the License.
2266N/A *
2266N/A * When distributing Covered Code, include this CDDL HEADER in each
2266N/A * file and include the License file at
2266N/A * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
2266N/A * add the following below this CDDL HEADER, with the fields enclosed
2266N/A * by brackets "[]" replaced with your own identifying information:
2266N/A * Portions Copyright [yyyy] [name of copyright owner]
2266N/A *
2266N/A * CDDL HEADER END
2266N/A *
2266N/A *
3231N/A * Copyright 2008 Sun Microsystems, Inc.
2266N/A */
2266N/Apackage org.opends.server.extensions;
2266N/A
2266N/A
2266N/A
2266N/Aimport org.opends.messages.MessageBuilder;
2266N/Aimport org.opends.server.types.AccountStatusNotification;
2266N/A
2266N/A
2266N/A
2266N/A/**
2266N/A * This class implements a notification message template element that will
2266N/A * generate a value that is the name of the account status notification type.
2266N/A */
2266N/Apublic class NotificationTypeNotificationMessageTemplateElement
2266N/A extends NotificationMessageTemplateElement
2266N/A{
2266N/A /**
2266N/A * Creates a new notification type notification message template element.
2266N/A */
2266N/A public NotificationTypeNotificationMessageTemplateElement()
2266N/A {
2266N/A // No implementation is required.
2266N/A }
2266N/A
6420N/A /**
6420N/A * Creates a new notification type notification message template element.
6420N/A * @param options Options to apply. Right now only "l" or "u" at the end of
6420N/A * the String are honored. Gets ignored if {@code null} or empty.
6420N/A */
6420N/A public NotificationTypeNotificationMessageTemplateElement(String options)
6420N/A {
6420N/A checkCase(options);
6420N/A }
2266N/A
2266N/A
2266N/A /**
2266N/A * {@inheritDoc}
2266N/A */
2266N/A public void generateValue(MessageBuilder buffer,
2266N/A AccountStatusNotification notification)
2266N/A {
6420N/A if (toLower == null) {
6420N/A buffer.append(notification.getNotificationType().getName());
6420N/A } else if (toLower == Boolean.TRUE) {
6420N/A buffer.append(notification.getNotificationType().getName().toLowerCase());
6420N/A } else {
6420N/A buffer.append(notification.getNotificationType().getName().toUpperCase());
6420N/A }
2266N/A }
2266N/A}
2266N/A