stratos-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mariangela Hills (JIRA)" <>
Subject [jira] [Created] (STRATOS-964) Some REST API are not returning response codes
Date Fri, 14 Nov 2014 05:44:33 GMT
Mariangela Hills created STRATOS-964:

             Summary: Some REST API are not returning response codes
                 Key: STRATOS-964
             Project: Stratos
          Issue Type: Bug
          Components: REST API
    Affects Versions: 4.0.0 M4
            Reporter: Mariangela Hills

When looking though the code, I noticed that some of the REST APIs do not return a response
code. All HTTP requests sent in REST API  should return a response code. The following code
is one such example:

    public TenantInfoBean getTenant(@PathParam("tenantDomain") String tenantDomain) throws
RestAPIException {

        try {
            return getTenantForDomain(tenantDomain);
        } catch (Exception e) {
            String msg = "Error in getting tenant information for tenant " + tenantDomain;
            log.error(msg, e);
            throw new RestAPIException(msg);

    private TenantInfoBean getTenantForDomain(String tenantDomain) throws Exception {

        TenantManager tenantManager = ServiceHolder.getTenantManager();

        int tenantId;
        try {
            tenantId = tenantManager.getTenantId(tenantDomain);
        } catch (UserStoreException e) {
            String msg = "Error in retrieving the tenant id for the tenant domain: " +
                    tenantDomain + ".";
            throw new Exception(msg, e);
        Tenant tenant;
        try {
            tenant = (Tenant) tenantManager.getTenant(tenantId);
        } catch (UserStoreException e) {
            String msg = "Error in retrieving the tenant from the tenant manager.";
            throw new Exception(msg, e);

        TenantInfoBean bean = TenantMgtUtil.initializeTenantInfoBean(tenantId, tenant);

        // retrieve first and last names from the UserStoreManager
                ServiceHolder.getRealmService(), tenantId));
                ServiceHolder.getRealmService(), tenantId));

        //getting the subscription plan
        String activePlan = "";
        //TODO: usage plan using billing service

        if (activePlan != null && activePlan.trim().length() > 0) {
        } else {

        return bean;

This message was sent by Atlassian JIRA

View raw message