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 * Base resource operation builder to share class fields and userPrincipal method. 014 * @author whikloj 015 */ 016abstract public class AbstractResourceOperationBuilder implements ResourceOperationBuilder { 017 018 protected FedoraId rescId; 019 020 protected String userPrincipal; 021 022 protected Transaction transaction; 023 024 /** 025 * Constructor. 026 * 027 * @param transaction the transaction 028 * @param rescId the resource identifier. 029 */ 030 public AbstractResourceOperationBuilder(final Transaction transaction, final FedoraId rescId) { 031 this.transaction = transaction; 032 this.rescId = rescId; 033 } 034 035 @Override 036 public ResourceOperationBuilder userPrincipal(final String userPrincipal) { 037 this.userPrincipal = userPrincipal; 038 return this; 039 } 040 041}