Changeset 713
- Timestamp:
- 04/28/11 18:53:39 (2 years ago)
- Location:
- raptor-client/trunk/src/main/java/uk/ac/cardiff/raptor
- Files:
-
- 1 added
- 9 edited
-
event/expansion/AttributeAssociationDefinition.java (modified) (6 diffs)
-
event/expansion/AttributeAssociationEngine.java (modified) (2 diffs)
-
event/expansion/connector/DataConnector.java (modified) (1 diff)
-
event/expansion/connector/LdapDataConnector.java (modified) (10 diffs)
-
remoting/client/ReleaseFailureException.java (modified) (1 diff)
-
remoting/client/sei/impl/CxfServiceEndpointClient.java (modified) (2 diffs)
-
store/AsynchronousEntryStoragePipeline.java (modified) (3 diffs)
-
store/StorageEngine.java (modified) (4 diffs)
-
store/TransactionInProgressException.java (added)
-
store/impl/PersistantEntryHandler.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
raptor-client/trunk/src/main/java/uk/ac/cardiff/raptor/event/expansion/AttributeAssociationDefinition.java
r707 r713 5 5 6 6 import java.util.List; 7 7 import java.util.Map; 8 9 import org.slf4j.Logger; 10 import org.slf4j.LoggerFactory; 11 12 import uk.ac.cardiff.model.event.Event; 8 13 import uk.ac.cardiff.raptor.event.expansion.connector.AttributeAssociationException; 14 import uk.ac.cardiff.raptor.event.expansion.connector.DataConnector; 15 import uk.ac.cardiff.raptor.runtimeutils.ReflectionHelper; 9 16 10 17 /** … … 14 21 public class AttributeAssociationDefinition { 15 22 23 /** Class logger. */ 24 private final Logger log = LoggerFactory.getLogger(AttributeAssociationDefinition.class); 25 26 /** Human readable name for this definition*/ 27 private String definiationName; 28 16 29 /** The name of the field the subject's principal should be extracted from*/ 17 30 private String subjectPrincipalField; … … 19 32 private List<AttributeLookup> lookupAttributes; 20 33 34 /** Whether to apply the attribute association*/ 35 private boolean enabled; 36 21 37 /** The class type that these attribute definitions are attached to*/ 22 private Class internalModelClass; 23 38 private Class<?> classToAdd; 39 40 /** The class type that this attribute association is applicable for */ 41 private String associateWithClass; 42 43 /** The data connector used to acquire the attributes*/ 44 private DataConnector dataConnector; 45 46 /** The ldap search filter template*/ 47 private String searchFilterTemplate; 24 48 25 49 /** … … 35 59 } 36 60 61 public void initialise(){ 62 dataConnector.initialise(); 63 64 } 37 65 38 66 … … 50 78 51 79 80 private void populate(Map<String,String> attributes, Event event) throws InstantiationException, IllegalAccessException{ 81 82 Object classToPopulate = getClassToAdd().newInstance(); 83 84 for (Map.Entry<String,String> entry : attributes.entrySet()){ 85 String attributeSourceName = entry.getKey(); 86 String attributeValue = entry.getValue(); 87 log.trace("source [{}], value [{}]",attributeSourceName,attributeValue); 88 try{ 89 String internalFieldName = getInternalAttributeName(attributeSourceName); 90 ReflectionHelper.setValueOnObject(internalFieldName, attributeValue, classToPopulate); 91 } 92 catch(AttributeAssociationException e){ 93 log.warn("Error trying to populate internal model. {}",e.getMessage()); 94 } 95 } 96 97 //now attach the object where appropriate on the current <code>Event</code> object 98 ReflectionHelper.attachObjectTo(classToPopulate,event); 99 100 // log.debug("{}",event); 101 } 102 103 /** 104 * @param event 105 */ 106 public boolean associate(Event event) { 107 // log.debug("{},v {}",event.getClass().getCanonicalName(),associateWithClass.getClass().getCanonicalName()); 108 if (!event.getClass().getCanonicalName().equals(associateWithClass)){ 109 return false; 110 } 111 112 Object principalObject = ReflectionHelper.getValueFromObject(getSubjectPrincipalField(), event); 113 String principal = null; 114 if (principalObject instanceof String){ 115 principal = (String)principalObject; 116 } 117 if (principal!=null){ 118 try { 119 dataConnector.setReturnAttributes(getSourceAttributesAsArray()); 120 dataConnector.setSearchFilterTemplate(searchFilterTemplate); 121 Map<String, String> attributes = dataConnector.lookup(principal); 122 populate(attributes,event); 123 124 return true; 125 } catch (AttributeAssociationException e) { 126 log.error("Association error for principal [{}]",principal,e); 127 } catch (InstantiationException e) { 128 log.warn("Could not populate event [{}], {}",event,e.getMessage()); 129 } catch (IllegalAccessException e) { 130 log.warn("Could not populate event [{}], {}",event,e.getMessage()); 131 } 132 } 133 return false; 134 135 } 136 137 138 52 139 /** 53 140 * @param subjectPrincipalField the subjectPrincipalField to set … … 78 165 } 79 166 80 81 82 /** 83 * @param internalModelClass the internalModelClass to set 84 */ 85 public void setInternalModelClass(Class internalModelClass) { 86 this.internalModelClass = internalModelClass; 87 } 88 89 90 91 /** 92 * @return the internalModelClass 93 */ 94 public Class getInternalModelClass() { 95 return internalModelClass; 96 } 97 98 167 /** 168 * @param enabled the enabled to set 169 */ 170 public void setEnabled(boolean enabled) { 171 this.enabled = enabled; 172 } 173 174 175 176 /** 177 * @return the enabled 178 */ 179 public boolean isEnabled() { 180 return enabled; 181 } 182 183 184 185 /** 186 * @param dataConnector the dataConnector to set 187 */ 188 public void setDataConnector(DataConnector dataConnector) { 189 this.dataConnector = dataConnector; 190 } 191 192 193 194 /** 195 * @return the dataConnector 196 */ 197 public DataConnector getDataConnector() { 198 return dataConnector; 199 } 200 201 202 203 /** 204 * @param searchFilterTemplate the searchFilterTemplate to set 205 */ 206 public void setSearchFilterTemplate(String searchFilterTemplate) { 207 this.searchFilterTemplate = searchFilterTemplate; 208 } 209 210 211 212 /** 213 * @return the searchFilterTemplate 214 */ 215 public String getSearchFilterTemplate() { 216 return searchFilterTemplate; 217 } 218 219 220 221 /** 222 * @param definiationName the definiationName to set 223 */ 224 public void setDefiniationName(String definiationName) { 225 this.definiationName = definiationName; 226 } 227 228 229 230 /** 231 * @return the definiationName 232 */ 233 public String getDefiniationName() { 234 return definiationName; 235 } 236 237 /** 238 * @param classToAdd the classToAdd to set 239 */ 240 public void setClassToAdd(Class<?> classToAdd) { 241 this.classToAdd = classToAdd; 242 } 243 244 /** 245 * @return the classToAdd 246 */ 247 public Class<?> getClassToAdd() { 248 return classToAdd; 249 } 250 251 /** 252 * @param associateWithClass the associateWithClass to set 253 */ 254 public void setAssociateWithClass(String associateWithClass) { 255 this.associateWithClass = associateWithClass; 256 } 257 258 /** 259 * @return the associateWithClass 260 */ 261 public String getAssociateWithClass() { 262 return associateWithClass; 263 } 99 264 100 265 -
raptor-client/trunk/src/main/java/uk/ac/cardiff/raptor/event/expansion/AttributeAssociationEngine.java
r709 r713 41 41 42 42 /** Defines which attributes to add, and what principal to attach to*/ 43 private AttributeAssociationDefinition attributeAssociationDefinition; 44 45 private DataConnector dataConnector; 43 private List<AttributeAssociationDefinition> attributeAssociationDefinitions; 46 44 47 45 /** … … 52 50 } 53 51 54 55 52 /** 56 53 * Gets associated attributes for the given ... 57 54 */ 58 55 public void associateAttributes(List<Event> events) throws AttributeAssociationException{ 59 log.info("Has Attribute Definition [{}]",attributeAssociationDefinition!=null); 60 if (attributeAssociationDefinition==null){ 61 throw new AttributeAssociationException("Attribute association not specified"); 56 57 for (AttributeAssociationDefinition attributeAssociationDefinition: attributeAssociationDefinitions){ 58 log.info("Attribute Association Definition [{}], is enabled [{}]",attributeAssociationDefinition.getDefiniationName(), attributeAssociationDefinition.isEnabled()); 59 60 if (!attributeAssociationDefinition.isEnabled()){ 61 continue; 62 } 63 64 int attached=0; 65 int noPrincipal=0; 66 int current=0; 67 final int noOfEvents = events.size(); 68 for (Event event : events){ 69 printProgressPosition(current, noOfEvents); 70 boolean associated = attributeAssociationDefinition.associate(event); 71 if (associated){ 72 attached++; 73 } 74 else{ 75 noPrincipal++; 76 } 77 current++; 78 } 79 log.info("Attribute Association Definition {} finished, associated information to {} events, where {} events where not of a valid class type or did not have the correct principal", 80 new Object[]{attributeAssociationDefinition.getDefiniationName(),attached,noPrincipal}); 62 81 } 63 64 log.info("Attribute Association started for principal field [{}]",attributeAssociationDefinition.getSubjectPrincipalField());65 66 int attached=0;67 int noPrincipal=0;68 for (Event event : events){69 Object principalObject = ReflectionHelper.getValueFromObject(attributeAssociationDefinition.getSubjectPrincipalField(), event);70 String principal = null;71 if (principalObject instanceof String){72 principal = (String)principalObject;73 }74 if (principal!=null){75 try {76 dataConnector.setReturnAttributes(attributeAssociationDefinition.getSourceAttributesAsArray());77 Map<String, String> attributes = dataConnector.lookup(principal);78 populate(attributes,event);79 attached++;80 } catch (AttributeAssociationException e) {81 log.error("Association error for principal [{}]",principal,e);82 } catch (InstantiationException e) {83 log.warn("Could not populate event [{}], {}",event,e.getMessage());84 } catch (IllegalAccessException e) {85 log.warn("Could not populate event [{}], {}",event,e.getMessage());86 }87 }88 else{89 noPrincipal++;90 }91 }92 log.info("Associated information to {} events, where {} events did not have a valid principal",attached,noPrincipal);93 }94 95 private void populate(Map<String,String> attributes, Event event) throws InstantiationException, IllegalAccessException{96 97 Object classToPopulate = attributeAssociationDefinition.getInternalModelClass().newInstance();98 99 for (Map.Entry<String,String> entry : attributes.entrySet()){100 String attributeSourceName = entry.getKey();101 String attributeValue = entry.getValue();102 log.trace("source [{}], value [{}]",attributeSourceName,attributeValue);103 try{104 String internalFieldName = attributeAssociationDefinition.getInternalAttributeName(attributeSourceName);105 ReflectionHelper.setValueOnObject(internalFieldName, attributeValue, classToPopulate);106 }107 catch(AttributeAssociationException e){108 log.warn("Error trying to populate internal model. {}",e.getMessage());109 }110 }111 112 //now attach the object where approppriate on the current <code>Event</code> object113 ReflectionHelper.attachObjectTo(classToPopulate,event);114 115 log.debug("{}",event);116 }117 118 /**119 * @param attributeAssociationDefinition the attributeAssociationDefinition to set120 */121 public void setAttributeAssociationDefinition(AttributeAssociationDefinition attributeAssociationDefinition) {122 this.attributeAssociationDefinition = attributeAssociationDefinition;123 }124 125 /**126 * @return the attributeAssociationDefinition127 */128 public AttributeAssociationDefinition getAttributeAssociationDefinition() {129 return attributeAssociationDefinition;130 82 } 131 83 132 84 133 85 /** 134 * @param dataConnector the dataConnector to set 86 * Prints, as a percentage of the total, the event currently being processed. 87 * 88 * @param lineCount 89 * @param totalNoLines 135 90 */ 136 public void setDataConnector(DataConnector dataConnector) { 137 this.dataConnector = dataConnector; 138 dataConnector.initialise(); 91 private void printProgressPosition(int lineCount, int totalNoLines) { 92 double linePercentage = (((double) lineCount / (double) totalNoLines) * 100); 93 if (linePercentage % 25 >= 0 && linePercentage % 25 <= 0.003) 94 log.debug("Attribute Association, Complete {}%", linePercentage); 139 95 } 140 96 97 /** 98 * Also initialises the definitions 99 * 100 * @param attributeAssociationDefinitions the attributeAssociationDefinitions to set 101 */ 102 public void setAttributeAssociationDefinitions(List<AttributeAssociationDefinition> attributeAssociationDefinitions) { 103 this.attributeAssociationDefinitions = attributeAssociationDefinitions; 104 for (AttributeAssociationDefinition definition : attributeAssociationDefinitions){ 105 definition.initialise(); 106 } 107 } 141 108 142 109 /** 143 * @return the dataConnector110 * @return the attributeAssociationDefinitions 144 111 */ 145 public DataConnector getDataConnector() {146 return dataConnector;112 public List<AttributeAssociationDefinition> getAttributeAssociationDefinitions() { 113 return attributeAssociationDefinitions; 147 114 } 148 115 149 116 150 117 118 151 119 } -
raptor-client/trunk/src/main/java/uk/ac/cardiff/raptor/event/expansion/connector/DataConnector.java
r707 r713 18 18 public void setReturnAttributes(String[] s); 19 19 20 public void setSearchFilterTemplate(String searchFilterTemplate); 21 20 22 } -
raptor-client/trunk/src/main/java/uk/ac/cardiff/raptor/event/expansion/connector/LdapDataConnector.java
r707 r713 42 42 import net.shibboleth.idp.attribute.resolver.BaseDataConnector; 43 43 44 import org.joda.time.DateTime; 44 45 import org.opensaml.xml.security.x509.X509Credential; 45 46 import org.opensaml.xml.util.DatatypeHelper; … … 48 49 import org.springframework.context.ApplicationEvent; 49 50 import org.springframework.context.ApplicationListener; 51 52 import uk.ac.cardiff.raptor.event.expansion.AttributeLookup; 50 53 51 54 import edu.vt.middleware.ldap.Ldap; … … 129 132 private String searchFilterTemplate; 130 133 134 /** How long the cache remains valid before it is cleared */ 135 private long cacheTimeoutMs; 136 137 /** The time at which the cache was last reset*/ 138 private long cacheResetTimeMs; 131 139 132 140 /** … … 141 149 */ 142 150 public void initialise() { 143 initialized = true; 144 initializeLdapPool(); 145 initializeCache(); 151 if (!initialized){ 152 initialized = true; 153 initializeLdapPool(); 154 initializeCache(); 155 } 146 156 } 147 157 … … 163 173 if (cacheResults && initialized) { 164 174 cache = new HashMap<String, Map<String, Map<String, String>>>(); 175 cacheResetTimeMs = System.currentTimeMillis(); 165 176 } 166 177 } … … 172 183 if (cacheResults && initialized) { 173 184 cache.clear(); 185 cacheResetTimeMs = System.currentTimeMillis(); 174 186 } 175 187 } … … 289 301 public void setSslSocketFactory(SSLSocketFactory sf) { 290 302 ldapConfig.setSslSocketFactory(sf); 291 clearCache();292 initializeLdapPool();293 303 } 294 304 … … 676 686 } 677 687 688 private void checkCacheValidity(){ 689 if (cacheTimeoutMs==0 || !cacheResults){ 690 return; 691 } 692 long currentTimeMillis = System.currentTimeMillis(); 693 boolean shouldReset = (currentTimeMillis - cacheResetTimeMs) > cacheTimeoutMs; 694 if (shouldReset){ 695 log.info("Ldap cache was cleared, timeout reached"); 696 clearCache(); 697 } 698 } 699 678 700 679 701 /** {@inheritDoc} */ 680 702 public Map<String, String> lookup(String principal) throws AttributeAssociationException { 703 681 704 String searchFilter = searchFilterTemplate.replace("[principal]",principal); 682 683 705 searchFilter = searchFilter.trim(); 684 log.debug("Search filter: {}", searchFilter); 706 //log.debug("Search: "+searchFilter); 707 //check if cache is still valid 708 checkCacheValidity(); 685 709 686 710 // create Attribute objects to return … … 688 712 689 713 // check for cached data 690 // if (cacheResults) { 691 // log.debug("Checking cache for search results"); 692 // attributes = getCachedAttributes(resolutionContext, searchFilter); 693 // if (attributes != null && log.isDebugEnabled()) { 694 // log.debug("Returning attributes from cache"); 695 // } 696 // } 714 if (cacheResults) { 715 attributes = getCachedAttributes(principal, searchFilter); 716 } 697 717 698 718 // results not found in the cache 699 719 if (attributes == null) { 700 //log.debug("Retrieving attributes from LDAP");701 720 Iterator<SearchResult> results = searchLdap(searchFilter); 702 721 // check for empty result set 703 722 if (noResultsIsError && !results.hasNext()) { 704 throw new AttributeAssociationException("No LDAP entry found for scmps2");723 throw new AttributeAssociationException("No LDAP entry found for "+principal); 705 724 } 706 725 // build resolved attributes from LDAP attributes 707 726 attributes = buildBaseAttributes(results); 708 //if (cacheResults && attributes != null) {709 // setCachedAttributes(resolutionContext, searchFilter, attributes);710 //log.debug("Stored results in the cache");711 //}727 if (cacheResults && attributes != null) { 728 setCachedAttributes(principal, searchFilter, attributes); 729 //log.debug("Stored results in the cache"); 730 } 712 731 } 713 732 … … 866 885 867 886 868 // /** 869 // * This stores the supplied attributes in the cache. 870 // * 871 // * @param resolutionContext <code>ResolutionContext</code> 872 // * @param searchFiler the searchFilter that produced the attributes 873 // * @param attributes <code>Map</code> of attribute ids to attributes 874 // */ 875 // protected void setCachedAttributes(AttributeResolutionContext resolutionContext, String searchFiler, 876 // Map<String, Attribute> attributes) { 877 // Map<String, Map<String, Attribute>> results = null; 878 // String principal = resolutionContext.getAttributeRequestContext().getPrincipalName(); 879 // if (cache.containsKey(principal)) { 880 // results = cache.get(principal); 881 // } else { 882 // results = new HashMap<String, Map<String, Attribute>>(); 883 // cache.put(principal, results); 884 // } 885 // results.put(searchFiler, attributes); 886 // } 887 888 // /** 889 // * This retrieves any cached attributes for the supplied resolution context. Returns null if nothing is cached. 890 // * 891 // * @param resolutionContext <code>ResolutionContext</code> 892 // * @param searchFilter the search filter the produced the attributes 893 // * 894 // * @return <code>Map</code> of attributes ids to attributes 895 // */ 896 // protected Map<String, Attribute> getCachedAttributes(AttributeResolutionContext resolutionContext, 897 // String searchFilter) { 898 // Map<String, Attribute> attributes = null; 899 // if (cacheResults) { 900 // String principal = resolutionContext.getAttributeRequestContext().getPrincipalName(); 901 // if (cache.containsKey(principal)) { 902 // Map<String, Map<String, Attribute>> results = cache.get(principal); 903 // attributes = results.get(searchFilter); 904 // } 905 // } 906 // return attributes; 907 // } 887 /** 888 * This stores the supplied attributes in the cache. 889 * 890 * @param principalName 891 * @param searchFiler the searchFilter that produced the attributes 892 * @param attributes <code>Map</code> of attribute ids to attributes 893 */ 894 protected void setCachedAttributes(String principalName, String searchFiler, Map<String, String> attributes) { 895 Map<String, Map<String, String>> results = null; 896 if (cache.containsKey(principalName)) { 897 results = cache.get(principalName); 898 } else { 899 results = new HashMap<String, Map<String, String>>(); 900 cache.put(principalName, results); 901 } 902 results.put(searchFiler, attributes); 903 } 904 905 /** 906 * This retrieves any cached attributes for the supplied resolution context. Returns null if nothing is cached. 907 * 908 * @param principalName 909 * @param searchFilter the search filter the produced the attributes 910 * 911 * @return <code>Map</code> of attributes ids to attributes 912 */ 913 protected Map<String, String> getCachedAttributes(String principalName, 914 String searchFilter) { 915 Map<String, String> attributes = null; 916 if (cacheResults) { 917 if (cache.containsKey(principalName)) { 918 Map<String, Map<String, String>> results = cache.get(principalName); 919 attributes = results.get(searchFilter); 920 } 921 } 922 return attributes; 923 } 924 925 /** 926 * @param cacheTimeoutMs the cacheTimeoutMs to set 927 */ 928 public void setCacheTimeoutMs(long cacheTimeoutMs) { 929 this.cacheTimeoutMs = cacheTimeoutMs; 930 } 931 932 /** 933 * @return the cacheTimeoutMs 934 */ 935 public long getCacheTimeoutMs() { 936 return cacheTimeoutMs; 937 } 908 938 909 939 -
raptor-client/trunk/src/main/java/uk/ac/cardiff/raptor/remoting/client/ReleaseFailureException.java
r672 r713 22 22 */ 23 23 private static final long serialVersionUID = -1091443418866759066L; 24 25 public ReleaseFailureException (String message, Exception e){26 super (message, e);24 25 public ReleaseFailureException (String message, Exception wrappedException){ 26 super (message,wrappedException); 27 27 } 28 28 -
raptor-client/trunk/src/main/java/uk/ac/cardiff/raptor/remoting/client/sei/impl/CxfServiceEndpointClient.java
r656 r713 43 43 44 44 import uk.ac.cardiff.model.event.AuthenticationEvent; 45 import uk.ac.cardiff.model.event.EzproxyAuthenticationEvent; 46 import uk.ac.cardiff.model.event.EzproxyProxyEvent; 47 import uk.ac.cardiff.model.event.OpenathenslaAuthenticationEvent; 45 48 import uk.ac.cardiff.model.event.ShibbolethIdpAuthenticationEvent; 46 49 import uk.ac.cardiff.model.wsmodel.EventPushMessage; … … 72 75 overrides.add(ShibbolethIdpAuthenticationEvent.class.getName()); 73 76 overrides.add(AuthenticationEvent.class.getName()); 77 overrides.add(EzproxyAuthenticationEvent.class.getName()); 78 overrides.add(OpenathenslaAuthenticationEvent.class.getName()); 74 79 databinding.setOverrideTypes(overrides); 75 80 76 81 for (String typeName : overrides) { 77 Class c = null;82 Class<?> c = null; 78 83 try { 79 84 c = ClassLoaderUtils.loadClass(typeName, TypeUtil.class); -
raptor-client/trunk/src/main/java/uk/ac/cardiff/raptor/store/AsynchronousEntryStoragePipeline.java
r699 r713 28 28 29 29 30 public class AsynchronousEntryStoragePipeline implements StoreEntriesTaskCallbackInterface{30 public class AsynchronousEntryStoragePipeline { 31 31 32 32 /** class logger */ … … 48 48 } 49 49 50 public void storageResultCallback(Object result) {51 log.debug("Storage task completed {}, for transaction id [{}]",result, transactionId);52 53 }54 55 50 /** 56 51 * Starts and shuts down the <code>storeEntryTask</code> immediately, so that when it completes … … 59 54 * @param events 60 55 */ 61 public void execute(List<Event> events ){62 StoreEntriesPipelineTask storeEntryTask = new StoreEntriesPipelineTask(entryHandler, attributeAssociationEngine, events, this);56 public void execute(List<Event> events, StoreEntriesTaskCallbackInterface callback){ 57 StoreEntriesPipelineTask storeEntryTask = new StoreEntriesPipelineTask(entryHandler, attributeAssociationEngine, events,callback); 63 58 ExecutorService es = Executors.newSingleThreadExecutor(); 64 59 es.submit(storeEntryTask); -
raptor-client/trunk/src/main/java/uk/ac/cardiff/raptor/store/StorageEngine.java
r699 r713 31 31 * 32 32 */ 33 public class StorageEngine {33 public class StorageEngine implements StoreEntriesTaskCallbackInterface{ 34 34 35 35 /** Class logger*/ … … 43 43 private AttributeAssociationEngine attributeAssociationEngine; 44 44 45 /** The ID of the currently executing transaction */ 46 private int currentTransactionId; 47 48 /** Whether a transaction is currently in progress*/ 49 private boolean transactionInProgress; 45 50 46 51 /** Default Constructor*/ 47 52 public StorageEngine(){ 53 transactionInProgress=false; 54 } 48 55 56 public void storageResultCallback(Object result) { 57 log.debug("Storage task completed {}, for transaction id [{}]",result, currentTransactionId); 58 transactionInProgress=false; 49 59 } 50 60 … … 52 62 * @param events 53 63 */ 54 public void performAsynchronousEntryStoragePipeline(int transactionId, List<Event> events){ 64 public void performAsynchronousEntryStoragePipeline(int transactionId, List<Event> events) throws TransactionInProgressException{ 65 if (transactionInProgress){ 66 throw new TransactionInProgressException("Transaction "+currentTransactionId+" currently in processing"); 67 } 68 log.info("Committing {} entries to the storage engine, with transaction id [{}]", events.size(),transactionId); 69 transactionInProgress=true; 70 this.currentTransactionId = transactionId; 55 71 AsynchronousEntryStoragePipeline asyncEntryStorage = new AsynchronousEntryStoragePipeline(transactionId, entryHandler,attributeAssociationEngine); 56 asyncEntryStorage.execute(events );72 asyncEntryStorage.execute(events,this); 57 73 } 58 74 … … 103 119 104 120 121 122 105 123 } -
raptor-client/trunk/src/main/java/uk/ac/cardiff/raptor/store/impl/PersistantEntryHandler.java
r707 r713 121 121 hashcode = ((Integer) ReflectionHelper.getValueFromObject("hashCode", event)).intValue(); 122 122 } catch (Exception e) { 123 log.error("Could not get hashcode for event {}, event not stored" );123 log.error("Could not get hashcode for event {}, event not stored", event); 124 124 continue; 125 125 }
Note: See TracChangeset
for help on using the changeset viewer.
