All Examples  Security Examples  This Package

Class examples.security.rdbmsrealm.RDBMSDelegate

java.lang.Object
    |
    +----examples.security.rdbmsrealm.RDBMSDelegate

class RDBMSDelegate
extends java.lang.Object
Author:
Copyright (c) 1998-2000 by BEA Systems, Inc. All Rights Reserved.

Class Index

 o RDBMSDelegate.DFactory
This is the factory class that creates instances of the RDBMSDelegate class for pooling.
 o RDBMSDelegate.Finished
We use this class to indicate to a caller that a method has reached the end of a ResultSet.

Variable Index

 o aclOwner
This is the bogus owner associated with all ACLs found in the database.
 o addGroupMemberStmt
 
 o conn
The main connection to the database.
 o conn2
 
 o conn3
 
 o conn4
 
 o DB_PASSWORD
 
 o DB_URL
 
 o DB_USER
 
 o DRIVER
 
 o getAclEntriesStmt
 
 o getAclsStmt
 
 o getGroupMembersStmt
 
 o getGroupNewStatement
Determine whether or not we need to create a new SQL statement for recursive calls to getGroup.
 o getGroupsStmt
 
 o getPermissionsStmt
 
 o getPermissionStmt
 
 o getUsersStmt
 
 o getUserStmt
 
 o newUserStmt
 
 o properties
 
 o realm
The realm with which this delegate is associated.

Constructor Index

 o RDBMSDelegate(RDBMSRealm)
Create a new delegate, associated with the given realm.

Method Index

 o addGroupMember(RDBMSGroup, Principal)
 
 o close()
Clean up after ourselves.
 o finalize()
Clean up after ourselves.
 o getAcl(String)
Get an ACL from the database, or null if the ACL doesn't exist.
 o getAclInternal(String, ResultSet)
Called by both getAcl and getAcls.
 o getAcls()
Get all ACLs from the database.
 o getGroup(String)
Get the named group from the database, or null if it doesn't exist.
 o getGroupInternal(String, ResultSet)
This method is called both by getGroup and getGroups.
 o getGroups()
Get all groups from the database.
 o getPermission(String)
Obtain the named permission from the database, or null if none.
 o getPermissions()
Return an Enumeration of the permissions for this realm.
 o getPrincipal(String)
Resolve a name to a User or Group.
 o getUser(String)
Get a user from the database, or null if the user doesn't exist.
 o getUsers()
Get all users from the database.
 o newUser(String, String)
 
 o prepare(String)
A shorthand convenience function for preparing an SQL statement.

Field Detail

 o DRIVER
static final java.lang.String DRIVER
 o DB_URL
static final java.lang.String DB_URL
 o DB_USER
static final java.lang.String DB_USER
 o DB_PASSWORD
static final java.lang.String DB_PASSWORD
 o realm
protected RDBMSRealm realm
          The realm with which this delegate is associated.
 o conn
protected java.sql.Connection conn
          The main connection to the database.
 o conn2
protected java.sql.Connection conn2
 o conn3
protected java.sql.Connection conn3
 o conn4
protected java.sql.Connection conn4
 o properties
private examples.security.util.RealmProperties properties
 o getUserStmt
private java.sql.PreparedStatement getUserStmt
 o getGroupMembersStmt
private java.sql.PreparedStatement getGroupMembersStmt
 o getPermissionStmt
private java.sql.PreparedStatement getPermissionStmt
 o getAclEntriesStmt
private java.sql.PreparedStatement getAclEntriesStmt
 o getUsersStmt
private java.sql.PreparedStatement getUsersStmt
 o getGroupsStmt
private java.sql.PreparedStatement getGroupsStmt
 o getAclsStmt
private java.sql.PreparedStatement getAclsStmt
 o getPermissionsStmt
private java.sql.PreparedStatement getPermissionsStmt
 o newUserStmt
private java.sql.PreparedStatement newUserStmt
 o addGroupMemberStmt
private java.sql.PreparedStatement addGroupMemberStmt
 o getGroupNewStatement
private boolean getGroupNewStatement
          Determine whether or not we need to create a new SQL statement for recursive calls to getGroup. Some servers need this, and some don't.
 o aclOwner
protected java.security.Principal aclOwner
          This is the bogus owner associated with all ACLs found in the database.

Constructor Detail

 o RDBMSDelegate
RDBMSDelegate(RDBMSRealm realm)
          Create a new delegate, associated with the given realm.
Throws:
RDBMSException - an error occurred in fetching properties or communicating with the database

Method Detail

 o prepare
protected java.sql.PreparedStatement prepare(java.lang.String propKey) throws java.sql.SQLException, RDBMSException
          A shorthand convenience function for preparing an SQL statement.
Parameters:
name - the name of the statement to prepare
 o getUser
RDBMSUser getUser(java.lang.String name) throws java.sql.SQLException
          Get a user from the database, or null if the user doesn't exist.
 o getUsers
java.util.Enumeration getUsers() throws java.sql.SQLException
          Get all users from the database.
 o getGroup
RDBMSGroup getGroup(java.lang.String name) throws java.sql.SQLException
          Get the named group from the database, or null if it doesn't exist.
 o getGroups
java.util.Enumeration getGroups() throws java.sql.SQLException
          Get all groups from the database. Note that in this realm, empty groups cannot currently exist.
 o newUser
RDBMSUser newUser(java.lang.String name,
                  java.lang.String passwd) throws java.sql.SQLException, java.lang.SecurityException
 o getGroupInternal
protected RDBMSGroup getGroupInternal(java.lang.String name,
                                      java.sql.ResultSet rs) throws RDBMSDelegate.Finished, java.sql.SQLException
          This method is called both by getGroup and getGroups. It looks through the given ResultSet and gathers group members until it either hits a differently-named group or the end of the ResultSet.
 o addGroupMember
boolean addGroupMember(RDBMSGroup group,
                       java.security.Principal member) throws java.sql.SQLException
 o getAcl
weblogic.security.acl.AclImpl getAcl(java.lang.String name) throws java.sql.SQLException
          Get an ACL from the database, or null if the ACL doesn't exist.
 o getAcls
java.util.Enumeration getAcls() throws java.sql.SQLException
          Get all ACLs from the database.
 o getAclInternal
protected weblogic.security.acl.AclImpl getAclInternal(java.lang.String name,
                                 java.sql.ResultSet rs) throws RDBMSDelegate.Finished, java.sql.SQLException
          Called by both getAcl and getAcls.
 o getPrincipal
protected java.security.Principal getPrincipal(java.lang.String name) throws java.sql.SQLException
          Resolve a name to a User or Group. If the principal in question doesn't exist in the database, we return null.
 o getPermission
weblogic.security.acl.PermissionImpl getPermission(java.lang.String name) throws java.sql.SQLException
          Obtain the named permission from the database, or null if none.
 o getPermissions
java.util.Enumeration getPermissions() throws java.sql.SQLException
          Return an Enumeration of the permissions for this realm.
 o finalize
protected void finalize()
          Clean up after ourselves.
Overrides:
finalize in class java.lang.Object
 o close
void close()
          Clean up after ourselves.

All Examples  Security Examples  This Package