Java Doc for EntityReplicator.java in  » ERP-CRM-Financial » SourceTap-CRM » com » sourcetap » sfa » replication » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » ERP CRM Financial » SourceTap CRM » com.sourcetap.sfa.replication 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sourcetap.sfa.replication.GenericReplicator
      com.sourcetap.sfa.replication.EntityReplicator

All known Subclasses:   com.sourcetap.sfa.replication.AccountReplicator,  com.sourcetap.sfa.replication.ProductCategoryReplicator,  com.sourcetap.sfa.replication.ActivityReplicator,  com.sourcetap.sfa.replication.EntityAccessReplicator,  com.sourcetap.sfa.replication.ProductReplicator,  com.sourcetap.sfa.replication.FileAttachmentReplicator,  com.sourcetap.sfa.replication.FullReplicator,  com.sourcetap.sfa.replication.TeamReplicator,  com.sourcetap.sfa.replication.DealReplicator,  com.sourcetap.sfa.replication.ContactReplicator,  com.sourcetap.sfa.replication.FileReplicator,  com.sourcetap.sfa.replication.ItIssueReplicator,  com.sourcetap.sfa.replication.ItIssueHistoryReplicator,
EntityReplicator
public class EntityReplicator extends GenericReplicator (Code)
This class is used for entity instance replication.

Typically this class, or its descendant, is used to replicate a single instance of an entity. This is accomplished by instantiating this class and calling its replicateInstance() method.

For each instance replicated, one or more related entity instances may be replicated when the replicateAllRelated() method is called automatically by the replicateInstance() method. If the relatedEntityMapVector attribute has been populated, the replicateAllRelated() method will call the replicateOneRelated() method for each item in the vector to replicate one entities instances. The related entities are located in the findOneRelated() method, which is called by replicateOneRelated(). For each related entity instance found, another instance of this class is used to replicate it.

Entity replication is used to do full replication. Full replication is required to populate a newly registered replication node, or to re-populate an inactive replication node. To perform full replication, the relatedEntityMapVector should be populated with a list of all entities to be removed and replicated, and the information required to find them. Then the removeAll() and replicateAll() methods should be called.
author:
   John Nutting



Field Summary
protected  StringentityName
     The name of the entity to be replicated.
final public static  Stringmodule
    
protected  VectorrelatedEntityMapVector
     Related Entity Map Vector

Each vector element contains a HashMap describing a related entity to be replicated for each instance of the main entity that is replicated.

protected  UserInfouserInfo
    

Constructor Summary
public  EntityReplicator()
     Constructor with no args.
public  EntityReplicator(GenericDelegator localDelegator, GenericDelegator masterDelegator, String entityName, UserInfo userInfo)
     Constructor with args.

Method Summary
public  voidaddRelatedEntityMap(HashMap relatedEntityMap)
     Adds a related entity map to the related entity map vector.
public  voidaddRelatedEntityMap(String relationTitle, String relatedEntityName, HashMap filterMap, boolean replicateAll, boolean removeAll, String replicatorClassName)
     Adds a related entity map to the related entity map vector.
protected  ListfindOneRelated(GenericDelegator delegator, GenericValue mainInstance, String relationTitle, String relatedEntityName, HashMap filterMap, boolean findAll)
     This method finds all instances of an entity related to the main entity.
public  StringgetEntityName()
     Gets the name of the entity to be replicated.
public static  EntityReplicatorgetEntityReplicator(String className, GenericDelegator localDelegator, GenericDelegator masterDelegator, String entityName, UserInfo userInfo)
     Instantiates EntityReplicator or one of its descendant classes.
public  VectorgetRelatedEntityMapVector()
     Gets the related entity map vector.
public  UserInfogetUserInfo()
    
public  intinsertLocalInstance(GenericValue masterInstance)
     This method stores the instance in the local data base.
author:
   John Nutting
Parameters:
  masterInstance - Entity instance from the master data base Status.
public  voidpopulateRelatedEntityMapVector()
     Populate the related entity map vector.
public  intremoveAllRelated(GenericValue localInstance)
     This method removes all instances for all related entities.
public  intremoveInstance(GenericValue mainInstance)
     This method removes one instance of the entity named in the entityName attribute.
