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 org.fcrepo.kernel.api.RdfStream;
021import org.fcrepo.kernel.api.Transaction;
022import org.fcrepo.kernel.api.identifiers.FedoraId;
023import org.fcrepo.kernel.api.operations.CreateRdfSourceOperation;
024
025/**
026 * Operation to create an RDF source.
027 *
028 * @author bbpennel
029 */
030public class CreateRdfSourceOperationImpl extends AbstractRdfSourceOperation implements CreateRdfSourceOperation {
031
032    private FedoraId parentId;
033
034    /**
035     * The interaction model
036     */
037    private String interactionModel;
038
039    private boolean archivalGroup = false;
040
041    /**
042     * Constructor for creation operation
043     *
044     * @param transaction the transaction
045     * @param rescId the internal identifier.
046     * @param interactionModel interaction model for the resource
047     * @param triples triples stream for the resource
048     */
049    protected CreateRdfSourceOperationImpl(final Transaction transaction, final FedoraId rescId,
050                                           final String interactionModel, final RdfStream triples) {
051        super(transaction, rescId, triples);
052        this.interactionModel = interactionModel;
053    }
054
055    @Override
056    public String getInteractionModel() {
057        return interactionModel;
058    }
059
060    @Override
061    public boolean isArchivalGroup() {
062        return this.archivalGroup;
063    }
064
065    @Override
066    public FedoraId getParentId() {
067        return parentId;
068    }
069
070    /**
071     * @param parentId the parentId to set
072     */
073    public void setParentId(final FedoraId parentId) {
074        this.parentId = parentId;
075    }
076
077    /**
078     *
079     * @param flag flag indicating whether resource is an Archival Group
080     */
081    public void setArchivalGroup(final boolean flag) {
082        this.archivalGroup = flag;
083    }
084
085
086}