Hyperic HQ Plugin API v. 4.4.0.2

org.hyperic.hq.bizapp.server.session
Class AuthzBossEJBImpl

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

public class AuthzBossEJBImpl
extends BizappSessionEJB
implements javax.ejb.SessionBean

The BizApp's interface to the Authz Subsystem

See Also:
Serialized Form

Field Summary
protected  boolean debug
           
protected  org.apache.commons.logging.Log log
           
 
Fields inherited from class org.hyperic.hq.bizapp.server.session.BizappSessionEJB
ctx
 
Constructor Summary
AuthzBossEJBImpl()
           
 
Method Summary
 AuthzSubject createSubject(java.lang.Integer sessionId, java.lang.String name, boolean active, java.lang.String dsn, java.lang.String dept, java.lang.String email, java.lang.String first, java.lang.String last, java.lang.String phone, java.lang.String sms, boolean useHtml)
          Create the user identified by the given ids from the subject as well as principal tables.
 void ejbActivate()
           
 void ejbCreate()
           
 void ejbPassivate()
           
 void ejbRemove()
           
 java.util.Map findResourcesByIds(java.lang.Integer sessionId, AppdefEntityID[] entities)
           
 AuthzSubject findSubjectById(java.lang.Integer sessionId, java.lang.Integer subjectId)
          Return the AuthzSubject object identified by the given subject id.
 AuthzSubject findSubjectByName(java.lang.Integer sessionId, java.lang.String subjectName)
          Return the AuthzSubject object identified by the given username.
 AuthzSubject findSubjectByNameNoAuthz(java.lang.Integer sessionId, java.lang.String subjectName)
          Return the AuthzSubject object identified by the given username.
 java.util.List getAllOperations(java.lang.Integer sessionId)
          Return the full List of OperationValue objects representing every resource type in the system that the user is allowed to view.
 java.util.List getAllOperations(java.lang.Integer sessionId, PageControl pc)
          Return a sorted, paged List of OperationValue objects representing every resource type in the system that the user is allowed to view.
 java.util.List getAllResourceGroups(java.lang.Integer sessionId, PageControl pc)
          Return a sorted, paged List of ResourceGroupValue objects representing every resource type in the system that the user is allowed to view.
 java.util.List getAllResourceTypes(java.lang.Integer sessionId)
          Return the full List of ResourceTypeValue objects representing every resource type in the system that the user is allowed to view.
 java.util.List getAllResourceTypes(java.lang.Integer sessionId, PageControl pc)
          Return a sorted, paged List of ResourceTypeValue objects representing every resource type in the system that the user is allowed to view.
 PageList getAllSubjects(java.lang.Integer sessionId, java.util.Collection excludes, PageControl pc)
          Return a sorted, paged List of AuthzSubjectValue objects representing every resource type in the system that the user is allowed to view.
 AuthzSubject getCurrentSubject(int sessionid)
           
 AuthzSubject getCurrentSubject(java.lang.String name)
           
 java.lang.String getEmailById(java.lang.Integer sessionId, java.lang.Integer userId)
          Get the email of a user by id
 java.lang.String getEmailByName(java.lang.Integer sessionId, java.lang.String userName)
          Get the email of a user by name
static org.hyperic.hq.bizapp.shared.AuthzBossLocal getOne()
           
 PageList getResourceGroupsById(java.lang.Integer sessionId, java.lang.Integer[] ids, PageControl pc)
          Return a sorted, paged List of ResourceGroupValue objects corresponding to the specified id values.
 PageList getSubjectsById(java.lang.Integer sessionId, java.lang.Integer[] ids, PageControl pc)
          Return a sorted, paged List of AuthzSubjectValue objects corresponding to the specified id values.
 PageList getSubjectsByName(java.lang.Integer sessionId, java.lang.String name, PageControl pc)
          Return a sorted, paged List of AuthzSubjectValue objects matching name as substring
 ConfigResponse getUserDashboardConfig(java.lang.Integer sessionId)
          Get the current user's dashboard
 ConfigResponse getUserPrefs(java.lang.Integer sessionId, java.lang.Integer subjectId)
          Return a ConfigResponse matching the UserPreferences
 ConfigResponse getUserPrefs(java.lang.String username)
          Return a ConfigResponse matching the UserPreferences
 boolean hasAdminPermission(int sessionId)
          Check if the current logged in user can administer CAM
 void removeSubject(java.lang.Integer sessionId, java.lang.Integer[] ids)
          Remove the user identified by the given ids from the subject as well as principal tables.
 void setUserPrefs(java.lang.Integer sessionId, java.lang.Integer subjectId, ConfigResponse prefs)
          Set the UserPreferences
 void setUserPrefsAfterCommit(java.lang.Integer sessionId, java.lang.Integer subjectId, ConfigResponse prefs)
          Set the UserPreferences
 void updateSubject(java.lang.Integer sessionId, AuthzSubject target, java.lang.Boolean active, java.lang.String dsn, java.lang.String dept, java.lang.String email, java.lang.String first, java.lang.String last, java.lang.String phone, java.lang.String sms, java.lang.Boolean useHtml)
          Update a subject
 
