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