com.ptc.windchill.upgrade.ius
Class IncrementalUpdate

java.lang.Object
  extended bycom.ptc.windchill.upgrade.ius.IncrementalUpdate

public class IncrementalUpdate
extends Object


Nested Class Summary
private static class IncrementalUpdate.IncrementalUpdateEntityResolver
          Loads the DTD for the appropriate phase for the *.xml file to validate against.
private static class IncrementalUpdate.IncrementalUpdateParserErrorHandler
           
(package private) static class IncrementalUpdate.MinTargetVersionComparer
          Create a comparator that will enable sorting Incremental Updates based on the minimum version of their target version set.
 
Field Summary
private static Object classLock__
           
private  String description_
           
static String DESCRIPTION_ELEMENT_NAME
           
private  ArrayList directives_
           
static String DIRECTIVES_ELEMENT_NAME
           
private  Element directivesElement_
           
private static String DTD_EXTENSION
           
private static String DTD_FOR_MIGRATORS_REQ_METHOD_SERVER
           
private static String DTD_FOR_STANDALONE_MIGRATORS
           
static String EXCLUDING_UPDATE_ELEMENT_NAME
           
private  ArrayList excludingUpdates_
           
static String IS_OPTIONAL_ATTRIBUTE_NAME
           
private  boolean isOptional_
           
private  String name_
           
static String NAME_ELEMENT_NAME
           
private static DocumentBuilder nonValidatingParser__
           
private static String PREFIX_PATH
           
static String REQUIRED_UPDATE_ELEMENT_NAME
           
private  ArrayList requiredUpdates_
           
static String ROOT_ELEMENT_NAME
           
static String SOURCE_VERSION_SET_ELEMENT_NAME
           
private  ReleaseIdSet sourceVersionSet_
           
static String TARGET_VERSION_SET_ELEMENT_NAME
           
private  ReleaseIdSet targetVersionSet_
           
private  UUID uuid_
           
static String UUID_ATTRIBUTE_NAME
           
private static UuidGenerator uuidGenerator__
           
private static DocumentBuilder validatingParser__
           
 
Constructor Summary
IncrementalUpdate()
          Create a new instance with a new UUID, empty name, description, directive list, source and version sets.
IncrementalUpdate(InputSource input_source, String source_name)
           
 
Method Summary
 void addExcludingUpdate(UUID update_id)
           
 void addRequiredUpdate(UUID update_id)
          Specify UUIDs for incremental updates that this update depends upon.
 Element asBriefDom(Document dom_factory)
          Write without directives or version sets.
 Element asDom(Document dom_factory)
           
private  Element asDom(Document dom_factory, boolean full)
           
 Document asDomDocument()
           
 Document asDomDocument(boolean full)
           
 boolean canRunAgainstSourceVersions(ReleaseId[] source_versions)
          Determines if the provided version is in the update's source version set.
 boolean canRunAgainstTargetVersions(ReleaseId[] target_versions)
          Determines if the provided version is in the update's target version set.
private  List directives()
          Returns directives, analyzing the DOM first if necessary.
 void execute(DirectiveServices directive_services)
           
static String getCorrectDtdFile()
          Determines the correct DTD file for the current phase
 String getDescription()
           
private  Document getDocumentFrom(InputSource input_source, String source_name)
           
 String getName()
           
private static DocumentBuilder getNonValidatingParser()
           
 List getRequiredUpdateUuids()
          Collection of UUIDs for incremental updates that this update depends upon.
private static EntityResolver getSaxEntityResolver()
          An instance of EntityResolver is created and returned.
private static ErrorHandler getSaxErrorHandler()
          An instance of ErrorHandler is created and returned.
(package private)  ReleaseIdSet getSourceVersionSet()
           
(package private)  ReleaseIdSet getTargetVersionSet()
           
 UUID getUuid()
           
private static UuidGenerator getUuidGenerator()
           
 List getUuidsThatExclude()
          Collection of UUIDs for incremental updates that this update is mutually exclusive with.
