org.jwall.audit.processor
Class DNSLookup

java.lang.Object
  extended by stream.AbstractProcessor
      extended by org.jwall.audit.processor.DNSLookup
All Implemented Interfaces:
EventProcessor<AuditEvent>, stream.Processor, stream.StatefulProcessor

public class DNSLookup
extends stream.AbstractProcessor
implements EventProcessor<AuditEvent>

A simple processor to enrich events by looking up the REMOTE_ADDR in the DNS service and placing the resolved name in REMOTE_HOST.

Author:
Christian Bockermann <chris@jwall.org>

Field Summary
 
Fields inherited from interface org.jwall.audit.EventProcessor
DELETE_FLAG
 
Constructor Summary
DNSLookup()
           
 
Method Summary
 Integer getCacheSize()
           
 String getKey()
           
 String getTarget()
           
 String lookup(String host)
           
 stream.data.Data process(stream.data.Data data)
           
 AuditEvent processEvent(AuditEvent event, Map<String,Object> context)
          This method is called upon event reception.
 String reverseLookup(String addr)
           
 void setCacheSize(Integer cacheSize)
           
 void setKey(String key)
           
 void setTarget(String target)
           
 
Methods inherited from class stream.AbstractProcessor
finish, init, resetState
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DNSLookup

public DNSLookup()
Method Detail

getKey

public String getKey()

setKey

public void setKey(String key)

getTarget

public String getTarget()

setTarget

public void setTarget(String target)

getCacheSize

public Integer getCacheSize()

setCacheSize

public void setCacheSize(Integer cacheSize)

reverseLookup

public String reverseLookup(String addr)

lookup

public String lookup(String host)

process

public stream.data.Data process(stream.data.Data data)
Specified by:
process in interface stream.Processor

processEvent

public AuditEvent processEvent(AuditEvent event,
                               Map<String,Object> context)
                        throws Exception
Description copied from interface: EventProcessor
This method is called upon event reception. The given map provides a context to communicate data between several event-processors. The implementor of this interface needs to take care that calls to this class my come from different threads, i.e. no state should be stored in the class to diminish the risk of concurrency problems.

Specified by:
processEvent in interface EventProcessor<AuditEvent>
Returns:
Throws:
Exception


Copyright © 2012 jwall.org. All Rights Reserved.