}
@Override
public void run() {
// Construct the data holders for what has been deleted, updated and inserted.
InterchangeDataHolder updatedData = new InterchangeDataHolder();
InterchangeIdHolder deletedData = new InterchangeIdHolder();
init();
try {
populateMainEntities(updatedData, deletedData);
} catch (DeployException ex) {
callback.caught(ex);
return;
}
if (Thread.currentThread().isInterrupted()) {
callback.cancelled();
return;
}
populateAuxiliaryProperties(updatedData, deletedData);
if (Thread.currentThread().isInterrupted()) {
callback.cancelled();
return;
}
DeployResultFactory resultFactory = new DeployResultFactory(project, serverInfo, user);
try {
// Now we can start calling our web services.
//
String user = wsConfiguration.getUserName();
String password = wsConfiguration.getPassword();
// First we check if all the required files are there.
CRequiredFiles requiredFiles = getRequiredFilesWsInput();
CFileDependencies fileDependencies = getFileDependencies();
if (requiredFiles != null) {
CFileCheckResult fileCheckResult = deployer.checkRequiredFiles(user, password, fileDependencies,
requiredFiles);
if (Thread.currentThread().isInterrupted()) {
callback.cancelled();
return;
}
if (fileCheckResult.getFileCheckStatus() != 0) {
// We need to send the data for some files.
AddRequiredFilesWithContent(fileCheckResult.getAvailableRequiredFiles());
fileCheckResult = deployer.checkRequiredFiles(user, password, fileDependencies, requiredFiles);
if (Thread.currentThread().isInterrupted()) {
callback.cancelled();
return;
}
if (fileCheckResult.getFileCheckStatus() != 0) {
callback.caught(new DeployException("Failed to upload all required files. "
+ "The server says that some files are missing but we don't "
+ "have them to send. This is most likely a bug, please report it"));
return;
}
}
}
updatedData.setPipelinePluginEntityAssociations(EntityPipelinePlugin
.getInterchangeDataTable(m_entityPipelinePlugins));
DeployLog.LOG.info("Now sending the project data to the server");
// Call deploy web service.
CDeployResults deployResults = deployer.deployInterchangeData(user, password, deletedData, updatedData);