001/*
002 * Licensed to DuraSpace under one or more contributor license agreements.
003 * See the NOTICE file distributed with this work for additional information
004 * regarding copyright ownership.
005 *
006 * DuraSpace licenses this file to you under the Apache License,
007 * Version 2.0 (the "License"); you may not use this file except in
008 * compliance with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018package org.fcrepo.kernel.impl.operations;
019
020import java.time.Instant;
021
022import org.fcrepo.kernel.api.RdfStream;
023import org.fcrepo.kernel.api.identifiers.FedoraId;
024import org.fcrepo.kernel.api.operations.RdfSourceOperation;
025
026/**
027 * Abstract operation for interacting with an rdf source
028 *
029 * @author bbpennel
030 */
031public abstract class AbstractRdfSourceOperation extends AbstractResourceOperation implements RdfSourceOperation {
032
033    protected RdfStream triples;
034
035    protected String lastModifiedBy;
036
037    protected String createdBy;
038
039    protected Instant lastModifiedDate;
040
041    protected Instant createdDate;
042
043    protected AbstractRdfSourceOperation(final FedoraId rescId, final RdfStream triples) {
044        super(rescId);
045        this.triples = triples;
046    }
047
048    @Override
049    public RdfStream getTriples() {
050        return triples;
051    }
052
053    @Override
054    public String getLastModifiedBy() {
055        return lastModifiedBy;
056    }
057
058    @Override
059    public String getCreatedBy() {
060        return createdBy;
061    }
062
063    @Override
064    public Instant getLastModifiedDate() {
065        return lastModifiedDate;
066    }
067
068    @Override
069    public Instant getCreatedDate() {
070        return createdDate;
071    }
072
073    /**
074     * @param lastModifiedBy the lastModifiedBy to set
075     */
076    protected void setLastModifiedBy(final String lastModifiedBy) {
077        this.lastModifiedBy = lastModifiedBy;
078    }
079
080    /**
081     * @param createdBy the createdBy to set
082     */
083    protected void setCreatedBy(final String createdBy) {
084        this.createdBy = createdBy;
085    }
086
087    /**
088     * @param lastModifiedDate the lastModifiedDate to set
089     */
090    protected void setLastModifiedDate(final Instant lastModifiedDate) {
091        this.lastModifiedDate = lastModifiedDate;
092    }
093
094    /**
095     * @param createdDate the createdDate to set
096     */
097    protected void setCreatedDate(final Instant createdDate) {
098        this.createdDate = createdDate;
099    }
100
101}