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 * Builder for operations to purge a resource
014 *
015 * @author whikloj
016 */
017public class PurgeResourceOperationBuilder extends AbstractResourceOperationBuilder
018        implements ResourceOperationBuilder {
019
020    /**
021     * Construct the builder
022     *
023     * @param transaction the transaction
024     * @param rescId identifier of the resource to delete
025     */
026    public PurgeResourceOperationBuilder(final Transaction transaction, final FedoraId rescId) {
027        super(transaction, rescId);
028    }
029
030    @Override
031    public PurgeResourceOperation build() {
032        final var operation = new PurgeResourceOperation(transaction, rescId);
033        operation.setUserPrincipal(userPrincipal);
034        return operation;
035    }
036}