public static HostBean simpleHostBeanRequest(String hostDescStr)
throws XmlException {
HostDescriptionType hostDesc = HostDescriptionDocument.Factory.parse(
hostDescStr).getHostDescription();
HostBean hostBean = new HostBean();
hostBean.setHostName(hostDesc.getHostName());
hostBean.setGFacPath(hostDesc.getHostConfiguration().getGFacPath());
PortRangeType portRange = hostDesc.getHostConfiguration()
.getPortRange();
if (portRange != null) {
hostBean.setPortRangeStart(portRange.getStart());
hostBean.setPortRangeEnd(portRange.getEnd());
}
PackageType[] java = hostDesc.getHostConfiguration().getJavaArray();
if (java.length > 0) {
hostBean.setJdkPath(java[0].getHome());
}
hostBean.setTmpDir(hostDesc.getHostConfiguration().getTmpDir());
NameValuePairType[] hostEnvs = hostDesc.getHostConfiguration()
.getHostEnvArray();
if (hostEnvs.length > 0) {
StringBuffer buf = new StringBuffer();
String prefix = "";
for (NameValuePairType envVal : hostEnvs) {
buf.append(prefix);
buf.append(envVal.getName()).append("=").append(
envVal.getValue());
prefix = ",";
}
hostBean.setHostEnv(buf.toString());
}
hostBean.setSshEnabled(hostDesc.getHostConfiguration().getSshEnabled());
if (hostDesc.getHostConfiguration().getGlobusGatekeeperArray().length > 0) {
hostBean
.setGateKeeperJobManager(hostDesc.getHostConfiguration()
.getGlobusGatekeeperArray(0).getJobmanagertype()
.toString());
// We are taking 1st value for now
hostBean.setGateKeeperendPointReference(hostDesc
.getHostConfiguration().getGlobusGatekeeperArray(0)
.getEndPointReference().toString());
hostBean.setGateKeeperName(hostDesc.getHostConfiguration()
.getGlobusGatekeeperArray(0).getName());
hostBean.setWsGram(hostDesc.getHostConfiguration()
.getGlobusGatekeeperArray(0).getWsGram());
}
if (hostDesc.getHostConfiguration().getGridFTPArray().length > 0) {
hostBean.setGridFtpName(hostDesc.getHostConfiguration()
.getGridFTPArray(0).getName());
hostBean.setGridFtpendPointReference(hostDesc
.getHostConfiguration().getGridFTPArray(0)
.getEndPointReference());
}
return hostBean;