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.EVENT_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("resource creation", "ResourceCreation"), 031 RESOURCE_DELETION("resource deletion", "ResourceDeletion"), 032 RESOURCE_MODIFICATION("resource modification", "ResourceModification"), 033 RESOURCE_RELOCATION("resource relocation", "ResourceRelocation"); 034 035 private final String eventName; 036 private final String eventType; 037 038 EventType(final String eventName, final String eventType) { 039 this.eventName = eventName; 040 this.eventType = eventType; 041 } 042 043 /** 044 * @return a human-readable name for this event 045 */ 046 public String getName() { 047 return this.eventName; 048 } 049 050 /** 051 * @return an rdf type for this event 052 */ 053 public String getType() { 054 return EVENT_NAMESPACE + eventType; 055 } 056}