19 package com.basistech.df.cybertriage.autopsy.ctoptions.ctcloud;
30 import java.awt.event.ComponentAdapter;
31 import java.awt.event.ComponentEvent;
32 import java.io.IOException;
33 import java.time.ZoneId;
34 import java.time.format.DateTimeFormatter;
35 import java.util.Optional;
36 import java.util.concurrent.ExecutionException;
37 import java.util.logging.Level;
38 import java.util.logging.Logger;
39 import javax.swing.JOptionPane;
40 import javax.swing.SwingUtilities;
41 import javax.swing.SwingWorker;
42 import org.apache.commons.lang3.StringUtils;
43 import org.netbeans.spi.options.OptionsPanelController;
44 import org.openide.util.NbBundle;
45 import org.openide.util.NbBundle.Messages;
46 import org.openide.util.lookup.ServiceProvider;
47 import org.openide.windows.WindowManager;
54 @ServiceProvider(service = CTOptionsSubPanel.class)
59 private static final DateTimeFormatter LICENSE_EXPIRES_FORMAT = DateTimeFormatter
60 .ofPattern(
"MMMM d, YYYY")
63 private static final DateTimeFormatter MALWARE_SCANS_RESET_FORMAT = DateTimeFormatter
64 .ofPattern(
"MMM d, YYYY' at 'h:mma")
71 private volatile String licenseInfoMessage = null;
75 private volatile String authTokenMessage = null;
84 this.addComponentListener(
new ComponentAdapter() {
86 public void componentHidden(ComponentEvent e) {
101 public void componentShown(ComponentEvent e) {
124 Optional<LicenseInfo> licenseInfoOpt = ctPersistence.
loadLicenseInfo();
125 LicenseInfo licenseInfo = licenseInfoOpt.orElse(null);
126 setLicenseDisplay(licenseInfo, null);
127 setMalwareScansDisplay(null, null);
128 if (licenseInfo != null) {
129 loadMalwareScansInfo(licenseInfo);
138 this.licenseInfo = licenseInfo;
139 this.licenseInfoMessage = licenseMessage;
140 renderLicenseState();
144 this.authTokenResponse = authTokenResponse;
145 this.authTokenMessage = authTokenMessage;
146 renderLicenseState();
153 return this.licenseFetcher != null && !this.licenseFetcher.isCancelled() && !this.licenseFetcher.isDone();
160 return this.authTokenFetcher != null && !this.authTokenFetcher.isCancelled() && !this.authTokenFetcher.isDone();
164 "CTOPtionsPanel_loadLicenseInfo_loading=Loading..."
167 if (isLicenseAddRunning()) {
168 this.licenseFetcher.cancel(
true);
170 setLicenseDisplay(null, Bundle.CTOPtionsPanel_loadLicenseInfo_loading());
171 setMalwareScansDisplay(null, null);
173 this.licenseFetcher.execute();
177 "CTOPtionsPanel_loadMalwareScansInfo_loading=Loading..."
180 if (isMalwareScansRunning()) {
181 this.authTokenFetcher.cancel(
true);
185 setMalwareScansDisplay(null, null);
189 setMalwareScansDisplay(null, Bundle.CTOPtionsPanel_loadMalwareScansInfo_loading());
192 this.authTokenFetcher.execute();
200 @SuppressWarnings(
"unchecked")
202 private
void initComponents() {
203 java.awt.GridBagConstraints gridBagConstraints;
205 javax.swing.JPanel licenseInfoPanel =
new javax.swing.JPanel();
206 licenseInfoMessageLabel =
new javax.swing.JLabel();
207 licenseInfoUserLabel =
new javax.swing.JLabel();
208 licenseInfoExpiresLabel =
new javax.swing.JLabel();
209 licenseInfoIdLabel =
new javax.swing.JLabel();
210 licenseInfoAddButton =
new javax.swing.JButton();
211 malwareScansPanel =
new javax.swing.JPanel();
212 malwareScansMessageLabel =
new javax.swing.JLabel();
213 maxHashLookupsLabel =
new javax.swing.JLabel();
214 maxFileUploadsLabel =
new javax.swing.JLabel();
215 countersResetLabel =
new javax.swing.JLabel();
216 hashLookupsRemainingLabel =
new javax.swing.JLabel();
217 fileUploadsRemainingLabel =
new javax.swing.JLabel();
219 setLayout(
new java.awt.GridBagLayout());
221 licenseInfoPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(
CTMalwareScannerOptionsPanel.class,
"CTMalwareScannerOptionsPanel.licenseInfoPanel.border.title")));
222 licenseInfoPanel.setLayout(
new java.awt.GridBagLayout());
224 org.openide.awt.Mnemonics.setLocalizedText(licenseInfoMessageLabel,
org.openide.util.NbBundle.getMessage(
CTMalwareScannerOptionsPanel.class,
"CTMalwareScannerOptionsPanel.licenseInfoMessageLabel.text"));
225 gridBagConstraints =
new java.awt.GridBagConstraints();
226 gridBagConstraints.gridx = 0;
227 gridBagConstraints.gridy = 0;
228 gridBagConstraints.gridwidth = 2;
229 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
230 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
231 gridBagConstraints.weightx = 1.0;
232 gridBagConstraints.insets =
new java.awt.Insets(5, 5, 5, 5);
233 licenseInfoPanel.add(licenseInfoMessageLabel, gridBagConstraints);
235 org.openide.awt.Mnemonics.setLocalizedText(licenseInfoUserLabel,
org.openide.util.NbBundle.getMessage(
CTMalwareScannerOptionsPanel.class,
"CTMalwareScannerOptionsPanel.licenseInfoUserLabel.text"));
236 gridBagConstraints =
new java.awt.GridBagConstraints();
237 gridBagConstraints.gridx = 0;
238 gridBagConstraints.gridy = 1;
239 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
240 gridBagConstraints.weightx = 1.0;
241 gridBagConstraints.insets =
new java.awt.Insets(5, 5, 5, 5);
242 licenseInfoPanel.add(licenseInfoUserLabel, gridBagConstraints);
244 org.openide.awt.Mnemonics.setLocalizedText(licenseInfoExpiresLabel,
org.openide.util.NbBundle.getMessage(
CTMalwareScannerOptionsPanel.class,
"CTMalwareScannerOptionsPanel.licenseInfoExpiresLabel.text"));
245 gridBagConstraints =
new java.awt.GridBagConstraints();
246 gridBagConstraints.gridx = 1;
247 gridBagConstraints.gridy = 1;
248 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
249 gridBagConstraints.weightx = 1.0;
250 gridBagConstraints.insets =
new java.awt.Insets(5, 5, 5, 5);
251 licenseInfoPanel.add(licenseInfoExpiresLabel, gridBagConstraints);
253 org.openide.awt.Mnemonics.setLocalizedText(licenseInfoIdLabel,
org.openide.util.NbBundle.getMessage(
CTMalwareScannerOptionsPanel.class,
"CTMalwareScannerOptionsPanel.licenseInfoIdLabel.text"));
254 gridBagConstraints =
new java.awt.GridBagConstraints();
255 gridBagConstraints.gridx = 0;
256 gridBagConstraints.gridy = 2;
257 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
258 gridBagConstraints.weightx = 1.0;
259 gridBagConstraints.insets =
new java.awt.Insets(0, 5, 5, 5);
260 licenseInfoPanel.add(licenseInfoIdLabel, gridBagConstraints);
262 org.openide.awt.Mnemonics.setLocalizedText(licenseInfoAddButton,
org.openide.util.NbBundle.getMessage(
CTMalwareScannerOptionsPanel.class,
"CTMalwareScannerOptionsPanel.licenseInfoAddButton.text"));
263 licenseInfoAddButton.addActionListener(
new java.awt.event.ActionListener() {
264 public void actionPerformed(java.awt.event.ActionEvent evt) {
265 licenseInfoAddButtonActionPerformed(evt);
268 gridBagConstraints =
new java.awt.GridBagConstraints();
269 gridBagConstraints.gridx = 1;
270 gridBagConstraints.gridy = 2;
271 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST;
272 gridBagConstraints.weightx = 1.0;
273 gridBagConstraints.insets =
new java.awt.Insets(0, 5, 5, 5);
274 licenseInfoPanel.add(licenseInfoAddButton, gridBagConstraints);
276 gridBagConstraints =
new java.awt.GridBagConstraints();
277 gridBagConstraints.gridx = 0;
278 gridBagConstraints.gridy = 1;
279 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
280 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
281 gridBagConstraints.weightx = 1.0;
282 add(licenseInfoPanel, gridBagConstraints);
284 malwareScansPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(
org.openide.util.NbBundle.getMessage(
CTMalwareScannerOptionsPanel.class,
"CTMalwareScannerOptionsPanel.malwareScansPanel.border.title")));
285 malwareScansPanel.setLayout(
new java.awt.GridBagLayout());
287 org.openide.awt.Mnemonics.setLocalizedText(malwareScansMessageLabel,
org.openide.util.NbBundle.getMessage(
CTMalwareScannerOptionsPanel.class,
"CTMalwareScannerOptionsPanel.malwareScansMessageLabel.text"));
288 gridBagConstraints =
new java.awt.GridBagConstraints();
289 gridBagConstraints.gridx = 0;
290 gridBagConstraints.gridy = 0;
291 gridBagConstraints.gridwidth = 2;
292 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
293 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
294 gridBagConstraints.weightx = 1.0;
295 gridBagConstraints.insets =
new java.awt.Insets(5, 5, 5, 5);
296 malwareScansPanel.add(malwareScansMessageLabel, gridBagConstraints);
298 org.openide.awt.Mnemonics.setLocalizedText(maxHashLookupsLabel,
org.openide.util.NbBundle.getMessage(
CTMalwareScannerOptionsPanel.class,
"CTMalwareScannerOptionsPanel.maxHashLookupsLabel.text"));
299 gridBagConstraints =
new java.awt.GridBagConstraints();
300 gridBagConstraints.gridx = 0;
301 gridBagConstraints.gridy = 1;
302 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
303 gridBagConstraints.weightx = 1.0;
304 gridBagConstraints.insets =
new java.awt.Insets(5, 5, 5, 5);
305 malwareScansPanel.add(maxHashLookupsLabel, gridBagConstraints);
307 org.openide.awt.Mnemonics.setLocalizedText(maxFileUploadsLabel,
org.openide.util.NbBundle.getMessage(
CTMalwareScannerOptionsPanel.class,
"CTMalwareScannerOptionsPanel.maxFileUploadsLabel.text"));
308 gridBagConstraints =
new java.awt.GridBagConstraints();
309 gridBagConstraints.gridx = 0;
310 gridBagConstraints.gridy = 2;
311 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
312 gridBagConstraints.weightx = 1.0;
313 gridBagConstraints.insets =
new java.awt.Insets(0, 5, 5, 5);
314 malwareScansPanel.add(maxFileUploadsLabel, gridBagConstraints);
316 org.openide.awt.Mnemonics.setLocalizedText(countersResetLabel,
org.openide.util.NbBundle.getMessage(
CTMalwareScannerOptionsPanel.class,
"CTMalwareScannerOptionsPanel.countersResetLabel.text"));
317 gridBagConstraints =
new java.awt.GridBagConstraints();
318 gridBagConstraints.gridx = 0;
319 gridBagConstraints.gridy = 3;
320 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
321 gridBagConstraints.weightx = 1.0;
322 gridBagConstraints.insets =
new java.awt.Insets(0, 5, 5, 5);
323 malwareScansPanel.add(countersResetLabel, gridBagConstraints);
325 org.openide.awt.Mnemonics.setLocalizedText(hashLookupsRemainingLabel,
org.openide.util.NbBundle.getMessage(
CTMalwareScannerOptionsPanel.class,
"CTMalwareScannerOptionsPanel.hashLookupsRemainingLabel.text"));
326 gridBagConstraints =
new java.awt.GridBagConstraints();
327 gridBagConstraints.gridx = 1;
328 gridBagConstraints.gridy = 1;
329 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
330 gridBagConstraints.weightx = 1.0;
331 gridBagConstraints.insets =
new java.awt.Insets(5, 5, 5, 5);
332 malwareScansPanel.add(hashLookupsRemainingLabel, gridBagConstraints);
334 org.openide.awt.Mnemonics.setLocalizedText(fileUploadsRemainingLabel,
org.openide.util.NbBundle.getMessage(
CTMalwareScannerOptionsPanel.class,
"CTMalwareScannerOptionsPanel.fileUploadsRemainingLabel.text"));
335 gridBagConstraints =
new java.awt.GridBagConstraints();
336 gridBagConstraints.gridx = 1;
337 gridBagConstraints.gridy = 2;
338 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
339 gridBagConstraints.weightx = 1.0;
340 gridBagConstraints.insets =
new java.awt.Insets(0, 5, 5, 5);
341 malwareScansPanel.add(fileUploadsRemainingLabel, gridBagConstraints);
343 gridBagConstraints =
new java.awt.GridBagConstraints();
344 gridBagConstraints.gridx = 0;
345 gridBagConstraints.gridy = 2;
346 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
347 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
348 gridBagConstraints.weightx = 1.0;
349 add(malwareScansPanel, gridBagConstraints);
353 "CTMalwareScannerOptionsPanel_licenseAddDialog_title=Add a License...",
354 "CTMalwareScannerOptionsPanel_licenseAddDialog_desc=License Number:",
355 "CTMalwareScannerOptionsPanel_licenseAddDialogEnteredErr_title=License Number Already Entered",
356 "CTMalwareScannerOptionsPanel_licenseAddDialogEnteredErr_desc=The license number has already been entered",
357 "CTMalwareScannerOptionsPanel_licenseAddDialogPatternErr_title=Invalid License Number",
358 "CTMalwareScannerOptionsPanel_licenseAddDialogPatternErr_desc=Please verify that license number is of format 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'"})
361 licenseDialog.setLocationRelativeTo(
this);
362 licenseDialog.setVisible(
true);
363 String licenseNumber = licenseDialog.getValue();
364 if (licenseNumber != null) {
365 synchronized (
this) {
367 loadLicenseInfo(licenseNumber);
372 JOptionPane.showMessageDialog(
374 Bundle.CTMalwareScannerOptionsPanel_licenseAddDialogEnteredErr_desc(),
375 Bundle.CTMalwareScannerOptionsPanel_licenseAddDialogEnteredErr_title(),
376 JOptionPane.INFORMATION_MESSAGE);
384 "CTMalwareScannerOptionsPanel_licenseInfo_userInfo=<html>User: {0}<br/>Email: {1}</html>",
385 "# {0} - expiresDate",
386 "CTMalwareScannerOptionsPanel_licenseInfo_expires=Expires: {0}",
388 "CTMalwareScannerOptionsPanel_licenseInfo_id=ID: {0}",
389 "# {0} - maxDailyLookups",
390 "CTMalwareScannerOptionsPanel_malwareScans_maxDailyHashLookups=Max Hash lookups: {0}/day",
391 "# {0} - maxDailyFileLookups",
392 "CTMalwareScannerOptionsPanel_malwareScans_maxDailyFileLookups=Max file uploads: {0}/day",
393 "# {0} - countersResetDate",
394 "CTMalwareScannerOptionsPanel_malwareScans_countersReset=Counters reset: {0}",
395 "# {0} - hashLookupsRemaining",
396 "CTMalwareScannerOptionsPanel_malwareScans_hashLookupsRemaining=Hash lookups remaining: {0}",
397 "# {0} - fileUploadsRemaining",
398 "CTMalwareScannerOptionsPanel_malwareScans_fileUploadsRemaining=File uploads remaining: {0}"})
400 this.licenseInfoAddButton.setEnabled(!isLicenseAddRunning());
402 this.licenseInfoMessageLabel.setVisible(StringUtils.isNotBlank(
this.licenseInfoMessage));
403 this.licenseInfoMessageLabel.setText(this.licenseInfoMessage);
405 if (licenseInfo == null) {
406 this.licenseInfoExpiresLabel.setVisible(
false);
407 this.licenseInfoIdLabel.setVisible(
false);
408 this.licenseInfoUserLabel.setVisible(
false);
410 this.licenseInfoExpiresLabel.setVisible(
true);
411 this.licenseInfoExpiresLabel.setText(Bundle.CTMalwareScannerOptionsPanel_licenseInfo_expires(
412 this.licenseInfo.getDecryptedLicense().getExpirationDate() == null
415 this.licenseInfoIdLabel.setVisible(
true);
416 this.licenseInfoIdLabel.setText(Bundle.CTMalwareScannerOptionsPanel_licenseInfo_id(StringUtils.defaultString(
this.licenseInfo.getDecryptedLicense().getBoostLicenseId())));
417 this.licenseInfoUserLabel.setVisible(
true);
418 this.licenseInfoUserLabel.setText(Bundle.CTMalwareScannerOptionsPanel_licenseInfo_userInfo(
419 StringUtils.defaultString(
this.licenseInfo.getDecryptedLicense().getCustomerName()),
420 StringUtils.defaultString(
this.licenseInfo.getDecryptedLicense().getCustomerEmail())));
423 this.malwareScansPanel.setVisible(StringUtils.isNotBlank(
this.authTokenMessage) || authTokenResponse != null);
425 this.malwareScansMessageLabel.setVisible(StringUtils.isNotBlank(
this.authTokenMessage));
426 this.malwareScansMessageLabel.setText(this.authTokenMessage);
428 if (authTokenResponse == null) {
429 this.maxHashLookupsLabel.setVisible(
false);
430 this.maxFileUploadsLabel.setVisible(
false);
431 this.countersResetLabel.setVisible(
false);
432 this.hashLookupsRemainingLabel.setVisible(
false);
433 this.fileUploadsRemainingLabel.setVisible(
false);
435 this.maxHashLookupsLabel.setVisible(
true);
436 this.maxHashLookupsLabel.setText(Bundle.CTMalwareScannerOptionsPanel_malwareScans_maxDailyHashLookups(
this.authTokenResponse.getHashLookupLimit()));
437 this.maxFileUploadsLabel.setVisible(
true);
438 this.maxFileUploadsLabel.setText(Bundle.CTMalwareScannerOptionsPanel_malwareScans_maxDailyFileLookups(
this.authTokenResponse.getFileUploadLimit()));
439 this.countersResetLabel.setVisible(
true);
440 this.countersResetLabel.setText(Bundle.CTMalwareScannerOptionsPanel_malwareScans_countersReset(
this.authTokenResponse.getResetDate() == null ?
"" : MALWARE_SCANS_RESET_FORMAT.format(this.authTokenResponse.
getResetDate())));
441 this.hashLookupsRemainingLabel.setVisible(
true);
442 this.hashLookupsRemainingLabel.setText(Bundle.CTMalwareScannerOptionsPanel_malwareScans_hashLookupsRemaining(remaining(this.authTokenResponse.
getHashLookupLimit(), this.authTokenResponse.
getHashLookupCount())));
443 this.fileUploadsRemainingLabel.setVisible(
true);
444 this.fileUploadsRemainingLabel.setText(Bundle.CTMalwareScannerOptionsPanel_malwareScans_fileUploadsRemaining(remaining(this.authTokenResponse.
getFileUploadLimit(), this.authTokenResponse.
getFileUploadCount())));
449 total = total == null ? 0 : total;
450 used = used == null ? 0 : used;
457 eulaDialog.setLocationRelativeTo(
this);
458 eulaDialog.setSize(eulaDialog.getPreferredSize());
459 eulaDialog.setVisible(
true);
461 if (eulaDialog.isAcceptPressed()) {
464 this.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
467 logger.log(Level.WARNING,
"An error occurred while fetching data", ex);
468 JOptionPane.showMessageDialog(
470 Bundle.CTMalwareScannerOptionsPanel_LicenseFetcher_localErr_desc(),
471 Bundle.CTMalwareScannerOptionsPanel_LicenseFetcher_localErr_title(),
472 JOptionPane.ERROR_MESSAGE);
474 setLicenseDisplay(this.licenseInfo, null);
475 loadMalwareScansInfo(this.licenseInfo);
480 "CTMalwareScannerOptionsPanel_LicenseFetcher_apiErr_title=Server Error",
481 "CTMalwareScannerOptionsPanel_LicenseFetcher_localErr_title=General Error",
482 "CTMalwareScannerOptionsPanel_LicenseFetcher_localErr_desc=A general error occurred while fetching license information. Please try again later.",})
488 this.licenseText = licenseText;
493 if (this.isCancelled()) {
503 SwingUtilities.invokeLater(() -> acceptEula(licenseResponse));
504 }
catch (InterruptedException ex) {
506 setLicenseDisplay(licenseInfo, null);
507 loadMalwareScansInfo(licenseInfo);
508 }
catch (ExecutionException ex) {
509 if (ex.getCause() != null && ex.getCause() instanceof
CTCloudException cloudEx) {
510 logger.log(Level.WARNING,
"An API error occurred while fetching license information", cloudEx);
511 JOptionPane.showMessageDialog(
513 cloudEx.getErrorCode().getDescription(),
514 Bundle.CTMalwareScannerOptionsPanel_LicenseFetcher_apiErr_title(),
515 JOptionPane.ERROR_MESSAGE);
517 logger.log(Level.WARNING,
"An error occurred while fetching data", ex);
518 JOptionPane.showMessageDialog(
520 Bundle.CTMalwareScannerOptionsPanel_LicenseFetcher_localErr_desc(),
521 Bundle.CTMalwareScannerOptionsPanel_LicenseFetcher_localErr_title(),
522 JOptionPane.ERROR_MESSAGE);
524 setLicenseDisplay(licenseInfo, null);
525 loadMalwareScansInfo(licenseInfo);
535 "CTMalwareScannerOptionsPanel_MalwareScansFetcher_apiErr_title=Server Error",
536 "CTMalwareScannerOptionsPanel_MalwareScansFetcher_localErr_title=General Error",
537 "CTMalwareScannerOptionsPanel_MalwareScansFetcher_localErr_desc=A general error occurred while fetching malware scans information. Please try again later.",})
543 this.decryptedLicense = decryptedLicense;
548 if (this.isCancelled()) {
559 authTokenResponse =
get();
560 }
catch (InterruptedException ex) {
562 }
catch (ExecutionException ex) {
563 if (ex.getCause() != null && ex.getCause() instanceof
CTCloudException cloudEx) {
564 logger.log(Level.WARNING,
"An API error occurred while fetching malware scans information for license", cloudEx);
565 JOptionPane.showMessageDialog(
567 cloudEx.getErrorDetails(),
568 Bundle.CTMalwareScannerOptionsPanel_MalwareScansFetcher_apiErr_title(),
569 JOptionPane.ERROR_MESSAGE);
571 logger.log(Level.WARNING,
"An error occurred while fetching data", ex);
572 JOptionPane.showMessageDialog(
574 Bundle.CTMalwareScannerOptionsPanel_MalwareScansFetcher_localErr_desc(),
575 Bundle.CTMalwareScannerOptionsPanel_MalwareScansFetcher_localErr_title(),
576 JOptionPane.ERROR_MESSAGE);
581 if (!this.isCancelled()) {
582 setMalwareScansDisplay(authTokenResponse, null);
Long getFileUploadLimit()
DecryptedLicenseResponse getDecryptedLicense()
javax.swing.JLabel licenseInfoUserLabel
static String getInferredUserTimeZone()
void licenseInfoAddButtonActionPerformed(java.awt.event.ActionEvent evt)
volatile LicenseInfo licenseInfo
javax.swing.JLabel maxHashLookupsLabel
Long getFileUploadCount()
static CTApiDAO getInstance()
synchronized void setMalwareScansDisplay(AuthTokenResponse authTokenResponse, String authTokenMessage)
synchronized boolean saveLicenseResponse(LicenseResponse licenseResponse)
synchronized void loadSettings()
synchronized void renderLicenseState()
AuthTokenFetcher(DecryptedLicenseResponse decryptedLicense)
synchronized void saveSettings()
void acceptEula(LicenseResponse licenseResponse)
LicenseResponse doInBackground()
AuthTokenResponse doInBackground()
javax.swing.JLabel fileUploadsRemainingLabel
LicenseFetcher(String licenseText)
javax.swing.JLabel licenseInfoExpiresLabel
synchronized Optional< LicenseInfo > loadLicenseInfo()
javax.swing.JLabel hashLookupsRemainingLabel
static CTLicensePersistence getInstance()
synchronized void loadMalwareScansInfo(LicenseInfo licenseInfo)
synchronized LicenseResponse getLicenseInfo()
javax.swing.JLabel licenseInfoIdLabel
javax.swing.JPanel malwareScansPanel
javax.swing.JLabel countersResetLabel
javax.swing.JButton licenseInfoAddButton
String getBoostLicenseId()
LicenseResponse getLicenseResponse()
Long getHashLookupLimit()
Instant getExpirationDate()
Long getHashLookupCount()
static LicenseDecryptorUtil getInstance()
synchronized void loadLicenseInfo(String licenseNumber)
AuthTokenResponse getAuthToken(DecryptedLicenseResponse decrypted)
synchronized boolean isLicenseAddRunning()
volatile LicenseFetcher licenseFetcher
javax.swing.JLabel licenseInfoMessageLabel
CTMalwareScannerOptionsPanel()
synchronized boolean isMalwareScansRunning()
final DecryptedLicenseResponse decryptedLicense
volatile AuthTokenFetcher authTokenFetcher
synchronized static Logger getLogger(String name)
javax.swing.JLabel malwareScansMessageLabel
LicenseInfo createLicenseInfo(LicenseResponse licenseResponse)
synchronized void setLicenseDisplay(LicenseInfo licenseInfo, String licenseMessage)
javax.swing.JLabel maxFileUploadsLabel
LicenseResponse getLicenseInfo(String licenseString)
long remaining(Long total, Long used)