Java Doc for XMLProcessor.java in  » Science » Cougaar12_4 » org » cougaar » lib » vishnu » client » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Science » Cougaar12_4 » org.cougaar.lib.vishnu.client 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.cougaar.lib.vishnu.client.XMLProcessor

XMLProcessor
public class XMLProcessor (Code)
Handles XML interaction...

Inner Class :class FormatProcessor
Inner Class :class MergeProcessor extends FormatProcessor
Inner Class :class DuplicateProcessor extends FormatProcessor
Inner Class :public class ObjectDescrip

Field Summary
protected  StringclusterName
    
protected  VishnuCommcomm
    
 ConfigFinderconfigFinder
    
protected  XMLizerdataXMLizer
    
protected  booleandebugDataXMLizer
    
protected  booleandebugFormatXMLizer
    
protected  VishnuDomUtildomUtil
    
protected  LoggerloggerformatXMLizeLoggerdataXMLizeLogger
    
protected  ParamMapmyParamTable
    
protected  Stringname
    
protected  booleanshowDataXML
    
protected  booleanshowFormatXML
    
protected  StringvishnuEpochEndTime
    
protected  StringvishnuEpochStartTime
    

Constructor Summary
public  XMLProcessor(ParamMap myParamTable, String name, String clusterName, VishnuDomUtil domUtil, VishnuComm comm, ConfigFinder configFinder, Logger logger, Logger dataXMLizeLogger, Logger formatXMLizeLogger)
    

Method Summary
protected  voidaddFieldsForDifferentTypes(Node root, Document doc, Map nameToNodes, Map nameToDescrip)
     Add new fields Where there was : FIELDFORMAT datatype="indirectObject" ...
protected  voidappendOtherData(Document dataDoc, Element placeToAdd, String otherData)
    
 Append any global other data
 Global data is optional, so if it can't find the file specified
 (for instance a default odd file) nothing will happen.
public  voidcreateDataXMLizer(Map nameToDescrip, String assetClassName)
    
protected  booleanduplicateNode(Node first, List nodes)
     Checks to see if first is an object format that has already been seen when iterating over the document. Duplicates can be subsets -- i.e.
protected  StringgetClusterName()
    
protected  VishnuCommgetComm()
    
protected  DocumentgetDataDoc(Collection taskAndAssets, Collection changedAssets, XMLizer dataXMLizer, String assetClassName)
     Uses dataXMLizer to generate XML for Vishnu Passes nameToDescrip Map to dataXMLizer so can rename fields to be unique.
public  XMLizergetDataXMLizer()
    
protected  DocumentgetFormatDoc(Collection taskAndAssets, String assetClassName)
    
public  DocumentgetFormatDocWithoutDuplicates(Collection templates, String assetClassName, List returnedMap)
    
protected  ParamMapgetMyParams()
    
protected  StringgetName()
    
protected  DocumentgetOtherDataDoc(String otherDataFile)
    
protected  DocumentgetVanillaHeader()
    
protected  booleanisObject(String type)
    
public  voidlocalSetup()
     Here all the various runtime parameters get set.
protected  voidmergeNode(Node first, List nodes, Iterator nodeListIter)
    
public  booleanotherDataFileExists(String otherDataFile)
    
protected  voidpostProcessData(Document dataDoc, Node dataNode, boolean sendingChangedObjects)
    
public  DocumentprepareDocument(Collection tasks, Collection changed, XMLizer dataXMLizer, boolean clearDatabase, boolean sendingChangedObjects, String assetClassName)
    
public  DocumentprepareFreezeAll()
    
public  DocumentprepareRescind(Enumeration removedTasks, String verb)
    
public  DocumentprepareUnfreeze(Collection unfreezeTasks)
    
protected  voidprocessObjectFormats(Node root, Map nameToNodes, Set potentialDuplicates, FormatProcessor formatProcessor)
     Given a set of potential duplicate types, removes those that are duplicates from the set of DOM Node OBJECTFORMATs sent to Vishnu.
