Github user swgkg commented on a diff in the pull request:

    https://github.com/apache/stratos/pull/84#discussion_r22098774
  
    --- Diff: 
components/org.apache.stratos.metadataservice/src/main/java/org/apache/stratos/metadataservice/services/MetaDataAdmin.java
 ---
    @@ -24,36 +43,67 @@
         @Context
         UriInfo uriInfo;
     
    -   private static Log log = LogFactory.getLog(MetaDataAdmin.class);
    -   @Context
    -   HttpServletRequest httpServletRequest;
    +    private static Log log = LogFactory.getLog(MetaDataAdmin.class);
    +    @Context
    +    HttpServletRequest httpServletRequest;
     
    -   private final String DEFAULT_REG_TYPE = "carbon";
     
    -   private XMLConfiguration conf;
    -    DataStore registry;
    +    private DataStore registry;
     
    +    /**
    +     * Meta data admin configuration loading
    +     */
         public MetaDataAdmin(){
    -        conf = ConfUtil.getInstance(null).getConfiguration();
    +        XMLConfiguration conf = 
ConfUtil.getInstance(null).getConfiguration();
    +        String DEFAULT_REG_TYPE = "carbon";
             String registryType =  
conf.getString("metadataservice.govenanceregistrytype", DEFAULT_REG_TYPE);
             registry = 
DataRegistryFactory.getDataRegistryFactory(registryType);
         }
    -   @POST
    -   @Path("/init")
    -   @AuthorizationAction("/permission/protected/manage/monitor/tenants")
    -   public void initialize() throws RestAPIException {
     
    -   }
    +    @POST
    +    @Path("/cartridge/metadata/{applicationname}/{cartridgetype}")
    +    @Produces("application/json")
    +    @Consumes("application/json")
    +    @AuthorizationAction("/permission/protected/manage/monitor/tenants")
    +    public Response 
addCartridgeMetaDataDetails(@PathParam("applicationname") String 
applicationName,
    +                                                
@PathParam("cartridgetype") String cartridgeType,
    +                                                CartridgeMetaData 
cartridgeMetaData) throws RestAPIException {
    +
    +
    +        URI url = uriInfo.getAbsolutePathBuilder().path(applicationName + 
"/" + cartridgeType).build();
    +        try {
    +            registry.addCartridgeMetaDataDetails(applicationName, 
cartridgeType, cartridgeMetaData);
    +        } catch (Exception err) {
    +            log.error("Error occurred while adding meta data details ", 
err);
    --- End diff --
    
    Thanks Ramith. yeah it is better to propagating the exception.Currently 
this method is re factored to "addPropertyToACluster". We have update that Rest 
API methods with PR#157


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to