ucar.unidata.data
Class DataSourceResults

java.lang.Object
  extended by ucar.unidata.data.DataSourceResults

public class DataSourceResults
extends Object

Holds the results from the createDataSource call.

Version:
$Revision: 1.17 $
Author:
IDV Development Team

Constructor Summary
DataSourceResults()
          Default bean constructor; does nothing
DataSourceResults(DataSource dataSource, Object definingObject)
          Create a DataSourceResults for the given parameters
DataSourceResults(Object failedDefiningObject, Throwable exc)
          Create a DataSourceResults from the failed parameters.
 
Method Summary
 void addFailed(Object definingObject, Throwable exception)
          Add a failed defining object and the failure exception to the lists.
 void addSuccess(DataSource dataSource, Object definingObject)
          Add a successful result to the lists
 boolean allFailed()
          See if all the results were failures.
 boolean allOk()
          See if all the results were okay.
 boolean anyFailed()
          See if there were any failures.
 boolean anyOk()
          See if there were any successes.
 List getDataSources()
          Get the list of successfully created DataSources
 List getExceptions()
          Get the list of failure exceptions.
 List getFailedData()
          Get the list of failed data.
 List getSuccessData()
          Get the list of successful defining objects.
 void merge(DataSourceResults results)
          Merge the results of another DataSourceResults to this one
 String toString()
          Get a String representation of this DataSourceResults.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataSourceResults

public DataSourceResults()
Default bean constructor; does nothing


DataSourceResults

public DataSourceResults(DataSource dataSource,
                         Object definingObject)
Create a DataSourceResults for the given parameters

Parameters:
dataSource - the DataSource
definingObject - the defining object for that source

DataSourceResults

public DataSourceResults(Object failedDefiningObject,
                         Throwable exc)
Create a DataSourceResults from the failed parameters.

Parameters:
failedDefiningObject - defining object for failure
exc - failed exception
Method Detail

merge

public void merge(DataSourceResults results)
Merge the results of another DataSourceResults to this one

Parameters:
results - other results.

getDataSources

public List getDataSources()
Get the list of successfully created DataSources

Returns:
list of DataSources

getSuccessData

public List getSuccessData()
Get the list of successful defining objects.

Returns:
list of successes

getExceptions

public List getExceptions()
Get the list of failure exceptions.

Returns:
list of failed exceptions

getFailedData

public List getFailedData()
Get the list of failed data.

Returns:
List of failed defining objects

anyFailed

public boolean anyFailed()
See if there were any failures.

Returns:
true if there were any failures

anyOk

public boolean anyOk()
See if there were any successes.

Returns:
true if there were any successes

allFailed

public boolean allFailed()
See if all the results were failures.

Returns:
true if no successes.

allOk

public boolean allOk()
See if all the results were okay.

Returns:
true if no failures

addSuccess

public void addSuccess(DataSource dataSource,
                       Object definingObject)
Add a successful result to the lists

Parameters:
dataSource - successfully created DataSource
definingObject - the defining object for dataSource.

addFailed

public void addFailed(Object definingObject,
                      Throwable exception)
Add a failed defining object and the failure exception to the lists.

Parameters:
definingObject - defining object for the DataSource
exception - failure exception

toString

public String toString()
Get a String representation of this DataSourceResults.

Overrides:
toString in class Object
Returns:
a string represenation of this