use of org.sonarsource.sonarlint.core.client.api.connected.GlobalStorageStatus in project sonarlint-core by SonarSource.
the class ConnectedContainer method updateModule.
public void updateModule(String moduleKey, ProgressWrapper progress) {
GlobalStorageStatus updateStatus = getComponentByType(StorageReader.class).getGlobalStorageStatus();
if (updateStatus == null) {
throw new GlobalUpdateRequiredException("Please update server first");
}
getComponentByType(ModuleStorageUpdateExecutor.class).update(moduleKey, progress);
}
use of org.sonarsource.sonarlint.core.client.api.connected.GlobalStorageStatus in project sonarlint-core by SonarSource.
the class StorageContainer method doAfterStart.
@Override
protected void doAfterStart() {
ConnectedGlobalConfiguration config = getComponentByType(ConnectedGlobalConfiguration.class);
GlobalStorageStatus updateStatus = getComponentByType(StorageContainerHandler.class).getGlobalStorageStatus();
if (updateStatus != null) {
LOG.info("Using storage for server '{}' (last update {})", config.getServerId(), DATE_FORMAT.format(updateStatus.getLastUpdateDate()));
installPlugins();
} else {
LOG.warn("No storage for server '{}'. Please update.", config.getServerId());
}
this.globalExtensionContainer = new GlobalExtensionContainer(this);
globalExtensionContainer.startComponents();
}
use of org.sonarsource.sonarlint.core.client.api.connected.GlobalStorageStatus in project sonarlint-intellij by SonarSource.
the class SonarQubeServerMgmtPanel method setStatus.
private void setStatus(ConnectedSonarLintEngine.State state) {
ConnectedSonarLintEngine.State currentState = engine.getState();
StringBuilder builder = new StringBuilder();
switch(currentState) {
case NEVER_UPDATED:
builder.append("never updated");
break;
case UPDATED:
GlobalStorageStatus storageStatus = engine.getGlobalStorageStatus();
if (storageStatus != null) {
builder.append(DateUtils.toAge(storageStatus.getLastUpdateDate().getTime()));
} else {
builder.append("up to date");
}
break;
case UPDATING:
builder.append("updating..");
break;
case NEED_UPDATE:
builder.append("needs update");
break;
case UNKNOW:
default:
builder.append("unknown");
break;
}
serverStatus.setText(builder.toString());
updateServerButton.setEnabled(state != ConnectedSonarLintEngine.State.UPDATING);
}
Aggregations