private static DocumentBuilder getValidatingParser()
           
 boolean isOptional()
           
private static Document readNonValidatedFrom(InputSource input_source, String source_name)
           
 void removeExcludingUpdate(UUID update_id)
          Exclude the incremental update that is in the ExcludeVersions tags.
 void removeRequiredUpdate(UUID update_id)
          Removes the IU from the arraylist so it is not applied
private static Document reReadValidated(Document document, String source_name)
           
 void setDescription(String description)
           
 void setIsOptional(boolean is_optional)
           
 void setName(String name)
           
 String toString()
           
private  String trimSpacesAroundLineBreaks(String description_parsing)
          Removes spaces for description of the Incremental Update.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ROOT_ELEMENT_NAME

public static final String ROOT_ELEMENT_NAME
See Also:
Constant Field Values

UUID_ATTRIBUTE_NAME

public static final String UUID_ATTRIBUTE_NAME
See Also:
Constant Field Values

IS_OPTIONAL_ATTRIBUTE_NAME

public static final String IS_OPTIONAL_ATTRIBUTE_NAME
See Also:
Constant Field Values

NAME_ELEMENT_NAME

public static final String NAME_ELEMENT_NAME
See Also:
Constant Field Values

DESCRIPTION_ELEMENT_NAME

public static final String DESCRIPTION_ELEMENT_NAME
See Also:
Constant Field Values

REQUIRED_UPDATE_ELEMENT_NAME

public static final String REQUIRED_UPDATE_ELEMENT_NAME
See Also:
Constant Field Values

EXCLUDING_UPDATE_ELEMENT_NAME

public static final String EXCLUDING_UPDATE_ELEMENT_NAME
See Also:
Constant Field Values

SOURCE_VERSION_SET_ELEMENT_NAME

public static final String SOURCE_VERSION_SET_ELEMENT_NAME
See Also:
Constant Field Values

TARGET_VERSION_SET_ELEMENT_NAME

public static final String TARGET_VERSION_SET_ELEMENT_NAME
See Also:
Constant Field Values

DIRECTIVES_ELEMENT_NAME

public static final String DIRECTIVES_ELEMENT_NAME
See Also:
Constant Field Values

classLock__

private static final Object classLock__

uuidGenerator__

private static UuidGenerator uuidGenerator__

nonValidatingParser__

private static DocumentBuilder nonValidatingParser__

validatingParser__

private static DocumentBuilder validatingParser__

uuid_

private UUID uuid_

name_

private String name_

description_

private String description_

isOptional_

private boolean isOptional_

sourceVersionSet_

private ReleaseIdSet sourceVersionSet_

targetVersionSet_

private ReleaseIdSet targetVersionSet_

requiredUpdates_

private ArrayList requiredUpdates_

excludingUpdates_

private ArrayList excludingUpdates_

directives_

private ArrayList directives_

directivesElement_

private Element directivesElement_

DTD_FOR_MIGRATORS_REQ_METHOD_SERVER

private static final String DTD_FOR_MIGRATORS_REQ_METHOD_SERVER
See Also:
Constant Field Values

DTD_FOR_STANDALONE_MIGRATORS

private static final String DTD_FOR_STANDALONE_MIGRATORS
See Also:
Constant Field Values

PREFIX_PATH

private static final String PREFIX_PATH
See Also:
Constant Field Values

DTD_EXTENSION

private static final String DTD_EXTENSION
See Also:
Constant Field Values
Constructor Detail

IncrementalUpdate

public IncrementalUpdate()
                  throws UuidGeneratorCreationException
Create a new instance with a new UUID, empty name, description, directive list, source and version sets.


IncrementalUpdate

public IncrementalUpdate(InputSource input_source,
                         String source_name)
                  throws UpdateIOException
Parameters:
input_source -
source_name - IncrementalUpdate file name
Method Detail

directives

