|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.sdsc.inca.util.XmlWrapper edu.sdsc.inca.util.SuiteStagesWrapper
public class SuiteStagesWrapper
Convenience object for accessing suite stages documents and persisting changes to them. A suite stages document stores series configs from a suite document in expanded form (i.e., macros are expanded and schedules selected). There are 3 main stages of a suite's series configs. 1) the series configs as specified by the user. These are known in the suite stages document as a "MultiResourceConfigs" meaning that each series config can potentially expand to run on multiple resources. 2) the expanded series configs per resource. These are known in the suite stages document as "PerResourceConfigs" meaning that the series config applies to a single resource.
Field Summary |
---|
Fields inherited from class edu.sdsc.inca.util.XmlWrapper |
---|
PASSWORD_MACRO_VALUE_PATTERN, PROCESSING_INSTRUCTION_PATTERN, XML_CDATA_PATTERN, XML_COMMENT_PATTERN, XML_NAME_PATTERN, XML_NODE_PATTERN |
Constructor Summary | |
---|---|
SuiteStagesWrapper(ResourcesWrapper resources)
Create a SuiteStagesWrapper object with a blank SuiteStages document. |
|
SuiteStagesWrapper(java.lang.String filename,
ResourcesWrapper resources)
Create a new SuiteStagesWrapper object from a SuiteStages file. |
|
SuiteStagesWrapper(java.lang.String filename,
java.lang.String passphrase,
ResourcesWrapper resources)
Create a new SuiteStagesWrapper object from a SuiteStages file. |
Method Summary | |
---|---|
static java.lang.String |
chooseCronFieldValue(java.lang.String field,
boolean startAtOne,
int count)
Given a field in a cron line (e.g., hour or day), check it for instances of '?' meaning anytime. |
static edu.sdsc.inca.dataModel.util.Schedule |
chooseSchedule(edu.sdsc.inca.dataModel.util.Schedule schedule)
A schedule may contain '?' in its cron fields meaning run at any time in the field. |
edu.sdsc.inca.dataModel.suiteStages.SuiteStagesDocument |
getDocument()
Return the SuiteStagesDocument contained in this SuiteStagesWrapper object. |
edu.sdsc.inca.dataModel.suite.SuiteDocument |
getPerResourceSuiteDocument()
Extract a suite document with all resource series config objects contained in this SuiteStages document. |
int |
getResourceSeriesConfigCount()
Return the number of per resource series configs stored in this SuiteStages document. |
java.util.HashMap<java.lang.String,SuiteWrapper> |
getResourceSuites()
Iterate through the per resource series configs and extract suites for each of the resources. |
static java.util.HashMap<java.lang.String,SuiteWrapper> |
getResourceSuites(edu.sdsc.inca.dataModel.suite.SuiteDocument suiteDoc)
Extract suites for each of the resources from the provided SuiteDocument |
int |
getSeriesConfigCount()
Return the number of multi-resource series configs stored in this SuiteStages document. |
edu.sdsc.inca.dataModel.suite.SuiteDocument |
getSuiteDocument()
Extract a suite document with all multi-resource series config objects contained in this SuiteStages document. |
edu.sdsc.inca.dataModel.suite.SuiteDocument |
getSuiteDocumentWithVersions()
Extract a suite document with all multi-resource series config objects contained in this SuiteStages document. |
static void |
main(java.lang.String[] args)
Provide a command line interface to examining existing suite stage wrapper files or expanding them. |
SuiteStagesWrapper |
modify(SuiteWrapper suiteChanges)
Apply multi-resource series config changes in the provided suite to the SuiteStages document. |
void |
remove()
Remove the suite document from disk. |
void |
save()
Save the suite document to disk. |
java.util.Vector<edu.sdsc.inca.dataModel.util.SeriesConfig> |
seriesConfigCrossProduct(edu.sdsc.inca.dataModel.util.SeriesConfig seriesConfig,
java.lang.String resource)
Expand the macros contained in the suite's seriesConfig using the definitions provided in resources and create multiple seriesConfig for suiteExpanded. |
void |
setDocument(edu.sdsc.inca.dataModel.suiteStages.SuiteStagesDocument suiteStages)
Set a new SuiteStages document for this object. |
edu.sdsc.inca.dataModel.suite.SuiteDocument |
setResources(ResourcesWrapper resources)
Set the new resource configuration information and apply it to the existing suite. |
SuiteWrapper |
updatePackage(java.lang.String name,
java.lang.String newVersion,
java.lang.String newUri)
|
Methods inherited from class edu.sdsc.inca.util.XmlWrapper |
---|
configEqual, createCron, cryptSensitive, escape, getPrettyPrintOptions, prettyPrint, read, save, unescape, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SuiteStagesWrapper(ResourcesWrapper resources) throws java.lang.InstantiationException
resources
- The resource configuration information.
java.lang.InstantiationException
- if unable to create empty documentpublic SuiteStagesWrapper(java.lang.String filename, ResourcesWrapper resources) throws java.io.IOException, org.apache.xmlbeans.XmlException, CrypterException
filename
- Path to a file containing suiteStages compliant XML.resources
- The resource configuration information.
CrypterException
- if unable to decrypt file
java.io.IOException
- if unable to read from disk
org.apache.xmlbeans.XmlException
- if unable to parse suite from diskpublic SuiteStagesWrapper(java.lang.String filename, java.lang.String passphrase, ResourcesWrapper resources) throws java.io.IOException, org.apache.xmlbeans.XmlException, CrypterException
filename
- Path to a file containing suiteStages compliant XML.passphrase
- Secret string used to encrypt/decrypt file to diskresources
- The resource configuration information.
CrypterException
- if trouble encrypting/decrypting file
java.io.IOException
- if problem reading in file
org.apache.xmlbeans.XmlException
- if problem parsing suiteMethod Detail |
---|
public static java.lang.String chooseCronFieldValue(java.lang.String field, boolean startAtOne, int count) throws ConfigurationException
field
- The field from a cron line which may or may not contain '?'startAtOne
- True if the minimum value of the field is 1. Otherwise
0 is assumed. E.g., it would be false for minute and true for days.count
- The count for the field. E.g., 24 for hours, 60 for minutes,
etc.
ConfigurationException
- if fields are out of rangepublic static edu.sdsc.inca.dataModel.util.Schedule chooseSchedule(edu.sdsc.inca.dataModel.util.Schedule schedule) throws ConfigurationException
schedule
- A schedule that may or may not contain '?'
ConfigurationException
- if fields are out of rangepublic SuiteWrapper updatePackage(java.lang.String name, java.lang.String newVersion, java.lang.String newUri)
public edu.sdsc.inca.dataModel.suiteStages.SuiteStagesDocument getDocument()
public edu.sdsc.inca.dataModel.suite.SuiteDocument getPerResourceSuiteDocument()
public int getResourceSeriesConfigCount()
public int getSeriesConfigCount()
public java.util.HashMap<java.lang.String,SuiteWrapper> getResourceSuites()
public static java.util.HashMap<java.lang.String,SuiteWrapper> getResourceSuites(edu.sdsc.inca.dataModel.suite.SuiteDocument suiteDoc)
suiteDoc
- A suite document with resource series configs.
public edu.sdsc.inca.dataModel.suite.SuiteDocument getSuiteDocument()
public edu.sdsc.inca.dataModel.suite.SuiteDocument getSuiteDocumentWithVersions()
public SuiteStagesWrapper modify(SuiteWrapper suiteChanges) throws SuiteModificationException
suiteChanges
- A suite document containing multi-resource series
config adds/deletes to be applied to the existing suiteStages document.
SuiteModificationException
- if unable to merge changespublic void remove()
public void save() throws CrypterException, java.io.IOException
CrypterException
- if unable to encrypt document
java.io.IOException
- if unable to write to diskpublic java.util.Vector<edu.sdsc.inca.dataModel.util.SeriesConfig> seriesConfigCrossProduct(edu.sdsc.inca.dataModel.util.SeriesConfig seriesConfig, java.lang.String resource) throws ConfigurationException
seriesConfig
- The seriesConfig from a SeriesConfig
object from the suite that may contain macros that
need to be expanded.resource
- The name of the resource this seriesConfig is being
expanded for.
ConfigurationException
- if unable to expand series configpublic void setDocument(edu.sdsc.inca.dataModel.suiteStages.SuiteStagesDocument suiteStages)
suiteStages
- A SuiteStages document.public edu.sdsc.inca.dataModel.suite.SuiteDocument setResources(ResourcesWrapper resources) throws java.lang.Exception
resources
- The new resource configuration information
java.lang.Exception
- if unable to apply to existing resourcespublic static void main(java.lang.String[] args)
args
- The command line arguments
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |