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