public class ConfigXmlParser extends Parser
Modifier and Type | Field and Description |
---|---|
private GridFTPServer |
gftp |
private java.lang.String |
m_key |
private java.lang.String |
m_namespace |
PoolConfig |
m_pconfig |
private SiteInfo |
m_pool_info |
static java.lang.String |
SCHEMA_LOCATION
The "not-so-official" location URL of the VDLx schema definition.
|
static java.lang.String |
SCHEMA_NAMESPACE
uri namespace
|
DEFAULT_PARSER_NAME, mAdjFName, mLocator, mLogger, mLogMsg, mParser, mProps, mTextContent, mTextString
Constructor and Description |
---|
ConfigXmlParser(PegasusProperties properties)
Default Class Constructor.
|
ConfigXmlParser(java.lang.String configFileName,
PegasusProperties properties)
Class Constructor intializes the parser and turns on validation.
|
Modifier and Type | Method and Description |
---|---|
void |
endDocument()
This is called automatically when the end of the XML file is reached.
|
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
An empty implementation is provided by DefaultHandler class.
|
PoolConfig |
getPoolConfig()
This class returns the reference to the
PooConfig object
containing information about all the pools. |
java.lang.String |
getSchemaLocation()
Helps the load database to locate the XML schema, if available.
|
java.lang.String |
getSchemaNamespace()
Returns the XML schema namespace that a document being parsed conforms
to.
|
private static void |
handleConfigTagEnd()
Handles the end of the Xml files.
|
private PoolConfig |
handleConfigTagStart() |
private static void |
handleGridFtpBandwidthTagEnd() |
private void |
handleGridFtpBandwidthTagStart(SiteInfo pinfo,
org.xml.sax.Attributes attrs)
sk added function to handle gridftpbandwidth tag
|
private void |
handleGridFtpTagEnd()
sk made changes to the following function to set GRIDFTPServer instead of
setting it in fn handleGridFtpTagStart()
|
private void |
handleGridFtpTagStart(SiteInfo pinfo,
org.xml.sax.Attributes attrs) |
private static void |
handleJobManagerTagEnd()
Handles the end of the JobManager Tag
|
private static void |
handleJobManagerTagStart(SiteInfo pinfo,
org.xml.sax.Attributes attrs)
This method handles the start of a jobmanager tag.
|
private static void |
handleLRCTagEnd()
Handles the end of the LRC Tag
|
private static void |
handleLRCTagStart(SiteInfo pinfo,
org.xml.sax.Attributes attrs) |
private static void |
handlePoolTagEnd()
Handles the end of the pool tag.
|
private SiteInfo |
handlePoolTagStart(PoolConfig pcfg,
org.xml.sax.Attributes attrs) |
private void |
handleProfileTagEnd(SiteInfo pinfo)
Handles the end of the Profile tag.
|
private void |
handleProfileTagStart(SiteInfo pinfo,
org.xml.sax.Attributes attrs) |
private void |
handleWorkDirectoryTagEnd(SiteInfo pinfo)
This method handles the Workdirectory tg end.
|
private static void |
handleWorkDirectoryTagStart(SiteInfo pinfo,
org.xml.sax.Attributes attrs)
Handles the WorkDirectory Tag Start.
|
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attrs)
An empty implementation is provided by DefaultHandler of ContentHandler.
|
void |
startParser(java.lang.String configxml)
Start the parser.
|
characters, ignoreWhitespace, ignoreWhitespace, setDocumentLocator, setParserFeature, setSchemaLocations, testForFile
public static final java.lang.String SCHEMA_LOCATION
public static final java.lang.String SCHEMA_NAMESPACE
public PoolConfig m_pconfig
private SiteInfo m_pool_info
private java.lang.String m_namespace
private java.lang.String m_key
private GridFTPServer gftp
public ConfigXmlParser(PegasusProperties properties)
properties
- the PegasusProperties
to be used.public ConfigXmlParser(java.lang.String configFileName, PegasusProperties properties)
configFileName
- The file which you want to parseproperties
- the PegasusProperties
to be used.public void startParser(java.lang.String configxml)
Parser
startParser
in class Parser
configxml
- the path to the XML file you want to parse.public void endDocument()
Parser
endDocument
in interface org.xml.sax.ContentHandler
endDocument
in class Parser
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
Parser
endElement
in interface org.xml.sax.ContentHandler
endElement
in class Parser
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attrs)
Parser
startElement
in interface org.xml.sax.ContentHandler
startElement
in class Parser
public java.lang.String getSchemaNamespace()
getSchemaNamespace
in class Parser
public java.lang.String getSchemaLocation()
Parser
getSchemaLocation
in class Parser
private PoolConfig handleConfigTagStart()
PoolConfig object when
it encounters start of XML.
org.griphyn.cPlanner.classes.PoolConfig
private SiteInfo handlePoolTagStart(PoolConfig pcfg, org.xml.sax.Attributes attrs) throws java.lang.Exception
pcfg
- Takes the PoolConfig class.attrs
- Takes the atrributes returned in XML.java.lang.Exception
org.griphyn.cPlanner.classes.SiteInfo
,
org.griphyn.cPlanner.classes.PoolConfig
private void handleProfileTagStart(SiteInfo pinfo, org.xml.sax.Attributes attrs) throws java.lang.Exception
pinfo
- Poolinfo object that is to be populatedattrs
- Attributes for the elementjava.lang.Exception
private static void handleLRCTagStart(SiteInfo pinfo, org.xml.sax.Attributes attrs) throws java.lang.Exception
pinfo
- Poolinfo object that is to be populatedattrs
- Attributes for the elementjava.lang.Exception
private void handleGridFtpTagStart(SiteInfo pinfo, org.xml.sax.Attributes attrs) throws java.lang.Exception
pinfo
- Poolinfo object that is to be populatedattrs
- Attributes for the elementjava.lang.Exception
private void handleGridFtpBandwidthTagStart(SiteInfo pinfo, org.xml.sax.Attributes attrs) throws java.lang.Exception
pinfo
- Poolinfo object that is to be populatedattrs
- Attributes for the elementjava.lang.Exception
private static void handleJobManagerTagStart(SiteInfo pinfo, org.xml.sax.Attributes attrs) throws java.lang.Exception
pinfo
- The PoolInfo
object which will hold the jobmanager informationattrs
- The attributes about the jobmanager tag returned from the XML.java.lang.Exception
org.griphyn.cPlanner.classes.SiteInfo
private static void handleWorkDirectoryTagStart(SiteInfo pinfo, org.xml.sax.Attributes attrs) throws java.lang.Exception
pinfo
- Takes a SiteInfo object for which the work directory is.attrs
- Takes the attributes returned from the XML by the parser.java.lang.Exception
org.griphyn.cPlanner.classes.SiteInfo
private static void handleConfigTagEnd()
private static void handlePoolTagEnd()
private void handleProfileTagEnd(SiteInfo pinfo) throws java.lang.RuntimeException
pinfo
- PoolInfo
object for which the
profiles are collected.java.lang.Exception
java.lang.RuntimeException
org.griphyn.cPlanner.classes.SiteInfo
private static void handleLRCTagEnd()
private void handleGridFtpTagEnd() throws java.lang.RuntimeException
java.lang.RuntimeException
private static void handleGridFtpBandwidthTagEnd()
private static void handleJobManagerTagEnd()
private void handleWorkDirectoryTagEnd(SiteInfo pinfo) throws java.lang.RuntimeException
pinfo
- Takes the PoolInfo object.java.lang.Exception
java.lang.RuntimeException
org.griphyn.cPlanner.classes.SiteInfo
public PoolConfig getPoolConfig()
PooConfig
object
containing information about all the pools.PoolConfig
object which
contains all the pools.org.griphyn.cPlanner.classes.PoolConfig