List<ServiceGroupMetaData> sgList = new ArrayList<ServiceGroupMetaData>();
TreeSet<String> serviceTypes = new TreeSet<String>();
serviceTypes.add("axis2");
for (Iterator sgs = getAxisConfig().getServiceGroups(); sgs.hasNext();) {
AxisServiceGroup serviceGroup = (AxisServiceGroup) sgs.next();
// Filtering the admin services
if (SystemFilter.isFilteredOutService(serviceGroup)) {
continue; // No advancement of currentIndex
}
String serviceType = "axis2";
Parameter serviceTypeParam;
if (serviceGroup.getServices().hasNext()) {
serviceTypeParam = (serviceGroup.getServices().next())
.getParameter(ServerConstants.SERVICE_TYPE);
if (serviceTypeParam != null) {
serviceType = (String) serviceTypeParam.getValue();
serviceTypes.add(serviceType);
}
}
if (!serviceTypeFilter.equals("ALL")) {
if (!serviceTypeFilter.equals(serviceType)) {
continue;
}
}
if (serviceGroupSearchString != null &&
serviceGroupSearchString.trim().length() > 0 &&
serviceGroup.getServiceGroupName().toLowerCase().
indexOf(serviceGroupSearchString.toLowerCase()) == -1) {
continue;
}
ServiceGroupMetaData sgMetaData = new ServiceGroupMetaData();
List<ServiceMetaData> services = new ArrayList<ServiceMetaData>();
boolean isClientSide = false;
for (Iterator serviceIter = serviceGroup.getServices(); serviceIter.hasNext();) {
AxisService axisService = (AxisService) serviceIter.next();
if (axisService.isClientSide()) {
isClientSide = true;
break;
}
ServiceMetaData service = new ServiceMetaData();
String serviceName = axisService.getName();
service.setName(serviceName);
// extract service type
serviceTypeParam = axisService.getParameter(ServerConstants.SERVICE_TYPE);
if (serviceTypeParam != null) {
serviceType = (String) serviceTypeParam.getValue();
}
service.setServiceType(serviceType);
AxisConfiguration axisConfiguration = getAxisConfig();
service.setWsdlURLs(Utils.getWsdlInformation(serviceName, axisConfiguration));
service.setTryitURL(Utils.getTryitURL(serviceName, getConfigContext()));
service.setActive(axisService.isActive());
Parameter parameter = axisService.getParameter(ServiceAdmin.DISABLE_TRY_IT_PARAM);
if (parameter != null && Boolean.TRUE.toString().equalsIgnoreCase((String) parameter.getValue())) {
service.setDisableTryit(true);
}
parameter = axisService.getParameter(ServiceAdmin.DISABLE_DELETION_PARAM);
if (parameter != null && Boolean.TRUE.toString().equalsIgnoreCase((String) parameter.getValue())) {
sgMetaData.setDisableDeletion(true);
}
services.add(service);
}
if (services.size() == 0 || isClientSide) {
continue; // No advancement of currentIndex
}
String sgName = serviceGroup.getServiceGroupName();
sgMetaData.setServices(services.toArray(new ServiceMetaData[services.size()]));
sgMetaData.setServiceGroupName(sgName);
sgMetaData.setServiceContextPath(getConfigContext().getServiceContextPath());
Parameter parameter =
serviceGroup.getParameter(Constants.Configuration.ENABLE_MTOM);
if (parameter != null) {
sgMetaData.setMtomStatus((String) parameter.getValue());
} else {
sgMetaData.setMtomStatus("false");
}