* @param osName
* @return
*/
public String deleteOem(String osName) {
try{
TblOem tblOem = tblOemJpaController.findTblOemByName(osName);
if(tblOem == null){
throw new ASException(ErrorCode.WS_OEM_DOES_NOT_EXIST, osName);
}
Collection<TblMle> tblMleCollection = tblOem.getTblMleCollection();
if( tblMleCollection != null ) {
log.info("OEM is currently associated with # MLEs: " + tblMleCollection.size());
if(!tblMleCollection.isEmpty()){
throw new ASException(ErrorCode.WS_OEM_ASSOCIATION_EXISTS, osName, tblMleCollection.size());
}
}
tblOemJpaController.destroy(tblOem.getId());
} catch(ASException ase){
throw ase;
} catch (Exception e) {
throw new ASException(e);