001/* 002 * Copyright 2020 Ping Identity Corporation 003 * All Rights Reserved. 004 */ 005/* 006 * Copyright 2020 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) 2020 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.extensions; 037 038 039 040import com.unboundid.asn1.ASN1Element; 041import com.unboundid.asn1.ASN1Null; 042import com.unboundid.ldap.sdk.LDAPException; 043import com.unboundid.ldap.sdk.ResultCode; 044import com.unboundid.util.Debug; 045import com.unboundid.util.NotMutable; 046import com.unboundid.util.StaticUtils; 047import com.unboundid.util.ThreadSafety; 048import com.unboundid.util.ThreadSafetyLevel; 049 050import static com.unboundid.ldap.sdk.unboundidds.extensions.ExtOpMessages.*; 051 052 053 054/** 055 * This class provides a collect support data log capture window implementation 056 * that indicates that the tool should use its default logic when determining 057 * which log content to include in the support data archive when processing a 058 * {@link CollectSupportDataExtendedRequest}. 059 * <BR> 060 * <BLOCKQUOTE> 061 * <B>NOTE:</B> This class, and other classes within the 062 * {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only 063 * supported for use against Ping Identity, UnboundID, and 064 * Nokia/Alcatel-Lucent 8661 server products. These classes provide support 065 * for proprietary functionality or for external specifications that are not 066 * considered stable or mature enough to be guaranteed to work in an 067 * interoperable way with other types of LDAP servers. 068 * </BLOCKQUOTE> 069 * 070 * @see CollectSupportDataExtendedRequest 071 */ 072@NotMutable() 073@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE) 074public final class ToolDefaultCollectSupportDataLogCaptureWindow 075 extends CollectSupportDataLogCaptureWindow 076{ 077 /** 078 * The singleton instance of this tool-default collect support data log 079 * capture window object. 080 */ 081 private static final ToolDefaultCollectSupportDataLogCaptureWindow INSTANCE = 082 new ToolDefaultCollectSupportDataLogCaptureWindow(); 083 084 085 086 /** 087 * The serial version UID for this serializable class. 088 */ 089 private static final long serialVersionUID = 7186806291464509659L; 090 091 092 093 // An ASN.1 element that provides an encoded representation of this 094 // tool-default collect support data log capture window. 095 private final ASN1Element encodedWindow; 096 097 098 099 /** 100 * Creates a new instance of this tool-default collect support data log 101 * capture window object. 102 */ 103 private ToolDefaultCollectSupportDataLogCaptureWindow() 104 { 105 encodedWindow = new ASN1Null(TYPE_TOOL_DEFAULT); 106 } 107 108 109 110 /** 111 * Retrieves the singleton instance of this tool-default collect support data 112 * log capture window object. 113 * 114 * @return The singleton instance of this tool-default collect support data 115 * log capture window object. 116 */ 117 public static ToolDefaultCollectSupportDataLogCaptureWindow getInstance() 118 { 119 return INSTANCE; 120 } 121 122 123 124 /** 125 * Decodes the provided ASN.1 element as a tool-default collect support data 126 * log capture window object. 127 * 128 * @param e The ASN.1 element to be decoded. It must not be {@code null}. 129 * 130 * @return The tool-default collect support data log capture window object 131 * that was decoded. 132 * 133 * @throws LDAPException If the provided ASN.1 element cannot be decoded as 134 * a valid tool-default collect support data log 135 * capture window object. 136 */ 137 static ToolDefaultCollectSupportDataLogCaptureWindow 138 decodeInternal(final ASN1Element e) 139 throws LDAPException 140 { 141 try 142 { 143 ASN1Null.decodeAsNull(e); 144 } 145 catch (final Exception ex) 146 { 147 Debug.debugException(ex); 148 throw new LDAPException(ResultCode.DECODING_ERROR, 149 ERR_TOOL_DEFAULT_CSD_LOG_WINDOW_CANNOT_DECODE.get( 150 StaticUtils.getExceptionMessage(ex)), 151 ex); 152 } 153 154 return INSTANCE; 155 } 156 157 158 159 /** 160 * {@inheritDoc} 161 */ 162 @Override() 163 public ASN1Element encode() 164 { 165 return encodedWindow; 166 } 167 168 169 170 /** 171 * {@inheritDoc} 172 */ 173 @Override() 174 public void toString(final StringBuilder buffer) 175 { 176 buffer.append("ToolDefaultCollectSupportDataLogCaptureWindow()"); 177 } 178}