Search in sources :

Example 1 with SetEntityWatchesResult

use of edu.stanford.bmir.protege.web.shared.watches.SetEntityWatchesResult in project webprotege by protegeproject.

the class SetEntityWatchesActionHandler method execute.

@Nonnull
@Override
public SetEntityWatchesResult execute(@Nonnull SetEntityWatchesAction action, @Nonnull ExecutionContext executionContext) {
    EventTag startTag = eventManager.getCurrentTag();
    UserId userId = action.getUserId();
    Set<Watch> watches = watchManager.getDirectWatches(action.getEntity(), userId);
    for (Watch watch : watches) {
        watchManager.removeWatch(watch);
    }
    for (Watch watch : action.getWatches()) {
        watchManager.addWatch(watch);
    }
    return new SetEntityWatchesResult(eventManager.getEventsFromTag(startTag));
}
Also used : UserId(edu.stanford.bmir.protege.web.shared.user.UserId) SetEntityWatchesResult(edu.stanford.bmir.protege.web.shared.watches.SetEntityWatchesResult) Watch(edu.stanford.bmir.protege.web.shared.watches.Watch) EventTag(edu.stanford.bmir.protege.web.shared.event.EventTag) Nonnull(javax.annotation.Nonnull)

Aggregations

EventTag (edu.stanford.bmir.protege.web.shared.event.EventTag)1 UserId (edu.stanford.bmir.protege.web.shared.user.UserId)1 SetEntityWatchesResult (edu.stanford.bmir.protege.web.shared.watches.SetEntityWatchesResult)1 Watch (edu.stanford.bmir.protege.web.shared.watches.Watch)1 Nonnull (javax.annotation.Nonnull)1