agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/dao/JobDao.java
/**
	 * Returns the total number of jobs in an active state 
	 * on a given system. Active states are defined by 
	 * JobStatusType.getActiveStatuses().
	 *
	 * @param systemId The user-defined name of the system for which to count active jobs.
	 * @return the number of current jobs for the system
	 * @throws JobException if unable to query the db
	 */
Returns the total number of jobs in an active state
on a given system.

@param systemId The user-defined name of the system for which to count active jobs.
@return the number of current jobs for the system
@throws JobException if unable to query the db
Returns the total number of jobs in an active state on a given system . @param systemId The user - defined name of the system for which to count active jobs . @return the number of current jobs for the system @throws JobException if unable to query the db
public static long countActiveJobsOnSystem(String systemId) throws JobException
	{
		try
		{
			Session session = getSession();
			session.clear();
			String hql = "select count(*) from Job " +
					"where system = :jobsystem and " +
					"status in (" + JobStatusType.getActiveStatusValues() + ")";
			long currentUserJobCount = (Long) session.createQuery(hql)
					.setString("jobsystem", systemId)
					.uniqueResult();
			session.flush();
			return currentUserJobCount;
		} catch (HibernateException ex) {
			throw new JobException(ex);
		} finally {
			try { HibernateUtil.commitTransaction();} catch (Exception ignored) {}
		}
	}
public static long countActiveJobsOnSystem ( String systemId ) throws JobException { try { Session session = getSession ( ) ; session . clear ( ) ; String hql = "select count(*) from Job " + "where system = :jobsystem and " + "status in (" + JobStatusType . getActiveStatusValues ( ) + ")" ; long currentUserJobCount = ( Long ) session . createQuery ( hql ) . setString ( "jobsystem" , systemId ) . uniqueResult ( ) ; session . flush ( ) ; return currentUserJobCount ; } catch ( HibernateException ex ) { throw new JobException ( ex ) ; } finally { try { HibernateUtil . commitTransaction ( ) ; } catch ( Exception ignored ) { } } }
Returns the total number of jobs in an active state
 on a given system.
Returns the total number of jobs in an active state on a given system .