Some changes to storage interface.
authorcli
Wed, 26 Aug 2009 17:04:04 +0200
changeset 242ff819fa5be1
parent 23 e4345a26f81f
child 25 dd05c3f2fa24
Some changes to storage interface.
org/sonews/storage/Storage.java
org/sonews/storage/impl/JDBCDatabase.java
     1.1 --- a/org/sonews/storage/Storage.java	Wed Aug 26 10:55:59 2009 +0200
     1.2 +++ b/org/sonews/storage/Storage.java	Wed Aug 26 17:04:04 2009 +0200
     1.3 @@ -135,6 +135,15 @@
     1.4    void setConfigValue(String key, String value)
     1.5      throws StorageBackendException;
     1.6  
     1.7 +  /**
     1.8 +   * Updates headers and channel references of the given article.
     1.9 +   * @param article
    1.10 +   * @return
    1.11 +   * @throws StorageBackendException
    1.12 +   */
    1.13 +  boolean update(Article article)
    1.14 +    throws StorageBackendException;
    1.15 +
    1.16    boolean update(Group group)
    1.17      throws StorageBackendException;
    1.18  
     2.1 --- a/org/sonews/storage/impl/JDBCDatabase.java	Wed Aug 26 10:55:59 2009 +0200
     2.2 +++ b/org/sonews/storage/impl/JDBCDatabase.java	Wed Aug 26 17:04:04 2009 +0200
     2.3 @@ -1743,6 +1743,17 @@
     2.4      }
     2.5    }
     2.6  
     2.7 +  @Override
     2.8 +  public boolean update(Article article)
     2.9 +    throws StorageBackendException
    2.10 +  {
    2.11 +    // DELETE FROM headers WHERE article_id = ?
    2.12 +
    2.13 +    // INSERT INTO headers ...
    2.14 +
    2.15 +    // SELECT * FROM postings WHERE article_id = ? AND group_id = ?
    2.16 +  }
    2.17 +
    2.18    /**
    2.19     * Writes the flags and the name of the given group to the database.
    2.20     * @param group