1 package org.apache.maven.index;
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 java.io.Serializable;
23 import java.util.regex.Pattern;
24
25 import org.apache.lucene.document.StoredField;
26
27 /**
28 * Pulling out ArtifactInfo, clearing up. TBD. This gonna be extensible "map-like" class with fields.
29 *
30 * @author cstamas
31 */
32 public class ArtifactInfoRecord
33 implements Serializable
34 {
35 private static final long serialVersionUID = -4577081994768263824L;
36
37 /** Field separator */
38 public static final String FS = "|";
39
40 public static final Pattern FS_PATTERN = Pattern.compile( Pattern.quote( FS ) );
41
42 /** Non available value */
43 public static final String NA = "NA";
44
45 // ----------
46 // V3 changes
47 // TODO: use getters instead of public fields
48 // ----------
49 // Listing all the fields that ArtifactInfo has on LuceneIndex
50
51 /**
52 * Unique groupId, artifactId, version, classifier, extension (or packaging). Stored, indexed untokenized
53 */
54 public static final IndexerField FLD_UINFO = new IndexerField( NEXUS.UINFO, IndexerFieldVersion.V1, "u",
55 "Artifact UINFO (as keyword, stored)", IndexerField.KEYWORD_STORED );
56
57 /**
58 * Del: contains UINFO to mark record as deleted (needed for incremental updates!). The original document IS
59 * removed, but this marker stays on index to note that fact.
60 */
61 public static final IndexerField FLD_DELETED = new IndexerField( NEXUS.DELETED, IndexerFieldVersion.V1, "del",
62 "Deleted field, will contain UINFO if document is deleted from index (not indexed, stored)", StoredField.TYPE );
63
64 }