Exemplo n.º 1
0
  @TransactionalWrite
  public Hub createHub(Hub hub, User currentUser) {
    authorize(currentUser, HUB_CREATE);

    validationService.validate(hub);
    return getHub(repository.insertHub(hub));
  }
Exemplo n.º 2
0
  @TransactionalWrite
  public Hub updateHub(long hubId, Hub hub, User currentUser) {
    authorize(currentUser, HUB_UPDATE);

    validationService.validate(hub);
    repository.updateHub(hubId, hub);
    return getHub(hubId);
  }
Exemplo n.º 3
0
 @TransactionalRead
 public SearchResults<Hub> search(HubSearch search) {
   return repository.findHubs(search);
 }
Exemplo n.º 4
0
 @TransactionalRead
 public Hub getHub(long hubId) {
   return repository.getHub(hubId);
 }