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