1 package org.apache.archiva.repository.events;
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.metadata.model.ProjectVersionMetadata;
23 import org.apache.archiva.metadata.repository.MetadataRepository;
24 import org.apache.archiva.metadata.repository.RepositorySession;
25 import org.apache.archiva.metadata.repository.storage.RepositoryStorageMetadataException;
26
27 /**
28 * Listen to events on the repository. This class is a stopgap
29 * refactoring measure until an event bus is in place to handle
30 * generic events such as these.
31 * <p>
32 * This assumes that the events occur before the action has completed, though they don't currently offer any mechanism
33 * to prevent an event from occurring or guarantee that it will happen.
34 * <p>
35 * FIXME: this needs to be made more permanent since 3rd party plugins will depend on it heavily
36 */
37 public interface RepositoryListener
38 {
39 void deleteArtifact( MetadataRepository metadataRepository, String repositoryId, String namespace, String project,
40 String version, String id );
41
42 void addArtifact( RepositorySession session, String repoId, String namespace, String projectId,
43 ProjectVersionMetadata metadata );
44
45 // FIXME: this would be better as a "processException" method, with the event information captured in a single class
46 void addArtifactProblem( RepositorySession session, String repoId, String namespace, String projectId,
47 String projectVersion, RepositoryStorageMetadataException exception );
48 }