001/*
002 * Copyright 2022-2024 Ping Identity Corporation
003 * All Rights Reserved.
004 */
005/*
006 * Copyright 2022-2024 Ping Identity Corporation
007 *
008 * Licensed under the Apache License, Version 2.0 (the "License");
009 * you may not use this file except in compliance with the License.
010 * You may obtain a copy of the License at
011 *
012 *    http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing, software
015 * distributed under the License is distributed on an "AS IS" BASIS,
016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017 * See the License for the specific language governing permissions and
018 * limitations under the License.
019 */
020/*
021 * Copyright (C) 2022-2024 Ping Identity Corporation
022 *
023 * This program is free software; you can redistribute it and/or modify
024 * it under the terms of the GNU General Public License (GPLv2 only)
025 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
026 * as published by the Free Software Foundation.
027 *
028 * This program is distributed in the hope that it will be useful,
029 * but WITHOUT ANY WARRANTY; without even the implied warranty of
030 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
031 * GNU General Public License for more details.
032 *
033 * You should have received a copy of the GNU General Public License
034 * along with this program; if not, see <http://www.gnu.org/licenses>.
035 */
036package com.unboundid.ldap.sdk.unboundidds.logs.v2.text;
037
038
039
040import java.util.List;
041import java.util.Set;
042
043import com.unboundid.ldap.sdk.ResultCode;
044import com.unboundid.ldap.sdk.unboundidds.controls.AssuredReplicationLocalLevel;
045import com.unboundid.ldap.sdk.unboundidds.controls.
046            AssuredReplicationRemoteLevel;
047import com.unboundid.ldap.sdk.unboundidds.logs.AccessLogMessageType;
048import com.unboundid.ldap.sdk.unboundidds.logs.LogException;
049import com.unboundid.ldap.sdk.unboundidds.logs.v2.ModifyResultAccessLogMessage;
050import com.unboundid.util.NotExtensible;
051import com.unboundid.util.NotMutable;
052import com.unboundid.util.NotNull;
053import com.unboundid.util.Nullable;
054import com.unboundid.util.ThreadSafety;
055import com.unboundid.util.ThreadSafetyLevel;
056
057
058
059/**
060 * This class provides a data structure that holds information about a
061 * text-formatted modify result access log message.
062 * <BR>
063 * <BLOCKQUOTE>
064 *   <B>NOTE:</B>  This class, and other classes within the
065 *   {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only
066 *   supported for use against Ping Identity, UnboundID, and
067 *   Nokia/Alcatel-Lucent 8661 server products.  These classes provide support
068 *   for proprietary functionality or for external specifications that are not
069 *   considered stable or mature enough to be guaranteed to work in an
070 *   interoperable way with other types of LDAP servers.
071 * </BLOCKQUOTE>
072 */
073@NotExtensible()
074@NotMutable()
075@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
076public class TextFormattedModifyResultAccessLogMessage
077       extends TextFormattedModifyRequestAccessLogMessage
078       implements ModifyResultAccessLogMessage
079{
080  /**
081   * The serial version UID for this serializable class.
082   */
083  private static final long serialVersionUID = 579526634550926224L;
084
085
086
087  // Indicates whether this operation is a change to a soft-deleted entry.
088  @Nullable private final Boolean changeToSoftDeletedEntry;
089
090  // The forward helper for this access log message.
091  @NotNull private final TextFormattedForwardAccessLogMessageHelper
092       forwardHelper;
093
094  // The result helper for this access log message.
095  @NotNull private final TextFormattedResultAccessLogMessageHelper
096       resultHelper;
097
098
099
100  /**
101   * Creates a new text-formatted modify result access log message from the
102   * provided message string.
103   *
104   * @param  logMessageString  The string representation of this log message.
105   *                           It must not be {@code null}.
106   *
107   * @throws  LogException  If the provided string cannot be parsed as a valid
108   *                        log message.
109   */
110  public TextFormattedModifyResultAccessLogMessage(
111              @NotNull final String logMessageString)
112         throws LogException
113  {
114    this(new TextFormattedLogMessage(logMessageString));
115  }
116
117
118
119  /**
120   * Creates a new text-formatted modify result access log message from the
121   * provided message.
122   *
123   * @param  logMessage  The log message to use to create this modify result
124   *                     access log message.  It must not be {@code null}.
125   */
126  TextFormattedModifyResultAccessLogMessage(
127       @NotNull final TextFormattedLogMessage logMessage)
128  {
129    super(logMessage);
130
131    changeToSoftDeletedEntry = getBooleanNoThrow(
132         TextFormattedAccessLogFields.CHANGE_TO_SOFT_DELETED_ENTRY);
133
134    resultHelper = new TextFormattedResultAccessLogMessageHelper(this);
135    forwardHelper = new TextFormattedForwardAccessLogMessageHelper(this);
136  }
137
138
139
140  /**
141   * {@inheritDoc}
142   */
143  @Override()
144  @NotNull()
145  public AccessLogMessageType getMessageType()
146  {
147    return AccessLogMessageType.RESULT;
148  }
149
150
151
152  /**
153   * {@inheritDoc}
154   */
155  @Override()
156  @Nullable()
157  public ResultCode getResultCode()
158  {
159    return resultHelper.getResultCode();
160  }
161
162
163
164  /**
165   * {@inheritDoc}
166   */
167  @Override()
168  @Nullable()
169  public String getDiagnosticMessage()
170  {
171    return resultHelper.getDiagnosticMessage();
172  }
173
174
175
176  /**
177   * {@inheritDoc}
178   */
179  @Override()
180  @Nullable()
181  public String getAdditionalInformation()
182  {
183    return resultHelper.getAdditionalInformation();
184  }
185
186
187
188  /**
189   * {@inheritDoc}
190   */
191  @Override()
192  @Nullable()
193  public String getMatchedDN()
194  {
195    return resultHelper.getMatchedDN();
196  }
197
198
199
200  /**
201   * {@inheritDoc}
202   */
203  @Override()
204  @NotNull()
205  public List<String> getReferralURLs()
206  {
207    return resultHelper.getReferralURLs();
208  }
209
210
211
212  /**
213   * {@inheritDoc}
214   */
215  @Override()
216  @Nullable()
217  public Double getProcessingTimeMillis()
218  {
219    return resultHelper.getProcessingTimeMillis();
220  }
221
222
223
224  /**
225   * {@inheritDoc}
226   */
227  @Override()
228  @Nullable()
229  public Double getWorkQueueWaitTimeMillis()
230  {
231    return resultHelper.getWorkQueueWaitTimeMillis();
232  }
233
234
235
236  /**
237   * {@inheritDoc}
238   */
239  @Override()
240  @NotNull()
241  public Set<String> getResponseControlOIDs()
242  {
243    return resultHelper.getResponseControlOIDs();
244  }
245
246
247
248  /**
249   * {@inheritDoc}
250   */
251  @Override()
252  @Nullable()
253  public Long getIntermediateResponsesReturned()
254  {
255    return resultHelper.getIntermediateResponsesReturned();
256  }
257
258
259
260  /**
261   * {@inheritDoc}
262   */
263  @Override()
264  @NotNull()
265  public List<String> getServersAccessed()
266  {
267    return resultHelper.getServersAccessed();
268  }
269
270
271
272  /**
273   * {@inheritDoc}
274   */
275  @Override()
276  @Nullable()
277  public Boolean getUncachedDataAccessed()
278  {
279    return resultHelper.getUncachedDataAccessed();
280  }
281
282
283
284  /**
285   * {@inheritDoc}
286   */
287  @Override()
288  @NotNull()
289  public Set<String> getUsedPrivileges()
290  {
291    return resultHelper.getUsedPrivileges();
292  }
293
294
295
296  /**
297   * {@inheritDoc}
298   */
299  @Override()
300  @NotNull()
301  public Set<String> getPreAuthorizationUsedPrivileges()
302  {
303    return resultHelper.getPreAuthorizationUsedPrivileges();
304  }
305
306
307
308  /**
309   * {@inheritDoc}
310   */
311  @Override()
312  @NotNull()
313  public Set<String> getMissingPrivileges()
314  {
315    return resultHelper.getMissingPrivileges();
316  }
317
318
319
320  /**
321   * {@inheritDoc}
322   */
323  @Override()
324  @Nullable()
325  public final String getAlternateAuthorizationDN()
326  {
327    return resultHelper.getAlternateAuthorizationDN();
328  }
329
330
331
332  /**
333   * {@inheritDoc}
334   */
335  @Override()
336  @Nullable()
337  public final String getReplicationChangeID()
338  {
339    return resultHelper.getReplicationChangeID();
340  }
341
342
343
344  /**
345   * {@inheritDoc}
346   */
347  @Override()
348  @Nullable()
349  public final AssuredReplicationLocalLevel getAssuredReplicationLocalLevel()
350  {
351    return resultHelper.getAssuredReplicationLocalLevel();
352  }
353
354
355
356  /**
357   * {@inheritDoc}
358   */
359  @Override()
360  @Nullable()
361  public final AssuredReplicationRemoteLevel getAssuredReplicationRemoteLevel()
362  {
363    return resultHelper.getAssuredReplicationRemoteLevel();
364  }
365
366
367
368  /**
369   * {@inheritDoc}
370   */
371  @Override()
372  @Nullable()
373  public final Long getAssuredReplicationTimeoutMillis()
374  {
375    return resultHelper.getAssuredReplicationTimeoutMillis();
376  }
377
378
379
380  /**
381   * {@inheritDoc}
382   */
383  @Override()
384  @Nullable()
385  public final Boolean getResponseDelayedByAssurance()
386  {
387    return resultHelper.getResponseDelayedByAssurance();
388  }
389
390
391
392  /**
393   * {@inheritDoc}
394   */
395  @Override()
396  @NotNull()
397  public final Set<String> getIndexesWithKeysAccessedNearEntryLimit()
398  {
399    return resultHelper.getIndexesWithKeysAccessedNearEntryLimit();
400  }
401
402
403
404  /**
405   * {@inheritDoc}
406   */
407  @Override()
408  @NotNull()
409  public final Set<String> getIndexesWithKeysAccessedExceedingEntryLimit()
410  {
411    return resultHelper.getIndexesWithKeysAccessedExceedingEntryLimit();
412  }
413
414
415
416  /**
417   * Retrieves a string representation of an intermediate client response
418   * control included in the log message.
419   *
420   * @return  A string representation of an intermediate client response control
421   *          included in the log message, or {@code null} if there is none.
422   */
423  @Nullable()
424  public final String getIntermediateClientResponseControl()
425  {
426    return resultHelper.getIntermediateClientResponseControl();
427  }
428
429
430
431  /**
432   * {@inheritDoc}
433   */
434  @Override()
435  @Nullable()
436  public String getTargetHost()
437  {
438    return forwardHelper.getTargetHost();
439  }
440
441
442
443  /**
444   * {@inheritDoc}
445   */
446  @Override()
447  @Nullable()
448  public Integer getTargetPort()
449  {
450    return forwardHelper.getTargetPort();
451  }
452
453
454
455  /**
456   * {@inheritDoc}
457   */
458  @Override()
459  @Nullable()
460  public String getTargetProtocol()
461  {
462    return forwardHelper.getTargetProtocol();
463  }
464
465
466
467  /**
468   * {@inheritDoc}
469   */
470  @Override()
471  @Nullable()
472  public final Boolean getChangeToSoftDeletedEntry()
473  {
474    return changeToSoftDeletedEntry;
475  }
476}