public static void deleteGlobalParameter(DbConn cnx, int id) { QueryResult qr = cnx.runUpdate("globalprm_delete_by_id", id); if (qr.nbUpdated != 1) { cnx.setRollbackOnly(); throw new JqmAdminApiUserException("no item with ID " + id); } }
public static void deleteQueueMapping(DbConn cnx, int id) { QueryResult qr = cnx.runUpdate("dp_delete_by_id", id); if (qr.nbUpdated != 1) { cnx.setRollbackOnly(); throw new JqmAdminApiUserException("no item with ID " + id); } }
public static void deleteUser(DbConn cnx, int id) { QueryResult qr = cnx.runUpdate("user_delete_by_id", id); if (qr.nbUpdated != 1) { cnx.setRollbackOnly(); throw new JqmAdminApiUserException("no item with ID " + id); } }
public static void deleteUser(DbConn cnx, int id) { QueryResult qr = cnx.runUpdate("user_delete_by_id", id); if (qr.nbUpdated != 1) { cnx.setRollbackOnly(); throw new JqmAdminApiUserException("no item with ID " + id); } }
public static void deleteGlobalParameter(DbConn cnx, int id) { QueryResult qr = cnx.runUpdate("globalprm_delete_by_id", id); if (qr.nbUpdated != 1) { cnx.setRollbackOnly(); throw new JqmAdminApiUserException("no item with ID " + id); } }
public static void deleteQueueMapping(DbConn cnx, int id) { QueryResult qr = cnx.runUpdate("dp_delete_by_id", id); if (qr.nbUpdated != 1) { cnx.setRollbackOnly(); throw new JqmAdminApiUserException("no item with ID " + id); } }
public static void deleteJndiObjectResource(DbConn cnx, int id) { cnx.runUpdate("jndiprm_delete_for_resource", id); QueryResult qr = cnx.runUpdate("jndi_delete_by_id", id); if (qr.nbUpdated != 1) { cnx.setRollbackOnly(); throw new JqmAdminApiUserException("no item with ID " + id); } }
public static void deleteJndiObjectResource(DbConn cnx, int id) { cnx.runUpdate("jndiprm_delete_for_resource", id); QueryResult qr = cnx.runUpdate("jndi_delete_by_id", id); if (qr.nbUpdated != 1) { cnx.setRollbackOnly(); throw new JqmAdminApiUserException("no item with ID " + id); } }
public static void deleteQueue(DbConn cnx, int id) { int countRunning = cnx.runSelectSingle("ji_select_count_by_queue", Integer.class, id); if (countRunning > 0) { cnx.setRollbackOnly(); throw new JqmAdminApiUserException( "cannot delete a queue with running instances. Disable it, wait for the end of all running instances, then retry."); } cnx.runUpdate("dp_delete_for_queue", id); QueryResult qr = cnx.runUpdate("q_delete_by_id", id); if (qr.nbUpdated != 1) { cnx.setRollbackOnly(); throw new JqmAdminApiUserException("no item with ID " + id); } }
public static void deleteQueue(DbConn cnx, int id) { int countRunning = cnx.runSelectSingle("ji_select_count_by_queue", Integer.class, id); if (countRunning > 0) { cnx.setRollbackOnly(); throw new JqmAdminApiUserException( "cannot delete a queue with running instances. Disable it, wait for the end of all running instances, then retry."); } cnx.runUpdate("dp_delete_for_queue", id); QueryResult qr = cnx.runUpdate("q_delete_by_id", id); if (qr.nbUpdated != 1) { cnx.setRollbackOnly(); throw new JqmAdminApiUserException("no item with ID " + id); } }
public static void deleteRole(DbConn cnx, int id, boolean force) { if (force) { cnx.runUpdate("user_remove_role", id); } else { int userUsingRole = cnx.runSelectSingle("user_select_count_using_role", Integer.class, id); if (userUsingRole > 0) { cnx.setRollbackOnly(); throw new JqmAdminApiUserException( "cannot delete a role currently attributed to a user. Remove role attribution of use force parameter."); } } QueryResult qr = cnx.runUpdate("role_delete_by_id", id); if (qr.nbUpdated != 1) { cnx.setRollbackOnly(); throw new JqmAdminApiUserException("no item with ID " + id); } }
public static void deleteRole(DbConn cnx, int id, boolean force) { if (force) { cnx.runUpdate("user_remove_role", id); } else { int userUsingRole = cnx.runSelectSingle("user_select_count_using_role", Integer.class, id); if (userUsingRole > 0) { cnx.setRollbackOnly(); throw new JqmAdminApiUserException( "cannot delete a role currently attributed to a user. Remove role attribution of use force parameter."); } } QueryResult qr = cnx.runUpdate("role_delete_by_id", id); if (qr.nbUpdated != 1) { cnx.setRollbackOnly(); throw new JqmAdminApiUserException("no item with ID " + id); } }
if (countRunning > 0) cnx.setRollbackOnly(); throw new JqmAdminApiUserException( "cannot delete a node with running instances. Disable it, wait for the end of all running instances, then retry."); if (n.getLastSeenAlive() != null && n.getLastSeenAlive().after(limit)) cnx.setRollbackOnly(); throw new JqmAdminApiUserException( "Can only remove a node either properly shut down or that has crashed more than 10 minutes ago."); if (qr.nbUpdated != 1) cnx.setRollbackOnly(); throw new JqmAdminApiUserException("no item with ID " + id);
if (countRunning > 0) cnx.setRollbackOnly(); throw new JqmAdminApiUserException( "cannot delete a node with running instances. Disable it, wait for the end of all running instances, then retry."); if (n.getLastSeenAlive() != null && n.getLastSeenAlive().after(limit)) cnx.setRollbackOnly(); throw new JqmAdminApiUserException( "Can only remove a node either properly shut down or that has crashed more than 10 minutes ago."); if (qr.nbUpdated != 1) cnx.setRollbackOnly(); throw new JqmAdminApiUserException("no item with ID " + id);
public static void deleteJobDef(DbConn cnx, int id) { int countRunning = cnx.runSelectSingle("ji_select_count_by_jd", Integer.class, id); if (countRunning > 0) { throw new JqmAdminApiUserException( "cannot delete a job definition with running instances. Disable it, wait for the end of all running instances, then retry."); } cnx.runUpdate("jdprm_delete_all_for_jd", id); QueryResult qr = cnx.runUpdate("jd_delete_by_id", id); if (qr.nbUpdated != 1) { cnx.setRollbackOnly(); throw new JqmAdminApiUserException("no item with ID " + id); } }
public static void deleteJobDef(DbConn cnx, int id) { int countRunning = cnx.runSelectSingle("ji_select_count_by_jd", Integer.class, id); if (countRunning > 0) { throw new JqmAdminApiUserException( "cannot delete a job definition with running instances. Disable it, wait for the end of all running instances, then retry."); } cnx.runUpdate("jdprm_delete_all_for_jd", id); QueryResult qr = cnx.runUpdate("jd_delete_by_id", id); if (qr.nbUpdated != 1) { cnx.setRollbackOnly(); throw new JqmAdminApiUserException("no item with ID " + id); } }