org.axway.grapes.server.db
Interface RepositoryHandler

All Known Implementing Classes:
MongodbHandler

public interface RepositoryHandler

Repository Handler Interface

This interface has to be implemented by all the classes that handles the interaction between the application and the database.

Author:
jdcoffre

Method Summary
 void addLicenseToArtifact(DbArtifact artifact, String licenseId)
          Add a license to an existing artifact
 void addModulesOrganization(String corporateGroupId, DbOrganization dbOrganization)
          Updates all module that matches the corporate GID prefix setting the Organization name
 void addUserRole(String user, DbCredential.AvailableRoles role)
          Add a role to the targeted user
 void approveLicense(DbLicense license, Boolean approved)
          Approve or reject a license
 void deleteArtifact(String gavc)
          Delete the targeted artifact
 void deleteLicense(String name)
          Delete the targeted license from the database
 void deleteModule(String moduleId)
          Delete the targeted module
 void deleteOrganization(String organizationId)
          Remove an organization
 void deleteProduct(String name)
          Deletes a product from the database
 List<DbLicense> getAllLicenses()
          Retrieve all licenses from the database
 List<DbOrganization> getAllOrganizations()
          Returns all the Organizations form the database
 List<DbModule> getAncestors(DbArtifact artifact, FiltersHolder filters)
          Retrieve the list of the modules the use the targeted artifact
 DbArtifact getArtifact(String gavc)
          Return the targeted artifact
 List<DbArtifact> getArtifacts(FiltersHolder filters)
          Return a list of all the artifacts that match the filters
 List<String> getArtifactVersions(DbArtifact artifact)
          Return the list of all the available versions of the targeted artifacts
 DbCredential getCredential(String userId)
          Returns the credentials of a user
 List<String> getGavcs(FiltersHolder filters)
          Return the list of all the artifacts gavcs that match the provided filters
 List<String> getGroupIds(FiltersHolder filters)
          Return the list of all the artifacts groupIds that match the provided filters
 DbLicense getLicense(String name)
          Retrieve the targeted license from the database
 List<String> getLicenseNames(FiltersHolder filters)
          Return a list of all the available licenses regarding the provided filters
 DbModule getModule(String moduleId)
          Return the targeted module
 List<String> getModuleNames(FiltersHolder filters)
          Return the list of all the module names that match the provided filters
 DbModule getModuleOf(String gavc)
          Return the module or the submodule that contains the gavc.
 List<DbModule> getModules(FiltersHolder filters)
          Return a list od module regarding the filters
 List<String> getModuleVersions(String name, FiltersHolder filters)
          Retrieve the list of all the available versions of a module
 DbOrganization getOrganization(String name)
          Returns an organization
 List<String> getOrganizationNames()
          Returns all the organization names
 DbProduct getProduct(String name)
          Returns a product regarding its name
 List<String> getProductNames()
          Returns the list of product names
 DbModule getRootModuleOf(String gavc)
          Return the module that contains the gavc.
 void promoteModule(DbModule module)
          Promote the targeted module
 void removeLicenseFromArtifact(DbArtifact artifact, String name)
          Remove a license from an existing artifact
 void removeModulesOrganization(DbOrganization dbOrganization)
          Updates all module reference to the organization removing the Organization field
 void removeModulesOrganization(String corporateGroupId, DbOrganization dbOrganization)
          Updates all module that matches the corporate GID prefix AND that reference to the organization removing the Organization field
 void removeUserRole(String user, DbCredential.AvailableRoles role)
          Remove a role to the targeted user
 void store(DbArtifact dbArtifact)
          Create a new artifact or update an existing one in the database
 void store(DbCredential credential)
          Store a new credential or update an existing one
 void store(DbLicense license)
          Store a new license or update an existing one
 void store(DbModule dbModule)
          Create a new module or update an existing one into the database
 void store(DbOrganization organization)
          Stores an organization into the database
 void store(DbProduct dbProduct)
          Stores a product in Grapes db
 void updateDoNotUse(DbArtifact artifact, Boolean doNotUse)
          Update "DO_NOT_USE" field of an artifact
 void updateDownloadUrl(DbArtifact artifact, String downLoadUrl)
          Update the download url field of an artifact
 void updateProvider(DbArtifact artifact, String provider)
          Update provider field of an artifact
 

Method Detail

store

void store(DbCredential credential)
Store a new credential or update an existing one

Parameters:
credential - DbCredential

getCredential

DbCredential getCredential(String userId)
Returns the credentials of a user

Parameters:
userId - String
Returns:
DbCredential

addUserRole

void addUserRole(String user,
                 DbCredential.AvailableRoles role)
Add a role to the targeted user

Parameters:
user - String
role - AvailableRoles

removeUserRole

void removeUserRole(String user,
                    DbCredential.AvailableRoles role)
Remove a role to the targeted user

Parameters:
user - String
role - AvailableRoles

store

void store(DbLicense license)
Store a new license or update an existing one

Parameters:
license - DbLicense

getLicenseNames

List<String> getLicenseNames(FiltersHolder filters)
Return a list of all the available licenses regarding the provided filters

Parameters:
filters - FiltersHolder
Returns:
List

getLicense

DbLicense getLicense(String name)
Retrieve the targeted license from the database

Parameters:
name - String
Returns:
DbLicense

getAllLicenses

List<DbLicense> getAllLicenses()
Retrieve all licenses from the database

Returns:
List

deleteLicense

void deleteLicense(String name)
Delete the targeted license from the database

Parameters:
name - String

getArtifacts

