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.json;
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;
056import com.unboundid.util.json.JSONObject;
057
058
059
060/**
061 * This class provides a data structure that holds information about a
062 * JSON-formatted modify result access log message.
063 * <BR>
064 * <BLOCKQUOTE>
065 *   <B>NOTE:</B>  This class, and other classes within the
066 *   {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only
067 *   supported for use against Ping Identity, UnboundID, and
068 *   Nokia/Alcatel-Lucent 8661 server products.  These classes provide support
069 *   for proprietary functionality or for external specifications that are not
070 *   considered stable or mature enough to be guaranteed to work in an
071 *   interoperable way with other types of LDAP servers.
072 * </BLOCKQUOTE>
073 */
074@NotExtensible()
075@NotMutable()
076@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
077public class JSONModifyResultAccessLogMessage
078       extends JSONModifyRequestAccessLogMessage
079       implements ModifyResultAccessLogMessage
080{
081  /**
082   * The serial version UID for this serializable class.
083   */
084  private static final long serialVersionUID = 756591782437114972L;
085
086
087
088  // Indicates whether this operation is a change to a soft-deleted entry.
089  @Nullable private final Boolean changeToSoftDeletedEntry;
090
091  // The forward helper for this access log message.
092  @NotNull private final JSONForwardAccessLogMessageHelper forwardHelper;
093
094  // The result helper for this access log message.
095  @NotNull private final JSONResultAccessLogMessageHelper resultHelper;
096
097
098
099  /**
100   * Creates a new JSON modify result access log message from the provided JSON
101   * object.
102   *
103   * @param  jsonObject  The JSON object that contains an encoded representation
104   *                     of this log message.  It must not be {@code null}.
105   *
106   * @throws  LogException  If the provided JSON object cannot be parsed as a
107   *                        valid log message.
108   */
109  public JSONModifyResultAccessLogMessage(@NotNull final JSONObject jsonObject)
110         throws LogException
111  {
112    super(jsonObject);
113
114    changeToSoftDeletedEntry = getBooleanNoThrow(
115         JSONFormattedAccessLogFields.CHANGE_TO_SOFT_DELETED_ENTRY);
116
117    resultHelper = new JSONResultAccessLogMessageHelper(this);
118    forwardHelper = new JSONForwardAccessLogMessageHelper(this);
119  }
120
121
122
123  /**
124   * {@inheritDoc}
125   */
126  @Override()
127  @NotNull()
128  public AccessLogMessageType getMessageType()
129  {
130    return AccessLogMessageType.RESULT;
131  }
132
133
134
135  /**
136   * {@inheritDoc}
137   */
138  @Override()
139  @Nullable()
140  public final ResultCode getResultCode()
141  {
142    return resultHelper.getResultCode();
143  }
144
145
146
147  /**
148   * {@inheritDoc}
149   */
150  @Override()
151  @Nullable()
152  public final String getDiagnosticMessage()
153  {
154    return resultHelper.getDiagnosticMessage();
155  }
156
157
158
159  /**
160   * {@inheritDoc}
161   */
162  @Override()
163  @Nullable()
164  public final String getAdditionalInformation()
165  {
166    return resultHelper.getAdditionalInformation();
167  }
168
169
170
171  /**
172   * {@inheritDoc}
173   */
174  @Override()
175  @Nullable()
176  public final String getMatchedDN()
177  {
178    return resultHelper.getMatchedDN();
179  }
180
181
182
183  /**
184   * {@inheritDoc}
185   */
186  @Override()
187  @NotNull()
188  public final List<String> getReferralURLs()
189  {
190    return resultHelper.getReferralURLs();
191  }
192
193
194
195  /**
196   * {@inheritDoc}
197   */
198  @Override()
199  @Nullable()
200  public final Double getProcessingTimeMillis()
201  {
202    return resultHelper.getProcessingTimeMillis();
203  }
204
205
206
207  /**
208   * {@inheritDoc}
209   */
210  @Override()
211  @Nullable()
212  public final Double getWorkQueueWaitTimeMillis()
213  {
214    return resultHelper.getWorkQueueWaitTimeMillis();
215  }
216
217
218
219  /**
220   * {@inheritDoc}
221   */
222  @Override()
223  @NotNull()
224  public final Set<String> getResponseControlOIDs()
225  {
226    return resultHelper.getResponseControlOIDs();
227  }
228
229
230
231  /**
232   * {@inheritDoc}
233   */
234  @Override()
235  @Nullable()
236  public final Long getIntermediateResponsesReturned()
237  {
238    return resultHelper.getIntermediateResponsesReturned();
239  }
240
241
242
243  /**
244   * {@inheritDoc}
245   */
246  @Override()
247  @NotNull()
248  public final List<String> getServersAccessed()
249  {
250    return resultHelper.getServersAccessed();
251  }
252
253
254
255  /**
256   * {@inheritDoc}
257   */
258  @Override()
259  @Nullable()
260  public final Boolean getUncachedDataAccessed()
261  {
262    return resultHelper.getUncachedDataAccessed();
263  }
264
265
266
267  /**
268   * {@inheritDoc}
269   */
270  @Override()
271  @NotNull()
272  public final Set<String> getUsedPrivileges()
273  {
274    return resultHelper.getUsedPrivileges();
275  }
276
277
278
279  /**
280   * {@inheritDoc}
281   */
282  @Override()
283  @NotNull()
284  public final Set<String> getPreAuthorizationUsedPrivileges()
285  {
286    return resultHelper.getPreAuthorizationUsedPrivileges();
287  }
288
289
290
291  /**
292   * {@inheritDoc}
293   */
294  @Override()
295  @NotNull()
296  public final Set<String> getMissingPrivileges()
297  {
298    return resultHelper.getMissingPrivileges();
299  }
300
301
302
303  /**
304   * {@inheritDoc}
305   */
306  @Override()
307  @Nullable()
308  public final String getAlternateAuthorizationDN()
309  {
310    return resultHelper.getAlternateAuthorizationDN();
311  }
312
313
314
315  /**
316   * {@inheritDoc}
317   */
318  @Override()
319  @Nullable()
320  public final String getReplicationChangeID()
321  {
322    return resultHelper.getReplicationChangeID();
323  }
324
325
326
327  /**
328   * {@inheritDoc}
329   */
330  @Override()
331  @Nullable()
332  public final AssuredReplicationLocalLevel getAssuredReplicationLocalLevel()
333  {
334    return resultHelper.getAssuredReplicationLocalLevel();
335  }
336
337
338
339  /**
340   * {@inheritDoc}
341   */
342  @Override()
343  @Nullable()
344  public final AssuredReplicationRemoteLevel getAssuredReplicationRemoteLevel()
345  {
346    return resultHelper.getAssuredReplicationRemoteLevel();
347  }
348
349
350
351  /**
352   * {@inheritDoc}
353   */
354  @Override()
355  @Nullable()
356  public final Long getAssuredReplicationTimeoutMillis()
357  {
358    return resultHelper.getAssuredReplicationTimeoutMillis();
359  }
360
361
362
363  /**
364   * {@inheritDoc}
365   */
366  @Override()
367  @Nullable()
368  public final Boolean getResponseDelayedByAssurance()
369  {
370    return resultHelper.getResponseDelayedByAssurance();
371  }
372
373
374
375  /**
376   * {@inheritDoc}
377   */
378  @Override()
379  @NotNull()
380  public final Set<String> getIndexesWithKeysAccessedNearEntryLimit()
381  {
382    return resultHelper.getIndexesWithKeysAccessedNearEntryLimit();
383  }
384
385
386
387  /**
388   * {@inheritDoc}
389   */
390  @Override()
391  @NotNull()
392  public final Set<String> getIndexesWithKeysAccessedExceedingEntryLimit()
393  {
394    return resultHelper.getIndexesWithKeysAccessedExceedingEntryLimit();
395  }
396
397
398
399  /**
400   * Retrieves information about an intermediate client response control
401   * included in the log message.
402   *
403   * @return  An intermediate client response control included in the log
404   *          message, or {@code null} if no intermediate client response
405   *          control is available.
406   */
407  @Nullable()
408  public final JSONIntermediateClientResponseControl
409                    getIntermediateClientResponseControl()
410  {
411    return resultHelper.getIntermediateClientResponseControl();
412  }
413
414
415
416  /**
417   * {@inheritDoc}
418   */
419  @Override()
420  @Nullable()
421  public final String getTargetHost()
422  {
423    return forwardHelper.getTargetHost();
424  }
425
426
427
428  /**
429   * {@inheritDoc}
430   */
431  @Override()
432  @Nullable()
433  public final Integer getTargetPort()
434  {
435    return forwardHelper.getTargetPort();
436  }
437
438
439
440  /**
441   * {@inheritDoc}
442   */
443  @Override()
444  @Nullable()
445  public final String getTargetProtocol()
446  {
447    return forwardHelper.getTargetProtocol();
448  }
449
450
451
452  /**
453   * {@inheritDoc}
454   */
455  @Override()
456  @Nullable()
457  public final Boolean getChangeToSoftDeletedEntry()
458  {
459    return changeToSoftDeletedEntry;
460  }
461}