001/* 002 * Copyright 2025 Ping Identity Corporation 003 * All Rights Reserved. 004 */ 005/* 006 * Copyright 2025 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) 2025 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; 037 038 039 040import com.unboundid.util.NotMutable; 041import com.unboundid.util.NotNull; 042import com.unboundid.util.ThreadSafety; 043import com.unboundid.util.ThreadSafetyLevel; 044 045 046 047/** 048 * This class provides an implementation of a search result listener that will 049 * simply ignore all search result entries and references returned by the 050 * server. This is primarily intended for use in cases where a search should 051 * be performed, but the actual results aren't needed (e.g., when performing 052 * automated tests). The number of entries and references returned will still 053 * be available in the search result. 054 */ 055@NotMutable() 056@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE) 057public final class DiscardResultsSearchResultListener 058 implements SearchResultListener 059{ 060 /** 061 * The singleton instance of this listener. 062 */ 063 @NotNull private static final DiscardResultsSearchResultListener INSTANCE = 064 new DiscardResultsSearchResultListener(); 065 066 067 068 /** 069 * The serial version UID for this serializable class. 070 */ 071 private static final long serialVersionUID = -9080502715469552786L; 072 073 074 075 /** 076 * Creates a new instance of this search result listener. 077 */ 078 private DiscardResultsSearchResultListener() 079 { 080 // No implementation is required. 081 } 082 083 084 085 /** 086 * Retrieves the singleton instance of this search result listener. 087 * 088 * @return The singleton instance of this search result listener. 089 */ 090 @NotNull() 091 public static DiscardResultsSearchResultListener getInstance() 092 { 093 return INSTANCE; 094 } 095 096 097 098 /** 099 * {@inheritDoc} 100 */ 101 @Override() 102 public void searchEntryReturned(@NotNull final SearchResultEntry searchEntry) 103 { 104 // No implementation is required. 105 } 106 107 108 109 /** 110 * {@inheritDoc} 111 */ 112 @Override() 113 public void searchReferenceReturned( 114 @NotNull final SearchResultReference searchReference) 115 { 116 // No implementation is required. 117 } 118}