com.ptc.windchill.upgrade.dust
Class ReadBlobData

java.lang.Object
  extended bycom.ptc.windchill.upgrade.dust.ReadBlobData

public class ReadBlobData
extends Object

Reads data files created by a previous ExportBlobData session, de-serializing each blob instance. If there are incompatibilities, an exception will be thrown and the stack trace will be included in the report.


Field Summary
private static String CLASS_NAME
           
private static boolean DEVELOPER_MODE
           
private  PrintWriter log_
           
private  String logLocation_
           
private  ReadBlobCheckOpts opts
           
private static boolean QUICK_REPORT_MODE
           
private static String RESOURCE
           
private static String STDERR
           
private  TimerStats timerStats
           
private  long totalInstanceCount_
           
private  Version version_
           
 
Constructor Summary
ReadBlobData()
           
 
Method Summary
 void execute(String[] args)
          Parse command line options and start it up.
protected  void finalize()
           
private  PrintWriter getLog()
           
private  String getPackageAsPath()
          Supports getStyleSheetInputStream by turning this class's package into a path that is terminated with a forward slash.
private  InputStream getStyleSheetInputStream(String xsl_file)
          Supports xslTransform by loading the stylesheet from the directory that this class is in.
private  void logMessage(String msg)
           
protected  void logSetup()
           
static void main(String[] args)
           
private  void read(File file, DefaultHandler contentHandler)
          Parse the given XML file, using BlobReportContentHandler which de-serializes the blobs.
private  String readBlobDataFor_(String dir_name, String out_file_name)
          Read the .data files from directory dir_name, creating a report named out_file_name.
 void readDataForClasses(String dir_, String file_name)
          Set up logging and timer stats, then read the data from XML and XSLT documents to create an HTML report.
private  void report(String message)
           
private  void report(String message_key, Object[] args)
           
private  boolean sendFeedback(String msg)
          Sends a message back to the client.
private  String showStackTrace(Throwable e)
          This gets called when there is a de-serialization problem.
private  void transformToHTML(String xml_name, String dir_, String xsl_file)
          Supports readDataForClasses by converting the XML and XSLT to HTML.
private  void warning(String localized_message)
           
private  void warning(String message_key, Object[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEVELOPER_MODE

private static boolean DEVELOPER_MODE

QUICK_REPORT_MODE

private static boolean QUICK_REPORT_MODE

RESOURCE

private static final String RESOURCE

CLASS_NAME

private static final String CLASS_NAME

STDERR

private static final String STDERR
See Also:
Constant Field Values

totalInstanceCount_

private long totalInstanceCount_

timerStats

private TimerStats timerStats

log_

private PrintWriter log_

logLocation_

private String logLocation_

version_

private Version version_

opts

private ReadBlobCheckOpts opts
Constructor Detail

ReadBlobData

public ReadBlobData()
Method Detail

main

public static void main(String[] args)

execute

public void execute(String[] args)
             throws WTException
Parse command line options and start it up.

Throws:
WTException

readDataForClasses

public void readDataForClasses(String dir_,
                               String file_name)
                        throws WTException
Set up logging and timer stats, then read the data from XML and XSLT documents to create an HTML report.

Throws:
WTException

transformToHTML

private void transformToHTML(String xml_name,
                             String dir_,
                             String xsl_file)
                      throws SAXException,
                             IOException,
                             WTException
Supports readDataForClasses by converting the XML and XSLT to HTML.

Throws:
SAXException
IOException
WTException

getStyleSheetInputStream

private InputStream getStyleSheetInputStream(String xsl_file)
                                      throws IOException
Supports xslTransform by loading the stylesheet from the directory that this class is in.

Parameters:
xsl_file - The XSL stylesheet that must be in this class's directory.
Returns:
A Streamed XMLSource for the stylesheet (null if file not found).
Throws:
IOException

getPackageAsPath

private String getPackageAsPath()
Supports getStyleSheetInputStream by turning this class's package into a path that is terminated with a forward slash.

Returns:
The Package's path terminated with a forward slash.

showStackTrace

private String showStackTrace(Throwable e)
                       throws SAXException
This gets called when there is a de-serialization problem. Start an instance element, if it hasn't already been done; Start a property element, using the stack trace for its value End the property element. Do not end the instance element because there could be more properties coming for this instance.

Throws:
SAXException

readBlobDataFor_

private String readBlobDataFor_(String dir_name,
                                String out_file_name)
                         throws WTException
Read the .data files from directory dir_name, creating a report named out_file_name.

Throws:
WTException

read

private void read(File file,
                  DefaultHandler contentHandler)
           throws WTException
Parse the given XML file, using BlobReportContentHandler which de-serializes the blobs.

Throws:
WTException

finalize

protected void finalize()

getLog

private final PrintWriter getLog()

report

private void report(String message)

report

private void report(String message_key,
                    Object[] args)

warning

private void warning(String localized_message)

warning

private void warning(String message_key,
                     Object[] args)

logSetup

protected void logSetup()
                 throws WTException
Throws:
WTException

sendFeedback

private boolean sendFeedback(String msg)
Sends a message back to the client.


logMessage

private void logMessage(String msg)