KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > commonj > sdo > DataGraph


1 /**
2  * <copyright>
3  *
4  * Service Data Objects
5  * Version 1.0
6  * Licensed Materials - Property of BEA and IBM
7  *
8  * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2003. All rights reserved.
9  *
10  * </copyright>
11  *
12  * $Id: DataGraph.java,v 1.1 2004/03/26 15:24:15 marcelop Exp $
13  */

14 package commonj.sdo;
15
16
17 /**
18  * A data graph is used to package a graph of {@link DataObject data objects} along with their
19  * metadata, that is, data describing the data.
20  * A data graph also contains a {@link #getChangeSummary change summary}
21  * which is used to record changes made to the objects in the graph.
22  */

23 public interface DataGraph
24 {
25   /**
26    * Returns the root {@link DataObject data object} of this data graph.
27    * @return the root data object.
28    * @see DataObject#getDataGraph
29    */

30   DataObject getRootObject();
31
32   /**
33    * Creates a new root data object of the {@link #getType specified type},
34    * replacing the existing root, if one exists.
35    * @param namespaceURI namespace of the type.
36    * @param typeName name of the type.
37    * @return the new root.
38    * @see #createRootObject(Type)
39    * @see #getType(String, String)
40    */

41   DataObject createRootObject(String JavaDoc namespaceURI, String JavaDoc typeName);
42
43   /**
44    * Creates a new root data object of the specified type,
45    * replacing the existing root, if one exists.
46    * @param type the type of the new root.
47    * @return the new root.
48    * @see #createRootObject(String, String)
49    */

50   DataObject createRootObject(Type type);
51
52   /**
53    * Returns the {@link ChangeSummary change summary} associated with this data graph.
54    * @return the change summary.
55    * @see ChangeSummary#getDataGraph
56    */

57   ChangeSummary getChangeSummary();
58
59   /**
60    * Returns the {@link Type type} with the given the {@link Type#getURI() URI},
61    * or contained by the resource at the given URI,
62    * and with the given {@link Type#getName name}.
63    * @param uri the namespace URI of a type or the location URI of a resource containing a type.
64    * @param typeName name of a type.
65    * @return the type with the corresponding namespace and name.
66    */

67   Type getType(String JavaDoc uri, String JavaDoc typeName);
68 }
69
Popular Tags