com.sun.j2ee.blueprints.petstore.util
Class J2eeSecurityAdapter

java.lang.Object
  |
  +--com.sun.j2ee.blueprints.petstore.util.J2eeSecurityAdapter

public class J2eeSecurityAdapter
extends java.lang.Object
implements SecurityAdapter

This class implements the SecurityAdapter interface. This class holds the security code specific to the J2EE RI. This class has the public field SECURITY_CONTEXT.

See Also:
SecurityAdapter

Field Summary
static java.lang.String SECURITY_CONTEXT
           
 
Constructor Summary
J2eeSecurityAdapter()
           
 
Method Summary
 void addUser(java.lang.String realmName, java.lang.String group, java.lang.String userName, java.lang.String password)
          This method is used to add user to web tier realm.
 void loginUser(java.lang.String userName, java.lang.String password, javax.servlet.http.HttpSession session)
          This portion of code will log in a user into the form based login mechanism of the sample application when a new account is created.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SECURITY_CONTEXT

public static final java.lang.String SECURITY_CONTEXT
Constructor Detail

J2eeSecurityAdapter

public J2eeSecurityAdapter()
Method Detail

addUser

public void addUser(java.lang.String realmName,
                    java.lang.String group,
                    java.lang.String userName,
                    java.lang.String password)
             throws DuplicateAccountException
This method is used to add user to web tier realm. - Currently this will only work in single vm mode on the J2ee RI (this code is non portable). This code creates the specfied group in the realm if it does not exist after which it will add the user to the specified group.
Specified by:
addUser in interface SecurityAdapter
Throws:
DupplicateAccountException - if the userName exists.

loginUser

public void loginUser(java.lang.String userName,
                      java.lang.String password,
                      javax.servlet.http.HttpSession session)
This portion of code will log in a user into the form based login mechanism of the sample application when a new account is created. This code is specific to the J2ee reference implementation.
Specified by:
loginUser in interface SecurityAdapter


Copyright © 2000 Sun Microsystems Inc. All Rights Reserved.