logger.info("org siteNodeVersions:" + siteNodeVersions.size());
List selectedSiteNodeVersions = new ArrayList();
Iterator realSiteNodeVersionsIterator = siteNodeVersions.iterator();
while(realSiteNodeVersionsIterator.hasNext())
{
SiteNodeVersion siteNodeVersion = (SiteNodeVersion)realSiteNodeVersionsIterator.next();
Iterator selectedSiteNodeVersionsIterator = selectedSiteNodeVersions.iterator();
boolean addVersion = true;
while(selectedSiteNodeVersionsIterator.hasNext())
{
SiteNodeVersion currentSiteNodeVersion = (SiteNodeVersion)selectedSiteNodeVersionsIterator.next();
if(siteNodeVersion.getIsActive().booleanValue() && siteNodeVersion.getSiteNodeVersionId().intValue() > currentSiteNodeVersion.getSiteNodeVersionId().intValue())
{
logger.info("A later version was found... removing this one..");
selectedSiteNodeVersionsIterator.remove();
addVersion = true;
}
}
if(addVersion)
selectedSiteNodeVersions.add(siteNodeVersion);
}
siteNodeVersions = selectedSiteNodeVersions;
}
Iterator siteNodeVersionsIterator = siteNodeVersions.iterator();
while(siteNodeVersionsIterator.hasNext())
{
SiteNodeVersion siteNodeVersion = (SiteNodeVersion)siteNodeVersionsIterator.next();
Collection serviceBindings = siteNodeVersion.getServiceBindings();
siteNodeVersion.setOwningSiteNode((SiteNodeImpl)siteNode);
Integer oldSiteNodeVersionId = siteNodeVersion.getId();
db.create(siteNodeVersion);
Integer newSiteNodeVersionId = siteNodeVersion.getId();
siteNodeVersionIdMap.put(oldSiteNodeVersionId.toString(), newSiteNodeVersionId.toString());
Iterator serviceBindingsIterator = serviceBindings.iterator();
while(serviceBindingsIterator.hasNext())
{