001 /*
002 * Copyright 2013-2015 UnboundID Corp.
003 * All Rights Reserved.
004 */
005 /*
006 * Copyright (C) 2015 UnboundID Corp.
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 */
021 package com.unboundid.ldap.sdk.unboundidds.logs;
022
023
024
025 import com.unboundid.util.NotMutable;
026 import com.unboundid.util.ThreadSafety;
027 import com.unboundid.util.ThreadSafetyLevel;
028
029
030
031 /**
032 * <BLOCKQUOTE>
033 * <B>NOTE:</B> This class is part of the Commercial Edition of the UnboundID
034 * LDAP SDK for Java. It is not available for use in applications that
035 * include only the Standard Edition of the LDAP SDK, and is not supported for
036 * use in conjunction with non-UnboundID products.
037 * </BLOCKQUOTE>
038 * This class provides a data structure that holds information about a log
039 * message that may appear in the Directory Server access log about the result
040 * of replication assurance processing for a modify DN operation.
041 */
042 @NotMutable()
043 @ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
044 public final class ModifyDNAssuranceCompletedAccessLogMessage
045 extends ModifyDNResultAccessLogMessage
046 {
047 /**
048 * The serial version UID for this serializable class.
049 */
050 private static final long serialVersionUID = 7999628814120272821L;
051
052
053
054 // Indicates whether the local assurance requirement was satisfied.
055 private final Boolean localAssuranceSatisfied;
056
057 // Indicates whether the remote assurance requirement was satisfied.
058 private final Boolean remoteAssuranceSatisfied;
059
060 // A string with information about the per-server assurance results.
061 private final String serverAssuranceResults;
062
063
064
065 /**
066 * Creates a new modify DN assurance complete access log message from the
067 * provided message string.
068 *
069 * @param s The string to be parsed as an modify DN assurance complete
070 * access log message.
071 *
072 * @throws LogException If the provided string cannot be parsed as a valid
073 * log message.
074 */
075 public ModifyDNAssuranceCompletedAccessLogMessage(final String s)
076 throws LogException
077 {
078 this(new LogMessage(s));
079 }
080
081
082
083 /**
084 * Creates a new modify DN assurance complete access log message from the
085 * provided message string.
086 *
087 * @param m The log message to be parsed as an modify DN assurance complete
088 * access log message.
089 */
090 public ModifyDNAssuranceCompletedAccessLogMessage(final LogMessage m)
091 {
092 super(m);
093
094 localAssuranceSatisfied = getNamedValueAsBoolean("localAssuranceSatisfied");
095 remoteAssuranceSatisfied =
096 getNamedValueAsBoolean("remoteAssuranceSatisfied");
097 serverAssuranceResults = getNamedValue("serverAssuranceResults");
098 }
099
100
101
102 /**
103 * Indicates whether the local assurance requirement was satisfied.
104 *
105 * @return {@code true} if the local assurance requirement was satisfied,
106 * {@code false} if the local assurance requirement was not
107 * satisfied, or {@code null} if it was not included in the log
108 * message.
109 */
110 public Boolean getLocalAssuranceSatisfied()
111 {
112 return localAssuranceSatisfied;
113 }
114
115
116
117 /**
118 * Indicates whether the remote assurance requirement was satisfied.
119 *
120 * @return {@code true} if the remote assurance requirement was satisfied,
121 * {@code false} if the remote assurance requirement was not
122 * satisfied, or {@code null} if it was not included in the log
123 * message.
124 */
125 public Boolean getRemoteAssuranceSatisfied()
126 {
127 return remoteAssuranceSatisfied;
128 }
129
130
131
132 /**
133 * Retrieves information about the assurance processing performed by
134 * individual servers in the replication environment.
135 *
136 * @return Information about the assurance processing performed by
137 * individual servers in the replication environment, or
138 * {@code null} if it was not included in the log message.
139 */
140 public String getServerAssuranceResults()
141 {
142 return serverAssuranceResults;
143 }
144
145
146
147 /**
148 * {@inheritDoc}
149 */
150 @Override()
151 public AccessLogMessageType getMessageType()
152 {
153 return AccessLogMessageType.ASSURANCE_COMPLETE;
154 }
155 }