public  intremoveLocalInstance(GenericValue localInstance)
     This method removes an instance of the main entity from the local data base.
author:
   John Nutting
Parameters:
  localInstance - Entity instance being removed Status.
protected  intremoveOneRelated(GenericValue mainInstance, String relationTitle, String relatedEntityName, HashMap filterMap, boolean removeAll, String replicatorClassName)
     This method removes all instances for one entity related to the main entity.
public  intreplicateAllRelated(GenericValue mainInstance)
     This method replicates all instances for all related entities.
public  intreplicateInstance(GenericValue mainInstance)
     This method replicates one instance of the entity named in the entityName attribute.
protected  intreplicateOneRelated(GenericValue mainInstance, String relationTitle, String relatedEntityName, HashMap filterMap, boolean replicateAll, String replicatorClassName)
     This method replicates all instances for one entity related to the main entity.
public  voidsetEntityName(String entityName_)
     Sets the name of the entity to be replicated.
public  voidsetUserInfo(UserInfo userInfo_)
    

Field Detail
entityName
protected String entityName(Code)
The name of the entity to be replicated.



module
final public static String module(Code)



relatedEntityMapVector
protected Vector relatedEntityMapVector(Code)
Related Entity Map Vector

Each vector element contains a HashMap describing a related entity to be replicated for each instance of the main entity that is replicated.

Each HashMap contains:

String relationTitle
String relatedEntityName
HashMap filterMap
String replicatorClassName
Boolean replicateAll Boolean removeAll




userInfo
protected UserInfo userInfo(Code)
User Information




Constructor Detail
EntityReplicator
public EntityReplicator()(Code)
Constructor with no args.



EntityReplicator
public EntityReplicator(GenericDelegator localDelegator, GenericDelegator masterDelegator, String entityName, UserInfo userInfo)(Code)
Constructor with args.
Parameters:
  mainInstance - Main entity instance for which related entities will be replicated
Parameters:
  localDelegator - Delegator to attach to local data base
Parameters:
  masterDelegator - Delegator to attach to master data base
Parameters:
  entityName - Name of the entity to be replicated
Parameters:
  userInfo - UserInfo object containing user information




Method Detail
addRelatedEntityMap
public void addRelatedEntityMap(HashMap relatedEntityMap)(Code)
Adds a related entity map to the related entity map vector.
author:
   John Nutting
Parameters:
  relatedEntityMap - HashMap containing information about a releated entity



addRelatedEntityMap
public void addRelatedEntityMap(String relationTitle, String relatedEntityName, HashMap filterMap, boolean replicateAll, boolean removeAll, String replicatorClassName)(Code)
Adds a related entity map to the related entity map vector.
author:
   John Nutting
Parameters:
  relationTitle - Relation title to be used by the entity engine to find relatedentity instances
Parameters:
  relatedEntityName - Name of the related entity to be replicated
Parameters:
  filterMap - HashMap containing additional filter values to be used by the entityengine when finding related entity instances
Parameters:
  replicateAll - Flag indicating to replicate all instances of this entityinstead of just the ones related to the main entity.
Parameters:
  removeAll - Flag indicating to remove all instances of this entity instead ofjust the ones related to the main entity.
Parameters:
  replicatorClassName - Name of a descendant class of this class which will be usedto replicate the related entity instances



findOneRelated
protected List findOneRelated(GenericDelegator delegator, GenericValue mainInstance, String relationTitle, String relatedEntityName, HashMap filterMap, boolean findAll)(Code)
This method finds all instances of an entity related to the main entity. This is used for replicating and removing, so it accepts the delegator as an argument to point it to the correct data base.
author:
   John Nutting
Parameters:
  mainInstance - Main entity instance for which related entities will be replicated
Parameters:
  relationTitle - Relation title to be used by the entity engine to find relatedentity instances
Parameters:
  relatedEntityName - Name of the related entity to be replicated
Parameters:
  filterMap - HashMap containing additional filter values to be used by the entityengine when finding related entity instances
Parameters:
  findAll - Flag indicating to find all instances of the entity instead of usinga relation List of generic values related to the main entity instance



