Search in sources :

Example 6 with HistoryPointImpl

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);
        }
    }
}
Also used : HistoryPointImpl(org.olat.core.id.context.HistoryPointImpl) ContextEntry(org.olat.core.id.context.ContextEntry) HistoryPoint(org.olat.core.id.context.HistoryPoint)

Aggregations

ContextEntry (org.olat.core.id.context.ContextEntry)6 HistoryPoint (org.olat.core.id.context.HistoryPoint)6 HistoryPointImpl (org.olat.core.id.context.HistoryPointImpl)6 AssertException (org.olat.core.logging.AssertException)4