de.uplanet.lucy.server.auxiliaries
Class NewsAgentProxy

java.lang.Object
  extended by de.uplanet.lucy.server.auxiliaries.NewsAgentProxy

public final class NewsAgentProxy
extends java.lang.Object

Version:
$Revision: 72197 $

Constructor Summary
NewsAgentProxy(de.uplanet.jdbc.JdbcConnection p_conn)
           
 
Method Summary
 de.uplanet.lucy.server.newsagent.IFilter createFilter(java.lang.String p_strFilterClass)
          Create a message filter.
 de.uplanet.lucy.server.newsagent.IOrder createSortOrder(java.lang.String p_strOrderClass)
          Create a message sort order.
 boolean delete(java.lang.String p_strMessageId)
          Delete a message.
 void done()
          Deprecated. This call is not needed anymore.
 int filter(de.uplanet.lucy.server.newsagent.IFilter p_filter)
          Filter the messages that have already being loaded.
 de.uplanet.lucy.server.newsagent.Message get(int p_iIndex)
          Get the message at the specified index out of the filtered collection.
 int load(de.uplanet.lucy.server.newsagent.IFilter p_filter, de.uplanet.lucy.server.newsagent.IOrder p_order, int p_iMaxCount)
          Load messages from the database.
 int loadArchive(java.lang.String p_strRecipientId, java.util.Date p_dtFrom, java.util.Date p_dtTo, int p_iMaxCount)
           
 int loadArchiveSent(java.lang.String p_strSenderId, java.util.Date p_dtFrom, java.util.Date p_dtTo, int p_iMaxCount)
           
 de.uplanet.lucy.server.newsagent.Message loadMessage(java.lang.String p_strMessageId)
          Load a specific message.
 int loadNotExpired(java.lang.String p_strRecipientId, java.lang.String p_strOrderClass, int p_iMaxCount)
          Load unexpired messages for a specific recipient.
 int loadNotExpiredNotVisited(java.lang.String p_strRecipientId, java.lang.String p_strOrderClass, int p_iMaxCount)
          Load unexpired and unvisited messages for a specific recipient.
 void markDeleted(java.lang.String p_strMessageId, java.lang.String p_strUserId)
          Mark a message as deleted for the specified user.
 void markRead(java.lang.String p_strMessageId, java.lang.String p_strUserId)
           
 int size()
          Get the number of messages in the filtered collection.
 void sort(de.uplanet.lucy.server.newsagent.IOrder p_order)
          Sort the messages in the filtered messages collection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NewsAgentProxy

public NewsAgentProxy(de.uplanet.jdbc.JdbcConnection p_conn)
Parameters:
p_conn - The database connection to be used.
Method Detail

done

@Deprecated
public void done()
Deprecated. This call is not needed anymore.


size

public int size()
Get the number of messages in the filtered collection.

Returns:
The number of messages in the filtered collection.

get

public de.uplanet.lucy.server.newsagent.Message get(int p_iIndex)
Get the message at the specified index out of the filtered collection.

Parameters:
p_iIndex - The index of the message.
Returns:
The message with the specified index or null if there are no filtered messages available or an error occurred.

load

public int load(de.uplanet.lucy.server.newsagent.IFilter p_filter,
                de.uplanet.lucy.server.newsagent.IOrder p_order,
                int p_iMaxCount)
Load messages from the database.

Parameters:
p_filter - The filter to be applied when loading.
p_order - The order in which the messages should be loaded.
p_iMaxCount - The maximum number of messages to be loaded or -1 if all messages should be loaded.
Returns:
The number of messages that where actually loaded.

loadNotExpired

public int loadNotExpired(java.lang.String p_strRecipientId,
                          java.lang.String p_strOrderClass,
                          int p_iMaxCount)
Load unexpired messages for a specific recipient.

Parameters:
p_strRecipientId - The recipient's unique identifier.
p_strOrderClass - The sort order to be used.
p_iMaxCount - The maximum number of messages to be loaded or -1 if all messages should be loaded.
Returns:
The number of messages that where actually loaded.

loadNotExpiredNotVisited

public int loadNotExpiredNotVisited(java.lang.String p_strRecipientId,
                                    java.lang.String p_strOrderClass,
                                    int p_iMaxCount)
Load unexpired and unvisited messages for a specific recipient.

Parameters:
p_strRecipientId - The recipient's unique identifier.
p_strOrderClass - The sort order to be used.
p_iMaxCount - The maximum number of messages to be loaded or -1 if all messages should be loaded.
Returns:
The number of messages that where actually loaded.

loadArchive

public int loadArchive(java.lang.String p_strRecipientId,
                       java.util.Date p_dtFrom,
                       java.util.Date p_dtTo,
                       int p_iMaxCount)
Parameters:
p_strRecipientId - The recipient's unique identifier.
p_iMaxCount - The maximum number of messages to be loaded or -1 if all messages should be loaded.
Returns:
The number of messages that where actually loaded.

loadArchiveSent

public int loadArchiveSent(java.lang.String p_strSenderId,
                           java.util.Date p_dtFrom,
                           java.util.Date p_dtTo,
                           int p_iMaxCount)
Parameters:
p_strSenderId - The sender's unique identifier.
p_iMaxCount - The maximum number of messages to be loaded or -1 if all messages should be loaded.
Returns:
The number of messages that where actually loaded.

loadMessage

public de.uplanet.lucy.server.newsagent.Message loadMessage(java.lang.String p_strMessageId)
Load a specific message.

Parameters:
p_strMessageId - The message's unique identifier.

sort

public void sort(de.uplanet.lucy.server.newsagent.IOrder p_order)
Sort the messages in the filtered messages collection.

Parameters:
p_order - The sorting criterion.

filter

public int filter(de.uplanet.lucy.server.newsagent.IFilter p_filter)
Filter the messages that have already being loaded.

Parameters:
p_filter - The filter criterion.
Returns:
The number of messages in the filtered collection, i.e. the value of size().

markRead

public void markRead(java.lang.String p_strMessageId,
                     java.lang.String p_strUserId)
Parameters:
p_strMessageId - The message's unique identifier.
p_strUserId - The user's unique identifier.

markDeleted

public void markDeleted(java.lang.String p_strMessageId,
                        java.lang.String p_strUserId)
Mark a message as deleted for the specified user.

Either of the parameters may be null, however the method does nothing in these cases.

Parameters:
p_strMessageId - The unique identifier of the message.
p_strUserId - The unique identifier of the user.

delete

public boolean delete(java.lang.String p_strMessageId)
Delete a message. Checks if the current user is the sender of the news.

Parameters:
p_strMessageId - The unique identifier of the message.

createFilter

public de.uplanet.lucy.server.newsagent.IFilter createFilter(java.lang.String p_strFilterClass)
Create a message filter.

Parameters:
p_strFilterClass - The name of the filter class.
Returns:
The requested filter, or null if an error occurred.

createSortOrder

public de.uplanet.lucy.server.newsagent.IOrder createSortOrder(java.lang.String p_strOrderClass)
Create a message sort order.

Parameters:
p_strOrderClass - The name of the sort order class.
Returns:
The requested sort order, or null if an error occurred.


Last updated: 2011-01-27
Copyright 2000-2010 United Planet. All Rights Reserved.