com.ptc.windchill.esi.tgt
Class ESITargetAssignmentAdjuster

java.lang.Object
  extended bycom.ptc.windchill.esi.tgt.ESITargetAssignmentAdjuster
All Implemented Interfaces:
Externalizable, Serializable

public class ESITargetAssignmentAdjuster
extends Object
implements Externalizable

Processes an I*E group containing a list of ESITargets, the orginal assignment status (all , none, or some) and the desired status (all or none). Determines whether additions or deletions are required for each part identified by the ufids attribute.

Supported API: false

Extendable: false

See Also:
Serialized Form

Nested Class Summary
private  class ESITargetAssignmentAdjuster.TargetRequest
           
 
Field Summary
private static String CLASSNAME
           
private  Collection deletes
           
static String DESIRED_ATT
           
static long EXTERNALIZATION_VERSION_UID
           
private  Collection inserts
           
static String OBJECT_ID_ATT
           
protected static long OLD_FORMAT_VERSION_UID
           
private  Collection parts
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private  Group targets
           
private  ESITargetUtility targetUtility
           
private  TaskHelper taskHelper
           
private  String ufids
           
static String WAS_FULL_ATT
           
 
Constructor Summary
protected ESITargetAssignmentAdjuster(String ufids, Group targets, TaskHelper th, ESITargetUtility tu)
           
 
Method Summary
(package private)  void adjustAssignments()
          Adds and/or deletes ESITargetAssignmentLinks to make the existing assignments consistent with the desired state defined in the targets attribute.
private  void buildDeletes(Collection requests, Collection parts)
           
private  void buildInserts(Collection requests, Collection parts, Collection targetAssns)
           
private  void complain(String desired, Boolean wasFull, String ufid)
           
private  Collection getParts(String ufidString)
           
(package private) static ESITargetAssignmentAdjuster newESITargetAssignmentAdjuster(String ufids, Group targets, TaskHelper th, ESITargetUtility tu)
          

Supported API: false
private  void processRequests()
           
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(ESITargetAssignmentAdjuster thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
private  void updateAssignments(Collection requests, Collection parts, Collection targetAssns)
           
private  void validate()
           
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

ufids

private String ufids

parts

private Collection parts

targets

private Group targets

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

OBJECT_ID_ATT

public static final String OBJECT_ID_ATT
See Also:
Constant Field Values

WAS_FULL_ATT

public static final String WAS_FULL_ATT
See Also:
Constant Field Values

DESIRED_ATT

public static final String DESIRED_ATT
See Also:
Constant Field Values

taskHelper

private TaskHelper taskHelper

targetUtility

private ESITargetUtility targetUtility

deletes

private Collection deletes

inserts

private Collection inserts
Constructor Detail

ESITargetAssignmentAdjuster

protected ESITargetAssignmentAdjuster(String ufids,
                                      Group targets,
                                      TaskHelper th,
                                      ESITargetUtility tu)
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(ESITargetAssignmentAdjuster thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

newESITargetAssignmentAdjuster

static ESITargetAssignmentAdjuster newESITargetAssignmentAdjuster(String ufids,
                                                                  Group targets,
                                                                  TaskHelper th,
                                                                  ESITargetUtility tu)


Supported API: false

Parameters:
ufids - A concatenated set of UFIDs
targets - The value to assign to the targets attribute.
th -
tu - The ESITargetUtility that created this object.
Returns:
ESITargetAssignmentAdjuster

adjustAssignments

void adjustAssignments()
                 throws WTException
Adds and/or deletes ESITargetAssignmentLinks to make the existing assignments consistent with the desired state defined in the targets attribute.
Creates a database transaction so that all requests succeed or all fail

Supported API: false

Throws:
WTException

getParts

private Collection getParts(String ufidString)
                     throws WTException
Throws:
WTException

updateAssignments

private void updateAssignments(Collection requests,
                               Collection parts,
                               Collection targetAssns)
                        throws WTException
Throws:
WTException

validate

private void validate()
               throws WTException
Throws:
WTException

complain

private void complain(String desired,
                      Boolean wasFull,
                      String ufid)
               throws WTException
Throws:
WTException

buildDeletes

private void buildDeletes(Collection requests,
                          Collection parts)
                   throws WTException
Throws:
WTException

buildInserts

private void buildInserts(Collection requests,
                          Collection parts,
                          Collection targetAssns)
                   throws WTException
Throws:
WTException

processRequests

private void processRequests()
                      throws WTException
Throws:
WTException