String useType = null;
for (int j=0; j<discoveryURLVector.size(); j++)
{
DiscoveryURL discoveryURL = (DiscoveryURL)discoveryURLVector.get(j);
if(discoveryURL != null)
{
useType = discoveryURL.getUseType();
// check if the business has DiscoveryURL with useType as 'businessEntity'
if(useType.equals(businessEntityUseType))
{
businessEntityURLExists = true;
j = discoveryURLVector.size();
}
}
}
}
}
else
{
// create create a discoveryURLs and add it to business entity
business.setDiscoveryURLs(new DiscoveryURLs());
}
// add the businessEntity if businessEntity URL doesn't exist
if(!businessEntityURLExists)
{
// get the DiscoveryURL from the juddi properties file
StringBuffer siteURL = new StringBuffer();
siteURL.append(Config.getOperatorURL());
siteURL.append("/uddiget.jsp?businesskey=");
siteURL.append(business.getBusinessKey());
// add to the business entity
business.addDiscoveryURL(new DiscoveryURL(businessEntityUseType,siteURL.toString()));
}
}