1 /*
2 * Copyright (c) 2003
3 * Information Desire GmbH
4 * All rights reserved.
5 */
6 package com.infodesire.infobit;
7
8 import com.infodesire.infobit.data.Infobit;
9 import com.infodesire.infobit.data.Acl;
10 import com.infodesire.infobit.data.Version;
11 import com.infodesire.infobit.data.Content;
12 import com.infodesire.infobit.data.PrimitiveContent;
13 import com.infodesire.infobit.data.Keyworded;
14
15 import java.util.Set;
16 import java.util.Map;
17 import java.util.Collection;
18
19 import java.io.InputStream;
20 /***
21 * manager for infobits. frontend for infobit DAO
22 *
23 * @author konstantin
24 * @created July 29, 2003
25 * @version $Revision: 1.16 $
26 */
27 public interface InfobitManager {
28
29 /***
30 * create new infobit instance with specified name and acl
31 *
32 * @param name infobit name
33 * @param acl acl name
34 * @return Description of the Returned Value
35 * @exception InfobitException thrown when infobit creation fails
36 * @exception InfobitSecurityException thrown because of insufficient
37 * privileges
38 */
39 Infobit createInfobit(String name, Acl acl) throws InfobitException, InfobitSecurityException;
40
41
42 /***
43 * whether pool knows about infobit ( i.e. infobit exists )
44 *
45 * @param id infobit id
46 * @return whether infobit with given name exists
47 * @exception InfobitException thrown when some problem occurs
48 */
49 boolean hasInfobit(String id) throws InfobitException;
50
51
52 /***
53 * load infobit in with id. if exists and possible
54 *
55 * @param id infobit id
56 * @return infobit instance
57 * @exception InfobitException when some problem occurs
58 * @exception InfobitSecurityException Description of Exception
59 */
60 Infobit getInfobit(String id) throws InfobitException, InfobitSecurityException;
61
62
63 /***
64 * remove infobit if possible
65 *
66 * @param id infobit id
67 * @exception InfobitException when some problem occurs
68 * @exception InfobitSecurityException when insufficient permissions.
69 * @exception InfobitIntegrityException when removal violates structural
70 * integrity
71 */
72 void removeInfobit(String id) throws InfobitException, InfobitIntegrityException, InfobitSecurityException;
73
74
75 /***
76 * create new version with textual content.
77 *
78 * @param ib infobit
79 * @param name unique version name ( within given
80 * infobit )
81 * @param keywords keywords for searching. shall
82 * contain strings
83 * @param text textual content of infobit
84 * @return Description of the Returned Value
85 * @exception InfobitException when some problem occurs
86 * @exception InfobitSecurityException when insufficient permissions.
87 */
88 Version createText(Infobit ib, String name, String text, Set keywords) throws InfobitException, InfobitSecurityException;
89
90
91 /***
92 * create binary infobit content
93 *
94 * @param ib infobit
95 * @param name unique version name ( within given
96 * infobit )
97 * @param stream stream containing binary data
98 * @param mime mime type
99 * @param keywords keywords for searching . shall
100 * contain strings
101 * @return Description of the Returned Value
102 * @exception InfobitException when some problem occurs
103 * @exception InfobitSecurityException when insufficient permissions.
104 */
105 Version createBinary(Infobit ib, String name, InputStream stream, String mime, Set keywords) throws InfobitException, InfobitSecurityException;
106
107
108 /***
109 * create binary infobit content
110 *
111 * @param ib infobit
112 * @param name unique version name ( within given
113 * infobit )
114 * @param data array coontaining binary data
115 * @param mime mime type
116 * @param keywords keywords for searching. shall
117 * contain strings
118 * @return Description of the Returned Value
119 * @exception InfobitException when some problem occurs
120 * @exception InfobitSecurityException when insufficient permissions.
121 */
122 Version createBinary(Infobit ib, String name, byte[] data, String mime, Set keywords) throws InfobitException, InfobitSecurityException;
123
124
125 /***
126 * create template for scripts. template does not have any keywords. it does
127 * not need them
128 *
129 * @param ib infobit
130 * @param name unique version name ( within given
131 * infobit )
132 * @param text template text
133 * @return Description of the Returned Value
134 * @exception InfobitException when some problem occurs
135 * @exception InfobitSecurityException when insufficient permissions.
136 */
137 Version createTemplate(Infobit ib, String name, String text) throws InfobitException, InfobitSecurityException;
138
139
140 /***
141 * create script.
142 *
143 * @param ib infobit
144 * @param name unique version name ( within given
145 * infobit )
146 * @param template template infobit
147 * @param links map of links to be merged with
148 * template. shall be keyed by strings and contain infobits
149 * @param keywords keywords for searching. shall
150 * contain strings
151 * @return Description of the Returned Value
152 * @exception InfobitException Description of Exception
153 * @exception InfobitSecurityException Description of Exception
154 */
155 Version createScript(Infobit ib, String name, Infobit template, Map links, Set keywords) throws InfobitException, InfobitSecurityException;
156
157
158 /***
159 * Sets the ActualVersion attribute of the InfobitManager object
160 *
161 * @param ib The new ActualVersion value
162 * @param version The new ActualVersion value
163 * @exception InfobitException Description of Exception
164 * @exception InfobitSecurityException Description of Exception
165 */
166 void setActualVersion(Infobit ib, Version version) throws InfobitException, InfobitSecurityException;
167
168
169 /***
170 * stream with data of primitive content ( binary, text or whatever ).
171 * resulting stream is coming out of blob, and shall be used ASAP and in any
172 * case inside the same transaction. Intendet use is to stream this content
173 * out to web client.
174 *
175 * @param content Description of Parameter
176 * @return The Content value
177 * @exception InfobitException Description of Exception
178 * @exception InfobitSecurityException Description of Exception
179 */
180 InputStream getContent(PrimitiveContent content) throws InfobitException, InfobitSecurityException;
181
182
183 /***
184 * Gets the size of the content.
185 *
186 * @param content The content the size of which to
187 * query
188 * @return The size of <content>
189 * @exception InfobitException Description of Exception
190 * @exception InfobitSecurityException Description of Exception
191 */
192 int getContentLength(PrimitiveContent content)
193 throws InfobitException, InfobitSecurityException;
194
195
196 /***
197 * Primitive content as byte array. Better not to use it for big stuff.
198 *
199 * @param content Description of Parameter
200 * @return The Bytes value
201 * @exception InfobitException Description of Exception
202 * @exception InfobitSecurityException Description of Exception
203 */
204 byte[] getBytes(PrimitiveContent content) throws InfobitException, InfobitSecurityException;
205
206
207 /***
208 * primitive content as string. it's not said that this string will be
209 * making sense....
210 *
211 * @param content Description of Parameter
212 * @return The String value
213 * @exception InfobitException Description of Exception
214 * @exception InfobitSecurityException Description of Exception
215 */
216 String getString(PrimitiveContent content) throws InfobitException, InfobitSecurityException;
217
218
219 /***
220 * set attribute value for given infobit. set to null to remove attribute
221 *
222 * @param name The new Attribute value
223 * @param value The new Attribute value
224 * @param infobit The new Attribute value
225 * @exception InfobitException Description of Exception
226 * @exception InfobitSecurityException Description of Exception
227 */
228 void setAttribute(Infobit infobit, String name, String value) throws InfobitException, InfobitSecurityException;
229
230
231 /***
232 * set attribute value for given infobit content. set value to null for
233 * removal
234 *
235 * @param name The new Attribute value
236 * @param value The new Attribute value
237 * @param content The new Attribute value
238 * @exception InfobitException Description of Exception
239 * @exception InfobitSecurityException Description of Exception
240 */
241 void setAttribute(Content content, String name, String value) throws InfobitException, InfobitSecurityException;
242
243
244 /***
245 * query infobits. supply only where clause
246 *
247 * @param where Description of Parameter
248 * @return The InfobitByAttributes value
249 * @exception InfobitException Description of Exception
250 * @exception InfobitSecurityException Description of Exception
251 */
252 Collection queryInfobits(String where) throws InfobitException, InfobitSecurityException;
253
254 }
This page was automatically generated by Maven