src/org/sonews/storage/impl/DrupalDatabase.java
author František Kučera <franta-hg@frantovo.cz>
Sun Oct 09 00:00:25 2011 +0200 (2011-10-09)
changeset 64 72950b29569e
parent 63 d883d4ab7b9d
child 65 b58cab5be0f4
permissions -rw-r--r--
Drupal: bez dědičnosti, implementujeme rovnou rozhraní (nelze dědit).
franta-hg@63
     1
/*
franta-hg@63
     2
 *   SONEWS News Server
franta-hg@63
     3
 *   see AUTHORS for the list of contributors
franta-hg@63
     4
 *
franta-hg@63
     5
 *   This program is free software: you can redistribute it and/or modify
franta-hg@63
     6
 *   it under the terms of the GNU General Public License as published by
franta-hg@63
     7
 *   the Free Software Foundation, either version 3 of the License, or
franta-hg@63
     8
 *   (at your option) any later version.
franta-hg@63
     9
 *
franta-hg@63
    10
 *   This program is distributed in the hope that it will be useful,
franta-hg@63
    11
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
franta-hg@63
    12
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
franta-hg@63
    13
 *   GNU General Public License for more details.
franta-hg@63
    14
 *
franta-hg@63
    15
 *   You should have received a copy of the GNU General Public License
franta-hg@63
    16
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
franta-hg@63
    17
 */
franta-hg@63
    18
package org.sonews.storage.impl;
franta-hg@63
    19
franta-hg@64
    20
import java.sql.SQLException;
franta-hg@64
    21
import java.util.List;
franta-hg@64
    22
import org.sonews.feed.Subscription;
franta-hg@64
    23
import org.sonews.storage.Article;
franta-hg@64
    24
import org.sonews.storage.ArticleHead;
franta-hg@64
    25
import org.sonews.storage.Group;
franta-hg@64
    26
import org.sonews.storage.Storage;
franta-hg@64
    27
import org.sonews.storage.StorageBackendException;
franta-hg@64
    28
import org.sonews.util.Pair;
franta-hg@64
    29
franta-hg@63
    30
/**
franta-hg@63
    31
 *
franta-hg@63
    32
 * @author František Kučera (frantovo.cz)
franta-hg@63
    33
 */
franta-hg@64
    34
