Java EE 5 SDK

com.sun.appserv.security
Class AppservRealm

java.lang.Object
  extended by com.sun.enterprise.security.auth.realm.Realm
      extended by com.sun.appserv.security.AppservRealm
All Implemented Interfaces:
Comparable

public abstract class AppservRealm
extends com.sun.enterprise.security.auth.realm.Realm

Parent class for iAS Realm classes.

This class provides default implementation for most of the abstract methods in com.sun.enterprise.security.auth.realm.Realm. Since most of these abstract methods are not supported by Realms there is no need for the subclasses to implement them. The default implementations provided here generally throw an exception if invoked.

Author:
Harpreet Singh

Field Summary
protected static Logger _logger
           
static String JAAS_CONTEXT_PARAM
           
protected static com.sun.enterprise.util.i18n.StringManager sm
           
 
Constructor Summary
AppservRealm()
           
 
Method Summary
 com.sun.enterprise.security.auth.realm.AuthenticationHandler getAuthenticationHandler()
          Returns an AuthenticationHandler object which can be used to authenticate within this realm.
 Enumeration getGroupNames()
          Returns names of all the groups in this particular realm.
 com.sun.enterprise.security.auth.realm.User getUser(String name)
          Returns the information recorded about a particular named user.
 Enumeration getUserNames()
          Returns names of all the users in this particular realm.
 void refresh()
          Refreshes the realm data so that new users/groups are visible.
 
Methods inherited from class com.sun.enterprise.security.auth.realm.Realm
compareTo, getAuthType, getDefaultInstance, getDefaultRealm, getGroupNames, getInstance, getJAASContext, getName, getProperties, getProperty, getRealmNames, init, instantiate, instantiate, isValidRealm, setDefaultRealm, setName, setProperty, toString, updateInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

JAAS_CONTEXT_PARAM

public static final String JAAS_CONTEXT_PARAM
See Also:
Constant Field Values

_logger

protected static Logger _logger

sm

protected static com.sun.enterprise.util.i18n.StringManager sm
Constructor Detail

AppservRealm

public AppservRealm()
Method Detail

getAuthenticationHandler

public com.sun.enterprise.security.auth.realm.AuthenticationHandler getAuthenticationHandler()
Returns an AuthenticationHandler object which can be used to authenticate within this realm.

This method return null always, since AuthenticationHandlers are generally not supported by iAS realms. Subclass can override if necessary.

Specified by:
getAuthenticationHandler in class com.sun.enterprise.security.auth.realm.Realm
Returns:
An AuthenticationHandler object for this realm (always null)

getUserNames

public Enumeration getUserNames()
                         throws com.sun.enterprise.security.auth.realm.BadRealmException
Returns names of all the users in this particular realm.

This method always throws a BadRealmException since by default this operation is not supported. Subclasses which support this method can override.

Specified by:
getUserNames in class com.sun.enterprise.security.auth.realm.Realm
Returns:
enumeration of user names (strings)
Throws:
com.sun.enterprise.security.auth.realm.BadRealmException - if realm data structures are bad

getUser

public com.sun.enterprise.security.auth.realm.User getUser(String name)
                                                    throws com.sun.enterprise.security.auth.realm.NoSuchUserException,
                                                           com.sun.enterprise.security.auth.realm.BadRealmException
Returns the information recorded about a particular named user.

This method always throws a BadRealmException since by default this operation is not supported. Subclasses which support this method can override.

Specified by:
getUser in class com.sun.enterprise.security.auth.realm.Realm
Parameters:
name - name of the user whose information is desired
Returns:
the user object
Throws:
com.sun.enterprise.security.auth.realm.NoSuchUserException - if the user doesn't exist
com.sun.enterprise.security.auth.realm.BadRealmException - if realm data structures are bad

getGroupNames

public Enumeration getGroupNames()
                          throws com.sun.enterprise.security.auth.realm.BadRealmException
Returns names of all the groups in this particular realm.

This method always throws a BadRealmException since by default this operation is not supported. Subclasses which support this method can override.

Specified by:
getGroupNames in class com.sun.enterprise.security.auth.realm.Realm
Returns:
enumeration of group names (strings)
Throws:
com.sun.enterprise.security.auth.realm.BadRealmException - if realm data structures are bad

refresh

public void refresh()
             throws com.sun.enterprise.security.auth.realm.BadRealmException
Refreshes the realm data so that new users/groups are visible.

This method always throws a BadRealmException since by default this operation is not supported. Subclasses which support this method can override.

Specified by:
refresh in class com.sun.enterprise.security.auth.realm.Realm
Throws:
com.sun.enterprise.security.auth.realm.BadRealmException - if realm data structures are bad

Java EE 5 SDK

Submit a bug or feature

Copyright 2006 Sun Microsystems, Inc. All rights reserved.