use of org.vcell.util.document.VCellServerID in project vcell by virtualcell.
the class AddNewServiceDialog method getServiceSpec.
/**
* Insert the method's description here.
* Creation date: (8/22/2003 4:07:31 PM)
* @return cbit.vcell.messaging.admin.VCellServiceConfig
*/
public ServiceSpec getServiceSpec() {
VCellServerID site = VCellServerID.getServerID(getSiteField().getText());
ServiceType stype = (ServiceType) getTypeCombo().getSelectedItem();
int ordinal = 0;
try {
ordinal = Integer.parseInt("" + getOrdinalCombo().getSelectedItem());
} catch (NumberFormatException ex) {
throw new RuntimeException("Ordinal must be a number!");
}
ServiceStartupType startup = ServiceStartupType.fromDescription((String) getStartupCombo().getSelectedItem());
int memoryMB = Integer.parseInt(getMemoryMBField().getText());
return new ServiceSpec(site, stype, ordinal, startup, memoryMB);
}
use of org.vcell.util.document.VCellServerID in project vcell by virtualcell.
the class SimulationDatabaseDirect method translateToSimulationJobStatusPersistent.
private SimulationJobStatusPersistent translateToSimulationJobStatusPersistent(SimulationJobStatus simJobStatus) {
VCellServerID serverID = simJobStatus.getServerID();
VCSimulationIdentifier vcSimID = simJobStatus.getVCSimulationIdentifier();
int jobIndex = simJobStatus.getJobIndex();
Date submitDate = simJobStatus.getSubmitDate();
SimulationJobStatusPersistent.SchedulerStatus schedulerStatus = SimulationJobStatusPersistent.SchedulerStatus.valueOf(simJobStatus.getSchedulerStatus().name());
int taskID = simJobStatus.getTaskID();
SimulationMessagePersistent simMessage = SimulationMessagePersistent.fromSerializedMessage(simJobStatus.getSimulationMessage().toSerialization());
Date queueDate = simJobStatus.getSimulationQueueEntryStatus().getQueueDate();
int queuePriority = simJobStatus.getSimulationQueueEntryStatus().getQueuePriority();
SimulationJobStatusPersistent.SimulationQueueID queueId = SimulationJobStatusPersistent.SimulationQueueID.valueOf(simJobStatus.getSimulationQueueEntryStatus().getQueueID().name());
SimulationQueueEntryStatusPersistent simQueueStatus = new SimulationQueueEntryStatusPersistent(queueDate, queuePriority, queueId);
SimulationExecutionStatusPersistent simExecStatus = new SimulationExecutionStatusPersistent(simJobStatus.getSimulationExecutionStatus().getStartDate(), simJobStatus.getSimulationExecutionStatus().getComputeHost(), simJobStatus.getSimulationExecutionStatus().getLatestUpdateDate(), simJobStatus.getSimulationExecutionStatus().getEndDate(), simJobStatus.getSimulationExecutionStatus().hasData(), simJobStatus.getSimulationExecutionStatus().getHtcJobID());
SimulationJobStatusPersistent simJobStatusPersistent = new SimulationJobStatusPersistent(serverID, vcSimID, jobIndex, submitDate, schedulerStatus, taskID, simMessage, simQueueStatus, simExecStatus);
return simJobStatusPersistent;
}
use of org.vcell.util.document.VCellServerID in project vcell by virtualcell.
the class SimulationStateMachine method onSystemAbort.
public synchronized void onSystemAbort(SimulationJobStatus oldJobStatus, String failureMessage, SimulationDatabase simulationDatabase, VCMessageSession session) throws VCMessagingException, UpdateSynchronizationException, DataAccessException, SQLException {
updateSolverProcessTimestamp();
int taskID = oldJobStatus.getTaskID();
//
// status information (initialized as if new record)
//
Date startDate = null;
boolean hasData = false;
HtcJobID htcJobID = null;
String computeHost = null;
VCellServerID vcServerID = VCellServerID.getSystemServerID();
Date submitDate = null;
Date queueDate = null;
int queuePriority = PRIORITY_DEFAULT;
//
// update using previously stored status (if available).
//
SimulationExecutionStatus oldSimExeStatus = oldJobStatus.getSimulationExecutionStatus();
if (oldSimExeStatus != null && oldSimExeStatus.getStartDate() != null) {
startDate = oldSimExeStatus.getStartDate();
}
if (oldSimExeStatus != null && oldSimExeStatus.hasData()) {
hasData = true;
}
if (oldSimExeStatus != null && oldSimExeStatus.getComputeHost() != null) {
computeHost = oldSimExeStatus.getComputeHost();
}
if (oldSimExeStatus != null && oldSimExeStatus.getHtcJobID() != null) {
htcJobID = oldSimExeStatus.getHtcJobID();
}
vcServerID = oldJobStatus.getServerID();
submitDate = oldJobStatus.getSubmitDate();
SimulationQueueEntryStatus oldQueueStatus = oldJobStatus.getSimulationQueueEntryStatus();
if (oldQueueStatus != null && oldQueueStatus.getQueueDate() != null) {
queueDate = oldQueueStatus.getQueueDate();
}
if (oldQueueStatus != null) {
queuePriority = oldQueueStatus.getQueuePriority();
}
SimulationQueueEntryStatus newQueueStatus = new SimulationQueueEntryStatus(queueDate, queuePriority, SimulationJobStatus.SimulationQueueID.QUEUE_ID_NULL);
Date endDate = new Date();
Date lastUpdateDate = new Date();
SimulationExecutionStatus newExeStatus = new SimulationExecutionStatus(startDate, computeHost, lastUpdateDate, endDate, hasData, htcJobID);
SimulationJobStatus newJobStatus = new SimulationJobStatus(vcServerID, oldJobStatus.getVCSimulationIdentifier(), jobIndex, submitDate, SchedulerStatus.FAILED, taskID, SimulationMessage.jobFailed(failureMessage), newQueueStatus, newExeStatus);
simulationDatabase.updateSimulationJobStatus(newJobStatus);
// addStateMachineTransition(new StateMachineTransition(new AbortStateMachineEvent(taskID, failureMessage), oldJobStatus, newJobStatus));
String userName = VCMessagingConstants.USERNAME_PROPERTY_VALUE_ALL;
StatusMessage msgForClient = new StatusMessage(newJobStatus, userName, null, null);
msgForClient.sendToClient(session);
if (lg.isTraceEnabled())
lg.trace("Send status to client: " + msgForClient);
}
Aggregations