private ResourcesBL() { super(); try { dal = ResourcesDAL.getInstance(); } catch (SQLException e) { Logger.log(LOG_LEVEL.ERROR, e); } }
public List<Resource> getAllRootResources() { List<Resource> rootResources = new ArrayList<>(); try { rootResources = this.dal.fetchOnlyRootResources(); } catch (SQLException e) { Logger.log(LOG_LEVEL.ERROR, e); } return rootResources; }
@Override public STATUS_CODE validate(Resource bo) { try { if (!this.dal.exists(bo)) { return STATUS_CODE.OK; } } catch (SQLException e) { Logger.log(LOG_LEVEL.WARNING, e); return STATUS_CODE.FAIL; } return STATUS_CODE.ALREADY_EXISTS; }