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