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

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

public class OrganizationResource
extends AbstractResource

Organization Resource

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

Author:
jdcoffre

Constructor Summary
OrganizationResource(RepositoryHandler repositoryHandler, GrapesServerConfig configuration)
           
 
Method Summary
 javax.ws.rs.core.Response addCorporateGroupIdPrefix(DbCredential credential, String organizationId, String corporateGroupId)
          Add a new Corporate GroupId to an organization.
 javax.ws.rs.core.Response delete(DbCredential credential, String name)
          Delete an organization This method is call via DELETE /organization/
 javax.ws.rs.core.Response get(String name)
          Returns an organization This method is call via GET /organization/
 javax.ws.rs.core.Response getCorporateGroupIdPrefix(String organizationId)
          Return the list of corporate GroupId prefix configured for an organization.
 javax.ws.rs.core.Response getNames()
          Return the list of available organization name.
 javax.ws.rs.core.Response postOrganization(DbCredential credential, Organization organization)
          Handle organization posts when the server got a request POST /organization & MIME that contains an organization.
 javax.ws.rs.core.Response removeCorporateGroupIdPrefix(DbCredential credential, String organizationId, String corporateGroupId)
          Remove an existing Corporate GroupId from an organization.
 
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

OrganizationResource

public OrganizationResource(RepositoryHandler repositoryHandler,
                            GrapesServerConfig configuration)
Method Detail

postOrganization

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

Parameters:
organization - The organization 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()
Return the list of available organization name. This method is call via GET /organization/names

Returns:
Response A list of organization name in HTML or JSON

get

public javax.ws.rs.core.Response get(String name)
Returns an organization This method is call via GET /organization/

Parameters:
name - String
Returns:
Response An Organization in HTML or JSON

delete

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

Parameters:
name - String Organization name
Returns:
Response

getCorporateGroupIdPrefix

public javax.ws.rs.core.Response getCorporateGroupIdPrefix(String organizationId)
Return the list of corporate GroupId prefix configured for an organization.

Parameters:
organizationId - String Organization name
Returns:
Response A list of corporate groupId prefix in HTML or JSON

addCorporateGroupIdPrefix

public javax.ws.rs.core.Response addCorporateGroupIdPrefix(@Auth
                                                           DbCredential credential,
                                                           String organizationId,
                                                           String corporateGroupId)
Add a new Corporate GroupId to an organization.

Parameters:
credential - DbCredential
organizationId - String Organization name
corporateGroupId - String
Returns:
Response

removeCorporateGroupIdPrefix

public javax.ws.rs.core.Response removeCorporateGroupIdPrefix(@Auth
                                                              DbCredential credential,
                                                              String organizationId,
                                                              String corporateGroupId)
Remove an existing Corporate GroupId from an organization.

Returns:
Response


Copyright © 2014. All Rights Reserved.