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 static org.fcrepo.kernel.api.RdfLexicon.ACTIVITY_STREAMS_NAMESPACE;
021
022/**
023 * A collection of repository event types
024 *
025 * @author ajs6f
026 * @since Feb 7, 2013
027 */
028public enum EventType {
029
030    RESOURCE_CREATION("create resource", "Create"),
031    RESOURCE_DELETION("delete resource", "Delete"),
032    RESOURCE_MODIFICATION("update resource", "Update"),
033    RESOURCE_RELOCATION("move resource", "Move"),
034    INBOUND_REFERENCE("refer to resource", "Follow"),
035    RESOURCE_PURGE("remove resource tombstone", "Purge");
036
037    private final String eventName;
038    private final String eventType;
039
040    EventType(final String eventName, final String eventType) {
041        this.eventName = eventName;
042        this.eventType = eventType;
043    }
044
045    /**
046     * @return a human-readable name for this event
047     */
048    public String getName() {
049        return this.eventName;
050    }
051
052    /**
053     * @return  type for this event without the namespace.
054     */
055    public String getTypeAbbreviated() {
056        return eventType;
057    }
058
059    /**
060     * @return an rdf type for this event
061     */
062    public String getType() {
063        return ACTIVITY_STREAMS_NAMESPACE + eventType;
064    }
065
066}