Esempio n. 1
0
 /**
  * Updates given MotechRole
  *
  * @param motechRole to be updated
  */
 public void update(MotechRole motechRole) {
   dataService.update(motechRole);
 }
Esempio n. 2
0
 /**
  * Removes given MotechRole
  *
  * @param motechRole to be removed
  */
 public void remove(MotechRole motechRole) {
   dataService.delete(motechRole);
 }
Esempio n. 3
0
 /**
  * Creates MotechRole if it doesn't exists
  *
  * @param role to be created
  */
 public void add(MotechRole role) {
   if (findByRoleName(role.getRoleName()) == null) {
     dataService.create(role);
   }
 }
Esempio n. 4
0
 /**
  * Looks for and returns MotechRole with given name
  *
  * @param roleName name of MotechRole
  * @return MotechRole or null if name is a null
  */
 public MotechRole findByRoleName(String roleName) {
   return null == roleName ? null : dataService.findByRoleName(roleName);
 }
Esempio n. 5
0
 /**
  * Returns all MotechRoles
  *
  * @return list that contains roles
  */
 public List<MotechRole> getRoles() {
   return dataService.retrieveAll();
 }