edu.sdsc.inca.depot.persistent
Class Series

java.lang.Object
  extended by edu.sdsc.inca.depot.persistent.PersistentObject
      extended by edu.sdsc.inca.depot.persistent.Series

public class Series
extends PersistentObject

Author:
Cathie Olschanowsky, Jim Hayes This class represents a series of reports. Each report in a series shares the same resource and context

Field Summary
 
Fields inherited from class edu.sdsc.inca.depot.persistent.PersistentObject
DB_EMPTY_STRING, logger, MAX_DB_LONG_STRING_LENGTH, MAX_DB_STRING_LENGTH
 
Constructor Summary
Series()
          Default constructor.
Series(java.lang.String resource, java.lang.String context, java.lang.String reporter)
          Constructs a new Series containing the specified values.
 
Method Summary
 void addReport(Report report)
          Add a Report to the set of those associated with this Series.
 void addSeriesConfig(SeriesConfig sc)
          Add a SeriesConfig to the set of those associated with this Series.
 boolean equals(java.lang.Object o)
          Compares another object to this Series for logical equality.
 Series fromBean(edu.sdsc.inca.dataModel.util.Report r)
          Copies information from an Inca schema XmlBean Report object so that this object contains equivalent information.
 Series fromBean(edu.sdsc.inca.dataModel.util.Series s)
          Copies information from an Inca schema XmlBean Series object so that this object contains equivalent information.
 PersistentObject fromBean(org.apache.xmlbeans.XmlObject o)
          Copies information from an Inca schema XmlBean Series object so that this object contains equivalent information.
static Series generate(java.lang.String resource, java.lang.String context, int args)
          Returns a phony Series with a given resource and context.
 java.lang.String generateReport()
          Generates a phony report for this Series.
 java.lang.String generateReport(java.util.Date d)
          Generates a phony report for this Series.
 java.util.Set getArgs()
          Get the set of Args associated with this Series.
 ArgSignature getArgSignature()
          Get the signature for the set of Args associated with this Series.
 java.lang.String getContext()
          Get the Series context string.
 java.lang.Long getId()
          Retrieve the id -- null if not yet connected to database.
 boolean getNice()
          Get the indicator as to whether the Series reporter should be run niced.
 java.lang.String getReporter()
          Get the Series reporter name.
 java.util.Collection getReports()
          Get the set of Reports associated with this Series.
 java.lang.String getResource()
          Get the name of the resource where this Series runs.
 java.util.Set getSeriesConfigs()
          Get the set of SeriesConfigs associated with this Series.
 java.lang.String getUri()
          Get the Series reporter URI.
 java.lang.String getVersion()
          Get the Series reporter version.
 int hashCode()
          Calculate a hash code using the same fields that where used in equals.
protected  void setArgs(java.util.Set args)
          Set the set of Args associated with this Series.
protected  void setArgSignature(ArgSignature sig)
          Set the signature for the set of Args associated with this Series.
 void setContext(java.lang.String context)
          Set the Series context string.
protected  void setId(java.lang.Long id)
          Set the id.
 void setNice(boolean nice)
          Set the indicator as to whether the Series reporter should be run niced.
 void setReporter(java.lang.String reporter)
          Set the Series reporter name.
protected  void setReports(java.util.Collection reports)
          Set the set of Reports associated with this Series.
 void setResource(java.lang.String resource)
          Set the name of the resource where this Series runs.
protected  void setSeriesConfigs(java.util.Set configs)
          Set the set of SeriesConfigs associated with this Series.
 void setUri(java.lang.String uri)
          Set the Series reporter URI.
 void setVersion(java.lang.String version)
          Set the Series reporter version.
 org.apache.xmlbeans.XmlObject toBean()
          Returns a Inca schema XmlBean Series object that contains information equivalent to this object.
 java.lang.String toString()
          Returns a string representation of this Series.
 
Methods inherited from class edu.sdsc.inca.depot.persistent.PersistentObject
toXml, truncate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Series

public Series()
Default constructor.


Series

public Series(java.lang.String resource,
              java.lang.String context,
              java.lang.String reporter)
Constructs a new Series containing the specified values.

Parameters:
resource - the Series resource
context - the Series context string
reporter - the Series reporter
Method Detail

fromBean

public PersistentObject fromBean(org.apache.xmlbeans.XmlObject o)
Copies information from an Inca schema XmlBean Series object so that this object contains equivalent information.

Specified by:
fromBean in class PersistentObject
Parameters:
o - the XmlBean Series object to copy
Returns:
this, for convenience

fromBean

public Series fromBean(edu.sdsc.inca.dataModel.util.Report r)
Copies information from an Inca schema XmlBean Report object so that this object contains equivalent information.

Parameters:
r - the XmlBean Report object to copy
Returns:
this, for convenience

fromBean

