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 */
018
019package org.fcrepo.kernel.impl.observer;
020
021import org.fcrepo.kernel.api.observer.Event;
022
023import java.util.Set;
024
025/**
026 * Stores details about an Event.
027 *
028 * @author pwinckles
029 */
030public interface EventBuilder {
031
032    /**
033     * Merges another EventBuilder into this EventBuilder. This should be used to combine multiple events on the same
034     * resource.
035     *
036     * @param other another EventBuilder
037     * @return this builder
038     */
039    EventBuilder merge(EventBuilder other);
040
041    /**
042     * Sets the resource's RDF Types on the event
043     *
044     * @param resourceTypes RDF Types
045     * @return this builder
046     */
047    EventBuilder withResourceTypes(Set<String> resourceTypes);
048
049    /**
050     * Sets the baseUrl of the requests
051     *
052     * @param baseUrl the base url
053     * @return this builder
054     */
055    EventBuilder withBaseUrl(String baseUrl);
056
057    /**
058     * Sets the user's user-agent
059     *
060     * @param userAgent the user's user-agent
061     * @return this builder
062     */
063    EventBuilder withUserAgent(String userAgent);
064
065    /**
066     * Constructs a new Event object from the details in the builder.
067     *
068     * @return new event
069     */
070    Event build();
071
072}