Hi,

I noticed following domain classes introduced recently in the CLI:


​
It seems like the naming convention used in above classes Applications,
Clusters, Groups and SubGroups is not correct. These classes look like
collection types but they are single object types.

Class: RestCommandLineService
public void describeApplication (String applicationID) {
        try {
            ApplicationBean list = (ApplicationBean)
restClient.listEntity(ENDPOINT_LIST_APPLICATION.replace("{appId}",
applicationID),
                    ApplicationBean.class, "applications");

            if ((list == null) || (list.getApplications() == null)) {
                System.out.println("Application not found: " +
applicationID);
                return;
            }

            System.out.println("Application : " + applicationID);
            System.out.println(getGson().toJson(list.getApplications()));
        } catch (Exception e) {
            String message = "Error in describing application: " +
applicationID;
            System.out.println(message);
            log.error(message, e);
        }
    }

- ApplicationBean class used in the above method has exposed a method
called getApplications() but it only returns an application.
- The above method defines a local variable called list but it only
contains one application object.

Thanks

-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PMC Member, Apache Stratos

Reply via email to