/** * Fluent API builder. * * @param cronExpression * @return */ public static ScheduledJob create(String cronExpression) { ScheduledJob res = new ScheduledJob(); res.cronExpression = cronExpression; return res; }
public static void upsertQueueMapping(DbConn cnx, QueueMappingDto dto) { if (dto.getId() != null) { cnx.runUpdate("dp_update_changed_by_id", dto.getEnabled(), dto.getNbThread(), dto.getPollingInterval(), dto.getNodeId(), dto.getQueueId(), dto.getId(), dto.getEnabled(), dto.getNbThread(), dto.getPollingInterval(), dto.getNodeId(), dto.getQueueId()); } else { DeploymentParameter.create(cnx, dto.getNodeId(), dto.getNbThread(), dto.getPollingInterval(), dto.getQueueId()); } }
private static JndiObjectResourceDto mapJndiObjectResource(ResultSet rs) throws SQLException { JndiObjectResourceDto res = new JndiObjectResourceDto(); res.setId(rs.getInt(1)); res.setName(rs.getString(2)); res.setAuth(rs.getString(3)); res.setType(rs.getString(4)); res.setFactory(rs.getString(5)); res.setDescription(rs.getString(6)); res.setTemplate(rs.getString(7)); res.setSingleton(rs.getBoolean(8)); return res; }
private static QueueMappingDto mapQueueMapping(ResultSet rs, int colShift) { try { QueueMappingDto tmp = new QueueMappingDto(); tmp.setId(rs.getInt(1 + colShift)); tmp.setEnabled(rs.getBoolean(2 + colShift)); tmp.setNbThread(rs.getInt(4 + colShift)); tmp.setPollingInterval(rs.getInt(5 + colShift)); tmp.setNodeId(rs.getInt(6 + colShift)); tmp.setQueueId(rs.getInt(7 + colShift)); tmp.setNodeName(rs.getString(8 + colShift)); tmp.setQueueName(rs.getString(9 + colShift)); return tmp; } catch (SQLException e) { throw new JqmAdminApiInternalException(e); } }
public static void upsertQueue(DbConn cnx, QueueDto dto) { if (dto.getId() != null) { cnx.runUpdate("q_update_changed_by_id", dto.isDefaultQueue(), dto.getDescription(), dto.getName(), dto.getId(), dto.isDefaultQueue(), dto.getDescription(), dto.getName()); } else { Queue.create(cnx, dto.getName(), dto.getDescription(), dto.isDefaultQueue()); } }
private static QueueDto mapQueue(ResultSet rs, int colShift) { try { QueueDto tmp = new QueueDto(); tmp.setId(rs.getInt(1 + colShift)); tmp.setDefaultQueue(rs.getBoolean(2 + colShift)); tmp.setDescription(rs.getString(3 + colShift)); tmp.setName(rs.getString(4 + colShift)); return tmp; } catch (SQLException e) { throw new JqmAdminApiInternalException(e); } }
private static GlobalParameterDto mapGlobalParameter(ResultSet rs) throws SQLException { GlobalParameterDto res = new GlobalParameterDto(); res.setId(rs.getInt(1)); res.setKey(rs.getString(2)); res.setValue(rs.getString(3)); return res; }
private static RRoleDto mapRole(ResultSet rs, int colShift) { try { RRoleDto tmp = new RRoleDto(); tmp.setId(rs.getInt(1 + colShift)); tmp.setName(rs.getString(2 + colShift)); tmp.setDescription(rs.getString(3 + colShift)); return tmp; } catch (SQLException e) { throw new JqmAdminApiInternalException(e); } }
@Override int doWork() { jqmlogger.info("# Roles defined"); try (DbConn cnx = Helpers.getNewDbSession()) { for (RRoleDto role : MetaService.getRoles(cnx)) { jqmlogger.info("{} - {}", role.getName(), role.getDescription()); } } return 0; } }
public static void upsertGlobalParameter(DbConn cnx, GlobalParameterDto dto) { if (dto == null || dto.getKey() == null || dto.getKey().isEmpty() || dto.getValue() == null || dto.getValue().isEmpty()) { throw new IllegalArgumentException("invalid dto object"); } GlobalParameter.setParameter(cnx, dto.getKey(), dto.getValue()); }
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); }
private static JndiObjectResourceDto mapJndiObjectResource(ResultSet rs) throws SQLException { JndiObjectResourceDto res = new JndiObjectResourceDto(); res.setId(rs.getInt(1)); res.setName(rs.getString(2)); res.setAuth(rs.getString(3)); res.setType(rs.getString(4)); res.setFactory(rs.getString(5)); res.setDescription(rs.getString(6)); res.setTemplate(rs.getString(7)); res.setSingleton(rs.getBoolean(8)); return res; }
public static void upsertQueueMapping(DbConn cnx, QueueMappingDto dto) { if (dto.getId() != null) { cnx.runUpdate("dp_update_changed_by_id", dto.getEnabled(), dto.getNbThread(), dto.getPollingInterval(), dto.getNodeId(), dto.getQueueId(), dto.getId(), dto.getEnabled(), dto.getNbThread(), dto.getPollingInterval(), dto.getNodeId(), dto.getQueueId()); } else { DeploymentParameter.create(cnx, dto.getNodeId(), dto.getNbThread(), dto.getPollingInterval(), dto.getQueueId()); } }
public static void upsertQueue(DbConn cnx, QueueDto dto) { if (dto.getId() != null) { cnx.runUpdate("q_update_changed_by_id", dto.isDefaultQueue(), dto.getDescription(), dto.getName(), dto.getId(), dto.isDefaultQueue(), dto.getDescription(), dto.getName()); } else { Queue.create(cnx, dto.getName(), dto.getDescription(), dto.isDefaultQueue()); } }
private static QueueDto mapQueue(ResultSet rs, int colShift) { try { QueueDto tmp = new QueueDto(); tmp.setId(rs.getInt(1 + colShift)); tmp.setDefaultQueue(rs.getBoolean(2 + colShift)); tmp.setDescription(rs.getString(3 + colShift)); tmp.setName(rs.getString(4 + colShift)); return tmp; } catch (SQLException e) { throw new JqmAdminApiInternalException(e); } }
private static GlobalParameterDto mapGlobalParameter(ResultSet rs) throws SQLException { GlobalParameterDto res = new GlobalParameterDto(); res.setId(rs.getInt(1)); res.setKey(rs.getString(2)); res.setValue(rs.getString(3)); return res; }
private static RRoleDto mapRole(ResultSet rs, int colShift) { try { RRoleDto tmp = new RRoleDto(); tmp.setId(rs.getInt(1 + colShift)); tmp.setName(rs.getString(2 + colShift)); tmp.setDescription(rs.getString(3 + colShift)); return tmp; } catch (SQLException e) { throw new JqmAdminApiInternalException(e); } }
public static void upsertGlobalParameter(DbConn cnx, GlobalParameterDto dto) { if (dto == null || dto.getKey() == null || dto.getKey().isEmpty() || dto.getValue() == null || dto.getValue().isEmpty()) { throw new IllegalArgumentException("invalid dto object"); } GlobalParameter.setParameter(cnx, dto.getKey(), dto.getValue()); }
/** * Fluent API builder. * * @param cronExpression * @return */ public static ScheduledJob create(String cronExpression) { ScheduledJob res = new ScheduledJob(); res.cronExpression = cronExpression; return res; }
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); }