Search in sources :

Example 1 with SchedulerStatus

use of cbit.vcell.server.SimulationJobStatusPersistent.SchedulerStatus in project vcell by virtualcell.

the class SimulationJobTable method getSimulationJobStatus.

/**
 * This method was created in VisualAge.
 * @return VCImage
 * @param rset ResultSet
 * @param log SessionLog
 */
public SimulationJobStatusPersistent getSimulationJobStatus(ResultSet rset) throws SQLException {
    // serverid
    String serID = rset.getString(this.serverID.toString());
    if (rset.wasNull()) {
        serID = null;
    }
    // simRef
    KeyValue parsedSimKey = new KeyValue(rset.getBigDecimal(simRef.toString()));
    // userKey
    KeyValue userKey = new KeyValue(rset.getBigDecimal(SimulationTable.table.ownerRef.toString()));
    // userKey
    String userid = rset.getString(UserTable.table.userid.toString());
    org.vcell.util.document.User owner = new org.vcell.util.document.User(userid, userKey);
    // submitDate
    java.util.Date parsedSubmitDate = rset.getTimestamp(submitDate.toString());
    // taskID
    int parsedTaskID = rset.getInt(taskID.toString());
    // schedulerStatus
    int parsedSchedulerStatusInt = rset.getInt(schedulerStatus.toString());
    SchedulerStatus parsedSchedulerStatus = SchedulerStatus.fromDatabaseNumber(parsedSchedulerStatusInt);
    // statusMsg
    String parsedStatusMsg = TokenMangler.getSQLRestoredString(rset.getString(statusMsg.toString()));
    SimulationMessagePersistent simulationMessage = SimulationMessagePersistent.fromSerialized(parsedSchedulerStatus, parsedStatusMsg);
    // 
    // read queue stuff
    // 
    // queueDate
    java.util.Date parsedQueuedDate = rset.getTimestamp(queueDate.toString());
    // queuePriority
    int parsedQueuePriority = rset.getInt(queuePriority.toString());
    if (rset.wasNull()) {
        parsedQueuePriority = -1;
    }
    // queueID
    int parsedQueueID = rset.getInt(queueID.toString());
    if (rset.wasNull()) {
        parsedQueueID = -1;
    }
    SimulationJobStatusPersistent.SimulationQueueID simulationQueueID = SimulationJobStatusPersistent.SimulationQueueID.fromDatabaseNumber(parsedQueueID);
    SimulationQueueEntryStatusPersistent simQueueEntryStatus = new SimulationQueueEntryStatusPersistent(parsedQueuedDate, parsedQueuePriority, simulationQueueID);
    // 
    // read solver stuff
    // 
    // startDate
    java.util.Date parsedStartDate = rset.getTimestamp(startDate.toString());
    // computeHost
    String parsedComputeHost = rset.getString(computeHost.toString());
    // latestUpdateDate
    java.util.Date parsedLatestUpdateDate = rset.getTimestamp(latestUpdateDate.toString());
    // endDate
    java.util.Date parsedEndDate = rset.getTimestamp(endDate.toString());
    // hasData
    String parsedHasData = rset.getString(hasData.toString());
    HtcJobID parsedHtcJobID = null;
    String htcJobIDString = rset.getString(pbsJobID.toString());
    if (!rset.wasNull() && htcJobIDString != null && htcJobIDString.length() > 0) {
        parsedHtcJobID = SimulationJobTable.fromDatabase(htcJobIDString);
    }
    SimulationExecutionStatusPersistent simExeStatus = new SimulationExecutionStatusPersistent(parsedStartDate, parsedComputeHost, parsedLatestUpdateDate, parsedEndDate, parsedHasData != null, parsedHtcJobID);
    VCSimulationIdentifier parsedVCSimID = new VCSimulationIdentifier(parsedSimKey, owner);
    // jobIndex
    int parsedJobIndex = rset.getInt(jobIndex.toString());
    SimulationJobStatusPersistent simulationJobStatus = new SimulationJobStatusPersistent(VCellServerID.getServerID(serID), parsedVCSimID, parsedJobIndex, parsedSubmitDate, parsedSchedulerStatus, parsedTaskID, simulationMessage, simQueueEntryStatus, simExeStatus);
    // sysDate
    java.util.Date parsedSysDate = rset.getTimestamp(DatabaseConstants.SYSDATE_COLUMN_NAME);
    if (!rset.wasNull()) {
        simulationJobStatus.setTimeDateStamp(parsedSysDate);
    }
    return simulationJobStatus;
}
Also used : VCSimulationIdentifier(cbit.vcell.solver.VCSimulationIdentifier) KeyValue(org.vcell.util.document.KeyValue) SchedulerStatus(cbit.vcell.server.SimulationJobStatusPersistent.SchedulerStatus) SimulationQueueEntryStatusPersistent(cbit.vcell.server.SimulationQueueEntryStatusPersistent) SimulationExecutionStatusPersistent(cbit.vcell.server.SimulationExecutionStatusPersistent) SimulationJobStatusPersistent(cbit.vcell.server.SimulationJobStatusPersistent) SimulationMessagePersistent(cbit.vcell.solver.server.SimulationMessagePersistent) HtcJobID(cbit.vcell.server.HtcJobID)

Aggregations

HtcJobID (cbit.vcell.server.HtcJobID)1 SimulationExecutionStatusPersistent (cbit.vcell.server.SimulationExecutionStatusPersistent)1 SimulationJobStatusPersistent (cbit.vcell.server.SimulationJobStatusPersistent)1 SchedulerStatus (cbit.vcell.server.SimulationJobStatusPersistent.SchedulerStatus)1 SimulationQueueEntryStatusPersistent (cbit.vcell.server.SimulationQueueEntryStatusPersistent)1 VCSimulationIdentifier (cbit.vcell.solver.VCSimulationIdentifier)1 SimulationMessagePersistent (cbit.vcell.solver.server.SimulationMessagePersistent)1 KeyValue (org.vcell.util.document.KeyValue)1