1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package com.ontotext.ordi;
19
20 import java.util.Map;
21
22 import com.ontotext.ordi.exception.ORDIException;
23
24 /**
25 * A factory for connections to the physical data source that this
26 * {@link DataSource} represents. An object that implements the DataSource
27 * interface will typically be registered with a naming service based on the
28 * JavaTM Naming and Directory (JNDI) API.
29 *
30 * @author vassil
31 *
32 */
33 public interface DataSource extends Wrapper, WarningAware {
34
35 /**
36 * Retrieves the meta-data properties used to create this {@link DataSource}.
37 *
38 * @return collection of key/values
39 */
40 public abstract Map<Object, Object> getMetaData();
41
42 /**
43 * Creates new connection with default values.
44 *
45 * @return connection to the physical data source.
46 * @throws ORDIException
47 */
48 public abstract Connection getConnection() throws ORDIException;
49
50 /**
51 * Creates a new connection with specified user name and password.
52 *
53 * @param user
54 * name to be used.
55 * @param pass
56 * of the specified user.
57 * @return connection to the physical data source.
58 * @throws ORDIException
59 */
60 public abstract Connection getConnection(String user, String pass)
61 throws ORDIException;
62
63 /**
64 * Sends a signal to the server for shutdown. There is no strict definition
65 * how the different implementation have to process it.
66 */
67 public void shutdown();
68
69 /**
70 * Verifies whether the server instance is shutdown.
71 * @return
72 */
73 public boolean isShutdown();
74 }