1 package org.apache.archiva.rest.api.model;
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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
22 import javax.xml.bind.annotation.XmlRootElement;
23 import java.io.Serializable;
24 import java.util.List;
26 @XmlRootElement( name = "artifact" )
28 implements Serializable
30 // The (optional) context for this result.
31 private String context;
33 // Basic hit, direct to non-artifact resource.
36 // Advanced hit, reference to groupId.
37 private String groupId;
39 // Advanced hit, reference to artifactId.
40 private String artifactId;
42 private String repositoryId;
44 private String version;
47 * Plugin goal prefix (only if packaging is "maven-plugin")
49 private String prefix;
52 * Plugin goals (only if packaging is "maven-plugin")
54 private List<String> goals;
57 * contains osgi metadata Bundle-Version if available
61 private String bundleVersion;
64 * contains osgi metadata Bundle-SymbolicName if available
68 private String bundleSymbolicName;
71 * contains osgi metadata Export-Package if available
75 private String bundleExportPackage;
78 * contains osgi metadata Export-Service if available
82 private String bundleExportService;
85 * contains osgi metadata Bundle-Description if available
89 private String bundleDescription;
92 * contains osgi metadata Bundle-Name if available
96 private String bundleName;
99 * contains osgi metadata Bundle-License if available
103 private String bundleLicense;
106 * contains osgi metadata Bundle-DocURL if available
110 private String bundleDocUrl;
113 * contains osgi metadata Import-Package if available
117 private String bundleImportPackage;
120 * contains osgi metadata Require-Bundle if available
124 private String bundleRequireBundle;
126 private String classifier;
128 private String packaging;
131 * file extension of the artifact
135 private String fileExtension;
138 * human readable size : not available for all services
155 * concat of artifactId+'-'+version+'.'+type
166 public Artifact( String groupId, String artifactId, String version )
168 this.artifactId = artifactId;
169 this.groupId = groupId;
170 this.version = version;
173 public String getGroupId()
178 public String getArtifactId()
183 public String getVersion()
188 public String getRepositoryId()
193 public void setGroupId( String groupId )
195 this.groupId = groupId;
198 public void setArtifactId( String artifactId )
200 this.artifactId = artifactId;
203 public void setVersion( String version )
205 this.version = version;
208 public void setRepositoryId( String repositoryId )
210 this.repositoryId = repositoryId;
213 public String getContext()
218 public void setContext( String context )
220 this.context = context;
223 public String getUrl()
228 public void setUrl( String url )
233 public String getPrefix()
238 public void setPrefix( String prefix )
240 this.prefix = prefix;
243 public List<String> getGoals()
248 public void setGoals( List<String> goals )
253 public String getBundleVersion()
255 return bundleVersion;
258 public void setBundleVersion( String bundleVersion )
260 this.bundleVersion = bundleVersion;
263 public String getBundleSymbolicName()
265 return bundleSymbolicName;
268 public void setBundleSymbolicName( String bundleSymbolicName )
270 this.bundleSymbolicName = bundleSymbolicName;
273 public String getBundleExportPackage()
275 return bundleExportPackage;
278 public void setBundleExportPackage( String bundleExportPackage )
280 this.bundleExportPackage = bundleExportPackage;
283 public String getBundleExportService()
285 return bundleExportService;
288 public void setBundleExportService( String bundleExportService )
290 this.bundleExportService = bundleExportService;
293 public String getBundleDescription()
295 return bundleDescription;
298 public void setBundleDescription( String bundleDescription )
300 this.bundleDescription = bundleDescription;
303 public String getBundleName()
308 public void setBundleName( String bundleName )
310 this.bundleName = bundleName;
313 public String getBundleLicense()
315 return bundleLicense;
318 public void setBundleLicense( String bundleLicense )
320 this.bundleLicense = bundleLicense;
323 public String getBundleDocUrl()
328 public void setBundleDocUrl( String bundleDocUrl )
330 this.bundleDocUrl = bundleDocUrl;
333 public String getBundleImportPackage()
335 return bundleImportPackage;
338 public void setBundleImportPackage( String bundleImportPackage )
340 this.bundleImportPackage = bundleImportPackage;
343 public String getBundleRequireBundle()
345 return bundleRequireBundle;
348 public void setBundleRequireBundle( String bundleRequireBundle )
350 this.bundleRequireBundle = bundleRequireBundle;
353 public String getClassifier()
358 public void setClassifier( String classifier )
360 this.classifier = classifier;
364 public String getPackaging()
369 public void setPackaging( String packaging )
371 this.packaging = packaging;
374 public String getFileExtension()
376 return fileExtension;
379 public void setFileExtension( String fileExtension )
381 this.fileExtension = fileExtension;
384 public String getSize()
389 public void setSize( String size )
394 public String getType()
399 public void setType( String type )
404 public String getPath()
409 public void setPath( String path )
414 public String getId()
419 public void setId( String id )
425 public String toString()
427 final StringBuilder sb = new StringBuilder();
428 sb.append( "Artifact" );
429 sb.append( "{context='" ).append( context ).append( '\'' );
430 sb.append( ", url='" ).append( url ).append( '\'' );
431 sb.append( ", groupId='" ).append( groupId ).append( '\'' );
432 sb.append( ", artifactId='" ).append( artifactId ).append( '\'' );
433 sb.append( ", repositoryId='" ).append( repositoryId ).append( '\'' );
434 sb.append( ", version='" ).append( version ).append( '\'' );
435 sb.append( ", prefix='" ).append( prefix ).append( '\'' );
436 sb.append( ", goals=" ).append( goals );
437 sb.append( ", bundleVersion='" ).append( bundleVersion ).append( '\'' );
438 sb.append( ", bundleSymbolicName='" ).append( bundleSymbolicName ).append( '\'' );
439 sb.append( ", bundleExportPackage='" ).append( bundleExportPackage ).append( '\'' );
440 sb.append( ", bundleExportService='" ).append( bundleExportService ).append( '\'' );
441 sb.append( ", bundleDescription='" ).append( bundleDescription ).append( '\'' );
442 sb.append( ", bundleName='" ).append( bundleName ).append( '\'' );
443 sb.append( ", bundleLicense='" ).append( bundleLicense ).append( '\'' );
444 sb.append( ", bundleDocUrl='" ).append( bundleDocUrl ).append( '\'' );
445 sb.append( ", bundleImportPackage='" ).append( bundleImportPackage ).append( '\'' );
446 sb.append( ", bundleRequireBundle='" ).append( bundleRequireBundle ).append( '\'' );
447 sb.append( ", classifier='" ).append( classifier ).append( '\'' );
448 sb.append( ", packaging='" ).append( packaging ).append( '\'' );
449 sb.append( ", fileExtension='" ).append( fileExtension ).append( '\'' );
450 sb.append( ", size='" ).append( size ).append( '\'' );
451 sb.append( ", type='" ).append( type ).append( '\'' );
452 sb.append( ", path='" ).append( path ).append( '\'' );
453 sb.append( ", id='" ).append( id ).append( '\'' );
455 return sb.toString();