protected  MapremoveDuplicates(Node root, Document doc)
     Looks at all the object format nodes in the document and removes duplicates (two object formats with the same name and same fields).
protected  voidsetDataXMLizer(XMLizer xmlizer)
    
protected  NodesetDocHeader(Document dataDoc, boolean clearDatabase)
     Sets the vishnu epoch start and end time and the proper problem name. If clearDatabase is true, appends CLEARDATABASE tag.
protected  voidsetResourceAttributes(Node first, Node other)
    

Field Detail
clusterName
protected String clusterName(Code)



comm
protected VishnuComm comm(Code)



configFinder
ConfigFinder configFinder(Code)



dataXMLizer
protected XMLizer dataXMLizer(Code)



debugDataXMLizer
protected boolean debugDataXMLizer(Code)



debugFormatXMLizer
protected boolean debugFormatXMLizer(Code)



domUtil
protected VishnuDomUtil domUtil(Code)



loggerformatXMLizeLoggerdataXMLizeLogger
protected Logger loggerformatXMLizeLoggerdataXMLizeLogger(Code)



myParamTable
protected ParamMap myParamTable(Code)



name
protected String name(Code)



showDataXML
protected boolean showDataXML(Code)



showFormatXML
protected boolean showFormatXML(Code)



vishnuEpochEndTime
protected String vishnuEpochEndTime(Code)



vishnuEpochStartTime
protected String vishnuEpochStartTime(Code)




Constructor Detail
XMLProcessor
public XMLProcessor(ParamMap myParamTable, String name, String clusterName, VishnuDomUtil domUtil, VishnuComm comm, ConfigFinder configFinder, Logger logger, Logger dataXMLizeLogger, Logger formatXMLizeLogger)(Code)




Method Detail
addFieldsForDifferentTypes
protected void addFieldsForDifferentTypes(Node root, Document doc, Map nameToNodes, Map nameToDescrip)(Code)
Add new fields Where there was : FIELDFORMAT datatype="indirectObject" ... is_subobject="true" name="indirectObject" now have : FIELDFORMAT datatype="indirectObject_0" ... is_subobject="true" name="indirectObject_0" FIELDFORMAT datatype="indirectObject_1" ... is_subobject="true" name="indirectObject_1" FIELDFORMAT datatype="string(128)" ... is_subobject="true" name="indirectObject_2" for as many duplicates as there are in the nameToNode map. nameToDescrip is used to lookup the object description for a type. Then for each field in the object description, if there is more than one known type for that field, adds new fields with unique names for each type. nameToDescrip is created in removeDuplicates
See Also:   XMLProcessor.removeDuplicates
Parameters:
  root - - of the document
Parameters:
  doc - - needed so can manufacture new nodes (fields), gets altered through addition ofnew fields
Parameters:
  nameToNodes - -- per field name, holds all the different possible object formats
Parameters:
  nameToDescrip - -- contents are altered to record new name->type pairs



appendOtherData
protected void appendOtherData(Document dataDoc, Element placeToAdd, String otherData)(Code)
 Append any global other data
 Global data is optional, so if it can't find the file specified
 (for instance a default odd file) nothing will happen.
 



createDataXMLizer
public void createDataXMLizer(Map nameToDescrip, String assetClassName)(Code)



duplicateNode
protected boolean duplicateNode(Node first, List nodes)(Code)
Checks to see if first is an object format that has already been seen when iterating over the document. Duplicates can be subsets -- i.e. have some subset of the fields of another object with this name. NOTE : if first is a duplicate of another of the Nodes in nodes, first is removed from the nodes list. If something is a resource, it should not be seen as a duplicate of another object that is not a resource!
Parameters:
  first - - the node itself
Parameters:
  nameToNodes - - hash that records name -> object format node mappings true if it's a duplicate of one already seen



getClusterName
protected String getClusterName()(Code)



getComm
protected VishnuComm getComm()(Code)



