org.rhq.enterprise.server.plugins.url
Class XmlIndexParser
java.lang.Object
org.rhq.enterprise.server.plugins.url.XmlIndexParser
- All Implemented Interfaces:
- IndexParser
public class XmlIndexParser
- extends Object
- implements IndexParser
Parses the index XML file whose format follows the package details schema.
- Author:
- John Mazzitelli
|
Method Summary |
protected static void |
generatePackageIndex(File file,
List<org.rhq.enterprise.server.xmlschema.generated.contentsource.packagedetails.PackageDetailsType> list,
File root,
org.rhq.enterprise.server.xmlschema.generated.contentsource.packagedetails.PackageDetailsKeyType packageTypeInfo)
|
protected Map<String,RemotePackageInfo> |
jaxbParse(InputStream indexStream,
URL indexUrl,
String rootUrlString)
|
static void |
main(String[] args)
A utility that can build an index file that contains metadata for content found
in a given directory. |
Map<String,RemotePackageInfo> |
parse(InputStream indexStream,
UrlProvider contentSource)
Given an input stream containing the index data, this will parse that data and return
the parsed information. |
protected String |
stripLeadingSlash(String str)
|
protected Property |
translateListProperty(org.rhq.enterprise.server.xmlschema.generated.contentsource.packagedetails.ListPropertyType object,
String defaultName)
|
protected Property |
translateMapProperty(org.rhq.enterprise.server.xmlschema.generated.contentsource.packagedetails.MapPropertyType object,
String defaultName)
|
protected Property |
translateSimpleProperty(org.rhq.enterprise.server.xmlschema.generated.contentsource.packagedetails.SimplePropertyType object,
String defaultName)
|
protected ContentProviderPackageDetails |
translateXmlToDomain(org.rhq.enterprise.server.xmlschema.generated.contentsource.packagedetails.PackageDetailsType pkg)
Translates the details XML type to its domain object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XmlIndexParser
public XmlIndexParser()
parse
public Map<String,RemotePackageInfo> parse(InputStream indexStream,
UrlProvider contentSource)
throws Exception
- Description copied from interface:
IndexParser
- Given an input stream containing the index data, this will parse that data and return
the parsed information.
- Specified by:
parse in interface IndexParser
- Parameters:
indexStream - stream containing the index data (it is not necessary for this method to close this)contentSource - the content source where the index file came from
- Returns:
- map containing the package metadata info, keyed on each package's location
- Throws:
Exception - if failed to parse the index file
jaxbParse
protected Map<String,RemotePackageInfo> jaxbParse(InputStream indexStream,
URL indexUrl,
String rootUrlString)
throws Exception
- Throws:
Exception
translateXmlToDomain
protected ContentProviderPackageDetails translateXmlToDomain(org.rhq.enterprise.server.xmlschema.generated.contentsource.packagedetails.PackageDetailsType pkg)
throws Exception
- Translates the details XML type to its domain object.
- Parameters:
pkg - the XML type object
- Returns:
- the domain object with the same data that the XML object had
- Throws:
Exception
translateSimpleProperty
protected Property translateSimpleProperty(org.rhq.enterprise.server.xmlschema.generated.contentsource.packagedetails.SimplePropertyType object,
String defaultName)
translateListProperty
protected Property translateListProperty(org.rhq.enterprise.server.xmlschema.generated.contentsource.packagedetails.ListPropertyType object,
String defaultName)
translateMapProperty
protected Property translateMapProperty(org.rhq.enterprise.server.xmlschema.generated.contentsource.packagedetails.MapPropertyType object,
String defaultName)
stripLeadingSlash
protected String stripLeadingSlash(String str)
main
public static void main(String[] args)
- A utility that can build an index file that contains metadata for content found
in a given directory.
java -cp "target\rhq-serverplugin-url-1.3.0-SNAPSHOT.jar;
..\..\..\..\core\client-api\target\rhq-core-client-api-1.3.0-SNAPSHOT.jar;
..\..\..\..\core\domain\target\rhq-core-domain-ejb3.jar;
%HOMEPATH%\.m2\repository\commons-logging\commons-logging\1.1.0.jboss\commons-logging-1.1.0.jboss.jar"
org.rhq.enterprise.server.plugins.url.XmlIndexParser
C:\my\content\source\directory
library
noarch
"JBossAS Server"
JBossAS
- Parameters:
args -
generatePackageIndex
protected static void generatePackageIndex(File file,
List<org.rhq.enterprise.server.xmlschema.generated.contentsource.packagedetails.PackageDetailsType> list,
File root,
org.rhq.enterprise.server.xmlschema.generated.contentsource.packagedetails.PackageDetailsKeyType packageTypeInfo)
throws Exception
- Throws:
Exception
Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.