public boolean removeSubFromUser( BasicUser user, com.ccc.oauth.apimanagement.model.Service service) { List<Subscribed> subs = servicesForUser(user); for (Subscribed sub : subs) { if (sub.getService().equals(service)) return subscribedManager.deleteE(sub); } return false; }
public boolean subscribeUser(BasicUser user, com.ccc.oauth.apimanagement.model.Service service) { Subscribed sub = new Subscribed(); sub.setService(service); sub.setUserName(user.getUsername()); return subscribedManager.saveE(sub); }