This project has retired. For details please refer to its
Attic page.
RepositoryProblemFacet xref
1 package org.apache.archiva.metadata.model.facets;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.HashMap;
23 import java.util.Map;
24
25 import org.apache.archiva.metadata.model.MetadataFacet;
26
27 public class RepositoryProblemFacet
28 implements MetadataFacet
29 {
30 public static final String FACET_ID = "org.apache.archiva.reports";
31
32 private String repositoryId;
33
34 private String namespace;
35
36 private String project;
37
38 private String version;
39
40 private String id;
41
42 private String message;
43
44 private String problem;
45
46 @Override
47 public String getFacetId()
48 {
49 return FACET_ID;
50 }
51
52 @Override
53 public String getName()
54 {
55 return createName( namespace, project, version, id );
56 }
57
58 @Override
59 public Map<String, String> toProperties()
60 {
61 Map<String, String> map = new HashMap<>();
62 map.put( "repositoryId", repositoryId );
63 map.put( "namespace", namespace );
64 map.put( "project", project );
65 map.put( "version", version );
66 if ( id != null )
67 {
68 map.put( "id", id );
69 }
70 map.put( "message", message );
71 map.put( "problem", problem );
72 return map;
73 }
74
75 @Override
76 public void fromProperties( Map<String, String> properties )
77 {
78 repositoryId = properties.get( "repositoryId" );
79 namespace = properties.get( "namespace" );
80 project = properties.get( "project" );
81 version = properties.get( "version" );
82 id = properties.get( "id" );
83 message = properties.get( "message" );
84 problem = properties.get( "problem" );
85 }
86
87 public void setRepositoryId( String repositoryId )
88 {
89 this.repositoryId = repositoryId;
90 }
91
92 public void setNamespace( String namespace )
93 {
94 this.namespace = namespace;
95 }
96
97 public String getRepositoryId()
98 {
99 return repositoryId;
100 }
101
102 public String getNamespace()
103 {
104 return namespace;
105 }
106
107 public void setProject( String project )
108 {
109 this.project = project;
110 }
111
112 public String getProject()
113 {
114 return project;
115 }
116
117 public void setVersion( String version )
118 {
119 this.version = version;
120 }
121
122 public String getVersion()
123 {
124 return version;
125 }
126
127 public void setId( String id )
128 {
129 this.id = id;
130 }
131
132 public String getId()
133 {
134 return id;
135 }
136
137 public void setMessage( String message )
138 {
139 this.message = message;
140 }
141
142 public String getMessage()
143 {
144 return message;
145 }
146
147 public void setProblem( String problem )
148 {
149 this.problem = problem;
150 }
151
152 public String getProblem()
153 {
154 return problem;
155 }
156
157 public static String createName( String namespace, String project, String projectVersion, String id )
158 {
159 String name = namespace + "/" + project + "/" + projectVersion;
160 if ( id != null )
161 {
162 name = name + "/" + id;
163 }
164 return name;
165 }
166 }