List<DbArtifact> getArtifacts(FiltersHolder filters)
Return a list of all the artifacts that match the filters

Parameters:
filters - FiltersHolder
Returns:
List

addLicenseToArtifact

void addLicenseToArtifact(DbArtifact artifact,
                          String licenseId)
Add a license to an existing artifact

Parameters:
artifact - DbArtifact
licenseId - String

removeLicenseFromArtifact

void removeLicenseFromArtifact(DbArtifact artifact,
                               String name)
Remove a license from an existing artifact

Parameters:
artifact - DbArtifact
name - String

approveLicense

void approveLicense(DbLicense license,
                    Boolean approved)
Approve or reject a license

Parameters:
license - DbLicense
approved - Boolean

store

void store(DbArtifact dbArtifact)
Create a new artifact or update an existing one in the database

Parameters:
dbArtifact - DbArtifact

getGavcs

List<String> getGavcs(FiltersHolder filters)
Return the list of all the artifacts gavcs that match the provided filters

Parameters:
filters - FiltersHolder
Returns:
List

getGroupIds

List<String> getGroupIds(FiltersHolder filters)
Return the list of all the artifacts groupIds that match the provided filters

Parameters:
filters - FiltersHolder
Returns:
List

getArtifactVersions

List<String> getArtifactVersions(DbArtifact artifact)
Return the list of all the available versions of the targeted artifacts

Parameters:
artifact - DbArtifact
Returns:
List

getArtifact

DbArtifact getArtifact(String gavc)
Return the targeted artifact

Parameters:
gavc - String
Returns:
DbArtifact

deleteArtifact

void deleteArtifact(String gavc)
Delete the targeted artifact

Parameters:
gavc - String

updateDoNotUse

void updateDoNotUse(DbArtifact artifact,
                    Boolean doNotUse)
Update "DO_NOT_USE" field of an artifact

Parameters:
artifact - DbArtifact
doNotUse - Boolean

updateDownloadUrl

void updateDownloadUrl(DbArtifact artifact,
                       String downLoadUrl)
Update the download url field of an artifact

Parameters:
artifact - DbArtifact
downLoadUrl - String

updateProvider

void updateProvider(DbArtifact artifact,
                    String provider)
Update provider field of an artifact

Parameters:
artifact - DbArtifact
provider - String

getAncestors

List<DbModule> getAncestors(DbArtifact artifact,
                            FiltersHolder filters)
Retrieve the list of the modules the use the targeted artifact

Parameters:
artifact - String
filters - FiltersHolder
Returns:
List

store

void store(DbModule dbModule)
Create a new module or update an existing one into the database

Parameters:
dbModule - DbModule

getModuleNames

List<String> getModuleNames(FiltersHolder filters)
Return the list of all the module names that match the provided filters

Parameters:
filters - FiltersHolder
Returns:
List

getModuleVersions

List<String> getModuleVersions(String name,
                               FiltersHolder filters)
Retrieve the list of all the available versions of a module

Parameters:
name - String
filters - FiltersHolder
Returns:
List

getModule

DbModule getModule(String moduleId)
Return the targeted module

Parameters:
moduleId - String
Returns:
DbModule

getModules

List<DbModule> getModules(FiltersHolder filters)
Return a list od module regarding the filters

Parameters:
filters - FiltersHolder
Returns:
List

deleteModule

void deleteModule(String moduleId)
Delete the targeted module

Parameters:
moduleId - String

promoteModule

void promoteModule(DbModule module)
Promote the targeted module

Parameters:
module - String

getRootModuleOf

DbModule getRootModuleOf(String gavc)
Return the module that contains the gavc. It returns null if no module matches.

Parameters:
gavc - String
Returns:
DbModule

getModuleOf

DbModule getModuleOf(String gavc)
Return the module or the submodule that contains the gavc. It returns null if no module matches.

Parameters:
gavc - String
Returns:
DbModule

getOrganizationNames

List<String> getOrganizationNames()
Returns all the organization names

Returns:
List

getOrganization

DbOrganization getOrganization(String name)
Returns an organization

Parameters:
name - String
Returns:
DbOrganization

deleteOrganization

void deleteOrganization(String organizationId)
Remove an organization

Parameters:
organizationId - String

store

void store(DbOrganization organization)
Stores an organization into the database

Parameters:
organization - DbOrganization

addModulesOrganization

void addModulesOrganization(String corporateGroupId,
                            DbOrganization dbOrganization)
Updates all module that matches the corporate GID prefix setting the Organization name

Parameters:
corporateGroupId - String
dbOrganization - DbOrganization

removeModulesOrganization

void removeModulesOrganization(String corporateGroupId,
                               DbOrganization dbOrganization)
Updates all module that matches the corporate GID prefix AND that reference to the organization removing the Organization field

Parameters:
corporateGroupId - String
dbOrganization - DbOrganization

removeModulesOrganization

void removeModulesOrganization(DbOrganization dbOrganization)
Updates all module reference to the organization removing the Organization field

Parameters:
dbOrganization - DbOrganization

getAllOrganizations

List<DbOrganization> getAllOrganizations()
Returns all the Organizations form the database

Returns:
List

store

void store(DbProduct dbProduct)
Stores a product in Grapes db

Parameters:
dbProduct - DbProduct

getProduct

DbProduct getProduct(String name)
Returns a product regarding its name

Parameters:
name - String
Returns:
DbProduct

getProductNames

List<String> getProductNames()
Returns the list of product names

Returns:
List

deleteProduct

void deleteProduct(String name)
Deletes a product from the database

Parameters:
name - String


Copyright © 2014. All Rights Reserved.