1 25 package org.ofbiz.entity.config; 26 27 import java.util.HashMap ; 28 import java.util.Iterator ; 29 import java.util.List ; 30 import java.util.Map ; 31 32 import org.ofbiz.base.util.UtilValidate; 33 import org.ofbiz.base.util.UtilXml; 34 import org.w3c.dom.Element ; 35 36 44 public class DelegatorInfo extends NamedInfo { 45 46 public String entityModelReader; 47 public String entityGroupReader; 48 public String entityEcaReader; 49 public boolean useEntityEca; 50 public String entityEcaHandlerClassName; 51 public boolean useDistributedCacheClear; 52 public String distributedCacheClearClassName; 53 public String distributedCacheClearUserLoginId; 54 public String sequencedIdPrefix; 55 public Map groupMap = new HashMap (); 56 57 public DelegatorInfo(Element element) { 58 super(element); 59 this.entityModelReader = element.getAttribute("entity-model-reader"); 60 this.entityGroupReader = element.getAttribute("entity-group-reader"); 61 this.entityEcaReader = element.getAttribute("entity-eca-reader"); 62 63 this.useEntityEca = !"false".equalsIgnoreCase(element.getAttribute("entity-eca-enabled")); 65 this.entityEcaHandlerClassName = element.getAttribute("entity-eca-handler-class-name"); 66 67 this.useDistributedCacheClear = "true".equalsIgnoreCase(element.getAttribute("distributed-cache-clear-enabled")); 69 this.distributedCacheClearClassName = element.getAttribute("distributed-cache-clear-class-name"); 70 if (UtilValidate.isEmpty(this.distributedCacheClearClassName)) this.distributedCacheClearClassName = "org.ofbiz.entityext.cache.EntityCacheServices"; 71 72 this.distributedCacheClearUserLoginId = element.getAttribute("distributed-cache-clear-user-login-id"); 73 if (UtilValidate.isEmpty(this.distributedCacheClearUserLoginId)) this.distributedCacheClearUserLoginId= "admin"; 74 75 this.sequencedIdPrefix = element.getAttribute("sequenced-id-prefix"); 76 77 List groupMapList = UtilXml.childElementList(element, "group-map"); 78 Iterator groupMapIter = groupMapList.iterator(); 79 80 while (groupMapIter.hasNext()) { 81 Element groupMapElement = (Element ) groupMapIter.next(); 82 groupMap.put(groupMapElement.getAttribute("group-name"), groupMapElement.getAttribute("datasource-name")); 83 } 84 } 85 } 86 | Popular Tags |