/
MetaData.java
86 lines (67 loc) · 3.31 KB
/
MetaData.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
* eXist Open Source Native XML Database
* Copyright (C) 2012 The eXist Project
* http://exist-db.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* $Id$
*/
package org.exist.storage.md;
import java.util.List;
import org.apache.log4j.Logger;
import org.exist.EXistException;
import org.exist.collections.Collection;
import org.exist.dom.DocumentAtExist;
import org.exist.dom.DocumentImpl;
import org.exist.security.PermissionDeniedException;
import org.exist.storage.MetaStorage;
import org.exist.xmldb.XmldbURI;
/**
* @author <a href="mailto:shabanovd@gmail.com">Dmitriy Shabanov</a>
*
*/
public abstract class MetaData implements MetaStorage {
protected static MetaData _ = null;
public static MetaData get() {
return _;
}
protected final static Logger LOG = Logger.getLogger(MetaData.class);
public abstract DocumentImpl getDocument(String uuid) throws EXistException, PermissionDeniedException;
public abstract Collection getCollection(String uuid) throws EXistException, PermissionDeniedException;
public abstract List<DocumentImpl> matchDocuments(String key, String value) throws EXistException, PermissionDeniedException;
public abstract List<DocumentImpl> matchDocumentsByKey(String key) throws EXistException, PermissionDeniedException;
public abstract List<DocumentImpl> matchDocumentsByValue(String value) throws EXistException, PermissionDeniedException;
public abstract Metas addMetas(DocumentAtExist doc);
public abstract Metas addMetas(Collection col);
public abstract Meta getMeta(String uuid);
//low level
protected abstract Meta _addMeta(Metas metas, String uuid, String key, String value);
protected abstract Metas _addMetas(String uri, String uuid);
protected abstract Metas replaceMetas(XmldbURI uri, String uuid);
public abstract Metas getMetas(DocumentAtExist doc);
public abstract Metas getMetas(XmldbURI uri);
public abstract void copyMetas(XmldbURI oldDoc, DocumentImpl newDoc);
public abstract void copyMetas(XmldbURI oldDoc, Collection newCol);
public abstract void moveMetas(XmldbURI oldUri, XmldbURI newUri);
public abstract void delMetas(XmldbURI uri);
public abstract void sync();
public abstract void close();
public abstract XmldbURI UUIDtoURI(String uuid);
public abstract String URItoUUID(XmldbURI uri);
// public abstract void indexMetas(Metas metas);
// public abstract NodeImpl search(String queryText, List<String> toBeMatchedURIs) throws XPathException;
// public abstract List<String> searchDocuments(String queryText, List<String> toBeMatchedURIs) throws XPathException;
}