com.ptc.windchill.upgrade.history
Class XmlIUHPersistenceDelegate

java.lang.Object
  extended bycom.ptc.windchill.upgrade.history.IUHPersistenceDelegate
      extended bycom.ptc.windchill.upgrade.history.XmlIUHPersistenceDelegate

public class XmlIUHPersistenceDelegate
extends IUHPersistenceDelegate


Field Summary
private static String ASSEMBLY_ELEMENT
           
private static String ASSEMBLY_RELEASE_ID
           
private static String ASSEMBLY_RELEASE_ID_ATTR
           
private  Document doc_
           
private  File file_
           
private static String INSTALLATION_COMPLETE_ATTR
           
private static String INSTALLATION_ELEMENT
           
private static String INSTALLATION_ID_ATTR
           
private static String INSTALLATION_TIMESTAMP_ATTR
           
private static String INSTALLATION_TIMESTAMP_FORMAT_ATTR
           
private static String IUAPPLICATION_ELEMENT
           
private static String IUAPPLICATION_NAME_ATTR
           
private static String IUAPPLICATION_UUID_ATTR
           
private static String ROOT_ELEMENT
           
private static String UPGRADE_PHASE_COMPLETE_ATTR
           
private static String UPGRADE_PHASE_ELEMENT
           
private static String UPGRADE_PHASE_ID_ATTR
           
private static String UPGRADE_PHASE_PHASETYPE_ATTR
           
private  XPathFactory xPathFactory_
           
 
Fields inherited from class com.ptc.windchill.upgrade.history.IUHPersistenceDelegate
 
Constructor Summary
XmlIUHPersistenceDelegate(File file, boolean preserve)
           
 
Method Summary
protected  boolean areAssembliesDirty(Installation installation)
           
protected  boolean areInstallationsDirty()
           
protected  boolean areIUApplicationsDirty(UpgradePhase upgrade_phase)
           
protected  boolean areUpgradePhasesDirty(Installation installation)
           
protected  void clear()
          Removes all contents from the history.
protected  Assembly createAssembly(Installation installation, ReleaseId release_id)
           
protected  Installation createInstallation(Date timestamp)
           
protected  IUApplication createIUApplication(UpgradePhase upgrade_phase, UUID uuid, String name)
           
protected  UpgradePhase createUpgradePhase(Installation installation, UpgradePhaseType phase_type)
           
private  NodeList findNodeListByXPath(Node rel_node, String xpath_expression)
           
protected  void flush()
          Force any pending stores for this history.
protected  ArrayList getAssemblies(Installation installation)
           
private  Element getInstallationElement(int installation_id)
           
protected  ArrayList getInstallations()
           
protected  ArrayList getIUApplications(UpgradePhase upgrade_phase)
           
private  Element getUpgradePhaseElement(int upgrade_phase_id)
           
protected  ArrayList getUpgradePhases(Installation installation)
           
private  XPathFactory getXPathFactory()
           
private  void initNew()
           
private static boolean isAttributeYes(String value)
           
protected  boolean isComplete(Installation installation)
           
protected  boolean isComplete(UpgradePhase upgrade_phase)
           
protected  void markComplete(Installation installation, boolean complete)
           
protected  void markComplete(UpgradePhase upgrade_phase, boolean complete)
           
private  int nextIdForElementType(String id_attribute_name, String element_name)
           
private  int nextInstallationId()
           
private  int nextUpgradePhaseId()
           
private  void read()
           
private static void safeCloseWithSmother(OutputStream os)
           
 
Methods inherited from class com.ptc.windchill.upgrade.history.IUHPersistenceDelegate
addInvalidateable, invalidate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROOT_ELEMENT

private static final String ROOT_ELEMENT
See Also:
Constant Field Values

INSTALLATION_ELEMENT

private static final String INSTALLATION_ELEMENT
See Also:
Constant Field Values

INSTALLATION_ID_ATTR

private static final String INSTALLATION_ID_ATTR
See Also:
Constant Field Values

INSTALLATION_COMPLETE_ATTR

private static final String INSTALLATION_COMPLETE_ATTR
See Also:
Constant Field Values

INSTALLATION_TIMESTAMP_ATTR

private static final String INSTALLATION_TIMESTAMP_ATTR
See Also:
Constant Field Values

INSTALLATION_TIMESTAMP_FORMAT_ATTR

private static final String INSTALLATION_TIMESTAMP_FORMAT_ATTR
See Also:
Constant Field Values

ASSEMBLY_ELEMENT

private static final String ASSEMBLY_ELEMENT
See Also:
Constant Field Values

ASSEMBLY_RELEASE_ID

private static final String ASSEMBLY_RELEASE_ID
See Also:
Constant Field Values

ASSEMBLY_RELEASE_ID_ATTR

private static final String ASSEMBLY_RELEASE_ID_ATTR
See Also:
Constant Field Values

UPGRADE_PHASE_ELEMENT

private static final String UPGRADE_PHASE_ELEMENT
See Also:
Constant Field Values

UPGRADE_PHASE_ID_ATTR

private static final String UPGRADE_PHASE_ID_ATTR
See Also:
Constant Field Values

UPGRADE_PHASE_PHASETYPE_ATTR

private static final String UPGRADE_PHASE_PHASETYPE_ATTR
See Also:
Constant Field Values

UPGRADE_PHASE_COMPLETE_ATTR

