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 036 private final String eventName; 037 private final String eventType; 038 039 EventType(final String eventName, final String eventType) { 040 this.eventName = eventName; 041 this.eventType = eventType; 042 } 043 044 /** 045 * @return a human-readable name for this event 046 */ 047 public String getName() { 048 return this.eventName; 049 } 050 051 /** 052 * @return type for this event without the namespace. 053 */ 054 public String getTypeAbbreviated() { 055 return eventType; 056 } 057 058 /** 059 * @return an rdf type for this event 060 */ 061 public String getType() { 062 return ACTIVITY_STREAMS_NAMESPACE + eventType; 063 } 064 065}