public class JDBCBackingEngine extends Object implements BackingEngine
GROUP_PREFIX| Constructor and Description |
|---|
JDBCBackingEngine(DataSource dataSource) |
JDBCBackingEngine(DataSource dataSource,
EncryptionSupport encryptionSupport) |
| Modifier and Type | Method and Description |
|---|---|
void |
addGroup(String username,
String group)
Add a user into a given group.
|
void |
addGroupRole(String group,
String role)
Add a role in a group.
|
void |
addRole(String username,
String role)
Add a role to a user.
|
void |
addUser(String username,
String password)
Add a new user.
|
void |
createGroup(String group)
Create a group
|
void |
deleteGroup(String username,
String group)
Remove a user from a group.
|
void |
deleteGroupRole(String group,
String role)
Remove a role from a group.
|
void |
deleteRole(String username,
String role)
Remove role from user.
|
void |
deleteUser(String username)
Delete user by username.
|
String |
getAddRoleStatement() |
String |
getAddUserStatement() |
String |
getDeleteAllUserRolesStatement() |
String |
getDeleteRoleStatement() |
String |
getDeleteUserStatement() |
String |
getSelectRolesQuery() |
String |
getSelectUsersQuery() |
Map<org.apache.karaf.jaas.boot.principal.GroupPrincipal,String> |
listGroups()
List all groups.
|
List<org.apache.karaf.jaas.boot.principal.GroupPrincipal> |
listGroups(org.apache.karaf.jaas.boot.principal.UserPrincipal principal)
List groups that a user is member of.
|
List<org.apache.karaf.jaas.boot.principal.RolePrincipal> |
listRoles(Principal principal)
List the roles of the
principal. |
List<org.apache.karaf.jaas.boot.principal.UserPrincipal> |
listUsers()
List all users.
|
org.apache.karaf.jaas.boot.principal.UserPrincipal |
lookupUser(String username)
Retrieve the
UserPrincipal corresponding to an username, or null if user doesn't exist. |
protected List<String> |
rawSelect(Connection connection,
String query,
String... params) |
protected void |
rawUpdate(Connection connection,
String query,
String... params) |
void |
setAddRoleStatement(String addRoleStatement) |
void |
setAddUserStatement(String addUserStatement) |
void |
setDeleteAllUserRolesStatement(String deleteAllUserRolesStatement) |
void |
setDeleteRoleStatement(String deleteRoleStatement) |
void |
setDeleteUserStatement(String deleteUserStatement) |
void |
setSelectRolesQuery(String selectRolesQuery) |
void |
setSelectUsersQuery(String selectUsersQuery) |
public JDBCBackingEngine(DataSource dataSource)
public JDBCBackingEngine(DataSource dataSource, EncryptionSupport encryptionSupport)
public void addUser(String username, String password)
addUser in interface BackingEngineusername - the user name.password - the user password.public void deleteUser(String username)
deleteUser in interface BackingEngineusername - the user name.public List<org.apache.karaf.jaas.boot.principal.UserPrincipal> listUsers()
listUsers in interface BackingEngineUserPrincipal.public org.apache.karaf.jaas.boot.principal.UserPrincipal lookupUser(String username)
BackingEngineUserPrincipal corresponding to an username, or null if user doesn't exist.lookupUser in interface BackingEngineusername - The username.UserPrincipal or null.public List<org.apache.karaf.jaas.boot.principal.RolePrincipal> listRoles(Principal principal)
principal.listRoles in interface BackingEngineprincipal - the principal (user or group).RolePrincipal.public void addRole(String username, String role)
addRole in interface BackingEngineusername - the user name.role - the role.public void deleteRole(String username, String role)
deleteRole in interface BackingEngineusername - the user name.role - the role to remove.public List<org.apache.karaf.jaas.boot.principal.GroupPrincipal> listGroups(org.apache.karaf.jaas.boot.principal.UserPrincipal principal)
BackingEnginelistGroups in interface BackingEngineprincipal - the UserPrincipal.GroupPrincipal.public void addGroup(String username, String group)
BackingEngineaddGroup in interface BackingEngineusername - the user name.group - the group.public void deleteGroup(String username, String group)
BackingEnginedeleteGroup in interface BackingEngineusername - the user name.group - the group.public void addGroupRole(String group, String role)
BackingEngineaddGroupRole in interface BackingEnginegroup - the group.role - the role.public void deleteGroupRole(String group, String role)
BackingEnginedeleteGroupRole in interface BackingEnginegroup - the group.role - the role.protected void rawUpdate(Connection connection, String query, String... params) throws SQLException
SQLExceptionprotected List<String> rawSelect(Connection connection, String query, String... params) throws SQLException
SQLExceptionpublic String getAddUserStatement()
public void setAddUserStatement(String addUserStatement)
public String getAddRoleStatement()
public void setAddRoleStatement(String addRoleStatement)
public String getDeleteRoleStatement()
public void setDeleteRoleStatement(String deleteRoleStatement)
public String getDeleteAllUserRolesStatement()
public void setDeleteAllUserRolesStatement(String deleteAllUserRolesStatement)
public String getDeleteUserStatement()
public void setDeleteUserStatement(String deleteUserStatement)
public String getSelectUsersQuery()
public void setSelectUsersQuery(String selectUsersQuery)
public String getSelectRolesQuery()
public void setSelectRolesQuery(String selectRolesQuery)
public Map<org.apache.karaf.jaas.boot.principal.GroupPrincipal,String> listGroups()
BackingEnginelistGroups in interface BackingEnginepublic void createGroup(String group)
BackingEnginecreateGroup in interface BackingEnginegroup - the group.Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.