1 package org.apache.archiva.repository.event;
2
3 /*
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 */
21
22 import org.apache.archiva.event.EventType;
23 import org.apache.archiva.repository.Repository;
24
25 /**
26 * Repository value events are used for providing information about repository attribute changes.
27 * The value event gives information of the attribute value before and after the change.
28 *
29 * @param <V> The type of the changed attribute
30 */
31 public class RepositoryValueEvent<V> extends RepositoryEvent {
32
33 private static final long serialVersionUID = 4176597620699304794L;
34
35 public static final EventType<RepositoryValueEvent<?>> ANY = new EventType(RepositoryEvent.ANY, "REPOSITORY.VALUE");
36
37 final V value;
38 final V oldValue;
39 final String attributeName;
40
41 public RepositoryValueEvent(EventType<? extends RepositoryValueEvent<V>> type, Object origin, Repository repo, V oldValue, V value,
42 String attributeName) {
43 super(type, origin, repo);
44 this.value = value;
45 this.oldValue = oldValue;
46 this.attributeName = attributeName;
47 }
48
49 public V getValue() {
50 return value;
51 }
52
53 public V getOldValue() {
54 return oldValue;
55 }
56
57 public String getAttributeName() {
58 return attributeName;
59 }
60
61 }