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 * trunk/opends/resource/legal-notices/OpenDS.LICENSE 011 * or https://OpenDS.dev.java.net/OpenDS.LICENSE. 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 * trunk/opends/resource/legal-notices/OpenDS.LICENSE. 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 2006-2008 Sun Microsystems, Inc. 026 */ 027 package org.opends.server.types.operation; 028 import org.opends.messages.MessageBuilder; 029 030 031 import java.util.List; 032 033 import org.opends.server.types.DN; 034 import org.opends.server.types.ResultCode; 035 036 037 038 /** 039 * This class defines a set of methods that are available for use by 040 * post-response plugins for all types of operations. Note that this 041 * interface is intended only to define an API for use by plugins and 042 * is not intended to be implemented by any custom classes. 043 */ 044 @org.opends.server.types.PublicAPI( 045 stability=org.opends.server.types.StabilityLevel.UNCOMMITTED, 046 mayInstantiate=false, 047 mayExtend=false, 048 mayInvoke=true) 049 public interface PostResponseOperation 050 extends PluginOperation 051 { 052 /** 053 * Retrieves the result code for this operation. 054 * 055 * @return The result code associated for this operation, or 056 * <CODE>UNDEFINED</CODE> if the operation has not yet 057 * completed. 058 */ 059 public ResultCode getResultCode(); 060 061 062 063 /** 064 * Retrieves the error message for this operation. Its contents may 065 * be altered by the caller. 066 * 067 * @return The error message for this operation. 068 */ 069 public MessageBuilder getErrorMessage(); 070 071 072 073 /** 074 * Retrieves the additional log message for this operation, which 075 * should be written to the log but not included in the response to 076 * the client. The contents of this buffer may be altered by the 077 * caller. 078 * 079 * @return The additional log message for this operation. 080 */ 081 public MessageBuilder getAdditionalLogMessage(); 082 083 084 085 /** 086 * Retrieves the matched DN for this operation. 087 * 088 * @return The matched DN for this operation, or <CODE>null</CODE> 089 * if the operation has not yet completed or does not have 090 * a matched DN. 091 */ 092 public DN getMatchedDN(); 093 094 095 096 /** 097 * Retrieves the set of referral URLs for this operation. Its 098 * contents must not be altered by the caller. 099 * 100 * @return The set of referral URLs for this operation, or 101 * <CODE>null</CODE> if the operation is not yet complete 102 * or does not have a set of referral URLs. 103 */ 104 public List<String> getReferralURLs(); 105 106 107 108 /** 109 * Retrieves the authorization DN for this operation. In many 110 * cases, it will be the same as the DN of the authenticated user 111 * for the underlying connection, or the null DN if no 112 * authentication has been performed on that connection. However, 113 * it may be some other value if special processing has been 114 * requested (e.g., the operation included a proxied authorization 115 * control). 116 * 117 * @return The authorization DN for this operation. 118 */ 119 public DN getAuthorizationDN(); 120 121 122 123 /** 124 * Retrieves the time that processing stopped for this operation. 125 * This will actually hold a time immediately before the response 126 * was sent to the client. 127 * 128 * @return The time that processing stopped for this operation. 129 */ 130 public long getProcessingStopTime(); 131 132 133 134 /** 135 * Retrieves the length of time in milliseconds that the server 136 * spent processing this operation. 137 * 138 * @return The length of time in milliseconds that the server spent 139 * processing this operation. 140 */ 141 public long getProcessingTime(); 142 } 143