super.init();
IResourceInitializerService svc = ctx.getBean(IResourceInitializerService.class);
IResourcePoolDAO rpDao = ctx.getBean(IResourcePoolDAO.class);
IDatastoreDAO dsDao = ctx.getBean(IDatastoreDAO.class);
INetworkDAO networkDao = ctx.getBean(INetworkDAO.class);
VcResourcePoolEntity rpEntity = rpDao.findByName(ResourceInitializerService.DEFAULT_RP);
if(rpEntity != null){
rpDao.delete(rpEntity);
}
List<VcDatastoreEntity> dss = dsDao.findByName(ResourceInitializerService.DEFAULT_DS_SHARED);
if(dss != null && dss.size() > 0){
for(VcDatastoreEntity ds : dss){
dsDao.delete(ds);
}
}
dss = dsDao.findByName(ResourceInitializerService.DEFAULT_DS_LOCAL);
if(dss != null && dss.size() > 0){
for(VcDatastoreEntity ds : dss){
dsDao.delete(ds);
}
}
NetworkEntity network = networkDao.findNetworkByName(ResourceInitializerService.DEFAULT_NETWORK);
if(network != null){
networkDao.delete(network);
}
svc.initResource();
}