KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sape > carbon > services > uniqueid > UniqueIDServiceConfiguration


1 /*
2  * The contents of this file are subject to the Sapient Public License
3  * Version 1.0 (the "License"); you may not use this file except in compliance
4  * with the License. You may obtain a copy of the License at
5  * http://carbon.sf.net/License.html.
6  *
7  * Software distributed under the License is distributed on an "AS IS" basis,
8  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
9  * the specific language governing rights and limitations under the License.
10  *
11  * The Original Code is The Carbon Component Framework.
12  *
13  * The Initial Developer of the Original Code is Sapient Corporation
14  *
15  * Copyright (C) 2003 Sapient Corporation. All Rights Reserved.
16  */

17
18 package org.sape.carbon.services.uniqueid;
19
20
21 import org.sape.carbon.core.component.ComponentConfiguration;
22 import org.sape.carbon.services.sql.StatementFactory;
23 import org.sape.carbon.services.sql.connection.ConnectionFactory;
24
25 /**
26  * <p>An Interface that represents the Factory configuration.</p>
27  *
28  * Copyright 2002 Sapient
29  * @since carbon 1.0
30  * @author Vivekanand Kirubanandan, June 2002
31  * @version $Revision: 1.4 $($Author: dvoet $ / $Date: 2003/05/05 21:21:38 $)
32  */

33 public interface UniqueIDServiceConfiguration
34     extends ComponentConfiguration {
35
36     /** Default value for InitialBlockStart */
37     long InitialBlockStart = 0;
38
39     /**
40      * InitialBlockStart is used to define the starting value of the ID
41      * in the case that the ID is automatically created by the service
42      *
43      * @return the first value of an ID that is automatically
44      * created
45      */

46     long getInitialBlockStart();
47
48     /**
49      * InitialBlockStart is used to define the starting value of the ID
50      * in the case that the ID is automatically created by the service.
51      *
52      * @param startValue the first value of an ID that is automatically
53      * created
54      */

55     void setInitialBlockStart(long startValue);
56
57     /**
58      * IDName identifies the UniqueID in the database (required)
59      *
60      * @return the name of the unique id
61      */

62     String JavaDoc getIDName();
63
64     /**
65      * IDName identifies the UniqueID in the database (required)
66      *
67      * @param name the name of the unique id
68      */

69     void setIDName(String JavaDoc name);
70
71     /** Default value for BlockSize */
72     long BlockSize = 100;
73
74     /**
75      * BlockSize is the number of IDs that is reserved upon each call to the
76      * database. This should be optimized to minimize hits to the database.
77      *
78      * @return the blocksize to reservice in the database
79      */

80     long getBlockSize();
81
82     /**
83      * BlockSize is the number of IDs that is reserved upon each call to the
84      * database. This should be optimized to minimize hits to the database.
85      *
86      * @param size the blocksize to reservce in the database
87      */

88     void setBlockSize(long size);
89
90     /** Default value for AutoCreate */
91     boolean AutoCreate = true;
92
93     /**
94      * AutoCreate specifies whether or not the ID should be created if it
95      * does not exist. If this is true, the ID will be automatically created
96      *
97      * @return indicates if the id will be auto created.
98      */

99     boolean isAutoCreate();
100
101     /**
102      * AutoCreate specifies whether or not the ID should be created if it
103      * does not exist. If this is true, the ID will be automatically created
104      *
105       * @param autoCreate should the id be auto created
106      */

107     void setAutoCreate(boolean autoCreate);
108
109     /**
110      * Reference to the StatementFactory that this service will use to
111      * create sql statements (required)
112      *
113      * @return statement factory to use with the service
114      */

115     StatementFactory getStatementFactory();
116
117     /**
118      * Reference to the StatementFactory that this service will use to
119      * create sql statements (required)
120      *
121      * @param factory statement factory to use with the service
122      */

123     void setStatementFactory(StatementFactory factory);
124
125
126     /**
127      * Reference to the ConnectionFactory that this service will use to
128      * create connections to the database (required)
129      *
130      * @return connection factory to use with the service
131      */

132     ConnectionFactory getConnectionFactory();
133
134     /**
135      * Reference to the ConnectionFactory that this service will use to
136      * create connections to the database (required)
137      *
138      * @param factory connection factory to use with the service
139      */

140     void setConnectionFactory(ConnectionFactory factory);
141
142     /** Default value for RetrieveStatementName */
143     String JavaDoc RetrieveStatementName = "RetrieveUniqueID";
144
145     /**
146      * Name of a PreparedStatement configured within the StatementFactory
147      * used to get the starting value of the next available block of IDs
148      *
149      * @return name of the prepared statement
150      */

151     String JavaDoc getRetrieveStatementName();
152
153     /**
154      * Name of a PreparedStatement configured within the StatementFactory
155      * used to get the starting value of the next available block of IDs
156      *
157      * @param name name of the prepared statement
158      */

159     void setRetrieveStatementName(String JavaDoc name);
160
161     /** Default value for UpdateStatementName */
162     String JavaDoc UpdateStatementName = "UpdateUniqueID";
163
164     /**
165      * Name of a PreparedStatement configured within the StatementFactory
166      * used to update the starting value of the next available block of IDs
167      *
168      * @return name of the prepared statement
169      */

170     String JavaDoc getUpdateStatementName();
171
172     /**
173      * Name of a PreparedStatement configured within the StatementFactory
174      * used to update the starting value of the next available block of IDs
175      *
176      * @param name name of the prepared statement
177      */

178     void setUpdateStatementName(String JavaDoc name);
179
180     /** Default value for CreateStatementName */
181     String JavaDoc CreateStatementName = "CreateUniqueID";
182
183     /**
184      * Name of a PreparedStatement configured within the StatementFactory
185      * used to create a new ID
186      *
187      * @return name of the prepared statement
188      */

189     String JavaDoc getCreateStatementName();
190
191     /**
192      * Name of a PreparedStatement configured within the StatementFactory
193      * used to create a new ID
194      *
195      * @param name name of the prepared statement
196      */

197     void setCreateStatementName(String JavaDoc name);
198
199 }
Popular Tags