org.axway.grapes.server.core
Class ArtifactHandler

java.lang.Object
  extended by org.axway.grapes.server.core.ArtifactHandler

public class ArtifactHandler
extends Object

Artifact Handler

Manages all operation regarding Artifacts. It can, get/update Artifacts of the database.

Author:
jdcoffre

Constructor Summary
ArtifactHandler(RepositoryHandler repositoryHandler)
           
 
Method Summary
 void addLicense(String gavc, String licenseId)
          Adds a license to an artifact if the license exist into the database
 void addLicenseToArtifact(String gavc, String licenseId)
          Add a license to an artifact
 void deleteArtifact(String gavc)
          Delete an artifact
 List<DbModule> getAncestors(String gavc, FiltersHolder filters)
          Return the list of module that uses the targeted artifact
 DbArtifact getArtifact(String gavc)
          Return an artifact regarding its gavc
 List<String> getArtifactGavcs(FiltersHolder filters)
          Gather the available gavc regarding the filters
 List<String> getArtifactGroupIds(FiltersHolder filters)
          Gather the available groupIds regarding the filters
 String getArtifactLastVersion(String gavc)
          Returns a the last available version of an artifact
 List<DbLicense> getArtifactLicenses(String gavc, FiltersHolder filters)
          Return the list of licenses attached to an artifact
 List<DbArtifact> getArtifacts(FiltersHolder filters)
          Returns a list of artifact regarding the filters
 List<String> getArtifactVersions(String gavc)
          Returns a the list of available version of an artifact
 DbModule getModule(DbArtifact dbArtifact)
          Returns the Module of artifact or null if there is none
 DbOrganization getOrganization(DbArtifact dbArtifact)
          Returns the Organization that produce this artifact or null if there is none
 void removeLicenseFromArtifact(String gavc, String licenseId)
          Remove a license from an artifact
 void store(DbArtifact dbArtifact)
          Update/save an artifact to the database
 void storeIfNew(DbArtifact dbArtifact)
          If the Artifact does not exist, it will add it to the database.
 void updateDoNotUse(String gavc, Boolean doNotUse)
          Add "DO_NOT_USE" flag to an artifact
 void updateDownLoadUrl(String gavc, String downLoadUrl)
          Update artifact download url of an artifact
 void updateProvider(String gavc, String provider)
          Update artifact provider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArtifactHandler

public ArtifactHandler(RepositoryHandler repositoryHandler)
Method Detail

store

public void store(DbArtifact dbArtifact)
Update/save an artifact to the database

Parameters:
dbArtifact - DbArtifact

storeIfNew

public void storeIfNew(DbArtifact dbArtifact)
If the Artifact does not exist, it will add it to the database. Nothing if it already exit.

Parameters:
dbArtifact - DbArtifact

addLicense

public void addLicense(String gavc,
                       String licenseId)
Adds a license to an artifact if the license exist into the database

Parameters:
gavc - String
licenseId - String

getArtifactGavcs

public List<String> getArtifactGavcs(FiltersHolder filters)
Gather the available gavc regarding the filters

Parameters:
filters - FiltersHolder
Returns:
List

getArtifactGroupIds

public List<String> getArtifactGroupIds(FiltersHolder filters)
Gather the available groupIds regarding the filters

Parameters:
filters -
Returns:
List

getArtifactVersions

public List<String> getArtifactVersions(String gavc)
Returns a the list of available version of an artifact

Parameters:
gavc - String
Returns:
List

getArtifactLastVersion

public String getArtifactLastVersion(String gavc)
Returns a the last available version of an artifact

Parameters:
gavc - String
Returns:
String

getArtifact

public DbArtifact getArtifact(String gavc)
Return an artifact regarding its gavc

Parameters:
gavc - String
Returns:
DbArtifact

getModule

public DbModule getModule(DbArtifact dbArtifact)
Returns the Module of artifact or null if there is none

Parameters:
dbArtifact - DbArtifact
Returns:
DbModule

getOrganization

public DbOrganization getOrganization(DbArtifact dbArtifact)
Returns the Organization that produce this artifact or null if there is none

Parameters:
dbArtifact - DbArtifact
Returns:
DbOrganization

updateDownLoadUrl

public void updateDownLoadUrl(String gavc,
                              String downLoadUrl)
Update artifact download url of an artifact

Parameters:
gavc - String
downLoadUrl - String

updateProvider

public void updateProvider(String gavc,
                           String provider)
Update artifact provider

Parameters:
gavc - String
provider - String

deleteArtifact

public void deleteArtifact(String gavc)
Delete an artifact

Parameters:
gavc - String

updateDoNotUse

public void updateDoNotUse(String gavc,
                           Boolean doNotUse)
Add "DO_NOT_USE" flag to an artifact

Parameters:
gavc - String
doNotUse - Boolean

getAncestors

public List<DbModule> getAncestors(String gavc,
                                   FiltersHolder filters)
Return the list of module that uses the targeted artifact

Parameters:
gavc - String
filters - FiltersHolder
Returns:
List

getArtifactLicenses

public List<DbLicense> getArtifactLicenses(String gavc,
                                           FiltersHolder filters)
Return the list of licenses attached to an artifact

Parameters:
gavc - String
filters - FiltersHolder
Returns:
List

addLicenseToArtifact

public void addLicenseToArtifact(String gavc,
                                 String licenseId)
Add a license to an artifact

Parameters:
gavc - String
licenseId - String

removeLicenseFromArtifact

public void removeLicenseFromArtifact(String gavc,
                                      String licenseId)
Remove a license from an artifact

Parameters:
gavc - String
licenseId - String

getArtifacts

public List<DbArtifact> getArtifacts(FiltersHolder filters)
Returns a list of artifact regarding the filters

Parameters:
filters - FiltersHolder
Returns:
List


Copyright © 2014. All Rights Reserved.