001/*
002 * Copyright 2013-2019 Ping Identity Corporation
003 * All Rights Reserved.
004 */
005/*
006 * Copyright (C) 2015-2019 Ping Identity Corporation
007 *
008 * This program is free software; you can redistribute it and/or modify
009 * it under the terms of the GNU General Public License (GPLv2 only)
010 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
011 * as published by the Free Software Foundation.
012 *
013 * This program is distributed in the hope that it will be useful,
014 * but WITHOUT ANY WARRANTY; without even the implied warranty of
015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
016 * GNU General Public License for more details.
017 *
018 * You should have received a copy of the GNU General Public License
019 * along with this program; if not, see <http://www.gnu.org/licenses>.
020 */
021package com.unboundid.ldap.sdk.unboundidds.logs;
022
023
024
025import com.unboundid.util.NotMutable;
026import com.unboundid.util.ThreadSafety;
027import com.unboundid.util.ThreadSafetyLevel;
028
029
030
031/**
032 * This class provides a data structure that holds information about a log
033 * message that may appear in the Directory Server access log about the result
034 * of replication assurance processing for a delete operation.
035 * <BR>
036 * <BLOCKQUOTE>
037 *   <B>NOTE:</B>  This class, and other classes within the
038 *   {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only
039 *   supported for use against Ping Identity, UnboundID, and
040 *   Nokia/Alcatel-Lucent 8661 server products.  These classes provide support
041 *   for proprietary functionality or for external specifications that are not
042 *   considered stable or mature enough to be guaranteed to work in an
043 *   interoperable way with other types of LDAP servers.
044 * </BLOCKQUOTE>
045 */
046@NotMutable()
047@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
048public final class DeleteAssuranceCompletedAccessLogMessage
049       extends DeleteResultAccessLogMessage
050{
051  /**
052   * The serial version UID for this serializable class.
053   */
054  private static final long serialVersionUID = -8053481412117123593L;
055
056
057
058  // Indicates whether the local assurance requirement was satisfied.
059  private final Boolean localAssuranceSatisfied;
060
061  // Indicates whether the remote assurance requirement was satisfied.
062  private final Boolean remoteAssuranceSatisfied;
063
064  // A string with information about the per-server assurance results.
065  private final String serverAssuranceResults;
066
067
068
069  /**
070   * Creates a new delete assurance complete access log message from the
071   * provided message string.
072   *
073   * @param  s  The string to be parsed as an delete assurance complete access
074   *            log message.
075   *
076   * @throws  LogException  If the provided string cannot be parsed as a valid
077   *                        log message.
078   */
079  public DeleteAssuranceCompletedAccessLogMessage(final String s)
080         throws LogException
081  {
082    this(new LogMessage(s));
083  }
084
085
086
087  /**
088   * Creates a new delete assurance complete access log message from the
089   * provided message string.
090   *
091   * @param  m  The log message to be parsed as an delete assurance complete
092   *            access log message.
093   */
094  public DeleteAssuranceCompletedAccessLogMessage(final LogMessage m)
095  {
096    super(m);
097
098    localAssuranceSatisfied = getNamedValueAsBoolean("localAssuranceSatisfied");
099    remoteAssuranceSatisfied =
100         getNamedValueAsBoolean("remoteAssuranceSatisfied");
101    serverAssuranceResults = getNamedValue("serverAssuranceResults");
102  }
103
104
105
106  /**
107   * Indicates whether the local assurance requirement was satisfied.
108   *
109   * @return  {@code true} if the local assurance requirement was satisfied,
110   *          {@code false} if the local assurance requirement was not
111   *          satisfied, or {@code null} if it was not included in the log
112   *          message.
113   */
114  public Boolean getLocalAssuranceSatisfied()
115  {
116    return localAssuranceSatisfied;
117  }
118
119
120
121  /**
122   * Indicates whether the remote assurance requirement was satisfied.
123   *
124   * @return  {@code true} if the remote assurance requirement was satisfied,
125   *          {@code false} if the remote assurance requirement was not
126   *          satisfied, or {@code null} if it was not included in the log
127   *          message.
128   */
129  public Boolean getRemoteAssuranceSatisfied()
130  {
131    return remoteAssuranceSatisfied;
132  }
133
134
135
136  /**
137   * Retrieves information about the assurance processing performed by
138   * individual servers in the replication environment.
139   *
140   * @return  Information about the assurance processing performed by
141   *          individual servers in the replication environment, or
142   *          {@code null} if it was not included in the log message.
143   */
144  public String getServerAssuranceResults()
145  {
146    return serverAssuranceResults;
147  }
148
149
150
151  /**
152   * {@inheritDoc}
153   */
154  @Override()
155  public AccessLogMessageType getMessageType()
156  {
157    return AccessLogMessageType.ASSURANCE_COMPLETE;
158  }
159}