use of org.olat.core.id.context.HistoryPointImpl in project openolat by klemens.
the class UserSession method addToHistory.
public void addToHistory(UserRequest ureq, BusinessControl businessControl) {
List<ContextEntry> entries = businessControl.getEntries();
String businessPath = businessControl.getAsString();
if (StringHelper.containsNonWhitespace(businessPath)) {
String uuid = ureq.getUuid();
if (!history.isEmpty()) {
// consolidate
synchronized (history) {
for (Iterator<HistoryPoint> it = history.iterator(); it.hasNext(); ) {
HistoryPoint p = it.next();
if (uuid.equals(p.getUuid())) {
it.remove();
}
}
}
}
// System.out.println(ureq.getUuid() + " Add business path: " + businessPath);
history.push(new HistoryPointImpl(ureq.getUuid(), businessPath, entries));
if (history.size() > 20) {
history.remove(0);
}
}
}
Aggregations