org.axway.grapes.server.webapp.resources
Class ModuleResource

java.lang.Object
  extended by com.yammer.dropwizard.views.View
      extended by org.axway.grapes.server.webapp.resources.AbstractResource
          extended by org.axway.grapes.server.webapp.resources.ModuleResource

public class ModuleResource
extends AbstractResource

Module Resource

This server resource handles all the request about modules.
This resource extends DepManViews to holds its own documentation. The documentation is available in ModuleResourceDocumentation.ftl file.

Author:
jdcoffre

Constructor Summary
ModuleResource(RepositoryHandler repoHandler, GrapesServerConfig dmConfig)
           
 
Method Summary
 javax.ws.rs.core.Response canBePromoted(String name, String version)
          Check if a module can be promoted or not This method is call via GET /module///promotion/check
 javax.ws.rs.core.Response delete(DbCredential credential, String name, String version)
          Delete a module.
 javax.ws.rs.core.Response get(String name, String version)
          Return a module.
 javax.ws.rs.core.Response getAllModules(javax.ws.rs.core.UriInfo uriInfo)
          Provide a list of module regarding the query parameter filters
 javax.ws.rs.core.Response getAncestors(String name, String version, javax.ws.rs.core.UriInfo uriInfo)
          Return ancestor list of a module.
 javax.ws.rs.core.Response getBuildInfo(String name, String version)
          Return a build info
 javax.ws.rs.core.Response getDependencies(String name, String version, javax.ws.rs.core.UriInfo uriInfo)
          Return a module dependency list.
 javax.ws.rs.core.Response getDependencyReport(String name, String version, javax.ws.rs.core.UriInfo uriInfo)
          Return a report about the targeted module dependencies.
 javax.ws.rs.core.Response getLicenses(String name, String version)
          Return license list of a module.
 javax.ws.rs.core.Response getNames(javax.ws.rs.core.UriInfo uriInfo)
          Return a list of moduleNames, stored in Grapes, regarding the filters passed in the query parameters.
 javax.ws.rs.core.Response getOrganization(String name, String version)
          Return an Organization.
 javax.ws.rs.core.Response getPromotionStatusReport(String name, String version)
          Return a promotion report
 javax.ws.rs.core.Response getVersions(String name, javax.ws.rs.core.UriInfo uriInfo)
          Return a list of moduleNames, stored in Grapes, regarding the filters passed in the query parameters.
 javax.ws.rs.core.Response getVersionsRedirection(String name, javax.ws.rs.core.UriInfo uriInfo)
           
 javax.ws.rs.core.Response isPromoted(String name, String version)
          Check if a module is promoted or not This method is call via GET /module///promotion
 javax.ws.rs.core.Response postModule(DbCredential credential, Module module)
          Handle the update/addition of a module in Grapes database
 javax.ws.rs.core.Response promote(DbCredential credential, String name, String version)
          Promote a module.
 javax.ws.rs.core.Response updateBuildInfo(String name, String version, Map<String,String> buildInfo)
          Update a build info
 
Methods inherited from class org.axway.grapes.server.webapp.resources.AbstractResource
getArtifactHandler, getArtifactJsonModel, getConfig, getDependencyHandler, getDependencyJsonModel, getDocumentation, getGraphsHandler, getIssueTrackerUrl, getLicenseHandler, getLicenseJsonModel, getModelMapper, getModuleHandler, getModuleJsonModel, getOnlineDocumentation, getOrganizationHandler, getOrganizationJsonModel, getProductHandler, getProgramVersion, getScopes
 
Methods inherited from class com.yammer.dropwizard.views.View
getCharset, getTemplateName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleResource

public ModuleResource(RepositoryHandler repoHandler,
                      GrapesServerConfig dmConfig)
Method Detail

postModule

public javax.ws.rs.core.Response postModule(@Auth
                                            DbCredential credential,
                                            Module module)
Handle the update/addition of a module in Grapes database

Parameters:
credential - DbCredential
module - Module
Returns:
Response

getNames

public javax.ws.rs.core.Response getNames(@Context
                                          javax.ws.rs.core.UriInfo uriInfo)
Return a list of moduleNames, stored in Grapes, regarding the filters passed in the query parameters. This method is call via GET /module/names

