1 /*
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3 *
4 * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
5 *
6 * The contents of this file are subject to the terms of either the GNU
7 * General Public License Version 2 only ("GPL") or the Common Development
8 * and Distribution License("CDDL") (collectively, the "License"). You
9 * may not use this file except in compliance with the License. You can obtain
10 * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
11 * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
12 * language governing permissions and limitations under the License.
13 *
14 * When distributing the software, include this License Header Notice in each
15 * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
16 * Sun designates this particular file as subject to the "Classpath" exception
17 * as provided by Sun in the GPL Version 2 section of the License file that
18 * accompanied this code. If applicable, add the following below the License
19 * Header, with the fields enclosed by brackets [] replaced by your own
20 * identifying information: "Portions Copyrighted [year]
21 * [name of copyright owner]"
22 *
23 * Contributor(s):
24 *
25 * If you wish your version of this file to be governed by only the CDDL or
26 * only the GPL Version 2, indicate your decision by adding "[Contributor]
27 * elects to include this software in this distribution under the [CDDL or GPL
28 * Version 2] license." If you don't indicate a single choice of license, a
29 * recipient has the option to distribute your version of this file under
30 * either the CDDL, the GPL Version 2 or to extend the choice of license to
31 * its licensees as provided above. However, if you add GPL Version 2 code
32 * and therefore, elected the GPL Version 2 license, then the option applies
33 * only if the new code is made subject to such option by the copyright
34 * holder.
35 */
36 package javax.resource.cci;
37
38
39 /** The <code>javax.resource.cci.Record</code> interface is the base
40 * interface for the representation of an input or output to the
41 * execute methods defined on an Interaction.
42 *
43 * <p>The Record interface can be extended to form a one of the
44 * following representations:
45 * <UL>
46 * <LI> MappedRecord: A key-value pair based collection represents
47 * a record. This interface is based on the <code>java.util.Map</code>
48 * <LI> IndexedRecord:An ordered and indexed collection represents
49 * a record. This interface is based on the <code>java.util.List</code>.
50 * <LI> JavaBean based representation of an EIS abstraction: An
51 * example is a custom record generated to represent a purchase
52 * order in an ERP system.
53 * <LI> <code>javax.resource.cci.ResultSet</code>: This interface
54 * extends both <code>java.sql.ResultSet</code> and <code>
55 * javax.resource.cci.Record</code>. A ResultSet
56 * represents tabular data.
57 * </UL>
58 *
59 * <p>A MappedRecord or IndexedRecord can contain another Record. This
60 * means that MappedRecord and IndexedRecord can be used to create
61 * a hierarchical structure of any arbitrary depth. A basic Java
62 * type is used as the leaf element of a hierarchical structure
63 * represented by a MappedRecord or IndexedRecord.
64 *
65 * @author Rahul Sharma
66 * @version 0.8
67 * @see javax.resource.cci.Interaction
68 * @see java.sql.ResultSet
69 **/
70 public interface Record extends java.lang.Cloneable, java.io.Serializable {
71
72 /** Gets the name of the Record.
73 *
74 * @return String representing name of the Record
75 **/
76 public
77 String getRecordName();
78
79 /** Sets the name of the Record.
80 *
81 * @param name Name of the Record
82 **/
83 public
84 void setRecordName(String name);
85
86 /** Sets a short description string for the Record. This property
87 * is used primarily by application development tools.
88 *
89 * @param description Description of the Record
90 **/
91 public
92 void setRecordShortDescription(String description);
93
94 /** Gets a short description string for the Record. This property
95 * is used primarily by application development tools.
96 *
97 * @return String representing a short description of the Record
98 **/
99 public
100 String getRecordShortDescription();
101
102 /** Check if this instance is equal to another Record.
103 *
104 * @return true if two instances are equal
105 **/
106 public
107 boolean equals(Object other);
108
109
110 /** Returns the hash code for the Record instance.
111 *
112 * @return hash code
113 **/
114 public
115 int hashCode();
116
117 /** Creates and returns a copy of this object. The precise
118 * meaning of "copy" may depend on the class of the object.
119 *
120 * @return a clone of this instance.
121 * @throws CloneNotSupportedException
122 * If the object's class does not support the
123 * Cloneable interface Subclasses that override the
124 * clone method can also throw this exception to
125 * indicate that an instance cannot be cloned.
126 **/
127 public
128 Object clone() throws CloneNotSupportedException;
129
130 }