001/*
002 * The contents of this file are subject to the license and copyright
003 * detailed in the LICENSE and NOTICE files at the root of the source
004 * tree.
005 */
006package org.fcrepo.kernel.impl.operations;
007
008import org.fcrepo.kernel.api.Transaction;
009import org.fcrepo.kernel.api.identifiers.FedoraId;
010import org.fcrepo.kernel.api.operations.ResourceOperationBuilder;
011
012
013/**
014 * Builder for operations to reindex a resource
015 *
016 * @author dbernstein
017 */
018public class ReindexResourceOperationBuilder extends AbstractResourceOperationBuilder
019        implements ResourceOperationBuilder {
020
021    /**
022     * Construct the builder
023     *
024     * @param tx the transaction
025     * @param rescId identifier of the resource to reindex
026     */
027    public ReindexResourceOperationBuilder(final Transaction tx, final FedoraId rescId) {
028        super(tx, rescId);
029    }
030
031    @Override
032    public ReindexResourceOperationImpl build() {
033        final var operation = new ReindexResourceOperationImpl(transaction, rescId);
034        operation.setUserPrincipal(userPrincipal);
035        operation.setTransaction(transaction);
036        return operation;
037    }
038}