Methods inherited from class org.hyperic.hq.bizapp.server.session.BizappSessionEJB
getAgentManager, getAIBoss, getAIManager, getAppdefBoss, getAppdefStatManager, getApplicationManager, getAuthManager, getAuthzBoss, getAuthzSubjectManager, getAutoInventoryManager, getAvailManager, getConfigManager, getControlBoss, getControlManager, getControlScheduleManager, getCPropManager, getDataMan, getEventsBoss, getMeasurementBoss, getMetricManager, getOverlord, getPlatformManager, getProductBoss, getProductManager, getReportProcessor, getResourceGroupManager, getResourceManager, getServerConfigManager, getServerManager, getServiceManager, getSessionContext, getSrnManager, getTemplateManager, getTrackerManager, rollback, setSessionContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.ejb.SessionBean
setSessionContext
 

Field Detail

log

protected org.apache.commons.logging.Log log

debug

protected boolean debug
Constructor Detail

AuthzBossEJBImpl

public AuthzBossEJBImpl()
Method Detail

hasAdminPermission

public boolean hasAdminPermission(int sessionId)
                           throws javax.ejb.FinderException,
                                  SessionTimeoutException,
                                  SessionNotFoundException
Check if the current logged in user can administer CAM

Returns:
true - if user has adminsterCAM op false otherwise
Throws:
javax.ejb.FinderException
SessionTimeoutException
SessionNotFoundException

getAllResourceTypes

public java.util.List getAllResourceTypes(java.lang.Integer sessionId,
                                          PageControl pc)
                                   throws javax.ejb.CreateException,
                                          javax.ejb.FinderException,
                                          PermissionException,
                                          SessionTimeoutException,
                                          SessionNotFoundException
Return a sorted, paged List of ResourceTypeValue objects representing every resource type in the system that the user is allowed to view.

Throws:
javax.ejb.CreateException
javax.ejb.FinderException
PermissionException
SessionTimeoutException
SessionNotFoundException

getAllResourceTypes

public java.util.List getAllResourceTypes(java.lang.Integer sessionId)
                                   throws javax.ejb.CreateException,
                                          javax.ejb.FinderException,
                                          PermissionException,
                                          SessionTimeoutException,
                                          SessionNotFoundException
Return the full List of ResourceTypeValue objects representing every resource type in the system that the user is allowed to view.

Throws:
javax.ejb.CreateException
javax.ejb.FinderException
PermissionException
SessionTimeoutException
SessionNotFoundException

getAllOperations

public java.util.List getAllOperations(java.lang.Integer sessionId,
                                       PageControl pc)
                                throws javax.ejb.FinderException,
                                       PermissionException,
                                       SessionTimeoutException,
                                       SessionNotFoundException
Return a sorted, paged List of OperationValue objects representing every resource type in the system that the user is allowed to view.

Throws:
javax.ejb.FinderException
PermissionException
SessionTimeoutException
SessionNotFoundException

getAllOperations

public java.util.List getAllOperations(java.lang.Integer sessionId)
                                throws javax.ejb.FinderException,
                                       PermissionException,
                                       SessionTimeoutException,
                                       SessionNotFoundException
Return the full List of OperationValue objects representing every resource type in the system that the user is allowed to view.

