001: /*
002: * Helma License Notice
003: *
004: * The contents of this file are subject to the Helma License
005: * Version 2.0 (the "License"). You may not use this file except in
006: * compliance with the License. A copy of the License is available at
007: * http://adele.helma.org/download/helma/license.txt
008: *
009: * Copyright 1998-2003 Helma Software. All Rights Reserved.
010: *
011: * $RCSfile$
012: * $Author: root $
013: * $Revision: 8604 $
014: * $Date: 2007-09-28 15:16:38 +0200 (Fre, 28 Sep 2007) $
015: */
016:
017: package helma.objectmodel;
018:
019: import helma.framework.IPathElement;
020: import helma.objectmodel.db.DbMapping;
021: import java.util.*;
022:
023: /**
024: * Interface that all Nodes implement. Currently, there are two implementations:
025: * Transient nodes which only exist in memory, and persistent Nodes, which are
026: * stored in a database (either the internal Object DB or an external relational DB).
027: */
028: public interface INode extends INodeState, IPathElement {
029: /**
030: * id-related methods
031: */
032: public String getID();
033:
034: /**
035: *
036: *
037: * @return ...
038: */
039: public String getName();
040:
041: /**
042: *
043: *
044: * @param dbmap ...
045: */
046: public void setDbMapping(DbMapping dbmap);
047:
048: /**
049: *
050: *
051: * @return ...
052: */
053: public DbMapping getDbMapping();
054:
055: /**
056: *
057: *
058: * @return ...
059: */
060: public int getState();
061:
062: /**
063: *
064: *
065: * @param s ...
066: */
067: public void setState(int s);
068:
069: /**
070: *
071: *
072: * @param name ...
073: */
074: public void setName(String name);
075:
076: /**
077: *
078: *
079: * @return ...
080: */
081: public long lastModified();
082:
083: /**
084: *
085: *
086: * @return ...
087: */
088: public long created();
089:
090: /**
091: *
092: *
093: * @return ...
094: */
095: public boolean isAnonymous(); // is this a named node, or an anonymous node in a collection?
096:
097: /**
098: *
099: *
100: * @return ...
101: */
102: public String getPrototype();
103:
104: /**
105: *
106: *
107: * @param prototype ...
108: */
109: public void setPrototype(String prototype);
110:
111: /**
112: *
113: *
114: * @return ...
115: */
116: public INode getCacheNode();
117:
118: /**
119: *
120: */
121: public void clearCacheNode();
122:
123: /**
124: *
125: *
126: * @return ...
127: */
128: public String getFullName();
129:
130: /**
131: *
132: *
133: * @param root ...
134: *
135: * @return ...
136: */
137: public String getFullName(INode root);
138:
139: /**
140: * node-related methods
141: */
142: public INode getParent();
143:
144: /**
145: *
146: *
147: * @param rel ...
148: */
149: public void setSubnodeRelation(String rel);
150:
151: /**
152: *
153: *
154: * @return ...
155: */
156: public String getSubnodeRelation();
157:
158: /**
159: *
160: *
161: * @return ...
162: */
163: public int numberOfNodes();
164:
165: /**
166: *
167: *
168: * @param node ...
169: *
170: * @return ...
171: */
172: public INode addNode(INode node);
173:
174: /**
175: *
176: *
177: * @param node ...
178: * @param where ...
179: *
180: * @return ...
181: */
182: public INode addNode(INode node, int where);
183:
184: /**
185: *
186: *
187: * @param name ...
188: *
189: * @return ...
190: */
191: public INode createNode(String name);
192:
193: /**
194: *
195: *
196: * @param name ...
197: * @param where ...
198: *
199: * @return ...
200: */
201: public INode createNode(String name, int where);
202:
203: /**
204: *
205: *
206: * @return ...
207: */
208: public Enumeration getSubnodes();
209:
210: /**
211: *
212: *
213: * @param name ...
214: *
215: * @return ...
216: */
217: public INode getSubnode(String name);
218:
219: /**
220: *
221: *
222: * @param index ...
223: *
224: * @return ...
225: */
226: public INode getSubnodeAt(int index);
227:
228: /**
229: *
230: *
231: * @param node ...
232: *
233: * @return ...
234: */
235: public int contains(INode node);
236:
237: /**
238: *
239: *
240: * @return ...
241: */
242: public boolean remove();
243:
244: /**
245: *
246: *
247: * @param node ...
248: */
249: public void removeNode(INode node);
250:
251: /**
252: * property-related methods
253: */
254: public Enumeration properties();
255:
256: /**
257: *
258: *
259: * @param name ...
260: *
261: * @return ...
262: */
263: public IProperty get(String name);
264:
265: /**
266: *
267: *
268: * @param name ...
269: *
270: * @return ...
271: */
272: public String getString(String name);
273:
274: /**
275: *
276: *
277: * @param name ...
278: *
279: * @return ...
280: */
281: public boolean getBoolean(String name);
282:
283: /**
284: *
285: *
286: * @param name ...
287: *
288: * @return ...
289: */
290: public Date getDate(String name);
291:
292: /**
293: *
294: *
295: * @param name ...
296: *
297: * @return ...
298: */
299: public long getInteger(String name);
300:
301: /**
302: *
303: *
304: * @param name ...
305: *
306: * @return ...
307: */
308: public double getFloat(String name);
309:
310: /**
311: *
312: *
313: * @param name ...
314: *
315: * @return ...
316: */
317: public INode getNode(String name);
318:
319: /**
320: *
321: *
322: * @param name ...
323: *
324: * @return ...
325: */
326: public Object getJavaObject(String name);
327:
328: /**
329: *
330: *
331: * @param name ...
332: * @param value ...
333: */
334: public void setString(String name, String value);
335:
336: /**
337: *
338: *
339: * @param name ...
340: * @param value ...
341: */
342: public void setBoolean(String name, boolean value);
343:
344: /**
345: *
346: *
347: * @param name ...
348: * @param value ...
349: */
350: public void setDate(String name, Date value);
351:
352: /**
353: *
354: *
355: * @param name ...
356: * @param value ...
357: */
358: public void setInteger(String name, long value);
359:
360: /**
361: *
362: *
363: * @param name ...
364: * @param value ...
365: */
366: public void setFloat(String name, double value);
367:
368: /**
369: *
370: *
371: * @param name ...
372: * @param value ...
373: */
374: public void setNode(String name, INode value);
375:
376: /**
377: *
378: *
379: * @param name ...
380: * @param value ...
381: */
382: public void setJavaObject(String name, Object value);
383:
384: /**
385: *
386: *
387: * @param name ...
388: */
389: public void unset(String name);
390: }
|