Drupal: nic to nedělá, jen loguje.
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sun, 09 Oct 2011 01:02:53 +0200
changeset 65b58cab5be0f4
parent 64 72950b29569e
child 66 c04eae2c57df
Drupal: nic to nedělá, jen loguje.
src/org/sonews/storage/impl/DrupalDatabase.java
     1.1 --- a/src/org/sonews/storage/impl/DrupalDatabase.java	Sun Oct 09 00:00:25 2011 +0200
     1.2 +++ b/src/org/sonews/storage/impl/DrupalDatabase.java	Sun Oct 09 01:02:53 2011 +0200
     1.3 @@ -18,13 +18,16 @@
     1.4  package org.sonews.storage.impl;
     1.5  
     1.6  import java.sql.SQLException;
     1.7 +import java.util.Collections;
     1.8  import java.util.List;
     1.9 +import java.util.logging.Level;
    1.10  import org.sonews.feed.Subscription;
    1.11  import org.sonews.storage.Article;
    1.12  import org.sonews.storage.ArticleHead;
    1.13  import org.sonews.storage.Group;
    1.14  import org.sonews.storage.Storage;
    1.15  import org.sonews.storage.StorageBackendException;
    1.16 +import org.sonews.util.Log;
    1.17  import org.sonews.util.Pair;
    1.18  
    1.19  /**
    1.20 @@ -42,151 +45,187 @@
    1.21  
    1.22  	@Override
    1.23  	public void addArticle(Article art) throws StorageBackendException {
    1.24 -		throw new StorageBackendException("Not supported yet.");
    1.25 +		Log.get().log(Level.SEVERE, "TODO: addArticle {0}", new Object[]{art});
    1.26  	}
    1.27  
    1.28  	@Override
    1.29  	public void addEvent(long timestamp, int type, long groupID) throws StorageBackendException {
    1.30 -		throw new StorageBackendException("Not supported yet.");
    1.31 +		Log.get().log(Level.SEVERE, "TODO: addEvent {0} / {1} / {2}", new Object[]{timestamp, type, groupID});
    1.32  	}
    1.33  
    1.34  	@Override
    1.35  	public void addGroup(String groupname, int flags) throws StorageBackendException {
    1.36 -		throw new StorageBackendException("Not supported yet.");
    1.37 +		Log.get().log(Level.SEVERE, "TODO: addGroup {0} / {1}", new Object[]{groupname, flags});
    1.38  	}
    1.39  
    1.40  	@Override
    1.41  	public int countArticles() throws StorageBackendException {
    1.42 -		throw new StorageBackendException("Not supported yet.");
    1.43 +		Log.get().log(Level.SEVERE, "TODO: countArticles");
    1.44 +		return 0;
    1.45  	}
    1.46  
    1.47  	@Override
    1.48  	public int countGroups() throws StorageBackendException {
    1.49 -		throw new StorageBackendException("Not supported yet.");
    1.50 +		Log.get().log(Level.SEVERE, "TODO: countGroups");
    1.51 +		return 0;
    1.52  	}
    1.53  
    1.54  	@Override
    1.55  	public void delete(String messageID) throws StorageBackendException {
    1.56 -		throw new StorageBackendException("Not supported yet.");
    1.57 +		Log.get().log(Level.SEVERE, "TODO: delete {0}", new Object[]{messageID});
    1.58  	}
    1.59  
    1.60  	@Override
    1.61  	public Article getArticle(String messageID) throws StorageBackendException {
    1.62 -		throw new StorageBackendException("Not supported yet.");
    1.63 +		Log.get().log(Level.SEVERE, "TODO: getArticle {0}", new Object[]{messageID});
    1.64 +		/** TODO: */
    1.65 +		return null;
    1.66  	}
    1.67  
    1.68  	@Override
    1.69  	public Article getArticle(long articleIndex, long groupID) throws StorageBackendException {
    1.70 -		throw new StorageBackendException("Not supported yet.");
    1.71 +		Log.get().log(Level.SEVERE, "TODO: getArticle {0} / {1}", new Object[]{articleIndex, groupID});
    1.72 +		/** TODO: */
    1.73 +		return null;
    1.74  	}
    1.75  
    1.76  	@Override
    1.77  	public List<Pair<Long, ArticleHead>> getArticleHeads(Group group, long first, long last) throws StorageBackendException {
    1.78 -		throw new StorageBackendException("Not supported yet.");
    1.79 +		Log.get().log(Level.SEVERE, "TODO: getArticleHeads {0} / {1} / {2}", new Object[]{group, first, last});
    1.80 +		/** TODO: */
    1.81 +		return Collections.emptyList();
    1.82  	}
    1.83  
    1.84  	@Override
    1.85  	public List<Pair<Long, String>> getArticleHeaders(Group group, long start, long end, String header, String pattern) throws StorageBackendException {
    1.86 -		throw new StorageBackendException("Not supported yet.");
    1.87 +		Log.get().log(Level.SEVERE, "TODO: getArticleHeaders {0} / {1} / {2} / {3} / {4}", new Object[]{group, start, end, header, pattern});
    1.88 +		/** TODO: */
    1.89 +		return Collections.emptyList();
    1.90  	}
    1.91  
    1.92  	@Override
    1.93  	public long getArticleIndex(Article art, Group group) throws StorageBackendException {
    1.94 -		throw new StorageBackendException("Not supported yet.");
    1.95 +		Log.get().log(Level.SEVERE, "TODO: getArticleIndex {0} / {1}", new Object[]{art, group});
    1.96 +		/** TODO: */
    1.97 +		return 0;
    1.98  	}
    1.99  
   1.100  	@Override
   1.101  	public List<Long> getArticleNumbers(long groupID) throws StorageBackendException {
   1.102 -		throw new StorageBackendException("Not supported yet.");
   1.103 +		Log.get().log(Level.SEVERE, "TODO: getArticleNumbers {0}", new Object[]{groupID});
   1.104 +		/** TODO: */
   1.105 +		return Collections.emptyList();
   1.106  	}
   1.107  
   1.108  	@Override
   1.109  	public String getConfigValue(String key) throws StorageBackendException {
   1.110 -		throw new StorageBackendException("Not supported yet.");
   1.111 +		Log.get().log(Level.SEVERE, "TODO: getConfigValue {0}", new Object[]{key});
   1.112 +		return null;
   1.113  	}
   1.114  
   1.115  	@Override
   1.116  	public int getEventsCount(int eventType, long startTimestamp, long endTimestamp, Group group) throws StorageBackendException {
   1.117 -		throw new StorageBackendException("Not supported yet.");
   1.118 +		Log.get().log(Level.SEVERE, "TODO: getEventsCount {0} / {1} / {2} / {3}", new Object[]{eventType, startTimestamp, endTimestamp, group});
   1.119 +		return 0;
   1.120  	}
   1.121  
   1.122  	@Override
   1.123  	public double getEventsPerHour(int key, long gid) throws StorageBackendException {
   1.124 -		throw new StorageBackendException("Not supported yet.");
   1.125 +		Log.get().log(Level.SEVERE, "TODO: getEventsPerHour {0} / {1}", new Object[]{key, gid});
   1.126 +		return 0;
   1.127  	}
   1.128  
   1.129  	@Override
   1.130  	public int getFirstArticleNumber(Group group) throws StorageBackendException {
   1.131 -		throw new StorageBackendException("Not supported yet.");
   1.132 +		Log.get().log(Level.SEVERE, "TODO: getFirstArticleNumber {0}", new Object[]{group});
   1.133 +		/** TODO: */
   1.134 +		return 0;
   1.135  	}
   1.136  
   1.137  	@Override
   1.138  	public Group getGroup(String name) throws StorageBackendException {
   1.139 -		throw new StorageBackendException("Not supported yet.");
   1.140 +		Log.get().log(Level.SEVERE, "TODO: getGroup {0}", new Object[]{name});
   1.141 +		/** TODO: */
   1.142 +		return null;
   1.143  	}
   1.144  
   1.145  	@Override
   1.146  	public List<Group> getGroups() throws StorageBackendException {
   1.147 -		throw new StorageBackendException("Not supported yet.");
   1.148 +		Log.get().log(Level.SEVERE, "TODO: getGroups");
   1.149 +		/** TODO: */
   1.150 +		return Collections.emptyList();
   1.151  	}
   1.152  
   1.153  	@Override
   1.154  	public List<String> getGroupsForList(String listAddress) throws StorageBackendException {
   1.155 -		throw new StorageBackendException("Not supported yet.");
   1.156 +		Log.get().log(Level.SEVERE, "TODO: getGroupsForList {0}", new Object[]{listAddress});
   1.157 +		return Collections.emptyList();
   1.158  	}
   1.159  
   1.160  	@Override
   1.161  	public int getLastArticleNumber(Group group) throws StorageBackendException {
   1.162 -		throw new StorageBackendException("Not supported yet.");
   1.163 +		Log.get().log(Level.SEVERE, "TODO: getLastArticleNumber {0}", new Object[]{group});
   1.164 +		/** TODO: */
   1.165 +		return 0;
   1.166  	}
   1.167  
   1.168  	@Override
   1.169  	public List<String> getListsForGroup(String groupname) throws StorageBackendException {
   1.170 -		throw new StorageBackendException("Not supported yet.");
   1.171 +		Log.get().log(Level.SEVERE, "TODO: getListsForGroup {0}", new Object[]{groupname});
   1.172 +		return Collections.emptyList();
   1.173  	}
   1.174  
   1.175  	@Override
   1.176  	public String getOldestArticle() throws StorageBackendException {
   1.177 -		throw new StorageBackendException("Not supported yet.");
   1.178 +		Log.get().log(Level.SEVERE, "TODO: getOldestArticle");
   1.179 +		return null;
   1.180  	}
   1.181  
   1.182  	@Override
   1.183  	public int getPostingsCount(String groupname) throws StorageBackendException {
   1.184 -		throw new StorageBackendException("Not supported yet.");
   1.185 +		Log.get().log(Level.SEVERE, "TODO: getPostingsCount {0}", new Object[]{groupname});
   1.186 +		return 0;
   1.187  	}
   1.188  
   1.189  	@Override
   1.190  	public List<Subscription> getSubscriptions(int type) throws StorageBackendException {
   1.191 -		throw new StorageBackendException("Not supported yet.");
   1.192 +		Log.get().log(Level.SEVERE, "TODO: getSubscriptions {0}", new Object[]{type});
   1.193 +		return Collections.emptyList();
   1.194  	}
   1.195  
   1.196  	@Override
   1.197  	public boolean isArticleExisting(String messageID) throws StorageBackendException {
   1.198 -		throw new StorageBackendException("Not supported yet.");
   1.199 +		Log.get().log(Level.SEVERE, "TODO: isArticleExisting {0}", new Object[]{messageID});
   1.200 +		/** TODO: */
   1.201 +		return false;
   1.202  	}
   1.203  
   1.204  	@Override
   1.205  	public boolean isGroupExisting(String groupname) throws StorageBackendException {
   1.206 -		throw new StorageBackendException("Not supported yet.");
   1.207 +		Log.get().log(Level.SEVERE, "TODO: isGroupExisting {0}", new Object[]{groupname});
   1.208 +		/** TODO: */
   1.209 +		return false;
   1.210  	}
   1.211  
   1.212  	@Override
   1.213  	public void purgeGroup(Group group) throws StorageBackendException {
   1.214 -		throw new StorageBackendException("Not supported yet.");
   1.215 +		Log.get().log(Level.SEVERE, "TODO: purgeGroup {0}", new Object[]{group});
   1.216  	}
   1.217  
   1.218  	@Override
   1.219  	public void setConfigValue(String key, String value) throws StorageBackendException {
   1.220 -		throw new StorageBackendException("Not supported yet.");
   1.221 +		Log.get().log(Level.SEVERE, "TODO: setConfigValue {0} = {1}", new Object[]{key, value});
   1.222  	}
   1.223  
   1.224  	@Override
   1.225  	public boolean update(Article article) throws StorageBackendException {
   1.226 -		throw new StorageBackendException("Not supported yet.");
   1.227 +		Log.get().log(Level.SEVERE, "TODO: update {0}", new Object[]{article});
   1.228 +		throw new StorageBackendException("Not implemented yet.");
   1.229  	}
   1.230  
   1.231  	@Override
   1.232  	public boolean update(Group group) throws StorageBackendException {
   1.233 -		throw new StorageBackendException("Not supported yet.");
   1.234 +		Log.get().log(Level.SEVERE, "TODO: update {0}", new Object[]{group});
   1.235 +		throw new StorageBackendException("Not implemented yet.");
   1.236  	}
   1.237  }