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.api.operations;
019
020import org.fcrepo.kernel.api.Transaction;
021import org.fcrepo.kernel.api.identifiers.FedoraId;
022
023import java.io.InputStream;
024import java.net.URI;
025
026/**
027 * Factory for constructing operations on non-rdf sources
028 *
029 * @author bbpennel
030 */
031public interface NonRdfSourceOperationFactory extends ResourceOperationFactory {
032
033    /**
034     * Get a builder for a external binary update operation
035     *
036     * @param transaction the transaction
037     * @param rescId id of the resource targeted by the operation
038     * @param handling the type of handling to be used for the external binary content
039     * @param contentUri the URI of the external binary content
040     * @return a new builder
041     */
042    NonRdfSourceOperationBuilder updateExternalBinaryBuilder(Transaction transaction, FedoraId rescId, String handling,
043                                                             URI contentUri);
044
045    /**
046     * Get a builder for an internal binary update operation
047     *
048     * @param transaction the transaction
049     * @param rescId id of the resource targeted by the operation
050     * @param contentStream inputstream for the content of this binary
051     * @return a new builder
052     */
053    NonRdfSourceOperationBuilder updateInternalBinaryBuilder(Transaction transaction, FedoraId rescId,
054                                                             InputStream contentStream);
055
056    /**
057     * Get a builder for a external binary create operation
058     *
059     * @param transaction the transaction
060     * @param rescId id of the resource targeted by the operation
061     * @param handling the type of handling to be used for the external binary content
062     * @param contentUri the URI of the external binary content
063     * @return a new builder
064     */
065    CreateNonRdfSourceOperationBuilder createExternalBinaryBuilder(Transaction transaction, FedoraId rescId,
066                                                                   String handling,
067                                                                   URI contentUri);
068
069    /**
070     * Get a builder for an internal binary create operation
071     *
072     * @param transaction the transaction
073     * @param rescId id of the resource targeted by the operation
074     * @param contentStream inputstream for the content of this binary
075     * @return a new builder
076     */
077    CreateNonRdfSourceOperationBuilder createInternalBinaryBuilder(Transaction transaction, FedoraId rescId,
078                                                                   InputStream contentStream);
079}