Hyperic HQ Plugin API v. 4.4.0.2

org.hyperic.hq.auth.server.session
Class AuthManagerEJBImpl

java.lang.Object
  extended by org.hyperic.hq.auth.server.session.AuthManagerEJBImpl
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EnterpriseBean, javax.ejb.SessionBean

public class AuthManagerEJBImpl
extends java.lang.Object
implements javax.ejb.SessionBean

The AuthManger

See Also:
Serialized Form

Constructor Summary
AuthManagerEJBImpl()
           
 
Method Summary
 void addUser(AuthzSubject subject, java.lang.String username, java.lang.String password)
          Add a user to the internal database
 void changePassword(AuthzSubject subject, java.lang.String username, java.lang.String password)
          Change the password for a user.
 void changePasswordHash(AuthzSubject subject, java.lang.String username, java.lang.String hash)
          Change the hashed password for a user.
 void deleteUser(AuthzSubject subject, java.lang.String username)
          Delete a user from the internal database
 void ejbActivate()
           
 void ejbCreate()
           
 void ejbPassivate()
           
 void ejbRemove()
           
static org.hyperic.hq.auth.shared.AuthManagerLocal getOne()
           
 Principal getPrincipal(AuthzSubject subject)
          Get the principle of a user
 int getSessionId(java.lang.String user, java.lang.String password)
          Authenticates the user using the given password
 int getUnauthSessionId(java.lang.String user)
          Get a session ID based on username only
 boolean isUser(AuthzSubject subject, java.lang.String username)
          Check existence of a user
 void setSessionContext(javax.ejb.SessionContext ctx)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthManagerEJBImpl

public AuthManagerEJBImpl()
Method Detail

getSessionId

public int getSessionId(java.lang.String user,
                        java.lang.String password)
                 throws javax.security.auth.login.LoginException,
                        ApplicationException,
                        PasswordIsNullException,
                        ServerStillStartingException,
                        AccountDisabledException
Authenticates the user using the given password

Parameters:
user - The user to authenticate
password - The password for the user
Returns:
session id that is associated with the user
Throws:
javax.security.auth.login.LoginException
ApplicationException
PasswordIsNullException
ServerStillStartingException
AccountDisabledException

getUnauthSessionId

public int getUnauthSessionId(java.lang.String user)
                       throws ApplicationException
Get a session ID based on username only

Parameters:
user - The user to authenticate
Returns:
session id that is associated with the user
Throws:
ApplicationException - if user is not found
javax.security.auth.login.LoginException - if user account has been disabled

addUser

public void addUser(AuthzSubject subject,
                    java.lang.String username,
                    java.lang.String password)
Add a user to the internal database

Parameters:
subject - The subject of the currently logged in user
username - The username to add
password - The password for this user

changePassword

public void changePassword(AuthzSubject subject,
                           java.lang.String username,
                           java.lang.String password)
                    throws PermissionException
Change the password for a user.

Parameters:
subject - The subject of the currently logged in user
username - The username whose password will be changed.
password - The new password for this user
Throws:
PermissionException

changePasswordHash

public void changePasswordHash(AuthzSubject subject,
                               java.lang.String username,
                               java.lang.String hash)
                        throws PermissionException
Change the hashed password for a user.

Parameters:
subject - The subject of the currently logged in user
username - The username whose password will be changed.
password - The new password for this user
Throws:
PermissionException

deleteUser

public void deleteUser(AuthzSubject subject,
                       java.lang.String username)
Delete a user from the internal database

Parameters:
subject - The subject of the currently logged in user
username - The user to delete

isUser

public boolean isUser(AuthzSubject subject,
                      java.lang.String username)
Check existence of a user

Parameters:
subject - The subject of the currently logged in user
username - The username of the user to get

getPrincipal

public Principal getPrincipal(AuthzSubject subject)
Get the principle of a user

Parameters:
subject - The subject for whom to return the principle

getOne

public static org.hyperic.hq.auth.shared.AuthManagerLocal getOne()

ejbCreate

public void ejbCreate()

ejbRemove

public void ejbRemove()
Specified by:
ejbRemove in interface javax.ejb.SessionBean

ejbActivate

public void ejbActivate()
Specified by:
ejbActivate in interface javax.ejb.SessionBean

ejbPassivate

public void ejbPassivate()
Specified by:
ejbPassivate in interface javax.ejb.SessionBean

setSessionContext

public void setSessionContext(javax.ejb.SessionContext ctx)
Specified by:
setSessionContext in interface javax.ejb.SessionBean

Hyperic HQ Plugin API v. 4.4.0.2

Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.