001/* 002 * CDDL HEADER START 003 * 004 * The contents of this file are subject to the terms of the 005 * Common Development and Distribution License, Version 1.0 only 006 * (the "License"). You may not use this file except in compliance 007 * with the License. 008 * 009 * You can obtain a copy of the license at 010 * docs/licenses/cddl.txt 011 * or http://www.opensource.org/licenses/cddl1.php. 012 * See the License for the specific language governing permissions 013 * and limitations under the License. 014 * 015 * When distributing Covered Code, include this CDDL HEADER in each 016 * file and include the License file at 017 * docs/licenses/cddl.txt. If applicable, 018 * add the following below this CDDL HEADER, with the fields enclosed 019 * by brackets "[]" replaced with your own identifying information: 020 * Portions Copyright [yyyy] [name of copyright owner] 021 * 022 * CDDL HEADER END 023 * 024 * 025 * Copyright 2010-2017 Ping Identity Corporation 026 */ 027package com.unboundid.directory.sdk.common.operation; 028 029 030 031import java.util.List; 032 033import com.unboundid.ldap.sdk.LDAPException; 034import com.unboundid.ldap.sdk.LDAPResult; 035import com.unboundid.ldap.sdk.ResultCode; 036import com.unboundid.util.NotExtensible; 037import com.unboundid.util.ThreadSafety; 038import com.unboundid.util.ThreadSafetyLevel; 039 040 041 042/** 043 * This interface defines a set of methods which may be used to update the 044 * contents of operation results. 045 */ 046@NotExtensible() 047@ThreadSafety(level=ThreadSafetyLevel.INTERFACE_NOT_THREADSAFE) 048public interface UpdatableGenericResult 049 extends GenericResult, UpdatableResult 050{ 051 /** 052 * Specifies the result code for the result. 053 * 054 * @param resultCode The result code for the result. It must not be 055 * {@code null}. 056 */ 057 void setResultCode(final ResultCode resultCode); 058 059 060 061 /** 062 * Specifies the matched DN for the result, if any. 063 * 064 * @param matchedDN The matched DN for the result. It may be {@code null} 065 * if there is none. 066 * 067 * @throws LDAPException If the provided DN cannot be parsed. 068 */ 069 void setMatchedDN(final String matchedDN) 070 throws LDAPException; 071 072 073 074 /** 075 * Specifies the diagnostic message for the result, if any. 076 * 077 * @param diagnosticMessage The diagnostic message for the result. It may 078 * be {@code null} if there is none. 079 */ 080 void setDiagnosticMessage(final String diagnosticMessage); 081 082 083 084 /** 085 * Specifies the referral URLs for the result. 086 * 087 * @param referralURLs The referral URLs for the result. It may be 088 * {@code null} or empty if there are none. 089 */ 090 void setReferralURLs(final List<String> referralURLs); 091 092 093 094 /** 095 * Specifies an additional log message for the result which will not be 096 * returned to the client but may be included in access log messages for the 097 * associated operation. 098 * 099 * @param message An additional log message for the result. 100 */ 101 void setAdditionalLogMessage(final String message); 102 103 104 105 /** 106 * Sets the contents of this result with information from the provided 107 * LDAP result, including the result code, diagnostic message, matched DN, 108 * referral URLs, and controls. 109 * 110 * @param result The result to use to update this result. It must not be 111 * {@code null}. 112 */ 113 void setResultData(final LDAPResult result); 114 115 116 117 /** 118 * Sets the contents of this result with information from the provided 119 * LDAP exception, including the result code, diagnostic message, matched DN, 120 * referral URLs, and controls. 121 * 122 * @param le The exception to use to update this result. It must not be 123 * {@code null}. 124 */ 125 void setResultData(final LDAPException le); 126}