* @param osVersion
* @return
*/
public String deleteOs(String osName, String osVersion) {
try {
TblOs tblOs = tblOsJpaController.findTblOsByNameVersion(osName, osVersion);
if (tblOs == null) {
throw new ASException(ErrorCode.WS_OS_DOES_NOT_EXIST,osName, osVersion);
}
Collection<TblMle> tblMleCollection = tblOs.getTblMleCollection();
if( tblMleCollection != null ) {
log.info("OS is currently associated with # MLEs: " + tblMleCollection.size());
if(!tblMleCollection.isEmpty()){
throw new ASException(ErrorCode.WS_OS_ASSOCIATION_EXISTS, osName, osVersion, tblMleCollection.size());
}
}
tblOsJpaController.destroy(tblOs.getId());
} catch (ASException ase) {
throw ase;
} catch (Exception e) {
throw new ASException(e);