KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > maven > artifact > metadata > ArtifactMetadata


1 package org.apache.maven.artifact.metadata;
2
3 /*
4  * Copyright 2001-2005 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 import org.apache.maven.artifact.repository.ArtifactRepository;
20 import org.apache.maven.artifact.repository.metadata.RepositoryMetadataStoreException;
21
22 /**
23  * Contains metadata about an artifact, and methods to retrieve/store it from an artifact repository.
24  *
25  * @author <a HREF="mailto:brett@apache.org">Brett Porter</a>
26  * @version $Id: ArtifactMetadata.java 320683 2005-10-13 08:04:27Z brett $
27  * @todo merge with artifactmetadatasource
28  * @todo retrieval exception not appropriate for store
29  */

30 public interface ArtifactMetadata
31 {
32     /**
33      * Whether this metadata should be stored alongside the artifact.
34      */

35     boolean storedInArtifactVersionDirectory();
36
37     /**
38      * Whether this metadata should be stored alongside the group.
39      */

40     boolean storedInGroupDirectory();
41
42     String JavaDoc getGroupId();
43
44     String JavaDoc getArtifactId();
45
46     String JavaDoc getBaseVersion();
47
48     Object JavaDoc getKey();
49
50     /**
51      * Get the filename of this metadata on the local repository.
52      *
53      * @param repository the remote repository it came from
54      * @return the filename
55      */

56     String JavaDoc getLocalFilename( ArtifactRepository repository );
57
58     /**
59      * Get the filename of this metadata on the remote repository.
60      *
61      * @return the filename
62      */

63     String JavaDoc getRemoteFilename();
64
65     /**
66      * Merge a new metadata set into this piece of metadata.
67      *
68      * @param metadata the new metadata
69      * @todo this should only be needed on the repository metadata
70      */

71     void merge( ArtifactMetadata metadata );
72
73     /**
74      * Store the metadata in the local repository.
75      *
76      * @param localRepository the local repository
77      * @param remoteRepository the remote repository it came from
78      * @todo this should only be needed on the repository metadata
79      */

80     void storeInLocalRepository( ArtifactRepository localRepository, ArtifactRepository remoteRepository )
81         throws RepositoryMetadataStoreException;
82
83     String JavaDoc extendedToString();
84 }
85
Popular Tags