private final List directives()
                       throws UpdateIOException
Returns directives, analyzing the DOM first if necessary.

Throws:
UpdateIOException

trimSpacesAroundLineBreaks

private String trimSpacesAroundLineBreaks(String description_parsing)
Removes spaces for description of the Incremental Update.


asDomDocument

public Document asDomDocument()
                       throws UpdateIOException
Throws:
UpdateIOException

asDomDocument

public Document asDomDocument(boolean full)
                       throws UpdateIOException
Throws:
UpdateIOException

asDom

private Element asDom(Document dom_factory,
                      boolean full)
               throws UpdateIOException
Throws:
UpdateIOException

asDom

public Element asDom(Document dom_factory)
              throws UpdateIOException
Throws:
UpdateIOException

asBriefDom

public Element asBriefDom(Document dom_factory)
                   throws UpdateIOException
Write without directives or version sets.

Throws:
UpdateIOException

execute

public void execute(DirectiveServices directive_services)
             throws UpdateExecutionException
Throws:
UpdateExecutionException

getName

public String getName()

setName

public void setName(String name)

getDescription

public String getDescription()

setDescription

public void setDescription(String description)

isOptional

public boolean isOptional()

setIsOptional

public void setIsOptional(boolean is_optional)

getUuid

public UUID getUuid()

getUuidGenerator

private static UuidGenerator getUuidGenerator()
                                       throws UuidGeneratorCreationException
Throws:
UuidGeneratorCreationException

canRunAgainstSourceVersions

public final boolean canRunAgainstSourceVersions(ReleaseId[] source_versions)
Determines if the provided version is in the update's source version set.


canRunAgainstTargetVersions

public final boolean canRunAgainstTargetVersions(ReleaseId[] target_versions)
Determines if the provided version is in the update's target version set.


getRequiredUpdateUuids

public List getRequiredUpdateUuids()
Collection of UUIDs for incremental updates that this update depends upon.


getUuidsThatExclude

public List getUuidsThatExclude()
Collection of UUIDs for incremental updates that this update is mutually exclusive with.


addRequiredUpdate

public void addRequiredUpdate(UUID update_id)
Specify UUIDs for incremental updates that this update depends upon.


removeRequiredUpdate

public void removeRequiredUpdate(UUID update_id)
Removes the IU from the arraylist so it is not applied

Parameters:
update_id - UUID

addExcludingUpdate

public void addExcludingUpdate(UUID update_id)

removeExcludingUpdate

public void removeExcludingUpdate(UUID update_id)
Exclude the incremental update that is in the ExcludeVersions tags.

Parameters:
update_id - UUID

toString

public String toString()

getDocumentFrom

private Document getDocumentFrom(InputSource input_source,
                                 String source_name)
                          throws UpdateIOException
Throws:
UpdateIOException

getNonValidatingParser

private static DocumentBuilder getNonValidatingParser()
                                               throws ParserConfigurationException
Throws:
ParserConfigurationException

getValidatingParser

private static DocumentBuilder getValidatingParser()
                                            throws ParserConfigurationException
Throws:
ParserConfigurationException

readNonValidatedFrom

private static Document readNonValidatedFrom(InputSource input_source,
                                             String source_name)
                                      throws UpdateIOException
Throws:
UpdateIOException

reReadValidated

private static Document reReadValidated(Document document,
                                        String source_name)
                                 throws UpdateIOException
Throws:
UpdateIOException

getCorrectDtdFile

public static String getCorrectDtdFile()
Determines the correct DTD file for the current phase


getSaxErrorHandler

private static ErrorHandler getSaxErrorHandler()
An instance of ErrorHandler is created and returned.


getSaxEntityResolver

private static EntityResolver getSaxEntityResolver()
An instance of EntityResolver is created and returned.


getSourceVersionSet

ReleaseIdSet getSourceVersionSet()

getTargetVersionSet

ReleaseIdSet getTargetVersionSet()