KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > outerj > daisy > repository > schema > RepositorySchema


1 /*
2  * Copyright 2004 Outerthought bvba and Schaubroeck nv
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.outerj.daisy.repository.schema;
17
18 import org.outerj.daisy.repository.ValueType;
19 import org.outerj.daisy.repository.RepositoryException;
20 import org.outerj.daisy.repository.LinkExtractorInfos;
21
22 /**
23  * Allows querying and manipulation of the Repository Schema.
24  *
25  * <p>The Repository Schema defines the types of documents that can be stored
26  * in the repository. See {@link DocumentType} for more information about what
27  * constitutes a Document Type.
28  *
29  * <p>The various get methods all take a parameter "updateable". If true,
30  * the returned object can be modified and saved, and is caller-specific.
31  * If false, the returned object is not updateable (thus immutable), and the same object
32  * instance can be returned to different callers (i.e. it is threadsafe). The
33  * returned objects can in that case be retrieved from a cache, allowing very fast
34  * access to the schema information. So in general, if you don't need to modify
35  * the schema information, supply <tt>false</tt> for the updateable parameter.
36  */

37 public interface RepositorySchema {
38     /**
39      * @deprecated Use createDocumentType instead.
40      */

41     public DocumentType createNewDocumentType(String JavaDoc name);
42
43     /**
44      * Creates a new document type with the given name. The document type is
45      * not created immediately in the repository, to do this you need to call
46      * the save() method on the returned object.
47      */

48     public DocumentType createDocumentType(String JavaDoc name);
49
50     public void deleteDocumentType(long documentTypeId) throws RepositoryException;
51
52     /**
53      * @deprecated Use createFieldType instead.
54      */

55     public FieldType createNewFieldType(String JavaDoc name, ValueType valueType);
56
57     public FieldType createFieldType(String JavaDoc name, ValueType valueType);
58
59     public FieldType createFieldType(String JavaDoc name, ValueType valueType, boolean multiValue);
60
61     public void deleteFieldType(long fieldTypeId) throws RepositoryException;
62
63     /**
64      * @deprecated Use createPartType instead.
65      */

66     public PartType createNewPartType(String JavaDoc name, String JavaDoc mimeTypes);
67
68     public PartType createPartType(String JavaDoc name, String JavaDoc mimeTypes);
69
70     public void deletePartType(long partTypeId) throws RepositoryException;
71
72     public void addListener(RepositorySchemaListener listener);
73
74     public void removeListener(RepositorySchemaListener listener);
75
76     public DocumentTypes getAllDocumentTypes(boolean updateable) throws RepositoryException;
77
78     public FieldTypes getAllFieldTypes(boolean updateable) throws RepositoryException;
79
80     public PartTypes getAllPartTypes(boolean updateable) throws RepositoryException;
81
82     /**
83      * @throws PartTypeNotFoundException in case the part type does not exist.
84      */

85     public PartType getPartTypeById(long id, boolean updateable) throws RepositoryException;
86
87     /**
88      * @throws PartTypeNotFoundException in case the part type does not exist.
89      */

90     public PartType getPartTypeByName(String JavaDoc name, boolean updateable) throws RepositoryException;
91
92     /**
93      * @throws FieldTypeNotFoundException in case the field type does not exist.
94      */

95     public FieldType getFieldTypeById(long id, boolean updateable) throws RepositoryException;
96
97     /**
98      * @throws FieldTypeNotFoundException in case the field type does not exist.
99      */

100     public FieldType getFieldTypeByName(String JavaDoc name, boolean updateable) throws RepositoryException;
101
102     /**
103      * @throws DocumentTypeNotFoundException in case the document type does not exist.
104      */

105     public DocumentType getDocumentTypeById(long id, boolean updateable) throws RepositoryException;
106
107     /**
108      * @throws DocumentTypeNotFoundException in case the document type does not exist.
109      */

110     public DocumentType getDocumentTypeByName(String JavaDoc name, boolean updateable) throws RepositoryException;
111
112     /**
113      * @param nameOrId if this starts with a digit, will do getDocumentTypeById, otherwise ByName
114      */

115     public DocumentType getDocumentType(String JavaDoc nameOrId, boolean updateable) throws RepositoryException;
116
117     /**
118      * Returns information about the available link extractors.
119      */

120     public LinkExtractorInfos getLinkExtractors() throws RepositoryException;
121 }
122
Popular Tags