Throws:
javax.ejb.FinderException
PermissionException
SessionTimeoutException
SessionNotFoundException

getAllSubjects

public PageList getAllSubjects(java.lang.Integer sessionId,
                               java.util.Collection excludes,
                               PageControl pc)
                        throws javax.ejb.FinderException,
                               SessionTimeoutException,
                               SessionNotFoundException,
                               PermissionException
Return a sorted, paged List of AuthzSubjectValue objects representing every resource type in the system that the user is allowed to view.

Throws:
javax.ejb.FinderException
SessionTimeoutException
SessionNotFoundException
PermissionException

getSubjectsById

public PageList getSubjectsById(java.lang.Integer sessionId,
                                java.lang.Integer[] ids,
                                PageControl pc)
                         throws PermissionException,
                                SessionTimeoutException,
                                SessionNotFoundException
Return a sorted, paged List of AuthzSubjectValue objects corresponding to the specified id values.

Throws:
PermissionException
SessionTimeoutException
SessionNotFoundException

getSubjectsByName

public PageList getSubjectsByName(java.lang.Integer sessionId,
                                  java.lang.String name,
                                  PageControl pc)
                           throws PermissionException,
                                  SessionTimeoutException,
                                  SessionNotFoundException
Return a sorted, paged List of AuthzSubjectValue objects matching name as substring

Throws:
PermissionException
SessionTimeoutException
SessionNotFoundException

getAllResourceGroups

public java.util.List getAllResourceGroups(java.lang.Integer sessionId,
                                           PageControl pc)
                                    throws javax.ejb.FinderException,
                                           PermissionException,
                                           SessionTimeoutException,
                                           SessionNotFoundException
Return a sorted, paged List of ResourceGroupValue objects representing every resource type in the system that the user is allowed to view.

Throws:
javax.ejb.FinderException
PermissionException
SessionTimeoutException
SessionNotFoundException

getResourceGroupsById

public PageList getResourceGroupsById(java.lang.Integer sessionId,
                                      java.lang.Integer[] ids,
                                      PageControl pc)
                               throws javax.ejb.FinderException,
                                      PermissionException,
                                      SessionTimeoutException,
                                      SessionNotFoundException
Return a sorted, paged List of ResourceGroupValue objects corresponding to the specified id values.

Throws:
javax.ejb.FinderException
PermissionException
SessionTimeoutException
SessionNotFoundException

findResourcesByIds

public java.util.Map findResourcesByIds(java.lang.Integer sessionId,
                                        AppdefEntityID[] entities)
                                 throws SessionNotFoundException,
                                        SessionTimeoutException
Throws:
SessionNotFoundException
SessionTimeoutException

removeSubject

public void removeSubject(java.lang.Integer sessionId,
                          java.lang.Integer[] ids)
                   throws javax.ejb.FinderException,
                          javax.ejb.RemoveException,
                          PermissionException,
                          SessionTimeoutException,
                          SessionNotFoundException
Remove the user identified by the given ids from the subject as well as principal tables.

Throws:
javax.ejb.FinderException
javax.ejb.RemoveException
PermissionException
SessionTimeoutException
SessionNotFoundException

updateSubject

public void updateSubject(java.lang.Integer sessionId,
                          AuthzSubject target,
                          java.lang.Boolean active,
                          java.lang.String dsn,
                          java.lang.String dept,
                          java.lang.String email,
                          java.lang.String first,
                          java.lang.String last,
                          java.lang.String phone,
                          java.lang.String sms,
                          java.lang.Boolean useHtml)
                   throws PermissionException,
                          SessionException
Update a subject

Throws:
PermissionException
SessionException

createSubject

public AuthzSubject createSubject(java.lang.Integer sessionId,
                                  java.lang.String name,
                                  boolean active,
                                  java.lang.String dsn,
                                  java.lang.String dept,
                                  java.lang.String email,
                                  java.lang.String first,
                                  java.lang.String last,
                                  java.lang.String phone,
                                  java.lang.String sms,
                                  boolean useHtml)
                           throws PermissionException,
                                  javax.ejb.CreateException,
                                  SessionException
Create the user identified by the given ids from the subject as well as principal tables.

Throws:
PermissionException
javax.ejb.CreateException
SessionException