getDataDoc
protected Document getDataDoc(Collection taskAndAssets, Collection changedAssets, XMLizer dataXMLizer, String assetClassName)(Code)
Uses dataXMLizer to generate XML for Vishnu Passes nameToDescrip Map to dataXMLizer so can rename fields to be unique.
Parameters:
  taskAndAssets - what to send
Parameters:
  nameToDescrip - mapping of object type to object description (field names, etc.)



getDataXMLizer
public XMLizer getDataXMLizer()(Code)



getFormatDoc
protected Document getFormatDoc(Collection taskAndAssets, String assetClassName)(Code)
uses formatXMLizer to generate XML for Vishnu



getFormatDocWithoutDuplicates
public Document getFormatDocWithoutDuplicates(Collection templates, String assetClassName, List returnedMap)(Code)



getMyParams
protected ParamMap getMyParams()(Code)



getName
protected String getName()(Code)



getOtherDataDoc
protected Document getOtherDataDoc(String otherDataFile)(Code)
send other global data wrapped in the problem header
Parameters:
  otherDataFile - - other data file to read, process, and send



getVanillaHeader
protected Document getVanillaHeader()(Code)



isObject
protected boolean isObject(String type)(Code)
check type and see if it is not a primitive = object



localSetup
public void localSetup()(Code)
Here all the various runtime parameters get set. See documentation for details.



mergeNode
protected void mergeNode(Node first, List nodes, Iterator nodeListIter)(Code)



otherDataFileExists
public boolean otherDataFileExists(String otherDataFile)(Code)



postProcessData
protected void postProcessData(Document dataDoc, Node dataNode, boolean sendingChangedObjects)(Code)
changes newobjects tag to changedobjects tag if sendingChangedObjects is true;



prepareDocument
public Document prepareDocument(Collection tasks, Collection changed, XMLizer dataXMLizer, boolean clearDatabase, boolean sendingChangedObjects, String assetClassName)(Code)
get the document from the data xmlizer, set some attributes on the header, and then do any post-processing



prepareFreezeAll
public Document prepareFreezeAll()(Code)
make a document that tells Vishnu to freeze all assignments



prepareRescind
public Document prepareRescind(Enumeration removedTasks, String verb)(Code)



prepareUnfreeze
public Document prepareUnfreeze(Collection unfreezeTasks)(Code)



processObjectFormats
protected void processObjectFormats(Node root, Map nameToNodes, Set potentialDuplicates, FormatProcessor formatProcessor)(Code)
Given a set of potential duplicate types, removes those that are duplicates from the set of DOM Node OBJECTFORMATs sent to Vishnu. Removes duplicate OBJECTFORMATs from root. If there is only one remaining Node for a type in potentialDuplicates, the type is removed from the list of potential duplicates. First finds those nodes that should be removed and then removes them in a separate step.
Parameters:
  potentialDuplicates - set of type names of potential duplicates
Parameters:
  nameToNodes - list of DOM Nodes for type
Parameters:
  root - DATAFORMAT tag which is the parent of all OBJECTFORMATs



removeDuplicates
protected Map removeDuplicates(Node root, Document doc)(Code)
Looks at all the object format nodes in the document and removes duplicates (two object formats with the same name and same fields). Object formats that have the same name but with different fields are renamed to make them distinct. addFieldsForDifferentTypes adds fields to refer to the new unique names, and setObjectNames renames the object formats. The returned maps are needed for the object data phase, so we can figure out what the unique type should be for a data object with an ambiguous type.
Parameters:
  root - - where to start in document
Parameters:
  doc - - doc to remove the duplicates from Map [] containing two maps - name to object descriptionand name to node



setDataXMLizer
protected void setDataXMLizer(XMLizer xmlizer)(Code)



setDocHeader
protected Node setDocHeader(Document dataDoc, boolean clearDatabase)(Code)
Sets the vishnu epoch start and end time and the proper problem name. If clearDatabase is true, appends CLEARDATABASE tag.



setResourceAttributes
protected void setResourceAttributes(Node first, Node other)(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.