|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
edu.isi.pegasus.planner.parser.Parser
edu.isi.pegasus.planner.catalog.site.impl.XML
public class XML
A back port to old site catalog schema for the current Site Catalog API This class parses XML documents that conform to site catalog schema version 2.
http://pegasus.isi.edu/schema/sc-2.0.xsd
| Field Summary | |
|---|---|
private GridFTPServer |
gftp
|
private String |
m_key
|
private String |
m_namespace
|
PoolConfig |
m_pconfig
|
private SiteInfo |
m_pool_info
|
private String |
mFilename
The Site Catalog file to be parser. |
private LogManager |
mLogger
The Logging instance. |
private SiteStore |
mSiteStore
Stores sites in memory |
static String |
SCHEMA_LOCATION
The "not-so-official" location URL of the VDLx schema definition. |
static String |
SCHEMA_NAMESPACE
uri namespace |
| Fields inherited from class edu.isi.pegasus.planner.parser.Parser |
|---|
DEFAULT_PARSER_NAME, mAdjFName, mLocator, mLogMsg, mParser, mProps, mTextContent, mTextString |
| Fields inherited from interface edu.isi.pegasus.planner.catalog.SiteCatalog |
|---|
c_prefix, VERSION |
| Fields inherited from interface edu.isi.pegasus.planner.catalog.Catalog |
|---|
DB_ALL_PREFIX |
| Constructor Summary | |
|---|---|
XML()
The default constructor. |
|
| Method Summary | |
|---|---|
void |
close()
Close the connection to backend file. |
boolean |
connect(Properties props)
Establishes a connection to the file from the properties. |
boolean |
connect(String filename)
Initializes the Site Catalog Parser instance for the file. |
void |
endDocument()
This is called automatically when the end of the XML file is reached. |
void |
endElement(String uri,
String localName,
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. |
String |
getSchemaLocation()
Helps the load database to locate the XML schema, if available. |
String |
getSchemaNamespace()
Returns the XML schema namespace that a document being parsed conforms to. |
private void |
handleConfigTagEnd()
Handles the end of the Xml files. |
private PoolConfig |
handleConfigTagStart()
|
private static void |
handleGridFtpBandwidthTagEnd()
|
private void |
handleGridFtpBandwidthTagStart(SiteInfo pinfo,
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,
Attributes attrs)
|
private static void |
handleJobManagerTagEnd()
Handles the end of the JobManager Tag |
private void |
handleJobManagerTagStart(SiteInfo pinfo,
Attributes attrs)
This method handles the start of a jobmanager tag. |
private static void |
handleLRCTagEnd()
Handles the end of the LRC Tag |
private void |
handleLRCTagStart(SiteInfo pinfo,
Attributes attrs)
|
private void |
handlePoolTagEnd()
Handles the end of the pool tag. |
private SiteInfo |
handlePoolTagStart(PoolConfig pcfg,
Attributes attrs)
|
private void |
handleProfileTagEnd(SiteInfo pinfo)
Handles the end of the Profile tag. |
private void |
handleProfileTagStart(SiteInfo pinfo,
Attributes attrs)
|
private void |
handleWorkDirectoryTagEnd(SiteInfo pinfo)
This method handles the Workdirectory tg end. |
private void |
handleWorkDirectoryTagStart(SiteInfo pinfo,
Attributes attrs)
Handles the WorkDirectory Tag Start. |
int |
insert(SiteCatalogEntry entry)
Not implemented as yet. |
boolean |
isClosed()
Returns if the connection is closed or not. |
Set<String> |
list()
Lists the site handles for all the sites in the Site Catalog. |
int |
load(List<String> sites)
Loads up the Site Catalog implementation with the sites whose site handles are specified. |
SiteCatalogEntry |
lookup(String handle)
Retrieves the SiteCatalogEntry for a site. |
int |
remove(String handle)
Not yet implemented as yet. |
void |
startElement(String uri,
String localName,
String qName,
Attributes attrs)
An empty implementation is provided by DefaultHandler of ContentHandler. |
void |
startParser(String configxml)
Start the parser. |
| Methods inherited from class edu.isi.pegasus.planner.parser.Parser |
|---|
characters, ignoreWhitespace, ignoreWhitespace, setDocumentLocator, setParserFeature, setSchemaLocations, testForFile |
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
|---|
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String SCHEMA_LOCATION
public static final String SCHEMA_NAMESPACE
public PoolConfig m_pconfig
private SiteInfo m_pool_info
private String m_namespace
private String m_key
private GridFTPServer gftp
private LogManager mLogger
private SiteStore mSiteStore
private String mFilename
| Constructor Detail |
|---|
public XML()
| Method Detail |
|---|
public boolean connect(Properties props)
throws SiteCatalogException
connect in interface Catalogprops - is the property table with sufficient settings to
to connect to the implementation.
SiteCatalogExceptionpublic boolean connect(String filename)
filename - is the name of the file to read.
public void close()
close in interface Catalogpublic boolean isClosed()
isClosed in interface CatalogCatalog.close()
public int load(List<String> sites)
throws SiteCatalogException
load in interface SiteCatalogsites - the list of sites to be loaded.
SiteCatalogException - in case of error.
public int insert(SiteCatalogEntry entry)
throws SiteCatalogException
insert in interface SiteCatalogentry - the entry
SiteCatalogException
public Set<String> list()
throws SiteCatalogException
list in interface SiteCatalogSiteCatalogException - in case of error.
public SiteCatalogEntry lookup(String handle)
throws SiteCatalogException
SiteCatalogEntry for a site.
lookup in interface SiteCataloghandle - the site handle / identifier.
null
if no match is found.
SiteCatalogException - in case of error.
public int remove(String handle)
throws SiteCatalogException
remove in interface SiteCataloghandle - the site to be removed
SiteCatalogExceptionpublic void startParser(String configxml)
Parser
startParser in class Parserconfigxml - the path to the XML file you want to parse.public void endDocument()
Parser
endDocument in interface ContentHandlerendDocument in class Parser
public void endElement(String uri,
String localName,
String qName)
Parser
endElement in interface ContentHandlerendElement in class Parser
public void startElement(String uri,
String localName,
String qName,
Attributes attrs)
Parser
startElement in interface ContentHandlerstartElement in class Parserpublic String getSchemaNamespace()
getSchemaNamespace in class Parserpublic String getSchemaLocation()
Parser
getSchemaLocation in class Parserprivate PoolConfig handleConfigTagStart()
PoolConfig object when
it encounters start of XML.- See Also:
org.griphyn.cPlanner.classes.PoolConfig
private SiteInfo handlePoolTagStart(PoolConfig pcfg,
Attributes attrs)
throws Exception
pcfg - Takes the PoolConfig class.attrs - Takes the atrributes returned in XML.
Exceptionorg.griphyn.cPlanner.classes.SiteInfo,
org.griphyn.cPlanner.classes.PoolConfig
private void handleProfileTagStart(SiteInfo pinfo,
Attributes attrs)
throws Exception
pinfo - Poolinfo object that is to be populatedattrs - Attributes for the element
Exception
private void handleLRCTagStart(SiteInfo pinfo,
Attributes attrs)
throws Exception
pinfo - Poolinfo object that is to be populatedattrs - Attributes for the element
Exception
private void handleGridFtpTagStart(SiteInfo pinfo,
Attributes attrs)
throws Exception
pinfo - Poolinfo object that is to be populatedattrs - Attributes for the element
Exception
private void handleGridFtpBandwidthTagStart(SiteInfo pinfo,
Attributes attrs)
throws Exception
pinfo - Poolinfo object that is to be populatedattrs - Attributes for the element
Exception
private void handleJobManagerTagStart(SiteInfo pinfo,
Attributes attrs)
throws Exception
pinfo - The PoolInfo object which will hold the jobmanager informationattrs - The attributes about the jobmanager tag returned from the XML.
Exceptionorg.griphyn.cPlanner.classes.SiteInfo
private void handleWorkDirectoryTagStart(SiteInfo pinfo,
Attributes attrs)
throws Exception
pinfo - Takes a SiteInfo object for which the work directory is.attrs - Takes the attributes returned from the XML by the parser.
Exceptionorg.griphyn.cPlanner.classes.SiteInfoprivate void handleConfigTagEnd()
private void handlePoolTagEnd()
private void handleProfileTagEnd(SiteInfo pinfo)
throws RuntimeException
pinfo - PoolInfo object for which the
profiles are collected.
Exception
RuntimeExceptionorg.griphyn.cPlanner.classes.SiteInfoprivate static void handleLRCTagEnd()
private void handleGridFtpTagEnd()
throws RuntimeException
RuntimeExceptionprivate static void handleGridFtpBandwidthTagEnd()
private static void handleJobManagerTagEnd()
private void handleWorkDirectoryTagEnd(SiteInfo pinfo)
throws RuntimeException
pinfo - Takes the PoolInfo object.
Exception
RuntimeExceptionorg.griphyn.cPlanner.classes.SiteInfopublic PoolConfig getPoolConfig()
PooConfig object
containing information about all the pools.
PoolConfig object which
contains all the pools.org.griphyn.cPlanner.classes.PoolConfig
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||