    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.

##

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

##

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

##

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

##

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

##

DRIVER

    static final java.lang.String DRIVER

DB_URL

    static final java.lang.String DB_URL

DB_USER

    static final java.lang.String DB_USER

DB_PASSWORD

    static final java.lang.String DB_PASSWORD

realm

    protected RDBMSRealm realm

The realm with which this delegate is associated.

conn

    protected java.sql.Connection conn

The main connection to the database.

conn2

    protected java.sql.Connection conn2

conn3

    protected java.sql.Connection conn3

conn4

    protected java.sql.Connection conn4

properties

    private examples.security.util.RealmProperties properties

getUserStmt

    private java.sql.PreparedStatement getUserStmt

getGroupMembersStmt

    private java.sql.PreparedStatement getGroupMembersStmt

getPermissionStmt

    private java.sql.PreparedStatement getPermissionStmt

getAclEntriesStmt

    private java.sql.PreparedStatement getAclEntriesStmt

getUsersStmt

    private java.sql.PreparedStatement getUsersStmt

getGroupsStmt

    private java.sql.PreparedStatement getGroupsStmt

getAclsStmt

    private java.sql.PreparedStatement getAclsStmt

getPermissionsStmt

    private java.sql.PreparedStatement getPermissionsStmt

newUserStmt

    private java.sql.PreparedStatement newUserStmt

addGroupMemberStmt

    private java.sql.PreparedStatement addGroupMemberStmt

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.

aclOwner

    protected java.security.Principal aclOwner

This is the bogus owner associated with all ACLs found in the database.

##

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

##

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

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.

getUsers

    java.util.Enumeration getUsers() throws java.sql.SQLException

Get all users from the database.

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.

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.

newUser

    RDBMSUser newUser(java.lang.String name,
                      java.lang.String passwd) throws java.sql.SQLException, java.lang.SecurityException

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.

addGroupMember

    boolean addGroupMember(RDBMSGroup group,
                           java.security.Principal member) throws java.sql.SQLException

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.

getAcls

    java.util.Enumeration getAcls() throws java.sql.SQLException

Get all ACLs from the database.

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.

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.

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.

getPermissions

    java.util.Enumeration getPermissions() throws java.sql.SQLException

Return an Enumeration of the permissions for this realm.

finalize

    protected void finalize()

Clean up after ourselves.
  Overrides:
    finalize in class java.lang.Object

close

    void close()

Clean up after ourselves.

    All Examples  Security Examples  This Package