getCurrentSubject

public AuthzSubject getCurrentSubject(int sessionid)
                               throws SessionException
Throws:
SessionException

getCurrentSubject

public AuthzSubject getCurrentSubject(java.lang.String name)
                               throws SessionException,
                                      ApplicationException
Throws:
SessionException
ApplicationException

findSubjectById

public AuthzSubject findSubjectById(java.lang.Integer sessionId,
                                    java.lang.Integer subjectId)
                             throws SessionNotFoundException,
                                    SessionTimeoutException,
                                    PermissionException
Return the AuthzSubject object identified by the given subject id.

Throws:
SessionTimeoutException
SessionNotFoundException
PermissionException

findSubjectByName

public AuthzSubject findSubjectByName(java.lang.Integer sessionId,
                                      java.lang.String subjectName)
                               throws javax.ejb.FinderException,
                                      SessionTimeoutException,
                                      SessionNotFoundException,
                                      PermissionException
Return the AuthzSubject object identified by the given username.

Throws:
javax.ejb.FinderException
SessionTimeoutException
SessionNotFoundException
PermissionException

findSubjectByNameNoAuthz

public AuthzSubject findSubjectByNameNoAuthz(java.lang.Integer sessionId,
                                             java.lang.String subjectName)
                                      throws javax.ejb.FinderException,
                                             SessionTimeoutException,
                                             SessionNotFoundException,
                                             PermissionException
Return the AuthzSubject object identified by the given username. This method should only be used in cases where displaying the user does not require an Authz check. An example of this is when the owner and last modifier need to be displayed, and the user viewing the resource does not have permissions to view other users. See bug #5452 for more information

Throws:
javax.ejb.FinderException
SessionTimeoutException
SessionNotFoundException
PermissionException

getUserPrefs

public ConfigResponse getUserPrefs(java.lang.String username)
                            throws SessionNotFoundException,
                                   ApplicationException,
                                   ConfigPropertyException
Return a ConfigResponse matching the UserPreferences

Throws:
ApplicationException
ConfigPropertyException
javax.security.auth.login.LoginException
SessionNotFoundException

getUserPrefs

public ConfigResponse getUserPrefs(java.lang.Integer sessionId,
                                   java.lang.Integer subjectId)
Return a ConfigResponse matching the UserPreferences


setUserPrefsAfterCommit

public void setUserPrefsAfterCommit(java.lang.Integer sessionId,
                                    java.lang.Integer subjectId,
                                    ConfigResponse prefs)
                             throws ApplicationException,
                                    SessionTimeoutException,
                                    SessionNotFoundException
Set the UserPreferences

Throws:
ApplicationException
SessionTimeoutException
SessionNotFoundException

setUserPrefs

public void setUserPrefs(java.lang.Integer sessionId,
                         java.lang.Integer subjectId,
                         ConfigResponse prefs)
                  throws ApplicationException,
                         SessionTimeoutException,
                         SessionNotFoundException
Set the UserPreferences

Throws:
ApplicationException
SessionTimeoutException
SessionNotFoundException

getUserDashboardConfig

public ConfigResponse getUserDashboardConfig(java.lang.Integer sessionId)
                                      throws SessionNotFoundException,
                                             SessionTimeoutException,
                                             PermissionException
Get the current user's dashboard

Throws:
SessionNotFoundException
SessionTimeoutException
PermissionException

getEmailByName

public java.lang.String getEmailByName(java.lang.Integer sessionId,
                                       java.lang.String userName)
                                throws javax.ejb.FinderException,
                                       SessionTimeoutException,
                                       SessionNotFoundException
Get the email of a user by name

Throws:
javax.ejb.FinderException
SessionTimeoutException
SessionNotFoundException

getEmailById

public java.lang.String getEmailById(java.lang.Integer sessionId,
                                     java.lang.Integer userId)
                              throws javax.ejb.FinderException,
                                     SessionTimeoutException,
                                     SessionNotFoundException
Get the email of a user by id

Throws:
javax.ejb.FinderException
SessionTimeoutException
SessionNotFoundException

getOne

public static org.hyperic.hq.bizapp.shared.AuthzBossLocal 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

Hyperic HQ Plugin API v. 4.4.0.2

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