Drop explicit jetty-servlets dependency
[aaa.git] / aaa-shiro / impl / src / main / java / org / opendaylight / aaa / impl / shiro / realm / ODLJdbcRealm.java
1 /*
2  * Copyright (c) 2016, 2017 Brocade Communications Systems, 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.shiro.realm;
9
10 import org.apache.shiro.realm.jdbc.JdbcRealm;
11 import org.slf4j.Logger;
12 import org.slf4j.LoggerFactory;
13
14 /**
15  * Wraps the generic <code>JdbcRealm</code> provided by Shiro.  This allows for
16  * enhanced logging as well as isolation of all realms in a single package,
17  * <code>org.opendaylight.aaa.shiro.realm</code>, which enables easier import
18  * by consuming servlets.  JdbcRealm allows integration of AAA with a generic
19  * JDBC-supporting data source.  This can ease deployment with existing OSS
20  * systems.
21  *
22  * To enabled the <code>ODLJdbcRealm</code>, modify the realms declaration in
23  * <code>etc/shiro.ini</code> as follows:
24  * <code>
25  * ds = com.mysql.jdbc.Driver
26  * ds.serverName = localhost
27  * ds.user = user
28  * ds.password = password
29  * ds.databaseName = db_name
30  * jdbcRealm = org.opendaylight.aaa.shiro.realm.ODLJdbcRealm
31  * jdbcRealm.dataSource = $ds
32  * jdbcRealm.authenticationQuery = "SELECT password FROM users WHERE user_name = ?"
33  * jdbcRealm.userRolesQuery = "SELECT role_name FROM user_rolesWHERE user_name = ?"
34  * ...
35  * securityManager.realms = $tokenAuthRealm, $jdbcRealm
36  * </code>
37  * Note that the values you use for these fields will likely differ from the
38  * ones provided above based on your particular deployment scenario.
39  */
40 public class ODLJdbcRealm extends JdbcRealm {
41
42     private static final Logger LOG = LoggerFactory.getLogger(ODLJdbcRealm.class);
43
44     public ODLJdbcRealm() {
45         LOG.debug("Creating an instance of ODLJdbcRealm to use with AAA");
46     }
47 }