All Examples Security Examples This Package
Class examples.security.rdbmsrealm.RDBMSRealm
java.lang.Object
|
+----weblogic.security.acl.AbstractListableRealm
|
+----weblogic.security.acl.AbstractManageableRealm
|
+----examples.security.rdbmsrealm.RDBMSRealm
- public class RDBMSRealm
- extends weblogic.security.acl.AbstractManageableRealm
- implements weblogic.security.acl.DebuggableRealm
RDBMS realm class. Note that due to the design of this
implementation, we do not allow empty groups and empty ACLs to
exist in the database.
- Author:
- Copyright (c) 1998-2000 by BEA Systems, Inc. All Rights Reserved.
-
delegatePool
- We maintain a pool of delegates, each with its own connection to
the database.
-
log
- The debugging log.
-
POOL_SIZE
- The maximum number of pooled database connections to maintain at
any given time.
-
RDBMS_DDL
- The name of the realm DDL file we will try to load.
-
RDBMS_PROPS
- The name of the realm properties file we will try to load.
-
RDBMSRealm()
- Create a new RDBMS realm object.
-
addGroupMember(RDBMSGroup, Principal)
- Return an enumeration of all users in the database.
-
authUserPassword(String, String)
- Authenticate the given user.
-
createGroup(String, Hashtable)
- Factory method for creating new group objects.
-
createUser(String, String)
- Factory method for creating new user objects.
-
getAcl(String)
- Return the ACL with the given name, or null if the ACL does
not exist in the database.
-
getAcls()
- Return an enumeration of all ACLs in the database.
-
getDebugLog()
- Obtain the debug log, if it is enabled.
-
getDelegate()
- Obtain a delegate from the pool.
-
getGroup(String)
- Return the group with the given name, or null if the group does
not exist in the database.
-
getGroupMembersInternal(String)
-
-
getGroups()
- Return an enumeration of all groups in the database.
-
getPermission(String)
- Get a Permission that matches the specified name.
-
getPermissions()
- Return an enumeration of all permissions in the database.
-
getPrincipal(String)
- Return the principal with the given name, or null if the
principal does not exist in the database.
-
getUser(String)
- Return the user with the given name, or null if the user does not
exist in the database.
-
getUsers()
- Return an enumeration of all users in the database.
-
newUser(String, Object, Object)
- Create a new User.
-
returnDelegate(RDBMSDelegate)
- Return a delegate to the pool.
-
setDebug(boolean)
- Enable or disable debug logging.
RDBMS_PROPS
static final java.lang.String RDBMS_PROPS
The name of the realm properties file we will try to load.
RDBMS_DDL
static final java.lang.String RDBMS_DDL
The name of the realm DDL file we will try to load.
POOL_SIZE
private static final int POOL_SIZE
The maximum number of pooled database connections to maintain at
any given time.
delegatePool
protected weblogic.utils.reuse.Pool delegatePool
We maintain a pool of delegates, each with its own connection to
the database. Access to the pool itself is synchronized, but
since only one thread will obtain a given delegate from the pool
at any time, we don't need to synchronize any other method calls.
- See Also:
- getDelegate, returnDelegate, RDBMSDelegate$DFactory
log
weblogic.logging.LogOutputStream log
The debugging log. This may be null.
RDBMSRealm
public RDBMSRealm()
Create a new RDBMS realm object.
getDelegate
protected RDBMSDelegate getDelegate()
Obtain a delegate from the pool. If the pool is empty, this may
cause a new delegate to be created and handed back to us. If a
fatal error occurs when you are using a delegate, do not return
it to the pool. You can do this by setting your reference to the
delegate to null and calling returnDelegate() as usual; it will
do the right thing.
- Throws:
- RDBMSException - an error occurred in communicating with
the database
- See Also:
- returnDelegate
returnDelegate
protected void returnDelegate(RDBMSDelegate delegate)
Return a delegate to the pool. If the delegate was set to null
because of errors, nothing is done.
- See Also:
- getDelegate
getUser
public weblogic.security.acl.User getUser(java.lang.String name)
Return the user with the given name, or null if the user does not
exist in the database.
- Parameters:
name
- the name to obtain
- Returns:
- the user, or null if none
- Throws:
- RDBMSException - an error occurred in communicating with
the database
- Overrides:
- getUser in class weblogic.security.acl.AbstractListableRealm
getPrincipal
java.security.Principal getPrincipal(java.lang.String name)
Return the principal with the given name, or null if the
principal does not exist in the database.
- Parameters:
name
- the name to obtain
- Returns:
- the principal, or null if none
- Throws:
- RDBMSException - an error occurred in communicating with
the database
getGroupMembersInternal
protected java.util.Hashtable getGroupMembersInternal(java.lang.String name)
- Overrides:
- getGroupMembersInternal in class weblogic.security.acl.AbstractListableRealm
getGroup
public java.security.acl.Group getGroup(java.lang.String name)
Return the group with the given name, or null if the group does
not exist in the database.
- Parameters:
name
- the name to obtain
- Returns:
- the group, or null if none
- Throws:
- RDBMSException - an error occurred in communicating with
the database
- Overrides:
- getGroup in class weblogic.security.acl.AbstractListableRealm
getAcl
public java.security.acl.Acl getAcl(java.lang.String name)
Return the ACL with the given name, or null if the ACL does
not exist in the database.
- Parameters:
name
- the name to obtain
- Returns:
- the ACL, or null if none
- Throws:
- RDBMSException - an error occurred in communicating with
the database
- Overrides:
- getAcl in class weblogic.security.acl.AbstractListableRealm
getUsers
public java.util.Enumeration getUsers()
Return an enumeration of all users in the database. Each element
of the Enumeration is a User object.
- Returns:
- all users
- Throws:
- RDBMSException - an error occurred in communicating with
the database
- Overrides:
- getUsers in class weblogic.security.acl.AbstractListableRealm
- See Also:
- weblogic.security.acl.User
addGroupMember
boolean addGroupMember(RDBMSGroup group,
java.security.Principal member)
Return an enumeration of all users in the database. Each element
of the Enumeration is a User object.
- Returns:
- all users
- Throws:
- RDBMSException - an error occurred in communicating with
the database
- See Also:
- weblogic.security.acl.User
getGroups
public java.util.Enumeration getGroups()
Return an enumeration of all groups in the database. Each
element of the Enumeration is a Group object. Note that in this
realm, empty groups cannot currently exist.
- Returns:
- all groups
- Throws:
- RDBMSException - an error occurred in communicating with
the database
- Overrides:
- getGroups in class weblogic.security.acl.AbstractListableRealm
- See Also:
- java.security.acl.Group
getAcls
public java.util.Enumeration getAcls()
Return an enumeration of all ACLs in the database. Each element
of the Enumeration is an Acl object. Note that in this realm,
empty ACLs cannot currently exist.
- Returns:
- all ACLs
- Throws:
- RDBMSException - an error occurred in communicating with
the database
- Overrides:
- getAcls in class weblogic.security.acl.AbstractListableRealm
- See Also:
- java.security.acl.Acl
getPermissions
public java.util.Enumeration getPermissions()
Return an enumeration of all permissions in the database. Each
element of the Enumeration is a Permission object.
- Returns:
- all permissions
- Throws:
- RDBMSException - an error occurred in communicating with
the database
- Overrides:
- getPermissions in class weblogic.security.acl.AbstractListableRealm
- See Also:
- java.security.acl.Permission
authUserPassword
protected weblogic.security.acl.User authUserPassword(java.lang.String name,
java.lang.String passwd)
Authenticate the given user. If the authentication step passes,
a User object is returned for that user, otherwise null is
returned.
- Returns:
- the authenticated user, or null
- Throws:
- RDBMSException - an error occurred in communicating with
the database
- Overrides:
- authUserPassword in class weblogic.security.acl.AbstractListableRealm
getPermission
public java.security.acl.Permission getPermission(java.lang.String name)
Get a Permission that matches the specified name. If no such
permission exists in the database, null is returned.
- Parameters:
name
- the name of the permission
- Returns:
- permission object, or nullp
- Throws:
- RDBMSException - an error occurred in communicating with
the database
- Overrides:
- getPermission in class weblogic.security.acl.AbstractListableRealm
newUser
public weblogic.security.acl.User newUser(java.lang.String name,
java.lang.Object credential,
java.lang.Object constraints) throws java.lang.SecurityException
Create a new User.
- Parameters:
name
- the name of the new user
credential
- the password for the user
constraints
- null, for this realm
- Returns:
- the new User
- Throws:
- java.lang.SecurityException - invalid credential or constraint
- Overrides:
- newUser in class weblogic.security.acl.AbstractManageableRealm
setDebug
public void setDebug(boolean enable)
Enable or disable debug logging.
getDebugLog
public weblogic.logging.LogOutputStream getDebugLog()
Obtain the debug log, if it is enabled.
createUser
RDBMSUser createUser(java.lang.String name,
java.lang.String passwd)
Factory method for creating new user objects.
createGroup
RDBMSGroup createGroup(java.lang.String name,
java.util.Hashtable members)
Factory method for creating new group objects.
All Examples Security Examples This Package