public static List<RUserDto> getUsers(DbConn cnx) { return getUsers(cnx, "user_select_all", 0); }
public static GlobalParameterDto getGlobalParameter(DbConn cnx, String key) { return getGlobalParameter(cnx, "globalprm_select_by_key", key); }
public static JndiObjectResourceDto getJndiObjectResource(DbConn cnx, Integer key) { return getUniqueJndiResource(cnx, "jndi_select_by_id", key); }
public static void changeUserPassword(DbConn cnx, String userLogin, String newPassword) { List<RUserDto> dtos = getUsers(cnx, "user_select_by_key", 0, userLogin); if (dtos.size() == 0) { throw new JqmAdminApiUserException("Cannot update the password of a user which does not exist - given login was " + userLogin); } changeUserPassword(cnx, dtos.get(0).getId(), newPassword); }
public static RRoleDto getRole(DbConn cnx, int id) { List<RRoleDto> res = getRoles(cnx, "role_select_by_id", 0, id); if (res.size() == 1) { return res.get(0); } else { throw new JqmAdminApiUserException("no result"); } }
public static RUserDto getUser(DbConn cnx, int id) { List<RUserDto> res = getUsers(cnx, "user_select_by_id", 0, id); if (res.size() == 1) { return res.get(0); } else { throw new JqmAdminApiUserException("no result"); } }
public static List<RRoleDto> getRoles(DbConn cnx) { return getRoles(cnx, "role_select_all", 0); }
public static List<JndiObjectResourceDto> getJndiObjectResource(DbConn cnx) { return getJndiObjectResources(cnx, "jndi_select_all"); }
public static void changeUserPassword(DbConn cnx, String userLogin, String newPassword) { List<RUserDto> dtos = getUsers(cnx, "user_select_by_key", 0, userLogin); if (dtos.size() == 0) { throw new JqmAdminApiUserException("Cannot update the password of a user which does not exist - given login was " + userLogin); } changeUserPassword(cnx, dtos.get(0).getId(), newPassword); }
public static RRoleDto getRole(DbConn cnx, int id) { List<RRoleDto> res = getRoles(cnx, "role_select_by_id", 0, id); if (res.size() == 1) { return res.get(0); } else { throw new JqmAdminApiUserException("no result"); } }
public static GlobalParameterDto getGlobalParameter(DbConn cnx, String key) { return getGlobalParameter(cnx, "globalprm_select_by_key", key); }
public static RUserDto getUser(DbConn cnx, int id) { List<RUserDto> res = getUsers(cnx, "user_select_by_id", 0, id); if (res.size() == 1) { return res.get(0); } else { throw new JqmAdminApiUserException("no result"); } }
public static List<RRoleDto> getRoles(DbConn cnx) { return getRoles(cnx, "role_select_all", 0); }
public static JndiObjectResourceDto getJndiObjectResource(DbConn cnx, Integer key) { return getUniqueJndiResource(cnx, "jndi_select_by_id", key); }
public static List<RUserDto> getUsers(DbConn cnx) { return getUsers(cnx, "user_select_all", 0); }
public static List<JndiObjectResourceDto> getJndiObjectResource(DbConn cnx) { return getJndiObjectResources(cnx, "jndi_select_all"); }
public static GlobalParameterDto getGlobalParameter(DbConn cnx, Integer key) { return getGlobalParameter(cnx, "globalprm_select_by_id", key); }
public static JndiObjectResourceDto getJndiObjectResource(DbConn cnx, String key) { return getUniqueJndiResource(cnx, "jndi_select_by_key", key); }
public static GlobalParameterDto getGlobalParameter(DbConn cnx, Integer key) { return getGlobalParameter(cnx, "globalprm_select_by_id", key); }
public static JndiObjectResourceDto getJndiObjectResource(DbConn cnx, String key) { return getUniqueJndiResource(cnx, "jndi_select_by_key", key); }