public Series fromBean(edu.sdsc.inca.dataModel.util.Series s)
Copies information from an Inca schema XmlBean Series object so that this object contains equivalent information.

Parameters:
s - the XmlBean Series object to copy
Returns:
this, for convenience

getId

public java.lang.Long getId()
Retrieve the id -- null if not yet connected to database.

Returns:
The Long representation of the DB ID

setId

protected void setId(java.lang.Long id)
Set the id. Hibernate use only.

Parameters:
id - The DB ID.

getReporter

public java.lang.String getReporter()
Get the Series reporter name.

Returns:
the Series reporter name

setReporter

public void setReporter(java.lang.String reporter)
Set the Series reporter name.

Parameters:
reporter - the Series reporter name

getVersion

public java.lang.String getVersion()
Get the Series reporter version.

Returns:
the Series reporter version

setVersion

public void setVersion(java.lang.String version)
Set the Series reporter version.

Parameters:
version - the Series reporter version

getUri

public java.lang.String getUri()
Get the Series reporter URI.

Returns:
the Series reporter URI

setUri

public void setUri(java.lang.String uri)
Set the Series reporter URI.

Parameters:
uri - the Series reporter URI

getContext

public java.lang.String getContext()
Get the Series context string.

Returns:
the Series context string

setContext

public void setContext(java.lang.String context)
Set the Series context string.

Parameters:
context - the Series context string

getNice

public boolean getNice()
Get the indicator as to whether the Series reporter should be run niced.

Returns:
the Series nice indicator

setNice

public void setNice(boolean nice)
Set the indicator as to whether the Series reporter should be run niced.

Parameters:
nice - the Series nice indicator

getResource

public java.lang.String getResource()
Get the name of the resource where this Series runs.

Returns:
the Series resource

setResource

public void setResource(java.lang.String resource)
Set the name of the resource where this Series runs.

Parameters:
resource - the Series resource

getArgs

public java.util.Set getArgs()
Get the set of Args associated with this Series.

Returns:
the Series set of Args

setArgs

protected void setArgs(java.util.Set args)
Set the set of Args associated with this Series. Hibernate only.

Parameters:
args - the Series set of Args

getArgSignature

public ArgSignature getArgSignature()
Get the signature for the set of Args associated with this Series.

Returns:
the Series arg signature

setArgSignature

protected void setArgSignature(ArgSignature sig)
Set the signature for the set of Args associated with this Series. Hibernate only.

Parameters:
sig - the Series arg signature

getReports

public java.util.Collection getReports()
Get the set of Reports associated with this Series. NOTE: this method can be very expensive, and it uses lazy initialization, so make sure that this Series is associated with a session before calling it.

Returns:
the Series associated Reports

setReports

protected void setReports(java.util.Collection reports)
Set the set of Reports associated with this Series. Hibernate only.

Parameters:
reports - the Series associated Reports

addReport

public void addReport(Report report)
Add a Report to the set of those associated with this Series.

Parameters:
report - a Report to associate

getSeriesConfigs

public java.util.Set getSeriesConfigs()
Get the set of SeriesConfigs associated with this Series.

Returns:
the Series set of SeriesConfigs

setSeriesConfigs

protected void setSeriesConfigs(java.util.Set configs)
Set the set of SeriesConfigs associated with this Series. Hibernate only.

Parameters:
configs - the Series set of SeriesConfigs

addSeriesConfig

public void addSeriesConfig(SeriesConfig sc)
Add a SeriesConfig to the set of those associated with this Series. Used by SeriesConfig.setSeries to take (shared) ownership of this Series.

Parameters:
sc - a SeriesConfig to associate

toBean

public org.apache.xmlbeans.XmlObject toBean()
Returns a Inca schema XmlBean Series object that contains information equivalent to this object.

Specified by:
toBean in class PersistentObject
Returns:
an XmlBean Series object that contains equivalent information

toString

public java.lang.String toString()
Returns a string representation of this Series.

Overrides:
toString in class java.lang.Object
Returns:
a string representation

equals

public boolean equals(java.lang.Object o)
Compares another object to this Series for logical equality.

Overrides:
equals in class java.lang.Object
Parameters:
o - the object to compare
Returns:
true iff the comparison object represents the same Series

hashCode

public int hashCode()
Calculate a hash code using the same fields that where used in equals.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code for the Series

generateReport

public java.lang.String generateReport()
Generates a phony report for this Series. Useful for testing.


generateReport

public java.lang.String generateReport(java.util.Date d)
Generates a phony report for this Series. Useful for testing.


generate

public static Series generate(java.lang.String resource,
                              java.lang.String context,
                              int args)
Returns a phony Series with a given resource and context. Useful for testing.

Parameters:
resource - the series resource
context - the series context
args - the number of phony arguments to generate
Returns:
a new Series