[ 
https://issues.apache.org/jira/browse/STRATOS-971?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lahiru Sandaruwan resolved STRATOS-971.
---------------------------------------
    Resolution: Fixed

> Inconsistency in parameter naming used in coding comments
> ---------------------------------------------------------
>
>                 Key: STRATOS-971
>                 URL: https://issues.apache.org/jira/browse/STRATOS-971
>             Project: Stratos
>          Issue Type: Sub-task
>          Components: REST API
>    Affects Versions: 4.1.0 M4
>            Reporter: Mariangela Hills
>
> There is inconsistency in coding comments. For example in {application_id} in 
> [1] and {appId} in [2] refer to the same parameter. However, the code 
> comments vary. Even this does not have an impact on the end user as the 
> parameter has been defined using the same name in both instances 
> (applicationId) , this will have an impact on a person traversing through the 
> source code.
> -----------------------------///////////////////////////-----------------------------
> Example 1: {application_id} and {appId}
> ----------------------------------------------------------------------------------------------------------
> [1]
> @GET
>     @Path("/subsscriptions/{application_id}")
>     @Produces("application/json")
>     @Consumes("application/json")
>     @AuthorizationAction("/permission/protected/manage/monitor/tenants")
>     public Response 
> getSubscriptionsOfApplication(@PathParam("application_id") String 
> applicationId) throws RestAPIException {
>         ApplicationSubscription subscriptions = 
> StratosApiV41Utils.getApplicationSubscriptions(applicationId, 
> getConfigContext());
>         if(subscriptions  == null){
>             return Response.status(Response.Status.NOT_FOUND).build();
>         }
>         return  Response.ok().entity(subscriptions).build();
>     }
> ----------------------------------------------------------------------------------------------------------
> [2]
> @GET
>     @Path("/application/{appId}")
>     @Consumes("application/json")
>     @AuthorizationAction("/permission/protected/manage/monitor/tenants")
>     public Response getApplicationInfo(@PathParam("appId") String 
> applicationId) throws RestAPIException {
>         ApplicationBean application = 
> StratosApiV41Utils.getApplicationInfo(applicationId);
>         if(application == null) {
>             return Response.status(Response.Status.NOT_FOUND).build();
>         }else{
>             return  Response.ok().entity(application).build();
>         }
>     }
> -----------------------------///////////////////////////-----------------------------
> Example 2: {groupDefinitionName} and {serviceGroup}
> [3]
>  @GET
>     @Path("/group/definition/{groupDefinitionName}")
>     @Produces("application/json")
>     @Consumes("application/json")
>     @AuthorizationAction("/permission/protected/manage/monitor/tenants")
>     public Response 
> getServiceGroupDefinition(@PathParam("groupDefinitionName") String 
> groupDefinitionName)
>             throws RestAPIException {
>         ServiceGroupDefinition serviceGroupDefinition = 
> StratosApiV41Utils.getServiceGroupDefinition(groupDefinitionName);
>         Response.ResponseBuilder rb;
>         if (serviceGroupDefinition != null) {
>             rb = Response.ok().entity(serviceGroupDefinition);
>         } else {
>             rb = Response.status(Response.Status.NOT_FOUND);
>         }
>         return rb.build();
>     }
> ----------------------------------------------------------------------------------------------------------
> [4]
>   @GET
>     @Path("/cartridge/list/subscribed/group/{serviceGroup}")
>     @Produces("application/json")
>     @Consumes("application/json")
>     @AuthorizationAction("/permission/admin/manage/view/cartridge")
>     public Response 
> getSubscribedCartridgesForServiceGroup(@PathParam("serviceGroup") String 
> serviceGroup) throws RestAPIException {
>         List<Cartridge> cartridgeList = 
> StratosApiV41Utils.getSubscriptions(null, serviceGroup, getConfigContext());
>         // Following is very important when working with axis2
>         ResponseBuilder rb = Response.ok();
>         rb.entity(cartridgeList.isEmpty() ? new Cartridge[0] : 
> cartridgeList.toArray(new Cartridge[cartridgeList.size()]));
>         return rb.build();
>     }
> ----------------------------------------------------------------------------------------------------------



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to