mleData.getOsVersion(), mleData.getOemName());
} catch (NoResultException nre){
throw new ASException(nre,ErrorCode.WS_MLE_DOES_NOT_EXIST, mleData.getName(), mleData.getVersion());
}
MwMleSourceJpaController mleSourceJpaController = new MwMleSourceJpaController(getEntityManagerFactory());
// Let us check if there is a mapping entry already for this MLE. If it does, then we need to return
// back appropriate error.
MwMleSource mleSourceCurrentObj = mleSourceJpaController.findByMleId(tblMle.getId());
if (mleSourceCurrentObj != null) {
log.error("White List host is already mapped to the MLE - " + tblMle.getName());
throw new ASException(ErrorCode.WS_MLE_SOURCE_MAPPING_ALREADY_EXISTS, mleData.getName());
}
// Else create a new entry in the DB.
MwMleSource mleSourceData = new MwMleSource();
mleSourceData.setMleId(tblMle);
mleSourceData.setHostName(mleSourceObj.getHostName());
mleSourceJpaController.create(mleSourceData);
} catch (ASException ase) {
throw ase;
} catch (Exception e) {
throw new ASException(e);