use of com.gitblit.models.PluginRegistry.PluginRegistration in project gitblit by gitblit.
the class PluginManager method getRegisteredPlugins.
@Override
public synchronized List<PluginRegistration> getRegisteredPlugins() {
List<PluginRegistration> list = new ArrayList<PluginRegistration>();
Map<String, PluginRegistration> map = new TreeMap<String, PluginRegistration>();
for (PluginRegistry registry : getRegistries()) {
list.addAll(registry.registrations);
for (PluginRegistration reg : list) {
reg.installedRelease = null;
map.put(reg.id, reg);
}
}
for (PluginWrapper pw : pf4j.getPlugins()) {
String id = pw.getDescriptor().getPluginId();
Version pv = pw.getDescriptor().getVersion();
PluginRegistration reg = map.get(id);
if (reg != null) {
reg.installedRelease = pv.toString();
}
}
return list;
}
use of com.gitblit.models.PluginRegistry.PluginRegistration in project gitblit by gitblit.
the class PluginManager method lookupRelease.
@Override
public synchronized PluginRelease lookupRelease(String pluginId, String version) {
PluginRegistration reg = lookupPlugin(pluginId);
if (reg == null) {
return null;
}
PluginRelease pv;
if (StringUtils.isEmpty(version)) {
pv = reg.getCurrentRelease(getSystemVersion());
} else {
pv = reg.getRelease(version);
}
return pv;
}
Aggregations