List<PluginInfo> pluginsMissing = new ArrayList<PluginInfo>();
Map<PluginInfo, PluginInfo> pluginsDifferent = new HashMap<PluginInfo, PluginInfo>();
for (PluginInfo localInfo: localPluginInfos) {
if (localInfo.isActive() && localInfo.isValid() && !localInfo.isPlatformPlugin()) {
PluginInfo remoteInfo = retrieveActiveByUniqueName(remotePluginInfos, localInfo.getUniqueName());
if (remoteInfo == null) {
pluginsMissing.add(localInfo);
} else {
if (!remoteInfo.getVersion().equals(localInfo.getVersion())) {
pluginsDifferent.put(localInfo, remoteInfo);
}
}
}
}
taskStatus.setSeverityLabel(pluginsMissing.size() + " missing, " + pluginsDifferent.size() + " different");
if (!pluginsMissing.isEmpty() || !pluginsDifferent.isEmpty()) {
taskStatus.setSeverity(TaskStatus.WARNING);
StringBuffer status = new StringBuffer();
if (!pluginsMissing.isEmpty()) {
status.append("The following plugins are missing on the remote server:\n");
for (int i=0; i < pluginsMissing.size(); i++) {
PluginInfo info = pluginsMissing.get(i);
status.append("- " + info.getUniqueName() + " (" + info.getVersion() + ")");
status.append("\n");
}
}
if (!pluginsDifferent.isEmpty()) {
status.append("The following plugins have different versions on the remote server:\n");
Iterator<PluginInfo> localInfos = pluginsDifferent.keySet().iterator();
while (localInfos.hasNext()) {
PluginInfo info = localInfos.next();
PluginInfo remote = pluginsDifferent.get(info);
status.append("- " + info.getUniqueName() + " (" + info.getVersion() + " != " + remote.getVersion() + ")");
status.append("\n");
}
}
taskStatus.setMessage(status.toString());
} else {