All Examples  This Package

Class examples.security.defaultrealm.DefaultRealmExtender

java.lang.Object
   |
   +----examples.security.defaultrealm.DefaultRealmExtender

public class DefaultRealmExtender
extends Object
implements ManageableRealm, DynamicUserAcl

You install this class by setting this property in the weblogic.properties file:

  weblogic.security.realmClass=examples.security.defaultrealm.DefaultRealmExtender

The class name of the underlying realm implementation may be set as a property value for "delegate.class" in a Java Class resource "properties" that exists in the same directory as the compiled class file, or change the "delegateClassName" static string in the example.

Author:
Copyright (c) 1997-1999 by BEA Systems. All Rights Reserved.

Variable Index

 o delegateClassName

Constructor Index

 o DefaultRealmExtender()

Method Index

 o deleteAcl(Principal, Acl)
Deletes a realm access control list.
 o deleteGroup(Group)
Deletes a realm Group.
 o deleteUser(User)
Deletes a realm User.
 o getAcl(String)
Returns the access control list that matches the specified name.
 o getAcl(String, char)
Retrieves an Access Control List (Acl) with the best matching name, or null.
 o getAclOwner(Object)
Returns the owner of a realm.
 o getAcls()
Returns an Enumeration of a realm's access control lists, including the default ACL "weblogic.admin."
 o getGroup(String)
Returns a Group that matches the specified name, or the default Group "everyone."
 o getGroups()
Returns an Enumeration of a realm's groups, including the default group "everyone."
 o getName()
Returns the name of a realm.
 o getPermission(String)
Returns a Permission that matches the specified name.
 o getPermissions()
Returns an Enumeration of a realm's permissions.
 o getUser(String)
Returns a User object (matching the specified name) that is known to the realm.
 o getUser(UserInfo)
Returns a User object (matching the specified UserInfo) that is known to the realm.
 o getUsers()
Returns an Enumeration of a realm's users, including the default users "system" and "guest."
 o init(String, Object)
Initializes the realm.
 o load(String, Object)
Loads a the specified realm.
 o newAcl(Principal, String)
Returns a realm access control list by the specified name, owned by the specified user.
 o newGroup(String)
Returns a realm Group with the specified name.
 o newPermission(String)
Returns a realm Permissions with the specified name.
 o newUser(String, Object, Object)
Returns a realm User with the specified name, credential, and constraints.
 o newUserAcl(String, char, Permission[])
Adds a new ACL to a realm that grants the current user permissions.
 o save(String)
Saves the realm by the name specified.
 o setPermission(Acl, Principal, Permission, boolean)
Sets a realm Permission for the specified Principal, for the specified access control list.

Variables

 o delegateClassName
 protected String delegateClassName

Constructors

 o DefaultRealmExtender
 public DefaultRealmExtender()

Methods

 o init
 public void init(String name,
                  Object ownerCredential) throws NotOwnerException
Initializes the realm. A user, specified by name and with the appropriate credentials is required to initialize a realm.

 o getName
 public String getName()
Returns the name of a realm.

 o getUser
 public User getUser(String name)
Returns a User object (matching the specified name) that is known to the realm.

 o getUser
 public User getUser(UserInfo userInfo)
Returns a User object (matching the specified UserInfo) that is known to the realm.

 o getAclOwner
 public Principal getAclOwner(Object credential)
Returns the owner of a realm.

 o getGroup
 public Group getGroup(String name)
Returns a Group that matches the specified name, or the default Group "everyone."

 o getAcl
 public Acl getAcl(String name)
Returns the access control list that matches the specified name.

 o getAcl
 public Acl getAcl(String name,
                   char separator)
Retrieves an Access Control List (Acl) with the best matching name, or null. A name matches if it is a prefix. The longer the prefix, the better the match. The only prefixes considered are up to, but excluding the separator character. For example: getAcl("files.personal.bill", '.') looks for Acls named files.personal.bill, files.personal, and files and returns the one with the longest name.

Parameters:
name - Name of the Acl to retrieve
separator - Character separator
Returns:
Acl object
 o getPermission
 public Permission getPermission(String name)
Returns a Permission that matches the specified name.

 o load
 public void load(String name,
                  Object credential) throws ClassNotFoundException, IOException, NotOwnerException
Loads a the specified realm.

 o save
 public void save(String name) throws IOException
Saves the realm by the name specified.

 o getUsers
 public Enumeration getUsers()
Returns an Enumeration of a realm's users, including the default users "system" and "guest."

 o getGroups
 public Enumeration getGroups()
Returns an Enumeration of a realm's groups, including the default group "everyone."

 o getAcls
 public Enumeration getAcls()
Returns an Enumeration of a realm's access control lists, including the default ACL "weblogic.admin."

 o getPermissions
 public Enumeration getPermissions()
Returns an Enumeration of a realm's permissions.

 o newUser
 public User newUser(String name,
                     Object credential,
                     Object constraints) throws SecurityException
Returns a realm User with the specified name, credential, and constraints.

 o newGroup
 public Group newGroup(String name) throws SecurityException
Returns a realm Group with the specified name.

 o newAcl
 public Acl newAcl(Principal owner,
                   String name) throws SecurityException
Returns a realm access control list by the specified name, owned by the specified user.

 o newPermission
 public Permission newPermission(String name) throws SecurityException
Returns a realm Permissions with the specified name.

 o deleteUser
 public void deleteUser(User user) throws SecurityException
Deletes a realm User.

 o deleteGroup
 public void deleteGroup(Group group) throws SecurityException
Deletes a realm Group.

 o deleteAcl
 public void deleteAcl(Principal owner,
                       Acl acl) throws SecurityException
Deletes a realm access control list. Only the owner of an ACL can delete it.

 o setPermission
 public void setPermission(Acl acl,
                           Principal principal,
                           Permission permission,
                           boolean allow)
Sets a realm Permission for the specified Principal, for the specified access control list. If the boolean "allow" is true, the Permission is positive.

 o newUserAcl
 public synchronized void newUserAcl(String newName,
                                     char separator,
                                     Permission permissions[])
Adds a new ACL to a realm that grants the current user permissions. The permissions are added to the entries found in the default ACL obtained by BasicRealm.getAcl(newName, separator).

Parameters:
newName - ACL name to be added
separator - Delimiter character for use in parsing the ACL name
permissions - Array of Permissions for the ACL

All Examples  This Package