Fix #548: API change; changed parameter type of Storage.getGroupsForList()
authorcli
Thu Aug 20 16:57:38 2009 +0200 (2009-08-20)
changeset 14efce4ec25564
parent 13 de98fd5b35f5
child 15 f2293e8566f5
Fix #548: API change; changed parameter type of Storage.getGroupsForList()
org/sonews/mlgw/Dispatcher.java
org/sonews/storage/Storage.java
org/sonews/storage/impl/JDBCDatabase.java
     1.1 --- a/org/sonews/mlgw/Dispatcher.java	Thu Aug 20 16:49:38 2009 +0200
     1.2 +++ b/org/sonews/mlgw/Dispatcher.java	Thu Aug 20 16:57:38 2009 +0200
     1.3 @@ -111,7 +111,7 @@
     1.4        // listPost[0] is of form "<mailto:dev@openoffice.org>"
     1.5        listPost[0]  = chunkListPost(listPost[0]);
     1.6        listPostAddr = new InternetAddress(listPost[0], false);
     1.7 -      groups = StorageManager.current().getGroupsForList(listPostAddr);
     1.8 +      groups = StorageManager.current().getGroupsForList(listPostAddr.getAddress());
     1.9      }
    1.10      else if(fallback)
    1.11      {
    1.12 @@ -123,7 +123,8 @@
    1.13        {
    1.14          if(toa instanceof InternetAddress)
    1.15          {
    1.16 -          List<String> g = StorageManager.current().getGroupsForList((InternetAddress) toa);
    1.17 +          List<String> g = StorageManager.current()
    1.18 +            .getGroupsForList(((InternetAddress)toa).getAddress());
    1.19            groups.addAll(g);
    1.20          }
    1.21        }
     2.1 --- a/org/sonews/storage/Storage.java	Thu Aug 20 16:49:38 2009 +0200
     2.2 +++ b/org/sonews/storage/Storage.java	Thu Aug 20 16:57:38 2009 +0200
     2.3 @@ -19,7 +19,6 @@
     2.4  package org.sonews.storage;
     2.5  
     2.6  import java.util.List;
     2.7 -import javax.mail.internet.InternetAddress;
     2.8  import org.sonews.feed.Subscription;
     2.9  import org.sonews.util.Pair;
    2.10  
    2.11 @@ -92,7 +91,14 @@
    2.12    List<Channel> getGroups()
    2.13      throws StorageBackendException;
    2.14  
    2.15 -  List<String> getGroupsForList(InternetAddress inetaddress)
    2.16 +  /**
    2.17 +   * Retrieves the collection of groupnames that are associated with the
    2.18 +   * given list address.
    2.19 +   * @param inetaddress
    2.20 +   * @return
    2.21 +   * @throws StorageBackendException
    2.22 +   */
    2.23 +  List<String> getGroupsForList(String listAddress)
    2.24      throws StorageBackendException;
    2.25  
    2.26    int getLastArticleNumber(Group group)
     3.1 --- a/org/sonews/storage/impl/JDBCDatabase.java	Thu Aug 20 16:49:38 2009 +0200
     3.2 +++ b/org/sonews/storage/impl/JDBCDatabase.java	Thu Aug 20 16:57:38 2009 +0200
     3.3 @@ -31,7 +31,6 @@
     3.4  import java.util.regex.Pattern;
     3.5  import java.util.regex.PatternSyntaxException;
     3.6  import javax.mail.Header;
     3.7 -import javax.mail.internet.InternetAddress;
     3.8  import javax.mail.internet.MimeUtility;
     3.9  import org.sonews.config.Config;
    3.10  import org.sonews.util.Log;
    3.11 @@ -1053,14 +1052,14 @@
    3.12    }
    3.13  
    3.14    @Override
    3.15 -  public List<String> getGroupsForList(InternetAddress listAddress)
    3.16 +  public List<String> getGroupsForList(String listAddress)
    3.17      throws StorageBackendException
    3.18    {
    3.19      ResultSet rs = null;
    3.20      
    3.21      try
    3.22      {
    3.23 -      this.pstmtGetGroupForList.setString(1, listAddress.getAddress());
    3.24 +      this.pstmtGetGroupForList.setString(1, listAddress);
    3.25  
    3.26        rs = this.pstmtGetGroupForList.executeQuery();
    3.27        List<String> groups = new ArrayList<String>();