|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ptc.windchill.esi.migrate.TargetFactory
Utility class for creating and retrieving ESITarget instances during the migration of RTP Organizations (ERBOrganization) to ESI Targets. NOTE: The 'system' attribute of ESITarget will be set to the object ID ('ida2a2') of the ERBOrganization entry.
Field Summary | |
protected static String |
ID_PREFIX
|
protected static String |
ID_SEPARATOR
|
protected static String |
ORG_CLASS_NAME
|
protected static Class |
TARGET_CLASS
|
protected static Hashtable |
targetIdCache
|
protected static Hashtable |
targetSystemCache
|
protected static ESITargetUtility |
tgtUtility
|
Constructor Summary | |
TargetFactory()
|
Method Summary | |
protected static void |
addToCache(ESITarget target)
Adds the supplied target to the Target cache using the target's corresponding organization identity as the key. |
static boolean |
completeMigration(ESITarget target)
Finalizes the migration activity for the supplied ESI Target. |
static ESITarget |
createTargetFromOrg(String name,
String description,
long id)
Creates an ESITarget object from the supplied ERBOrganization values. |
protected static long |
decodeId(String name)
Decodes the supplied name and returns only the id portion. |
protected static String |
decodeName(String name)
Decodes the supplied name and returns only the name portion. |
protected static String |
encodeId(long id)
Encodes the supplied identity such that it can be appended with a name for storing or can be used for searching using the SQL LIKE operator. |
protected static String |
encodeName(String name,
long id)
Encodes the supplied name and identity into a single string value. |
protected static boolean |
equals(Object o1,
Object o2)
Determines if the two references are equal, taking null into account. |
protected static ESITarget |
findInCache(long id)
Finds the target that corresponds to the supplied organization identity. |
protected static ESITarget |
findInCache(String system)
Finds the target that corresponds to the supplied system value. |
static ESITarget |
getTargetBySystem(String system)
Returns the ESI Target having the supplied system value. |
static ESITarget |
getTargetForOrg(long id)
Returns the ESITarget that was created for the corresponding ERBOrganization identity value. |
static ESITarget |
getTargetForOrg(ObjectIdentifier objectId)
Returns the ESITarget that was created for the corresponding ERBOrganization ObjectIdentifier value. |
static ESITarget |
getTargetForOrg(String orgName,
String erpSystem)
Returns the corresponding ESI Target for the ERBOrganization identified by the supplied values. |
static QueryResult |
getTargetsInMigration()
Queries those ESI Target objects that are partially migrated. |
protected static QueryResult |
getTargetsWithNameLike(String likeValue)
Returns a query result of those targets that have a name matching (i.e., SQL LIKE) the supplied value. |
static boolean |
hasTargetForOrg(String name,
String description,
long id)
Determines if an ESITarget object has been created for the supplied ERBOrganization values. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static String ORG_CLASS_NAME
protected static Class TARGET_CLASS
protected static String ID_PREFIX
protected static String ID_SEPARATOR
protected static ESITargetUtility tgtUtility
protected static Hashtable targetIdCache
protected static Hashtable targetSystemCache
Constructor Detail |
public TargetFactory()
Method Detail |
protected static void addToCache(ESITarget target)
target
- - the targetprotected static ESITarget findInCache(long id)
id
- - the identity of the ERBOrganization
protected static ESITarget findInCache(String system)
system
- - the unique id of the target ERP system/org.
protected static String encodeId(long id)
id
- - the identity of the ERBOrganization
protected static String encodeName(String name, long id)
name
- - the name of the organzationid
- - the identity of the ERBOrganization
protected static long decodeId(String name)
name
- - the encoded name
protected static String decodeName(String name)
name
- - the encoded name
public static ESITarget createTargetFromOrg(String name, String description, long id) throws UniquenessException, WTException
name
- - the name of the organzationdescription
- - the description of the organizationid
- - the identity of the ERBOrganization
UniquenessException
WTException
public static boolean hasTargetForOrg(String name, String description, long id) throws WTException
name
- - the name of the organzationdescription
- - the description of the organizationid
- - the identity of the ERBOrganization
WTException
protected static QueryResult getTargetsWithNameLike(String likeValue) throws WTException
likeValue
- - the name of the organzation
WTException
public static ESITarget getTargetForOrg(long id) throws WTException, ESINoSuchTargetException
id
- - the identity of the ERBOrganization
WTException
ESINoSuchTargetException
- if no corresponding target is foundpublic static ESITarget getTargetForOrg(ObjectIdentifier objectId) throws WTException, ESINoSuchTargetException
objectId
- - the identifier of the ERBOrganization object
WTException
ESINoSuchTargetException
- if no corresponding target is foundpublic static ESITarget getTargetForOrg(String orgName, String erpSystem) throws WTException, ESINoSuchTargetException
orgName
- - the 'orgName' column value of ERBOrganizationerpSystem
- - the 'erpSystem' column value of ERBOrganization
ESINoSuchTargetException
- if no corresponding target is found
WTException
public static ESITarget getTargetBySystem(String system) throws WTException, ESINoSuchTargetException
system
- - the unique id of the target ERP system/org.
ESINoSuchTargetException
- if no corresponding target is found
WTException
public static QueryResult getTargetsInMigration() throws WTException
WTException
public static boolean completeMigration(ESITarget target) throws WTException
target
- - the target to finalize
WTException
protected static boolean equals(Object o1, Object o2)
o1
- - the first object referenceo2
- - the second object reference
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |