edu.sdsc.inca.depot.persistent
Class Suite

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

public class Suite
extends PersistentObject

A Suite is a named collection of SeriesConfigs.


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
Suite()
          Default constructor.
Suite(java.lang.String name, java.lang.String guid, java.lang.String description)
          Constructs a new Suite containing the specified values.
 
Method Summary
 void addSeriesConfig(SeriesConfig sc)
          Add a SeriesConfig to the set of those associated with the Suite.
 boolean equals(java.lang.Object o)
          Compares another object to this Suite for logical equality.
 Suite fromBean(edu.sdsc.inca.dataModel.suite.Suite s)
          Copies information from an Inca schema XmlBean Suite object so that this object contains equivalent information.
 PersistentObject fromBean(org.apache.xmlbeans.XmlObject o)
          Copies information from an Inca schema XmlBean Suite object so that this object contains equivalent information.
static Suite generate(java.lang.String guid, int seriesConfigs)
          Returns a phony suite with a given number of unrelated (sharing neither resource nor context) SeriesConfigs.
 java.lang.String getDescription()
          Get the (usually user-supplied) Suite description string.
 java.lang.String getGuid()
          Get the guid (agent id + name) of the Suite.
 java.lang.Long getId()
          Retrieve the id -- null if not yet connected to database.
 java.lang.String getName()
          Get the name of the Suite.
 SeriesConfig getSeriesConfig(int i)
          Retrieves a specified SeriesConfig from the associated set.
 java.util.Set getSeriesConfigs()
          Gets the collection of SeriesConfig objects associated with this Suite.
 int getVersion()
          Get the version number of the Suite--the number of times updated.
 int hashCode()
          Calculate a hash code using the same fields that where used in equals.
 void incrementVersion()
          Add 1 to the version number of the Suite--the number of times updated.
 void setDescription(java.lang.String description)
          Set the (usually user-supplied) Suite description string.
 void setGuid(java.lang.String guid)
          Set the guid (agent id + name) of the Suite.
protected  void setId(java.lang.Long id)
          Set the id.
 void setName(java.lang.String name)
          Set the name of the Suite.
protected  void setSeriesConfigs(java.util.Set configs)
          Sets the collection of SeriesConfig objects associated with this Suite.
 void setVersion(int version)
          Set the version number of the Suite--the number of times updated.
 org.apache.xmlbeans.XmlObject toBean()
          Returns a Inca schema XmlBean Suite object that contains information equivalent to this object.
 java.lang.String toXml()
          Returns XML text for this Suite.
 
Methods inherited from class edu.sdsc.inca.depot.persistent.PersistentObject
truncate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Suite

public Suite()
Default constructor.


Suite

public Suite(java.lang.String name,
             java.lang.String guid,
             java.lang.String description)
Constructs a new Suite containing the specified values.

Parameters:
name - the name of the Suite
guid - the guid (agent + name) of the Suite
description - the description of the Suite
Method Detail

fromBean

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

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

fromBean

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

Parameters:
s - the XmlBean Suite 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.

getName

public java.lang.String getName()
Get the name of the Suite.

Returns:
the Suite name

setName

public void setName(java.lang.String name)
Set the name of the Suite.

Parameters:
name - the Suite name

getGuid

public java.lang.String getGuid()
Get the guid (agent id + name) of the Suite.

Returns:
the Suite guid

setGuid

public void setGuid(java.lang.String guid)
Set the guid (agent id + name) of the Suite.

Parameters:
guid - the Suite guid

getDescription

public java.lang.String getDescription()
Get the (usually user-supplied) Suite description string.

Returns:
the Suite description

setDescription

public void setDescription(java.lang.String description)
Set the (usually user-supplied) Suite description string.

Parameters:
description - the Suite description

getVersion

public int getVersion()
Get the version number of the Suite--the number of times updated.

Returns:
the Suite version number

setVersion

public void setVersion(int version)
Set the version number of the Suite--the number of times updated.

Parameters:
version - the Suite version number

incrementVersion

public void incrementVersion()
Add 1 to the version number of the Suite--the number of times updated.


getSeriesConfig

public SeriesConfig getSeriesConfig(int i)
Retrieves a specified SeriesConfig from the associated set.

Parameters:
i - the index into the set of the desired SeriesConfig
Returns:
the specified SeriesConfig; null if none

getSeriesConfigs

public java.util.Set getSeriesConfigs()
Gets the collection of SeriesConfig objects associated with this Suite.

Returns:
the set of associated SeriesConfigs

setSeriesConfigs

protected void setSeriesConfigs(java.util.Set configs)
Sets the collection of SeriesConfig objects associated with this Suite. Hibernate only.

Parameters:
configs - the set of associated SeriesConfigs

addSeriesConfig

public void addSeriesConfig(SeriesConfig sc)
Add a SeriesConfig to the set of those associated with the Suite.

Parameters:
sc - a SeriesConfig to associate

toBean

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

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

toXml

public java.lang.String toXml()
Returns XML text for this Suite.

Overrides:
toXml in class PersistentObject
Returns:
XML text

equals

public boolean equals(java.lang.Object o)
Compares another object to this Suite 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 Suite

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 Suite

generate

public static Suite generate(java.lang.String guid,
                             int seriesConfigs)
Returns a phony suite with a given number of unrelated (sharing neither resource nor context) SeriesConfigs. Useful for testing.

Parameters:
guid - the suite guid
seriesConfigs - the number of series configs to populate the suite
Returns:
a new Suite