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