2.17.2: 2011-06-17

net.sf.basedb.clients.web.extensions
Class ScanResults

java.lang.Object
  extended by net.sf.basedb.clients.web.extensions.ScanResults

public class ScanResults
extends Object

Holds information about the results of a scan for new/deleted/updated extensions.

Version:
2.7
Author:
nicklas
See Also:
ExtensionsControl.installAndUpdateExtensions(boolean)
Last modified
$Date: 2008-09-11 22:05:50 +0200 (Thu, 11 Sep 2008) $

Nested Class Summary
static class ScanResults.FileResults
          Scan results for a single XML or JAR file.
 
Field Summary
private  long endTime
           
private  Map<ExtensionsFile,ScanResults.FileResults> fileResults
           
private  boolean forceUpdate
           
private  boolean hasError
           
private  boolean manualScan
           
private  int numErrorFiles
           
private  long startTime
           
private  String summary
           
 
Constructor Summary
ScanResults(boolean manualScan, boolean forceUpdate)
          Create a new scan results object.
 
Method Summary
(package private)  void addErrorMessage(ExtensionsFile extFile, String message)
          Adds a detail message inidcating a failed operation to a file.
(package private)  void addMessage(ExtensionsFile extFile, String message)
          Adds a detail message indicating a successful operation to a file.
private  void addMessage(ExtensionsFile extFile, String message, boolean error)
           
 long getEndTime()
          Get the end time of the scan as a millisecond value.
 Collection<ExtensionsFile> getFiles()
          Get all extension files that was handled in the last scan.
 int getNumErrorFiles()
          The number of extension files that could not be completely loaded because of an error.
 ScanResults.FileResults getResults(ExtensionsFile extFile)
          Get the results for a specific extensions file.
 long getStartTime()
          Get the start time of the scan as a millisecond value.
 String getSummary()
          Get a summary of the scan results as a textual description.
 boolean hasError()
          Check if the scan was successful or not.
(package private)  void setEnded()
          Set the end time of the scan
(package private)  void setStatus(ExtensionsFile extFile, String status)
          Sets the short status message for an entire file.
(package private)  void setSummary(String summary)
           
 boolean wasForceUpdate()
           
 boolean wasManual()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

manualScan

private final boolean manualScan

forceUpdate

private final boolean forceUpdate

startTime

private final long startTime

fileResults

private Map<ExtensionsFile,ScanResults.FileResults> fileResults

hasError

private boolean hasError

numErrorFiles

private int numErrorFiles

endTime

private long endTime

summary

private String summary
Constructor Detail

ScanResults

public ScanResults(boolean manualScan,
                   boolean forceUpdate)
Create a new scan results object.

Parameters:
manualScan - TRUE if this is a manual scan, FALSE if it is an automatic scan
forceUpdate - TRUE if the scan is forcing update of already installed extensions, FALSE otherwise
Method Detail

setEnded

void setEnded()
Set the end time of the scan


getStartTime

public long getStartTime()
Get the start time of the scan as a millisecond value.

See Also:
System.currentTimeMillis()

getEndTime

public long getEndTime()
Get the end time of the scan as a millisecond value.

See Also:
System.currentTimeMillis()

getSummary

public String getSummary()
Get a summary of the scan results as a textual description.


setSummary

void setSummary(String summary)

wasManual

public boolean wasManual()
Returns:
TRUE if the scan was manual, FALSE if it was automatic

wasForceUpdate

public boolean wasForceUpdate()
Returns:
TRUE if the scan forced update of already installed extensions, FALSE otherwise

hasError

public boolean hasError()
Check if the scan was successful or not. For more detailed information use getResults(ExtensionsFile).

Returns:
TRUE if there was any problems, FALSE if everything was successful

getNumErrorFiles

public int getNumErrorFiles()
The number of extension files that could not be completely loaded because of an error.


getFiles

public Collection<ExtensionsFile> getFiles()
Get all extension files that was handled in the last scan. The collection includes both new, deleted and updated extension files.

Returns:
A collections with ExtensionsFile:s

getResults

public ScanResults.FileResults getResults(ExtensionsFile extFile)
Get the results for a specific extensions file.

Parameters:
extFile - The extensions file to get the results for
Returns:
A ScanResults.FileResults object or null if the extensions file is not found

setStatus

void setStatus(ExtensionsFile extFile,
               String status)
Sets the short status message for an entire file. Example: "Installed", "Failed", etc.

Parameters:
extFile - The file to set the status on
status - The status message
See Also:
addMessage(ExtensionsFile, String), addErrorMessage(ExtensionsFile, String)

addMessage

void addMessage(ExtensionsFile extFile,
                String message)
Adds a detail message indicating a successful operation to a file.

Parameters:
extFile - The file to add the message to
message - The message
See Also:
addErrorMessage(ExtensionsFile, String)

addErrorMessage

void addErrorMessage(ExtensionsFile extFile,
                     String message)
Adds a detail message inidcating a failed operation to a file.

Parameters:
extFile - The file to add the message to
message - The message

addMessage

private void addMessage(ExtensionsFile extFile,
                        String message,
                        boolean error)

2.17.2: 2011-06-17