getEntityName
public String getEntityName()(Code)
Gets the name of the entity to be replicated.
author:
   John Nutting Name of the entity to be replicated



getEntityReplicator
public static EntityReplicator getEntityReplicator(String className, GenericDelegator localDelegator, GenericDelegator masterDelegator, String entityName, UserInfo userInfo)(Code)
Instantiates EntityReplicator or one of its descendant classes.
Parameters:
  className - The class to be instantiated Object of class specified by className parameter



getRelatedEntityMapVector
public Vector getRelatedEntityMapVector()(Code)
Gets the related entity map vector.
author:
   John Nutting Related entity map vector.



getUserInfo
public UserInfo getUserInfo()(Code)
Gets the user information
author:
   John Nutting UserInfo object



insertLocalInstance
public int insertLocalInstance(GenericValue masterInstance)(Code)
This method stores the instance in the local data base.
author:
   John Nutting
Parameters:
  masterInstance - Entity instance from the master data base Status. Possible values: STATUS_CONTINUE, STATUS_ERROR, STATUS_CANCELED



populateRelatedEntityMapVector
public void populateRelatedEntityMapVector()(Code)
Populate the related entity map vector. This method is called from the constructors to allow the related entities to be specified before replication begins.
author:
   John Nutting



removeAllRelated
public int removeAllRelated(GenericValue localInstance)(Code)
This method removes all instances for all related entities.

This method uses the relatedEntityMapVector to determine what related entities need to be removed. For each related entity, this method calls removeOneRelated(). Each call to removeOneRelated() calls findOneRelated(), which finds all instances of the specified entity. Then removeOneRelated() calls removeLocalInstance for each instance of the related entity to recursively replicate the tree of instances.
author:
   John Nutting
Parameters:
  localInstance - Local entity from which related entity instances are to be removed Status. Possible values: STATUS_CONTINUE, STATUS_ERROR, STATUS_CANCELED




removeInstance
public int removeInstance(GenericValue mainInstance)(Code)
This method removes one instance of the entity named in the entityName attribute.

First the removeRelatedEntities() method is called so child entity instances can be removed from the local data base. Then the instance passed in the instance argument is removed from the local data base.
author:
   John Nutting
Parameters:
  mainInstance - Entity instance being replicated The status of the replication. Possible values: STATUS_CONTINUE, STATUS_ERROR,STATUS_CANCEL




removeLocalInstance
public int removeLocalInstance(GenericValue localInstance)(Code)
This method removes an instance of the main entity from the local data base.
author:
   John Nutting
Parameters:
  localInstance - Entity instance being removed Status. Possible values: STATUS_CONTINUE, STATUS_ERROR, STATUS_CANCELED



removeOneRelated
protected int removeOneRelated(GenericValue mainInstance, String relationTitle, String relatedEntityName, HashMap filterMap, boolean removeAll, String replicatorClassName)(Code)
This method removes all instances for one entity related to the main entity.

This method calls findOneRelated(), which finds all instances of the related entity. Then this method calls removeInstance for each instance of the related entity to recursively replicate the tree of instances.
author:
   John Nutting
Parameters:
  mainInstance - Main entity instance for which related entities will be replicated
Parameters:
  relationTitle - Relation title to be used by the entity engine to find relatedentity instances
Parameters:
  relatedEntityName - Name of the related entity to be replicated
Parameters:
  filterMap - HashMap containing additional filter values to be used by the entityengine when finding related entity instances
Parameters:
  removeAll - Flag indicating to remove all instances of this entity instead ofjust removing the ones related to the main entity.
Parameters:
  replicatorClassName - Name of a descendant class of this class which will be usedto replicate the related entity instances Status. Possible values: STATUS_CONTINUE, STATUS_ERROR, STATUS_CANCELED




replicateAllRelated
public int replicateAllRelated(GenericValue mainInstance)(Code)
This method replicates all instances for all related entities.

This method uses the relatedEntityMapVector to determine what related entities need to be replicated. For each related entity, this method calls replicateOneRelated(). Each call to replicateOneRelated() calls findOneRelated(), which finds all instances of the specified entity. Then replicateOneRelated() calls replicateInstance for each instance of the related entity to recursively replicate the tree of instances.
author:
   John Nutting
