source: main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/FlatDatabaseWrapper.java@ 31230

Last change on this file since 31230 was 31230, checked in by ak19, 7 years ago

Commit for GS3 server side part of OAI deletion police implementation. Still to implement the GS2 server side part. The earlier commits implemented the PERL side, the oai-inf db implementation. I think I've now got the GS3 server side working, but have yet to try validating against the OAI validator. (I need to test that on a machine that is publicly accessible).

File size: 1.9 KB
Line 
1/*
2 * FlatDatabaseWrapper.java
3 * Copyright (C) 2008 New Zealand Digital Library, http://www.nzdl.org
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19package org.greenstone.gsdl3.util;
20
21import java.util.ArrayList;
22
23public interface FlatDatabaseWrapper {
24
25 /* just read access, many readers can share a database */
26 public final static int READ = 0;
27 /* read/write, exclusive access */
28 public final static int WRITE = 1;
29
30 // do we want the other modes?
31 // -- read/write - create if doesn't exist
32 // -- read/write - create a new database
33 /** open database named filename, using mode */
34 public boolean openDatabase(String filename, int mode);
35
36 /** close the database associated with this wrapper */
37 public void closeDatabase();
38
39 /** returns the value associated with the key */
40 public String getValue(String key);
41
42 /** sets the given key to the given value in the database */
43 public boolean setValue(String key, String value);
44
45 /** deletes the given key from the database */
46 public boolean deleteKey(String key);
47
48 /** Returns all the keys of the database as String */
49 public ArrayList<String> getAllEntryKeys();
50
51 /** returns a string of key-value entries that can be
52 * printed for debugging purposes*/
53 public String displayAllEntries();
54}
55
Note: See TracBrowser for help on using the repository browser.