3.1.2: 2012-07-31

net.sf.basedb.util.extensions.manager
Class ProcessResults

java.lang.Object
  extended by net.sf.basedb.util.extensions.manager.ProcessResults

public class ProcessResults
extends Object

Class for collecting results from a scan for new/deleted/updated extensions.

Since:
3.0
Author:
Nicklas
Last modified
$Date: 2011-04-27 11:27:56 +0200 (Wed, 27 Apr 2011) $

Nested Class Summary
static class ProcessResults.FileResults
          Scan results for a single XML or JAR file.
 
Field Summary
private  long endTime
           
private  Map<ExtensionsFile,ProcessResults.FileResults> fileResults
           
private  boolean hasError
           
private  int numErrorFiles
           
private  long startTime
           
private  String summary
           
 
Constructor Summary
ProcessResults()
          Create a new process results object.
 
Method Summary
 void addErrorMessage(ExtensionsFile xtFile, String message)
          Adds a detailed message inidcating a failed operation to a file.
 void addMessage(ExtensionsFile xtFile, String message)
          Adds a detailed message indicating a successful operation to a file.
private  void addMessage(ExtensionsFile xtFile, String message, boolean error)
           
 List<ProcessResults.FileResults> getAllResults()
           
 long getEndTime()
          Get the end time of the scan as a millisecond value.
 int getNumErrorFiles()
          The number of extension files that could not be completely loaded because of an error.
 ProcessResults.FileResults getResults(ExtensionsFile xtFile)
          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.
 void setEnded()
          Set the end time of the scan.
 void setStatus(ExtensionsFile xtFile, String status)
          Sets a short overall status message for an entire file.
 void setSummary(String summary)
          Set a summary of the results.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

startTime

private final long startTime

fileResults

private Map<ExtensionsFile,ProcessResults.FileResults> fileResults

hasError

private boolean hasError

numErrorFiles

private int numErrorFiles

endTime

private long endTime

summary

private String summary
Constructor Detail

ProcessResults

public ProcessResults()
Create a new process results object.

Method Detail

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()

setEnded

public void setEnded()
Set the end time of the scan.


getSummary

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


setSummary

public void setSummary(String summary)
Set a summary of the results.


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.


getAllResults

public List<ProcessResults.FileResults> getAllResults()

getResults

public ProcessResults.FileResults getResults(ExtensionsFile xtFile)
Get the results for a specific extensions file.

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

setStatus

public void setStatus(ExtensionsFile xtFile,
                      String status)
Sets a short overall status message for an entire file. Example: "Installed", "Failed", etc.

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

addMessage

public void addMessage(ExtensionsFile xtFile,
                       String message)
Adds a detailed message indicating a successful operation to a file.

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

addErrorMessage

public void addErrorMessage(ExtensionsFile xtFile,
                            String message)
Adds a detailed message inidcating a failed operation to a file.

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

addMessage

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

3.1.2: 2012-07-31