public class DrupalDatabase implements Storage {
franta-hg@64
    35
franta-hg@64
    36
	/**
franta-hg@64
    37
	 * Rises the database: reconnect and recreate all prepared statements.
franta-hg@64
    38
	 * @throws java.lang.SQLException
franta-hg@64
    39
	 */
franta-hg@64
    40
	protected void arise() throws SQLException {
franta-hg@64
    41
	}
franta-hg@64
    42
franta-hg@64
    43
	@Override
franta-hg@64
    44
	public void addArticle(Article art) throws StorageBackendException {
franta-hg@64
    45
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
    46
	}
franta-hg@64
    47
franta-hg@64
    48
	@Override
franta-hg@64
    49
	public void addEvent(long timestamp, int type, long groupID) throws StorageBackendException {
franta-hg@64
    50
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
    51
	}
franta-hg@64
    52
franta-hg@64
    53
	@Override
franta-hg@64
    54
	public void addGroup(String groupname, int flags) throws StorageBackendException {
franta-hg@64
    55
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
    56
	}
franta-hg@64
    57
franta-hg@64
    58
	@Override
franta-hg@64
    59
	public int countArticles() throws StorageBackendException {
franta-hg@64
    60
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
    61
	}
franta-hg@64
    62
franta-hg@64
    63
	@Override
franta-hg@64
    64
	public int countGroups() throws StorageBackendException {
franta-hg@64
    65
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
    66
	}
franta-hg@64
    67
franta-hg@64
    68
	@Override
franta-hg@64
    69
	public void delete(String messageID) throws StorageBackendException {
franta-hg@64
    70
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
    71
	}
franta-hg@64
    72
franta-hg@64
    73
	@Override
franta-hg@64
    74
	public Article getArticle(String messageID) throws StorageBackendException {
franta-hg@64
    75
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
    76
	}
franta-hg@64
    77
franta-hg@64
    78
	@Override
franta-hg@64
    79
	public Article getArticle(long articleIndex, long groupID) throws StorageBackendException {
franta-hg@64
    80
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
    81
	}
franta-hg@64
    82
franta-hg@64
    83
	@Override
franta-hg@64
    84
	public List<Pair<Long, ArticleHead>> getArticleHeads(Group group, long first, long last) throws StorageBackendException {
franta-hg@64
    85
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
    86
	}
franta-hg@64
    87
franta-hg@64
    88
	@Override
franta-hg@64
    89
	public List<Pair<Long, String>> getArticleHeaders(Group group, long start, long end, String header, String pattern) throws StorageBackendException {
franta-hg@64
    90
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
    91
	}
franta-hg@64
    92
franta-hg@64
    93
	@Override
franta-hg@64
    94
	public long getArticleIndex(Article art, Group group) throws StorageBackendException {
franta-hg@64
    95
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
    96
	}
franta-hg@64
    97
franta-hg@64
    98
	@Override
franta-hg@64
    99
	public List<Long> getArticleNumbers(long groupID) throws StorageBackendException {
franta-hg@64
   100
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
   101
	}
franta-hg@64
   102
franta-hg@64
   103
	@Override
franta-hg@64
   104
	public String getConfigValue(String key) throws StorageBackendException {
franta-hg@64
   105
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
   106
	}
franta-hg@64
   107
franta-hg@64
   108
	@Override
franta-hg@64
   109
	public int getEventsCount(int eventType, long startTimestamp, long endTimestamp, Group group) throws StorageBackendException {
franta-hg@64
   110
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
   111
	}
franta-hg@64
   112
franta-hg@64
   113
	@Override
franta-hg@64
   114
	public double getEventsPerHour(int key, long gid) throws StorageBackendException {
franta-hg@64
   115
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
   116
	}
franta-hg@64
   117
franta-hg@64
   118
	@Override
franta-hg@64
   119
	public int getFirstArticleNumber(Group group) throws StorageBackendException {
franta-hg@64
   120
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
   121
	}
franta-hg@64
   122
franta-hg@64
   123
	@Override
franta-hg@64
   124
	public Group getGroup(String name) throws StorageBackendException {
franta-hg@64
   125
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
   126
	}
franta-hg@64
   127
franta-hg@64
   128
	@Override
franta-hg@64
   129
	public List<Group> getGroups() throws StorageBackendException {
franta-hg@64
   130
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
   131
	}
franta-hg@64
   132
franta-hg@64
   133
	@Override
franta-hg@64
   134
	public List<String> getGroupsForList(String listAddress) throws StorageBackendException {
franta-hg@64
   135
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
   136
	}
franta-hg@64
   137
franta-hg@64
   138
	@Override
franta-hg@64
   139
	public int getLastArticleNumber(Group group) throws StorageBackendException {
franta-hg@64
   140
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
   141
	}
franta-hg@64
   142
franta-hg@64
   143
	@Override
franta-hg@64
   144
	public List<String> getListsForGroup(String groupname) throws StorageBackendException {
franta-hg@64
   145
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
   146
	}
franta-hg@64
   147
franta-hg@64
   148
	@Override
franta-hg@64
   149
	public String getOldestArticle() throws StorageBackendException {
franta-hg@64
   150
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
   151
	}
franta-hg@64
   152
franta-hg@64
   153
	@Override
franta-hg@64
   154
	public int getPostingsCount(String groupname) throws StorageBackendException {
franta-hg@64
   155
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
   156
	}
franta-hg@64
   157
franta-hg@64
   158
	@Override
franta-hg@64
   159
	public List<Subscription> getSubscriptions(int type) throws StorageBackendException {
franta-hg@64
   160
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
   161
	}
franta-hg@64
   162
franta-hg@64
   163
	@Override
franta-hg@64
   164
	public boolean isArticleExisting(String messageID) throws StorageBackendException {
franta-hg@64
   165
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
   166
	}
franta-hg@64
   167
franta-hg@64
   168
	@Override
franta-hg@64
   169
	public boolean isGroupExisting(String groupname) throws StorageBackendException {
franta-hg@64
   170
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
   171
	}
franta-hg@64
   172
franta-hg@64
   173
	@Override
franta-hg@64
   174
	public void purgeGroup(Group group) throws StorageBackendException {
franta-hg@64
   175
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
   176
	}
franta-hg@64
   177
franta-hg@64
   178
	@Override
franta-hg@64
   179
	public void setConfigValue(String key, String value) throws StorageBackendException {
franta-hg@64
   180
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
   181
	}
franta-hg@64
   182
franta-hg@64
   183
	@Override
franta-hg@64
   184
	public boolean update(Article article) throws StorageBackendException {
franta-hg@64
   185
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
   186
	}
franta-hg@64
   187
franta-hg@64
   188
	@Override
franta-hg@64
   189
	public boolean update(Group group) throws StorageBackendException {
franta-hg@64
   190
		throw new StorageBackendException("Not supported yet.");
franta-hg@64
   191
	}
franta-hg@63
   192
}