Rio Project 4.2 API Documentation



org.rioproject.tools.cli
Class Formatter

java.lang.Object
  extended by org.rioproject.tools.cli.Formatter

public class Formatter
extends Object

Utility class for formatting results

Author:
Dennis Reedy

Constructor Summary
Formatter()
           
 
Method Summary
static String asChoices(ServiceItem[] items)
           
static String asChoices(ServiceItem[] items, int options)
           
static String asList(ServiceItem[] items)
           
static String asList(ServiceItem[] items, int options)
           
static void cybernodeLister(ServiceItem[] items, int options, BufferedReader br, PrintStream out)
          Produce output for an array of Cybernodes
static String[] formattedArray(ServiceItem[] items, int options)
           
static String fromArray(String[] array)
          Utility to convert a String array to a comma delimited String
static String fromArray(String[] array, String delim)
          Utility to convert a String array to a delimited String
static String getExportCodebase(Object service)
          Get the codebase for the service by getting the service's classloader and extracting only the http: address and port number
static void promptMore(BufferedReader br, PrintStream out)
           
static void provisionManagerLister(ServiceItem[] items, int options, BufferedReader br, PrintStream out)
          Produce output for an array of Provision Managers
static String[] toArray(String arg)
          Convert comma-separated String to array of Strings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Formatter

public Formatter()
Method Detail

asList

public static String asList(ServiceItem[] items)

asList

public static String asList(ServiceItem[] items,
                            int options)

asChoices

public static String asChoices(ServiceItem[] items)

asChoices

public static String asChoices(ServiceItem[] items,
                               int options)

formattedArray

public static String[] formattedArray(ServiceItem[] items,
                                      int options)

cybernodeLister

public static void cybernodeLister(ServiceItem[] items,
                                   int options,
                                   BufferedReader br,
                                   PrintStream out)
Produce output for an array of Cybernodes

Parameters:
items - Array of ServiceItems
options - Options to use
br - A BufferredReader, allows for the user to press enter for more
out - The output PrintStream

provisionManagerLister

public static void provisionManagerLister(ServiceItem[] items,
                                          int options,
                                          BufferedReader br,
                                          PrintStream out)
Produce output for an array of Provision Managers

Parameters:
items - Array of ServiceItems
options - Options
br - A BufferredReader, allows for the user to press enter for more
out - The output PrintStream

getExportCodebase

public static String getExportCodebase(Object service)
Get the codebase for the service by getting the service's classloader and extracting only the http: address and port number

Parameters:
service - The service
Returns:
A String codebase

fromArray

public static String fromArray(String[] array)
Utility to convert a String array to a comma delimited String

Parameters:
array - An array of Strings, must not be null
Returns:
A comma delimited String. If the array is empty, return a String with zero-length

fromArray

public static String fromArray(String[] array,
                               String delim)
Utility to convert a String array to a delimited String

Parameters:
array - An array of Strings, must not be null
delim - Delimiter to use between Strings, must not be null
Returns:
A comma delimited String. If the array is empty, return a String with zero-length

toArray

public static String[] toArray(String arg)
Convert comma-separated String to array of Strings

Parameters:
arg - The comma separated string
Returns:
A converted array of strings

promptMore

public static void promptMore(BufferedReader br,
                              PrintStream out)

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.