private static final String UPGRADE_PHASE_COMPLETE_ATTR
See Also:
Constant Field Values

IUAPPLICATION_ELEMENT

private static final String IUAPPLICATION_ELEMENT
See Also:
Constant Field Values

IUAPPLICATION_UUID_ATTR

private static final String IUAPPLICATION_UUID_ATTR
See Also:
Constant Field Values

IUAPPLICATION_NAME_ATTR

private static final String IUAPPLICATION_NAME_ATTR
See Also:
Constant Field Values

file_

private File file_

doc_

private Document doc_

xPathFactory_

private XPathFactory xPathFactory_
Constructor Detail

XmlIUHPersistenceDelegate

public XmlIUHPersistenceDelegate(File file,
                                 boolean preserve)
                          throws IUHException
Method Detail

isAttributeYes

private static boolean isAttributeYes(String value)

areInstallationsDirty

protected final boolean areInstallationsDirty()
Specified by:
areInstallationsDirty in class IUHPersistenceDelegate

getInstallations

protected final ArrayList getInstallations()
                                    throws IUHException
Specified by:
getInstallations in class IUHPersistenceDelegate
Throws:
IUHException

createInstallation

protected final Installation createInstallation(Date timestamp)
                                         throws IUHException
Specified by:
createInstallation in class IUHPersistenceDelegate
Throws:
IUHException

markComplete

protected final void markComplete(Installation installation,
                                  boolean complete)
                           throws IUHException
Specified by:
markComplete in class IUHPersistenceDelegate
Throws:
IUHException

getInstallationElement

private Element getInstallationElement(int installation_id)
                                throws IUHException
Throws:
IUHException

markComplete

protected final void markComplete(UpgradePhase upgrade_phase,
                                  boolean complete)
                           throws IUHException
Specified by:
markComplete in class IUHPersistenceDelegate
Throws:
IUHException

getUpgradePhaseElement

private Element getUpgradePhaseElement(int upgrade_phase_id)
                                throws IUHException
Throws:
IUHException

isComplete

protected boolean isComplete(Installation installation)
                      throws IUHException
Specified by:
isComplete in class IUHPersistenceDelegate
Throws:
IUHException

areAssembliesDirty

protected final boolean areAssembliesDirty(Installation installation)
Specified by:
areAssembliesDirty in class IUHPersistenceDelegate

getAssemblies

protected final ArrayList getAssemblies(Installation installation)
                                 throws IUHException
Specified by:
getAssemblies in class IUHPersistenceDelegate
Throws:
IUHException

createAssembly

protected final Assembly createAssembly(Installation installation,
                                        ReleaseId release_id)
                                 throws IUHException
Specified by:
createAssembly in class IUHPersistenceDelegate
Throws:
IUHException

isComplete

protected boolean isComplete(UpgradePhase upgrade_phase)
                      throws IUHException
Specified by:
isComplete in class IUHPersistenceDelegate
Throws:
IUHException

areIUApplicationsDirty

protected final boolean areIUApplicationsDirty(UpgradePhase upgrade_phase)
Specified by:
areIUApplicationsDirty in class IUHPersistenceDelegate

getIUApplications

protected final ArrayList getIUApplications(UpgradePhase upgrade_phase)
                                     throws IUHException
Specified by:
getIUApplications in class IUHPersistenceDelegate
Throws:
IUHException

createIUApplication

protected final IUApplication createIUApplication(UpgradePhase upgrade_phase,
                                                  UUID uuid,
                                                  String name)
                                           throws IUHException
Specified by:
createIUApplication in class IUHPersistenceDelegate
Throws:
IUHException

createUpgradePhase

protected final UpgradePhase createUpgradePhase(Installation installation,
                                                UpgradePhaseType phase_type)
                                         throws IUHException
Specified by:
createUpgradePhase in class IUHPersistenceDelegate
Throws:
IUHException

getUpgradePhases

protected final ArrayList getUpgradePhases(Installation installation)
                                    throws IUHException
Specified by:
getUpgradePhases in class IUHPersistenceDelegate
Throws:
IUHException

areUpgradePhasesDirty

protected final boolean areUpgradePhasesDirty(Installation installation)
Specified by:
areUpgradePhasesDirty in class IUHPersistenceDelegate

clear

protected final void clear()
                    throws IUHException
Removes all contents from the history.

Specified by:
clear in class IUHPersistenceDelegate
Throws:
IUHException

flush

protected final void flush()
                    throws IUHException
Force any pending stores for this history.

Overrides:
flush in class IUHPersistenceDelegate
Throws:
IUHException

nextInstallationId

private int nextInstallationId()
                        throws IUHException
Throws:
IUHException

nextUpgradePhaseId

private int nextUpgradePhaseId()
                        throws IUHException
Throws:
IUHException

nextIdForElementType

private int nextIdForElementType(String id_attribute_name,
                                 String element_name)
                          throws IUHException
Throws:
IUHException

initNew

private void initNew()
              throws IUHException
Throws:
IUHException

read

private void read()
           throws IUHException
Throws:
IUHException

safeCloseWithSmother

private static void safeCloseWithSmother(OutputStream os)

getXPathFactory

private XPathFactory getXPathFactory()
                              throws IUHException
Throws:
IUHException

findNodeListByXPath

private NodeList findNodeListByXPath(Node rel_node,
                                     String xpath_expression)
                              throws IUHException
Returns:
possibly null NodeList
Throws:
IUHException