de.uplanet.lucy.server.newsagent
Interface IFilter

All Known Implementing Classes:
AbstractFilter, AppGuidFilter, AppGuidNullFilter, AppIdFilter, AppIdNullFilter, IdentityFilter, NewsArchiveReceivedFilter, NewsArchiveSentFilter, NotExpiredFilter, RecipientFilter, SingleAppGuidFilter, SingleAppIdFilter

@Scriptable
public interface IFilter

Used for news filtering on collection and / or database level.

Version:
$Revision: 71682 $

Method Summary
 void filter(java.util.List<Message> p_from, java.util.List<Message> p_to)
          Do the filtering, operating on array lists.
 void forConnection(de.uplanet.jdbc.JdbcConnection p_conn)
          Initialize the filter with a database connection.
 void forUser(java.lang.String p_strUserId)
          Prepare the filter for a specific user.
 boolean needsSqlPostProcessing()
          Indicates if post-processing is needed after SQL retrieval.
 boolean pass(Message p_message)
          Decide if the given message passes the filter.
 java.lang.String sqlQuery()
          Provide a SQL search query.
 

Method Detail

forConnection

void forConnection(de.uplanet.jdbc.JdbcConnection p_conn)
Initialize the filter with a database connection.

This may be used if the property needsSqlPostProcessing() depends on the database used.

Parameters:
p_conn - The database connection used.
Note:
Users must call this method before SQL-related properties are read.

forUser

void forUser(java.lang.String p_strUserId)
Prepare the filter for a specific user.

Parameters:
p_strUserId - The sender's or the recipient's GUID.

sqlQuery

java.lang.String sqlQuery()
Provide a SQL search query.

Returns:
A SQL query, or null if the filter cannot be applied at database level.

needsSqlPostProcessing

boolean needsSqlPostProcessing()
Indicates if post-processing is needed after SQL retrieval.

Returns:
true if post-processing is needed after SQL retrieval, false otherwise.

pass

boolean pass(Message p_message)
Decide if the given message passes the filter.

Parameters:
p_message - The message to be filtered.
Returns:
true if the message passes the filter, false otherwise.

filter

void filter(java.util.List<Message> p_from,
            java.util.List<Message> p_to)
Do the filtering, operating on array lists.

Parameters:
p_from - Collection of messages to be filtered.
p_to - The filtered collection.


Last updated: 2011-08-11 10-04
Copyright © 2000-2011 United Planet. All Rights Reserved.