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 2015 ForgeRock AS.
016 */
017package org.opends.server.replication.plugin;
018
019import org.opends.server.replication.protocol.LDAPUpdateMsg;
020
021/**
022 * This is a bag class to hold an update to replay in the queue of updates to
023 * be replayed by the replay threads.
024 * It associates an update message to replay with the matching
025 * ReplicationDomain.
026 */
027public class UpdateToReplay
028{
029  private LDAPUpdateMsg updateMessage;
030  private LDAPReplicationDomain replicationDomain;
031
032  /**
033   * Construct the object associating the update message with the replication
034   * domain that must be used to replay it (the on it comes from).
035   * @param updateMessage The update message
036   * @param replicationDomain The replication domain to use for replaying the
037   * change from the update message
038   */
039  public UpdateToReplay(LDAPUpdateMsg updateMessage,
040    LDAPReplicationDomain replicationDomain)
041  {
042    this.updateMessage = updateMessage;
043    this.replicationDomain = replicationDomain;
044  }
045
046  /**
047   * Getter for update message.
048   * @return The update message
049   */
050  public LDAPUpdateMsg getUpdateMessage()
051  {
052    return updateMessage;
053  }
054
055  /**
056   * Getter for replication domain.
057   * @return The replication domain
058   */
059  public LDAPReplicationDomain getReplicationDomain()
060  {
061    return replicationDomain;
062  }
063}