Parameters:
  mainInstance - Main entity instance for which related entities will be replicated Status. Possible values: STATUS_CONTINUE, STATUS_ERROR, STATUS_CANCELED




replicateInstance
public int replicateInstance(GenericValue mainInstance)(Code)
This method replicates one instance of the entity named in the entityName attribute.

Ths instance passed in the instance argument is copied from the master data base to the local data base. Then the replicateRelatedEntities() method is called so child entity instance can be replicated.

This method requires that all arguments passed to the constructor were not null and not empty. Alternatively, this method requires the setEntityName, setLocalDelegator, and setMasterDelegator methods to have been called since construction.
author:
   John Nutting
Parameters:
  mainInstance - Entity instance being replicated The status of the replication. Possible values: STATUS_CONTINUE, STATUS_ERROR,STATUS_CANCEL




replicateOneRelated
protected int replicateOneRelated(GenericValue mainInstance, String relationTitle, String relatedEntityName, HashMap filterMap, boolean replicateAll, String replicatorClassName)(Code)
This method replicates all instances for one entity related to the main entity.

This method calls findOneRelated(), which finds all instances of the related entity. Then this method calls replicateInstance for each instance of the related entity to recursively replicate the tree of instances.
author:
   John Nutting
Parameters:
  mainInstance - Main entity instance for which related entities will be replicated
Parameters:
  relationTitle - Relation title to be used by the entity engine to find relatedentity instances
Parameters:
  relatedEntityName - Name of the related entity to be replicated
Parameters:
  filterMap - HashMap containing additional filter values to be used by the entityengine when finding related entity instances
Parameters:
  replicatorClassName - Name of a descendant class of this class which will be usedto replicate the related entity instances Status. Possible values: STATUS_CONTINUE, STATUS_ERROR, STATUS_CANCELED




setEntityName
public void setEntityName(String entityName_)(Code)
Sets the name of the entity to be replicated.
author:
   John Nutting
Parameters:
  entityName_ - Name of the entity to be replicated



setUserInfo
public void setUserInfo(UserInfo userInfo_)(Code)
Sets the user information
author:
   John Nutting
Parameters:
  userInfo_ - UserInfo object



Fields inherited from com.sourcetap.sfa.replication.GenericReplicator
final public static int ACTION_DELETE(Code)(Java Doc)
final public static int ACTION_ERROR(Code)(Java Doc)
final public static int ACTION_INSERT(Code)(Java Doc)
final public static int ACTION_SKIP(Code)(Java Doc)
final public static int ACTION_UPDATE(Code)(Java Doc)
final public static int STATUS_CANCELED(Code)(Java Doc)
final public static int STATUS_CONTINUE(Code)(Java Doc)
final public static int STATUS_ERROR(Code)(Java Doc)
protected GenericDelegator localDelegator(Code)(Java Doc)
protected GenericDelegator masterDelegator(Code)(Java Doc)
final public static String module(Code)(Java Doc)

Methods inherited from com.sourcetap.sfa.replication.GenericReplicator
public static boolean getIsRegistered(GenericDelegator delegator)(Code)(Java Doc)
public GenericDelegator getLocalDelegator()(Code)(Java Doc)
public GenericDelegator getMasterDelegator()(Code)(Java Doc)
public static String getNextSeqId(String seqName, GenericDelegator delegator)(Code)(Java Doc)
public GenericValue getReplNodeGenericValue(String replNodeId)(Code)(Java Doc)
public static String getReplNodeId(GenericDelegator localDelegator)(Code)(Java Doc)
public String getReplNodeId()(Code)(Java Doc)
public int markNodeReplicated(String replNodeId, String userPartyId)(Code)(Java Doc)
public String register(String replNodeName, String ownerId, boolean isActive, String userPartyId)(Code)(Java Doc)
public void setLocalDelegator(GenericDelegator delegator)(Code)(Java Doc)
public void setMasterDelegator(GenericDelegator delegator)(Code)(Java Doc)
public String validateMasterLogin(String enteredUserLoginId, String enteredPassword, UserInfo masterUserInfo)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.