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

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.LicenseResource

public class LicenseResource
extends AbstractResource

License Resource

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

Author:
jdcoffre

Constructor Summary
LicenseResource(RepositoryHandler repoHandler, GrapesServerConfig dmConfig)
           
 
Method Summary
 javax.ws.rs.core.Response approve(DbCredential credential, String name, com.yammer.dropwizard.jersey.params.BooleanParam approved)
          Validate a license This method is call via POST /license/?approved=
 javax.ws.rs.core.Response delete(DbCredential credential, String name)
          Delete a license This method is call via DELETE /license/
 javax.ws.rs.core.Response get(String name)
          Return a license This method is call via GET /license/
 javax.ws.rs.core.Response getNames(javax.ws.rs.core.UriInfo uriInfo)
          Return the list of available license name.
 javax.ws.rs.core.Response postLicense(DbCredential credential, License license)
          Handle license posts when the server got a request POST /license & MIME that contains the license.
 
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

LicenseResource

public LicenseResource(RepositoryHandler repoHandler,
                       GrapesServerConfig dmConfig)
Method Detail

postLicense

public javax.ws.rs.core.Response postLicense(@Auth
                                             DbCredential credential,
                                             License license)
Handle license posts when the server got a request POST /license & MIME that contains the license.

Parameters:
license - The license to add to Grapes database
Returns:
Response An acknowledgment:
- 400 if the artifact is MIME is malformed
- 500 if internal error
- 201 if ok

getNames

public javax.ws.rs.core.Response getNames(@Context
                                          javax.ws.rs.core.UriInfo uriInfo)
Return the list of available license name. This method is call via GET /license/names

Parameters:
uriInfo - UriInfo
Returns:
Response A list of license name in HTML or JSON

get

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

Parameters:
name - String
Returns:
Response A license in HTML or JSON

delete

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

Parameters:
credential - DbCredential
name - String
Returns:
Response

approve

public javax.ws.rs.core.Response approve(@Auth
                                         DbCredential credential,
                                         String name,
                                         com.yammer.dropwizard.jersey.params.BooleanParam approved)
Validate a license This method is call via POST /license/?approved=

Parameters:
credential - DbCredential
name - String
approved - BooleanParam
Returns:
Response


Copyright © 2014. All Rights Reserved.