001/*
002 * CDDL HEADER START
003 *
004 * The contents of this file are subject to the terms of the
005 * Common Development and Distribution License, Version 1.0 only
006 * (the "License").  You may not use this file except in compliance
007 * with the License.
008 *
009 * You can obtain a copy of the license at
010 * docs/licenses/cddl.txt
011 * or http://www.opensource.org/licenses/cddl1.php.
012 * See the License for the specific language governing permissions
013 * and limitations under the License.
014 *
015 * When distributing Covered Code, include this CDDL HEADER in each
016 * file and include the License file at
017 * docs/licenses/cddl.txt.  If applicable,
018 * add the following below this CDDL HEADER, with the fields enclosed
019 * by brackets "[]" replaced with your own identifying information:
020 *      Portions Copyright [yyyy] [name of copyright owner]
021 *
022 * CDDL HEADER END
023 *
024 *
025 *      Copyright 2014-2021 Ping Identity Corporation
026 */
027package com.unboundid.directory.sdk.ds.types;
028
029
030
031import com.unboundid.util.NotExtensible;
032import com.unboundid.util.ThreadSafety;
033import com.unboundid.util.ThreadSafetyLevel;
034
035import java.util.Date;
036import java.util.List;
037
038
039
040/**
041 * This interface defines a set of methods that may be used to obtain
042 * information about a notification to be delivered by a notification
043 * manager.
044 */
045@NotExtensible()
046@ThreadSafety(level= ThreadSafetyLevel.INTERFACE_NOT_THREADSAFE)
047public interface Notification
048{
049  /**
050   * Retrieve the notification destination ID.
051   *
052   * @return  The notification destination ID.
053   */
054  String getDestinationID();
055
056
057
058  /**
059   * Retrieve the list of changes associated with the notification.
060   * A notification can include more than one change when the changes are
061   * part of an external transaction (e.g. a multi-update extended operation),
062   * unless the notification manager is configured to treat the changes
063   * individually.
064   *
065   * @return  The list of changes associated with the notification. The
066   *          returned list may not be modified.
067   */
068  List<NotificationChange> getNotificationChanges();
069
070
071
072  /**
073   * Retrieve the number of previous delivery attempts for this notification.
074   *
075   * @return  The number of previous delivery attempts for this notification.
076   */
077  int getNumPreviousDeliveryAttempts();
078
079
080
081  /**
082   * Retrieve the time at which the first delivery attempt was made, or
083   * {@code null} if there have been no previous delivery attempts.
084   *
085   * @return  The time at which the first delivery attempt was made, or
086   *          {@code null} if there have been no previous delivery attempts.
087   */
088  Date getTimeOfFirstDeliveryAttempt();
089
090
091
092  /**
093   * Retrieve the time at which the last delivery attempt was made, or
094   * {@code null} if there have been no previous delivery attempts.
095   *
096   * @return  The time at which the last delivery attempt was made, or
097   *          {@code null} if there have been no previous delivery attempts.
098   */
099  Date getTimeOfLastDeliveryAttempt();
100}