19 package org.sleuthkit.autopsy.communications;
21 import com.google.common.collect.ImmutableSet;
22 import com.google.common.eventbus.EventBus;
23 import java.util.HashSet;
29 class PinnedAccountModel {
37 private final Set<AccountDeviceInstanceKey> pinnedAccountDevices =
new HashSet<>();
39 private final EventBus eventBus =
new EventBus();
41 void registerhandler(Object handler) {
42 eventBus.register(handler);
45 void unregisterhandler(Object handler) {
46 eventBus.unregister(handler);
49 boolean isAccountPinned(AccountDeviceInstanceKey account) {
50 return pinnedAccountDevices.contains(account);
60 void unpinAccount(Set<AccountDeviceInstanceKey> accountDeviceInstances) {
61 pinnedAccountDevices.removeAll(accountDeviceInstances);
71 void pinAccount(Set<AccountDeviceInstanceKey> accountDeviceInstances) {
72 pinnedAccountDevices.addAll(accountDeviceInstances);
82 return pinnedAccountDevices.isEmpty();
86 pinnedAccountDevices.clear();
89 ImmutableSet<AccountDeviceInstanceKey> getPinnedAccounts() {
90 return ImmutableSet.copyOf(pinnedAccountDevices);