KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > rift > coad > daemon > hsqldb > HsqlDBEngine


1 /*
2  * HsqlDBEngineClient: The hsql database engine wrapper.
3  * Copyright (C) 2006 Rift IT Contracting
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  * HsqlDBEngine.java
20  */

21
22 // package path
23
package com.rift.coad.daemon.hsqldb;
24
25 // java imports
26
import java.rmi.Remote JavaDoc;
27 import java.rmi.RemoteException JavaDoc;
28
29 /**
30  * This interface supplies access to the Hsql server methods.
31  *
32  * @author Brett Chaldecott
33  */

34 public interface HsqlDBEngine extends Remote JavaDoc {
35     
36     /**
37      * Retrieves, in string form, this server's host address.
38      *
39      * @return this server's host address
40      *
41      * @jmx.managed-attribute
42      * access="read-write"
43      * description="Host InetAddress"
44      * @exception RemoteException
45      * @exception HsqlDBEngineException
46      */

47     public String JavaDoc getAddress() throws RemoteException JavaDoc, HsqlDBEngineException;
48     
49     
50     /**
51      * Retrieves the url alias (network name) of the i'th database
52      * that this Server hosts.
53      *
54      * @param index the index of the url alias upon which to report
55      * @param asconfigured if true, report the configured value, else
56      * the live value
57      * @return the url alias component of the i'th database
58      * that this Server hosts, or null if no such name exists.
59      *
60      * @jmx.managed-operation
61      * impact="INFO"
62      * description="url alias component of the i'th hosted Database"
63      *
64      * @jmx.managed-operation-parameter
65      * name="index"
66      * type="int"
67      * position="0"
68      * description="This Server's index for the hosted Database"
69      *
70      * @jmx.managed-operation-parameter
71      * name="asconfigured"
72      * type="boolean"
73      * position="1"
74      * description="if true, the configured value, else the live value"
75      *
76      * @exception RemoteException
77      * @exception HsqlDBEngineException
78      */

79     public String JavaDoc getDatabaseName(int index, boolean asconfigured) throws
80             RemoteException JavaDoc, HsqlDBEngineException;
81     
82     
83     /**
84      * Retrieves the HSQLDB path descriptor (uri) of the i'th
85      * Database that this Server hosts.
86      *
87      * @param index the index of the uri upon which to report
88      * @param asconfigured if true, report the configured value, else
89      * the live value
90      * @return the HSQLDB database path descriptor of the i'th database
91      * that this Server hosts, or null if no such path descriptor
92      * exists
93      *
94      * @jmx.managed-operation
95      * impact="INFO"
96      * description="For i'th hosted database"
97      *
98      * @jmx.managed-operation-parameter
99      * name="index"
100      * type="int"
101      * position="0"
102      * description="This Server's index for the hosted Database"
103      *
104      * @jmx.managed-operation-parameter
105      * name="asconfigured"
106      * type="boolean"
107      * position="1"
108      * description="if true, the configured value, else the live value"
109      *
110      * @exception RemoteException
111      * @exception HsqlDBEngineException
112      */

113     public String JavaDoc getDatabasePath(int index, boolean asconfigured) throws
114             RemoteException JavaDoc, HsqlDBEngineException;
115     
116     
117     /**
118      * This method returns the HsqlDB type
119      *
120      * @return A string containing the type of this db.
121      * @param index The index of this type.
122      * @exception RemoteException
123      * @exception HsqlDBEngineException
124      */

125     public String JavaDoc getDatabaseType(int index) throws RemoteException JavaDoc,
126             HsqlDBEngineException;
127     
128     
129     /**
130      * Retrieves this server's host port.
131      *
132      * @return this server's host port
133      *
134      * @jmx.managed-attribute
135      * access="read-write"
136      * description="At which ServerSocket listens for connections"
137      *
138      * @exception RemoteException
139      * @exception HsqlDBEngineException
140      */

141     public int getPort() throws RemoteException JavaDoc, HsqlDBEngineException;
142     
143     
144     /**
145      * Retrieves this server's product name. <p>
146      *
147      * Typically, this will be something like: "HSQLDB xxx server".
148      *
149      * @return the product name of this server
150      *
151      * @jmx.managed-attribute
152      * access="read-only"
153      * description="Of Server"
154      *
155      * @exception RemoteException
156      * @exception HsqlDBEngineException
157      */

158     public String JavaDoc getProductName() throws RemoteException JavaDoc, HsqlDBEngineException;
159     
160     
161     /**
162      * Retrieves the server's product version, as a String. <p>
163      *
164      * Typically, this will be something like: "1.x.x" or "2.x.x" and so on.
165      *
166      * @return the product version of the server
167      *
168      * @jmx.managed-attribute
169      * access="read-only"
170      * description="Of Server"
171      *
172      * @exception RemoteException
173      * @exception HsqlDBEngineException
174      */

175     public String JavaDoc getProductVersion() throws RemoteException JavaDoc,
176             HsqlDBEngineException;
177     
178     
179     /**
180      * Retrieves a string respresentaion of the network protocol
181      * this server offers, typically one of 'HTTP', HTTPS', 'HSQL' or 'HSQLS'.
182      *
183      * @return string respresentation of this server's protocol
184      *
185      * @jmx.managed-attribute
186      * access="read-only"
187      * description="Used to handle connections"
188      *
189      * @exception RemoteException
190      * @exception HsqlDBEngineException
191      */

192     public String JavaDoc getProtocol() throws RemoteException JavaDoc, HsqlDBEngineException;
193     
194     
195     /**
196      * Retrieves a String identifying this Server object.
197      *
198      * @return a String identifying this Server object
199      *
200      * @jmx.managed-attribute
201      * access="read-only"
202      * description="Identifying Server"
203      *
204      * @exception RemoteException
205      * @exception HsqlDBEngineException
206      */

207     public String JavaDoc getServerId() throws RemoteException JavaDoc, HsqlDBEngineException;
208     
209     
210     /**
211      * Retrieves current state of this server in numerically coded form. <p>
212      *
213      * Typically, this will be one of: <p>
214      *
215      * <ol>
216      * <li>ServerProperties.SERVER_STATE_ONLINE (1)
217      * <li>ServerProperties.SERVER_STATE_OPENING (4)
218      * <li>ServerProperties.SERVER_STATE_CLOSING (8)
219      * <li>ServerProperties.SERVER_STATE_SHUTDOWN (16)
220      * </ol>
221      *
222      * @return this server's state code.
223      *
224      * @jmx.managed-attribute
225      * access="read-only"
226      * description="1:ONLINE 4:OPENING 8:CLOSING, 16:SHUTDOWN"
227      *
228      * @exception RemoteException
229      * @exception HsqlDBEngineException
230      */

231     public int getState() throws RemoteException JavaDoc, HsqlDBEngineException;
232     
233     
234     /**
235      * Retrieves a character sequence describing this server's current state,
236      * including the message of the last exception, if there is one and it
237      * is still in context.
238      *
239      * @return this server's state represented as a character sequence.
240      *
241      * @jmx.managed-attribute
242      * access="read-only"
243      * description="State as string"
244      *
245      * @exception RemoteException
246      * @exception HsqlDBEngineException
247      */

248     public String JavaDoc getStateDescriptor() throws RemoteException JavaDoc,
249             HsqlDBEngineException;
250     
251     
252     /**
253      * Retrieves whether the use of secure sockets was requested in the
254      * server properties.
255      *
256      * @return if true, secure sockets are requested, else not
257      *
258      * @jmx.managed-attribute
259      * access="read-write"
260      * description="Use TLS/SSL sockets?"
261      *
262      * @exception RemoteException
263      * @exception HsqlDBEngineException
264      */

265     public boolean isTls() throws RemoteException JavaDoc, HsqlDBEngineException;
266     
267     /**
268      * Attempts to put properties from the file
269      * with the specified path. The file
270      * extension '.properties' is implicit and should not
271      * be included in the path specification.
272      *
273      * @param path the path of the desired properties file, without the
274      * '.properties' file extension
275      * @throws RuntimeException if this server is running
276      * @return true if the indicated file was read sucessfully, else false
277      *
278      * @jmx.managed-operation
279      * impact="ACTION"
280      * description="Reads in properties"
281      *
282      * @jmx.managed-operation-parameter
283      * name="path"
284      * type="java.lang.String"
285      * position="0"
286      * description="(optional) returns false if path is empty"
287      *
288      * @exception RemoteException
289      * @exception HsqlDBEngineException
290      */

291     public boolean putPropertiesFromFile(String JavaDoc path) throws RemoteException JavaDoc,
292             HsqlDBEngineException;
293     
294     
295     /**
296      * Puts properties from the supplied string argument. The relevant
297      * key value pairs are the same as those for the (web)server.properties
298      * file format, except that the 'server.' prefix should not be specified.
299      *
300      * @param s semicolon-delimited key=value pair string,
301      * e.g. k1=v1;k2=v2;k3=v3...
302      * @throws RuntimeException if this server is running
303      *
304      * @jmx.managed-operation
305      * impact="ACTION"
306      * description="'server.' key prefix automatically supplied"
307      *
308      * @jmx.managed-operation-parameter
309      * name="s"
310      * type="java.lang.String"
311      * position="0"
312      * description="semicolon-delimited key=value pairs"
313      *
314      * @exception RemoteException
315      * @exception HsqlDBEngineException
316      */

317     public void putPropertiesFromString(String JavaDoc s) throws RemoteException JavaDoc,
318             HsqlDBEngineException;
319     
320     
321 }
322
Popular Tags