com.trendmicro.grid.acl.ds.jpa
Class AbstractReceivedResultsHandler<T>

java.lang.Object
  extended by com.trendmicro.grid.acl.ds.jpa.AbstractReceivedResultsHandler<T>
Direct Known Subclasses:
AbstractReceivedFileContentsHandler, ReceivedPackageFamiliesHandler, ReceivedSourcesHandler

public abstract class AbstractReceivedResultsHandler<T>
extends Object

Is the abstract base to implementations that handle aspects of the storage of processing results.

Version:
1.0
Author:
juergen_kellerer, 2010-11-22

Nested Class Summary
protected static class AbstractReceivedResultsHandler.StorageContext
          Defines a storage context for handlers that summarizes the information needed to process a single transaction.
 
Constructor Summary
AbstractReceivedResultsHandler()
           
 
Method Summary
protected static boolean getValue(net.sf.tinyjee.config.PropertySection section, String property)
          Shortcut to retrieve a boolean value form the given property section.
protected abstract  T handle(AbstractReceivedResultsHandler.StorageContext context)
          Handles the job in relation to the given storage context.
protected static boolean isAfter(Date reference, Date dateToCheck)
          If a null safe compare method for 2 dataes.
protected static boolean isNull(com.trendmicro.grid.acl.metadata.Metadata metadata)
          Checks whether the given metadata element can be considered to be null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractReceivedResultsHandler

public AbstractReceivedResultsHandler()
Method Detail

isNull

protected static boolean isNull(com.trendmicro.grid.acl.metadata.Metadata metadata)
Checks whether the given metadata element can be considered to be null.

Parameters:
metadata - the metadata element to check.
Returns:
true if the element equals to 'null'.

isAfter

protected static boolean isAfter(Date reference,
                                 Date dateToCheck)
If a null safe compare method for 2 dataes.

Parameters:
reference - the reference data to verify whether dataToCheck is after it.
dateToCheck - the date the check against reference date.
Returns:
true if dateToCheck is after the reference date or when reference == null && dateToCheck != null.

getValue

protected static boolean getValue(net.sf.tinyjee.config.PropertySection section,
                                  String property)
Shortcut to retrieve a boolean value form the given property section.

Parameters:
section - the section to read from.
property - the key of the value to extract.
Returns:
true if the value was set and true.

handle

protected abstract T handle(AbstractReceivedResultsHandler.StorageContext context)
Handles the job in relation to the given storage context.

Parameters:
context - the data set to handle.
Returns:
an arbitrary value that may be used by downstream handlers, or 'null' if not relevant.