You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by prabathabey <gi...@git.apache.org> on 2015/05/26 05:31:54 UTC

[GitHub] stratos pull request: Adding network partitions for CLI

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

    https://github.com/apache/stratos/pull/198#discussion_r31002645
  
    --- Diff: components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java ---
    @@ -293,44 +297,44 @@ public void listCartridges() throws CommandException {
             }
         }
     
    -	/**
    -	 * List cartridge groups
    -	 *
    -	 * @throws CommandException
    -	 */
    -	public void listCartridgeGroups() throws CommandException {
    -		try {
    -			Type listType = new TypeToken<ArrayList<GroupBean>>() {
    -			}.getType();
    -			List<GroupBean> cartridgeGroupList = (List<GroupBean>) restClient.listEntity(ENDPOINT_LIST_CARTRIDGE_GROUPS,
    -			                                                                                listType, "Cartridge Groups");
    -
    -			if ((cartridgeGroupList == null) || (cartridgeGroupList.size() == 0)) {
    -				System.out.println("No cartridges found");
    -				return;
    -			}
    -
    -			RowMapper<GroupBean> cartridgeGroupMapper = new RowMapper<GroupBean>() {
    -				public String[] getData(GroupBean cartridgeGroup) {
    -					String[] data = new String[4];
    -					data[0] = cartridgeGroup.getName();
    -					data[1] = String.valueOf(cartridgeGroup.getCartridges().size());
    -					data[2] = String.valueOf(cartridgeGroup.getGroups().size());
    -					data[3] = String.valueOf(cartridgeGroup.isGroupScalingEnabled());
    -					return data;
    -				}
    -			};
    -
    -			GroupBean[] cartridgeGroups = new GroupBean[cartridgeGroupList.size()];
    -			cartridgeGroups = cartridgeGroupList.toArray(cartridgeGroups);
    -
    -			System.out.println("Cartridge Groups found:");
    -			CliUtils.printTable(cartridgeGroups, cartridgeGroupMapper, "Name", "No. of Cartridges", "No of Groups", "Dependency scaling");
    -		} catch (Exception e) {
    -			String message = "Error in listing cartridge groups";
    -			printError(message, e);
    -		}
    -	}
    +    /**
    +     * List cartridge groups
    +     *
    +     * @throws CommandException
    +     */
    +    public void listCartridgeGroups() throws CommandException {
    +        try {
    +            Type listType = new TypeToken<ArrayList<GroupBean>>() {
    +            }.getType();
    +            List<GroupBean> cartridgeGroupList = (List<GroupBean>) restClient.listEntity(ENDPOINT_LIST_CARTRIDGE_GROUPS,
    +                    listType, "Cartridge Groups");
    +
    +            if ((cartridgeGroupList == null) || (cartridgeGroupList.size() == 0)) {
    +                System.out.println("No cartridges found");
    --- End diff --
    
    Sys.outs need to be removed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---