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

java.lang.Object
  extended by com.yammer.dropwizard.views.View
      extended by org.axway.grapes.server.webapp.resources.AbstractResource
Direct Known Subclasses:
ArtifactResource, LicenseResource, ModuleResource, OrganizationResource, ProductResource, RootResource, Sequoia, WebAppResource

public abstract class AbstractResource
extends com.yammer.dropwizard.views.View

Abstract resource

Provide documentation and repository management support. This class should be extended by all the server resources.

Author:
jdcoffre

Constructor Summary
protected AbstractResource(RepositoryHandler repoHandler, String templateName, GrapesServerConfig dmConfig)
           
 
Method Summary
protected  ArtifactHandler getArtifactHandler()
          Return an ArtifactHandler
 String getArtifactJsonModel()
          Returns an empty model of an Artifact in Json
protected  GrapesServerConfig getConfig()
          Return Grapes configuration
protected  DependencyHandler getDependencyHandler()
          Return a DependencyHandler
 String getDependencyJsonModel()
          Returns an empty model of a Dependency in Json
 javax.ws.rs.core.Response getDocumentation()
          Provide the documentation of the LicenseResource when the server got a request GET /
protected  GraphsHandler getGraphsHandler(FiltersHolder filtersHolder)
          Return a GraphsHandler
 String getIssueTrackerUrl()
          Return the issue-tracker url configured in the server configuration file (null if empty)
protected  LicenseHandler getLicenseHandler()
          Return a LicenseHandler
 String getLicenseJsonModel()
          Returns an empty model of a License in Json
protected  ModelMapper getModelMapper()
          Returns model mapper for data-model conversion
protected  ModuleHandler getModuleHandler()
          Return a ModuleHandler
 String getModuleJsonModel()
          Returns an empty model of a Module in Json
 String getOnlineDocumentation()
          Return the online documentation url configured in the server configuration file (null if empty)
protected  OrganizationHandler getOrganizationHandler()
          Return a OrganizationHandler
 String getOrganizationJsonModel()
          Returns an empty model of a Organization in Json
protected  ProductHandler getProductHandler()
          Return a ProductHandler
 String getProgramVersion()
          Return the version of the application
 String getScopes()
          Returns the list of available scopes
 
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

AbstractResource

protected AbstractResource(RepositoryHandler repoHandler,
                           String templateName,
                           GrapesServerConfig dmConfig)
Method Detail

getDocumentation

public javax.ws.rs.core.Response getDocumentation()
Provide the documentation of the LicenseResource when the server got a request GET /

Returns:
Response The documentation in HTML

getOrganizationHandler

protected OrganizationHandler getOrganizationHandler()
Return a OrganizationHandler

Returns:
OrganizationHandler

getProductHandler

protected ProductHandler getProductHandler()
Return a ProductHandler

Returns:
ProductHandler

getModuleHandler

protected ModuleHandler getModuleHandler()
Return a ModuleHandler

Returns:
ArtifactHandler

getArtifactHandler

protected ArtifactHandler getArtifactHandler()
Return an ArtifactHandler

Returns:
ArtifactHandler

getDependencyHandler

protected DependencyHandler getDependencyHandler()
Return a DependencyHandler

Returns:
DependencyHandler

getLicenseHandler

protected LicenseHandler getLicenseHandler()
Return a LicenseHandler

Returns:
LicenseHandler

getGraphsHandler

protected GraphsHandler getGraphsHandler(FiltersHolder filtersHolder)
Return a GraphsHandler

Returns:
LicenseHandler

getConfig

protected GrapesServerConfig getConfig()
Return Grapes configuration

Returns:
GrapesServerConfig

getModelMapper

protected ModelMapper getModelMapper()
Returns model mapper for data-model conversion

Returns:
ModelMapper

getProgramVersion

public String getProgramVersion()
Return the version of the application

Returns:
String

getIssueTrackerUrl

public String getIssueTrackerUrl()
Return the issue-tracker url configured in the server configuration file (null if empty)

Returns:
String

getOnlineDocumentation

public String getOnlineDocumentation()
Return the online documentation url configured in the server configuration file (null if empty)

Returns:
String

getOrganizationJsonModel

public String getOrganizationJsonModel()
                                throws IOException
Returns an empty model of a Organization in Json

Returns:
String
Throws:
IOException

getModuleJsonModel

public String getModuleJsonModel()
                          throws IOException
Returns an empty model of a Module in Json

Returns:
String
Throws:
IOException

getArtifactJsonModel

public String getArtifactJsonModel()
                            throws IOException
Returns an empty model of an Artifact in Json

Returns:
String
Throws:
IOException

getDependencyJsonModel

public String getDependencyJsonModel()
                              throws IOException
Returns an empty model of a Dependency in Json

Returns:
String
Throws:
IOException

getLicenseJsonModel

public String getLicenseJsonModel()
                           throws IOException
Returns an empty model of a License in Json

Returns:
String
Throws:
IOException

getScopes

public String getScopes()
Returns the list of available scopes

Returns:
String


Copyright © 2014. All Rights Reserved.