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