Changeset 785


Ignore:
Timestamp:
05/12/11 00:16:03 (8 years ago)
Author:
philsmart
Message:
 
Location:
raptor-client/trunk/src/main/java/uk/ac/cardiff/raptor/attribute/filtering
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • raptor-client/trunk/src/main/java/uk/ac/cardiff/raptor/attribute/filtering/AttributeRule.java

    r783 r785  
    4646 
    4747    protected Object getValueForObject(Event event, String attributeID) { 
    48         return ReflectionHelper.getValueFromObject(attributeID, event); 
     48        Object result = ReflectionHelper.getValueFromObject(attributeID, event); 
     49        return result; 
    4950    } 
    5051 
  • raptor-client/trunk/src/main/java/uk/ac/cardiff/raptor/attribute/filtering/AttrributeFilterEngine.java

    r783 r785  
    8383 
    8484                List<Event> clonedSet = new ArrayList<Event>(); 
    85  
     85                 
    8686                log.debug("Events cloned"); 
    87                 for (Event entry : events) { 
    88                         //Event newEntry = cloner.deepClone(entry); 
    89                         //clonedSet.add(newEntry); 
     87                for (Event event : events) {                     
     88                        clonedSet.add(event.newInstance()); 
    9089                } 
    91                 return events; 
     90                return clonedSet; 
    9291        } 
    9392 
  • raptor-client/trunk/src/main/java/uk/ac/cardiff/raptor/attribute/filtering/HashAttributeRule.java

    r783 r785  
    3636     */ 
    3737    public void filterAttribute(Event event, ServiceMetadata metadata) throws AttributeFilterException { 
    38         log.debug("Filtering event {}",event); 
    3938        try{ 
    4039            if (classHasAttribute(event, getAttributeId())) { 
    4140                MessageDigest md = MessageDigest.getInstance(HASH_ALGORITHM); 
    42                 md.reset(); 
    4341                Object value = getValueForObject(event, getAttributeId()); 
    44                 log.debug("Value [{}]",metadata.getEntityId()+value); 
    4542                if (value instanceof String){ 
    4643                    String valueAsString = (String) value; 
     
    5249                    this.setValueForObject(event, hashedValue, getAttributeId()); 
    5350                    log.debug("hash: "+number.toString(16)); 
     51                } 
     52                else{ 
     53                        throw new AttributeFilterException("The hash filter requires attributes of type String"); 
    5454                } 
    5555 
Note: See TracChangeset for help on using the changeset viewer.