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.observer;
019
020import org.fcrepo.kernel.api.identifiers.FedoraId;
021
022import java.net.URI;
023import java.time.Instant;
024import java.util.Set;
025
026/**
027 * A very simple abstraction to support downstream event-related machinery.
028 *
029 * @author ajs6f
030 * @author acoburn
031 * @since Feb 19, 2013
032 */
033public interface Event {
034
035    /**
036     * @return the FedoraId of the resource associated with this event.
037     */
038    FedoraId getFedoraId();
039
040    /**
041     * @return the event types associated with this event.
042     */
043    Set<EventType> getTypes();
044
045    /**
046     * @return the RDF Types of the resource associated with this event.
047    **/
048    Set<String> getResourceTypes();
049
050    /**
051     * @return the path to the {@link org.fcrepo.kernel.api.models.FedoraResource}
052     */
053    String getPath();
054
055    /**
056     * @return the user ID associated with this event.
057     */
058    String getUserID();
059
060    /**
061     * Get the user URI associated with this event.
062     * @return user URI
063     */
064    URI getUserURI();
065
066    /**
067     * @return The user-agent associated to the request
068     */
069    String getUserAgent();
070
071    /**
072     * @return the date of this event.
073     */
074    Instant getDate();
075
076    /**
077     * Get the event ID.
078     * @return Event identifier to use for building event URIs (e.g., in an external triplestore).
079    **/
080    String getEventID();
081
082    /**
083     * @return The originating request's baseUrl
084     */
085    String getBaseUrl();
086
087}