Parameters:
uriInfo - UriInfo
Returns:
Response A list (in HTML or JSON) of moduleNames

getVersionsRedirection

public javax.ws.rs.core.Response getVersionsRedirection(String name,
                                                        @Context
                                                        javax.ws.rs.core.UriInfo uriInfo)

getVersions

public javax.ws.rs.core.Response getVersions(String name,
                                             @Context
                                             javax.ws.rs.core.UriInfo uriInfo)
Return a list of moduleNames, stored in Grapes, regarding the filters passed in the query parameters. This method is call via GET /module//versions

Parameters:
name - String
uriInfo - UriInfo
Returns:
Response A list (in HTML or JSON) of moduleNames

get

public javax.ws.rs.core.Response get(String name,
                                     String version)
Return a module. This method is call via GET /module//

Parameters:
name - String
version - String
Returns:
Response A list (in HTML or JSON) of moduleNames

delete

public javax.ws.rs.core.Response delete(@Auth
                                        DbCredential credential,
                                        String name,
                                        String version)
Delete a module. This method is call via DELETE /module//

Parameters:
credential - DbCredential
name - String
version - String
Returns:
Response

getOrganization

public javax.ws.rs.core.Response getOrganization(String name,
                                                 String version)
Return an Organization. This method is call via GET /module///organization

Parameters:
name - String
version - String
Returns:
Response A list (in HTML or JSON) of moduleNames

getAncestors

public javax.ws.rs.core.Response getAncestors(String name,
                                              String version,
                                              @Context
                                              javax.ws.rs.core.UriInfo uriInfo)
Return ancestor list of a module. This method is call via GET /module///ancestors

Parameters:
name - String
version - String
uriInfo - UriInfo
Returns:
Response A list of module

getDependencies

public javax.ws.rs.core.Response getDependencies(String name,
                                                 String version,
                                                 @Context
                                                 javax.ws.rs.core.UriInfo uriInfo)
Return a module dependency list. This method is call via GET /module///dependencies

Parameters:
name - String
version - String
uriInfo - UriInfo
Returns:
Response A list of dependencies in HTML or JSON

getDependencyReport

public javax.ws.rs.core.Response getDependencyReport(String name,
                                                     String version,
                                                     @Context
                                                     javax.ws.rs.core.UriInfo uriInfo)
Return a report about the targeted module dependencies. This method is call via GET /module///dependencies/report

Parameters:
name - String
version - String
uriInfo - UriInfo
Returns:
Response A list of dependencies in HTML or JSON

getLicenses

public javax.ws.rs.core.Response getLicenses(String name,
                                             String version)
Return license list of a module. This method is call via GET /module///licenses

Parameters:
name - String
version - String
Returns:
Response A list of license

promote

public javax.ws.rs.core.Response promote(@Auth
                                         DbCredential credential,
                                         String name,
                                         String version)
Promote a module. This method is call via POST /module///promote

Parameters:
credential - DbCredential
name - String
version - String
Returns:
Response

canBePromoted

public javax.ws.rs.core.Response canBePromoted(String name,
                                               String version)
Check if a module can be promoted or not This method is call via GET /module///promotion/check

Parameters:
name - String
version - String
Returns:
Response true if the module can be promoted, false otherwise.

getPromotionStatusReport

public javax.ws.rs.core.Response getPromotionStatusReport(String name,
                                                          String version)
Return a promotion report

Returns:
Response A promotion report

isPromoted

public javax.ws.rs.core.Response isPromoted(String name,
                                            String version)
Check if a module is promoted or not This method is call via GET /module///promotion

Returns:
Response true if the module is promoted, false otherwise.

getBuildInfo

public javax.ws.rs.core.Response getBuildInfo(String name,
                                              String version)
Return a build info

Returns:
Response that contains a Json Map

updateBuildInfo

public javax.ws.rs.core.Response updateBuildInfo(String name,
                                                 String version,
                                                 Map<String,String> buildInfo)
Update a build info

Returns:
Response that contains a Json Map

getAllModules

public javax.ws.rs.core.Response getAllModules(@Context
                                               javax.ws.rs.core.UriInfo uriInfo)
Provide a list of module regarding the query parameter filters

Parameters:
uriInfo -
Returns:
Response


Copyright © 2014. All Rights Reserved.