Search in sources :

Example 1 with SimulationJobStatusRepresentation

use of org.vcell.api.common.events.SimulationJobStatusRepresentation in project vcell by virtualcell.

the class SimulationJobStatusEvent method toJsonRep.

public SimulationJobStatusEventRepresentation toJsonRep() {
    String vcellServerID = this.jobStatus.getServerID().toString();
    Date timeDateStamp = this.jobStatus.getTimeDateStamp();
    String simulationKey = this.jobStatus.getVCSimulationIdentifier().getSimulationKey().toString();
    int taskID = this.jobStatus.getTaskID();
    int jobIndex = this.jobStatus.getJobIndex();
    Date submitDate = this.jobStatus.getSubmitDate();
    String owner_userid = this.username;
    String onwer_userkey = this.jobStatus.getVCSimulationIdentifier().getOwner().getID().toString();
    SimulationJobStatusRepresentation.SchedulerStatus schedulerStatus = SimulationJobStatusRepresentation.SchedulerStatus.valueOf(this.jobStatus.getSchedulerStatus().name());
    SimulationJobStatusRepresentation.DetailedState detailedState = SimulationJobStatusRepresentation.DetailedState.valueOf(this.jobStatus.getSimulationMessage().getDetailedState().name());
    String detailedStateMessage = this.jobStatus.getSimulationMessage().getDisplayMessage();
    Long htcJobNumber = null;
    String htcComputeServer = null;
    SimulationJobStatusRepresentation.BatchSystemType htcBatchSystemType = null;
    Date simexe_startDate = null;
    Date simexe_latestUpdateDate = null;
    Date simexe_endDate = null;
    String computeHost = null;
    Boolean hasData = null;
    SimulationExecutionStatus simExeStatus = this.jobStatus.getSimulationExecutionStatus();
    if (simExeStatus != null) {
        HtcJobID htcJobID = simExeStatus.getHtcJobID();
        if (htcJobID != null) {
            htcJobNumber = htcJobID.getJobNumber();
            htcComputeServer = htcJobID.getServer();
            htcBatchSystemType = SimulationJobStatusRepresentation.BatchSystemType.valueOf(htcJobID.getBatchSystemType().name());
        }
        simexe_startDate = simExeStatus.getStartDate();
        simexe_latestUpdateDate = simExeStatus.getLatestUpdateDate();
        simexe_endDate = simExeStatus.getEndDate();
        computeHost = simExeStatus.getComputeHost();
        hasData = simExeStatus.hasData();
    }
    Integer queuePriority = null;
    Date queueDate = null;
    SimulationJobStatusRepresentation.SimulationQueueID queueId = null;
    SimulationQueueEntryStatus simQueueStatus = this.jobStatus.getSimulationQueueEntryStatus();
    if (simQueueStatus != null) {
        queuePriority = simQueueStatus.getQueuePriority();
        queueDate = simQueueStatus.getQueueDate();
        queueId = SimulationJobStatusRepresentation.SimulationQueueID.valueOf(simQueueStatus.getQueueID().name());
    }
    SimulationJobStatusRepresentation jobStatus = new SimulationJobStatusRepresentation(vcellServerID, timeDateStamp, simulationKey, taskID, jobIndex, submitDate, owner_userid, onwer_userkey, schedulerStatus, detailedState, detailedStateMessage, htcJobNumber, htcComputeServer, htcBatchSystemType, queuePriority, queueDate, queueId, simexe_startDate, simexe_latestUpdateDate, simexe_endDate, computeHost, hasData);
    SimulationJobStatusEventRepresentation eventRep = new SimulationJobStatusEventRepresentation(jobStatus, progress, timePoint, username);
    return eventRep;
}
Also used : SimulationExecutionStatus(cbit.vcell.server.SimulationExecutionStatus) SimulationJobStatusRepresentation(org.vcell.api.common.events.SimulationJobStatusRepresentation) SimulationJobStatusEventRepresentation(org.vcell.api.common.events.SimulationJobStatusEventRepresentation) SimulationQueueEntryStatus(cbit.vcell.server.SimulationQueueEntryStatus) Date(java.util.Date) HtcJobID(cbit.vcell.server.HtcJobID)

Aggregations

HtcJobID (cbit.vcell.server.HtcJobID)1 SimulationExecutionStatus (cbit.vcell.server.SimulationExecutionStatus)1 SimulationQueueEntryStatus (cbit.vcell.server.SimulationQueueEntryStatus)1 Date (java.util.Date)1 SimulationJobStatusEventRepresentation (org.vcell.api.common.events.SimulationJobStatusEventRepresentation)1 SimulationJobStatusRepresentation (org.vcell.api.common.events.SimulationJobStatusRepresentation)1