Split out datastore implementation from aaa-shiro
[aaa.git] / aaa-idm-store-h2 / src / main / java / org / opendaylight / aaa / datastore / h2 / ConnectionProvider.java
1 /*
2  * Copyright (c) 2016 Red Hat, Inc. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.aaa.datastore.h2;
9
10 import java.sql.Connection;
11 import javax.sql.DataSource;
12
13 /**
14  * Provider of JDBC Connections.
15  * Essentially a much simplified {@link DataSource}.
16  *
17  * @author Michael Vorburger
18  */
19 public interface ConnectionProvider {
20
21     /**
22      * Get a Connection.
23      *
24      * @return a connection from this Factory; it may be a brand new one
25      *         obtained from the JDBC Driver, or an existing open one, if it
26      *         hasn't previously been closed
27      * @throws StoreException
28      *             if no Connection could be obtained
29      */
30     Connection getConnection() throws StoreException;
31
32 }