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 legal-notices/CDDLv1_0.txt 010 * or http://forgerock.org/license/CDDLv1.0.html. 011 * See the License for the specific language governing permissions 012 * and limitations under the License. 013 * 014 * When distributing Covered Code, include this CDDL HEADER in each 015 * file and include the License file at legal-notices/CDDLv1_0.txt. 016 * If applicable, add the following below this CDDL HEADER, with the 017 * fields enclosed by brackets "[]" replaced with your own identifying 018 * information: 019 * Portions Copyright [yyyy] [name of copyright owner] 020 * 021 * CDDL HEADER END 022 * 023 * 024 * Copyright 2006-2008 Sun Microsystems, Inc. 025 * Portions Copyright 2011-2015 ForgeRock AS. 026 */ 027package org.opends.server.types.operation; 028import org.forgerock.i18n.LocalizableMessageBuilder; 029 030 031import java.util.List; 032 033import org.opends.server.types.AdditionalLogItem; 034import org.opends.server.types.DN; 035import org.forgerock.opendj.ldap.ResultCode; 036 037 038 039/** 040 * This class defines a set of methods that are available for use by 041 * post-response plugins for all types of operations. Note that this 042 * interface is intended only to define an API for use by plugins and 043 * is not intended to be implemented by any custom classes. 044 */ 045@org.opends.server.types.PublicAPI( 046 stability=org.opends.server.types.StabilityLevel.UNCOMMITTED, 047 mayInstantiate=false, 048 mayExtend=false, 049 mayInvoke=true) 050public interface PostResponseOperation 051 extends PluginOperation 052{ 053 /** 054 * Retrieves the result code for this operation. 055 * 056 * @return The result code associated for this operation, or 057 * <CODE>UNDEFINED</CODE> if the operation has not yet 058 * completed. 059 */ 060 ResultCode getResultCode(); 061 062 063 064 /** 065 * Retrieves the error message for this operation. Its contents may 066 * be altered by the caller. 067 * 068 * @return The error message for this operation. 069 */ 070 LocalizableMessageBuilder getErrorMessage(); 071 072 073 074 /** 075 * Retrieves the matched DN for this operation. 076 * 077 * @return The matched DN for this operation, or <CODE>null</CODE> 078 * if the operation has not yet completed or does not have 079 * a matched DN. 080 */ 081 DN getMatchedDN(); 082 083 084 085 /** 086 * Retrieves the set of referral URLs for this operation. Its 087 * contents must not be altered by the caller. 088 * 089 * @return The set of referral URLs for this operation, or 090 * <CODE>null</CODE> if the operation is not yet complete 091 * or does not have a set of referral URLs. 092 */ 093 List<String> getReferralURLs(); 094 095 096 097 /** 098 * Retrieves the authorization DN for this operation. In many 099 * cases, it will be the same as the DN of the authenticated user 100 * for the underlying connection, or the null DN if no 101 * authentication has been performed on that connection. However, 102 * it may be some other value if special processing has been 103 * requested (e.g., the operation included a proxied authorization 104 * control). 105 * 106 * @return The authorization DN for this operation. 107 */ 108 DN getAuthorizationDN(); 109 110 111 112 /** 113 * Retrieves the time that processing stopped for this operation. 114 * This will actually hold a time immediately before the response 115 * was sent to the client. 116 * 117 * @return The time that processing stopped for this operation. 118 */ 119 long getProcessingStopTime(); 120 121 122 123 /** 124 * Retrieves the length of time in milliseconds that the server 125 * spent processing this operation. 126 * 127 * @return The length of time in milliseconds that the server spent 128 * processing this operation. 129 */ 130 long getProcessingTime(); 131 132 133 134 /** 135 * Returns an unmodifiable list containing the additional log items for this 136 * operation, which should be written to the log but not included in the 137 * response to the client. 138 * 139 * @return An unmodifiable list containing the additional log items for this 140 * operation. 141 */ 142 List<AdditionalLogItem> getAdditionalLogItems(); 143} 144