public static String[] formattedArray(final ServiceItem[] items) {
List<OutputInfo> list = new ArrayList<OutputInfo>();
ServiceInfo[] serviceInfo = CLI.getInstance().finder.getServiceInfo();
for(int i=0; i<items.length; i++) {
ServiceInfo sInfo = null;
for (ServiceInfo aServiceInfo : serviceInfo) {
ServiceItem item = aServiceInfo.getServiceItem();
if (item.serviceID.equals(items[i].serviceID)) {
sInfo = aServiceInfo;
break;
}
}
if(sInfo==null) {
sInfo = new ServiceInfo(items[i]);
Future<ServiceInfo> future = CLI.getInstance().finder.resolveServiceInfo(sInfo);
try {
sInfo = future.get(5, TimeUnit.SECONDS);
} catch (Exception e) {
e.printStackTrace();
}
}
String name = sInfo.getServiceName();
String[] groups = sInfo.getGroups();
String host = sInfo.getHost();
if(groups==null)
groups = new String[]{"<?>"};
String[] optionValues= new String[] {"", "", ""};