public OperationStatus assignYdkRole(Long ydkRoleId, Long id) { // TODO Auto-generated method stub OperationStatus os = new OperationStatus(); if (id == null || ydkRoleId == null) { os.setIsSuccessful(false); os.setFailureReason("Null input"); return os; } YdkAccount ydkAccount = accountDbMngr.getYdkAccount(id); if (ydkAccount == null) { os.setIsSuccessful(false); os.setFailureReason("Could not find YdkAccount by id : " + id); return os; } YdkRole ydkRole = accountDbMngr.getYdkRole(id); if (ydkRole == null) { os.setIsSuccessful(false); os.setFailureReason("Could not find YdkRole by id : " + ydkRoleId); return os; } ydkAccount.setYdkRole(ydkRole); accountDbMngr.updateYdkAccount(ydkAccount); return os; }
public OperationStatus deactiveYdkAccount(Long id) { // TODO Auto-generated method stub OperationStatus os = new OperationStatus(); YdkAccount ydkAccount = accountDbMngr.getYdkAccount(id); if (ydkAccount == null) { os.setIsSuccessful(false); os.setFailureReason("Could not find YdkAccount by id : " + id); return os; } ydkAccount.setIsActived(false); accountDbMngr.updateYdkAccount(ydkAccount); return os; }
public WebServiceYdkAccount getYdkAccountById(Long id) { // TODO Auto-generated method stub WebServiceYdkAccount result = new WebServiceYdkAccount(); if (id == null) { result.getOs().setIsSuccessful(false); result.getOs().setFailureReason("Null input Id"); return result; } YdkAccount instance = accountDbMngr.getYdkAccount(id); if (instance == null) { result.getOs().setIsSuccessful(false); result.getOs().setFailureReason("YdkAccount not found by id: " + id); return result; } result.setYdkAccount(instance); // Eager get instance.getYdkRole().getMask(); instance.getYdkRole().setYdkAccounts(null); return result; }