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.ResourceOperation;
011
012/**
013 * Abstract operation for interacting with a resource
014 *
015 * @author bbpennel
016 */
017public abstract class AbstractResourceOperation implements ResourceOperation {
018
019    /**
020     * The internal Fedora ID.
021     */
022    private final FedoraId rescId;
023
024    private String userPrincipal;
025
026    private Transaction transaction;
027
028    protected AbstractResourceOperation(final Transaction transaction, final FedoraId rescId) {
029        this.rescId = rescId;
030        this.transaction = transaction;
031    }
032
033    @Override
034    public FedoraId getResourceId() {
035        return rescId;
036    }
037
038    @Override
039    public String getUserPrincipal() {
040        return userPrincipal;
041    }
042
043    @Override
044    public Transaction getTransaction() {
045        return transaction;
046    }
047
048    /**
049     * @param userPrincipal the userPrincipal to set
050     */
051    public void setUserPrincipal(final String userPrincipal) {
052        this.userPrincipal = userPrincipal;
053    }
054
055}