public InternalWebSocketHandler(WebServer daemonWebServer, String certificateCommonName, RequestFormatType requestFormatType) { this.daemonWebServer = daemonWebServer; this.eventBus = LocalEventBus.getInstance(); this.certificateCommonName = certificateCommonName; this.requestFormatType = requestFormatType; this.eventBus.register(this); }
private void handleEventResponse(WebSocketChannel clientSocket, EventResponse eventResponse) { eventBus.post(eventResponse); } }
public AbstractInitOperation(Config config, UserInteractionListener listener) { super(config); this.listener = listener; this.eventBus = LocalEventBus.getInstance(); }
public RemoteTransaction(Config config, TransferManager transferManager, TransactionTO transactionTO) { this.config = config; this.transferManager = transferManager; this.transactionTO = transactionTO; this.eventBus = LocalEventBus.getInstance(); }
private boolean askRetryPassword() { retryPasswordCount++; if (retryPasswordCount < MAX_RETRY_PASSWORD_COUNT) { int triesLeft = MAX_RETRY_PASSWORD_COUNT - retryPasswordCount; String triesLeftStr = triesLeft != 1 ? triesLeft + " tries left." : "Last chance."; eventBus.post(new ShowMessageExternalEvent("ERROR: Invalid password or corrupt ciphertext. " + triesLeftStr)); return true; } else { return false; } }
private void initEventBus() { eventBus = LocalEventBus.getInstance(); eventBus.register(this); }
public Downloader(Config config, TransferManager transferManager) { this.config = config; this.transferManager = transferManager; this.eventBus = LocalEventBus.getInstance(); }
private void fireDaemonReloadedEvent() { logger.log(Level.INFO, "Firing daemon-reloaded event ..."); eventBus.post(new DaemonReloadedExternalEvent()); }
private void initEventBus() { eventBus = LocalEventBus.getInstance(); eventBus.register(this); }
public InternalRestHandler(WebServer daemonWebServer, RequestFormatType requestFormatType) { this.daemonWebServer = daemonWebServer; this.eventBus = LocalEventBus.getInstance(); this.requestFormatType = requestFormatType; }
protected void fireNotifyCreateMaster() { eventBus.post(new ShowMessageExternalEvent("Creating master key from password (this might take a while) ...")); }
public Command() { this.eventBus = LocalEventBus.getInstance(); this.eventBus.register(this); }
public ManagementRequestHandler() { this.eventBus = LocalEventBus.getInstance(); }
@Override public void handle(String command) { try { ControlCommand controlCommand = ControlCommand.valueOf(command.trim().toUpperCase()); switch (controlCommand) { case SHUTDOWN: logger.log(Level.INFO, "Control file: Received shutdown command. Shutting down."); eventBus.post(controlCommand); controlFileTailer.stop(); break; case RELOAD: logger.log(Level.INFO, "Control file: Received reload command. Reloading config ..."); eventBus.post(controlCommand); break; default: throw new RuntimeException("This command should have been handled."); } } catch (Exception e) { logger.log(Level.WARNING, "Control file: Ignoring unknown command: " + command, e); } }
public EventUserInteractionListener() { this.eventBus = LocalEventBus.getInstance(); this.eventBus.register(this); this.waitObject = new Object(); }
public Indexer(Config config, Deduper deduper) { this.config = config; this.deduper = deduper; this.localDatabase = new SqlDatabase(config, true); this.eventBus = LocalEventBus.getInstance(); }
@Override public void onFinish() { eventBus.post(new UpIndexEndSyncExternalEvent(config.getLocalDir().getAbsolutePath())); }
public WatchServer() { this.daemonConfig = null; this.watchOperations = new TreeMap<File, WatchRunner>(); this.eventBus = LocalEventBus.getInstance(); this.eventBus.register(this); }
public PluginOperation(Config config, PluginOperationOptions options) { super(config); this.options = options; this.result = new PluginOperationResult(); this.eventBus = LocalEventBus.getInstance(); }
@Subscribe public void onGetFileResponseInternal(GetFileFolderResponseInternal fileResponseInternal) { File tempFile = fileResponseInternal.getTempFile(); GetFileFolderResponse fileResponse = fileResponseInternal.getFileResponse(); fileTokenTempFileCache.asMap().put(fileResponse.getTempToken(), tempFile); eventBus.post(fileResponse); }