hero.session
Class AdminSessionBean

java.lang.Object
  extended byhero.session.AdminSessionBean
All Implemented Interfaces:
javax.ejb.EnterpriseBean, hero.util.EventConstants, java.io.Serializable, javax.ejb.SessionBean

public class AdminSessionBean
extends java.lang.Object
implements javax.ejb.SessionBean, hero.util.EventConstants

The Admin Session Bean, is an stateful session bean that provides the admin API to get information about projects and activities in which the user is admin.

The following lines shows a sample code to use this API in your application:


First of all you have to import the Admin Session files:

import hero.interfaces.AdminSessionLocalHome;
import hero.interfaces.AdminSessionLocal;
import hero.interfaces.AdminSessionHome;
import hero.interfaces.AdminSession;
import hero.interfaces.AdminSessionUtil;

Now, it is time to create the Admin Session instance:

Like this if you want to use local interfaces:

AdminSessionLocalHome adminh = (AdminSessionLocalHome)hero.interfaces.AdminSessionUtil.getLocalHome();
AdminSessionLocal adminsession = adminh.create();

or like this if you use remote interfaces:

AdminSessionHome adminh = (AdminSessionHome)hero.interfaces.AdminSessionUtil.getHome();
AdminSession adminsession = adminh.create();


Now you can call all Admin Sessions methods...

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface hero.util.EventConstants
ADDEDGE, ADDITERATION, ADDNODE, ADDROLE, ADDUSERPROJECT, ANTICIPATING, CANCELED, CHANGEROLE, DELETEEDGE, DELETENODE, DELETEPROJECT, EDGE, EDGENAME, EVENT, FROM, ITERATION, LOG, NODE, NODEDEADLINE, NODEDEADLINES, NODEIN, NODENAME, NODEOUT, NODESTATE, NODETYPE, PROJECT, PROJECTNAME, READYINITIAL, ROLE, ROLENAME, SETEDGESTATE, SETNODEDEADLINE, SETNODEDEADLINES, SETNODEEXECUTOR, SETNODESTATE, SETUSERROLE, START, TERMINATED, TO, UNSETUSERROLE, USER, USERNAME, USERROLE
 
Constructor Summary
AdminSessionBean()
           
 
Method Summary
 java.lang.String cvStateToNum(java.lang.String state)
          Convert alpha state string to numeric state string as used in DB
 void ejbActivate()
           
 void ejbCreate()
          Create the AdminSession Bean
 void ejbPassivate()
           
 void ejbRemove()
           
 java.util.Collection getActivities()
          Get activities for instances/cooperatives projects in which this user is admin (admin is the role of the model administrator)
 java.util.Collection getActivities(java.util.HashMap filter)
          Get filtered activities for instances/cooperatives projects in which this user is admin (admin is the role of the model administrator)
 java.util.Collection getActivityExecutor()
          Get filtered activities list for processes
 java.util.Collection getActivityPerformer()
          Get filtered activities list for processes
 java.util.Collection getActivityProcesses()
          Get filtered activities list for processes
 java.util.Collection getActivityState()
          Get filtered activities list for processes
 java.util.Collection getCallbackPerformers()
          This method retrieve the list of performer assignments deployed on the server
 int getCountByFilter(java.lang.String type, java.util.HashMap filter)
          Get filtered instances count
 java.util.Collection getCustomInitiators()
          This method retrieve the list of Initiator Mappers deployed on the server
 java.util.Collection getCustomMappers()
          This method retrieve the list of mappers deployed on the server
 java.util.Collection getFinderByFilter(java.lang.String type, java.util.HashMap filter)
          Get filtered instances list for models in which this user is admin (admin is the role of the model administrator)
 java.util.Collection getInstanceCreators()
          Get filtered instances list of models for creators
 java.util.Collection getInstanceRoles()
          Get filtered instances list of models for creators
 java.util.Collection getInstances()
          Get instances list for models in which this user is admin (admin is the role of the model administrator)
 java.util.Collection getInstances(java.util.HashMap filter)
          Get filtered instances list for models in which this user is admin (admin is the role of the model administrator)
 java.util.Collection getInstanceStates()
          Get filtered instances list of models for states
 java.util.Collection getInstanceUsers()
          Get filtered instances list for models for users
 java.util.Collection getJavaHooks(java.lang.String eventType)
          This method retrieve the list of hooks deployed on the server
 java.util.Collection getListAsPK(java.lang.String type, java.util.HashMap filter)
          Get subset instances list for models in which this user is admin (admin is the role of the model administrator)
 java.util.Collection getListByPK(java.lang.String type, java.util.Collection list, int offset, int numrows)
          Get subset instances list (by PK)for models in which this user is admin (admin is the role of the model administrator)
 int getListCnt(java.lang.String type, java.util.HashMap filter)
          Get number of total admin workflow models (admin is the role of the model administrator)
 java.util.Collection getModels()
          Get admin workflow models (admin is the role of the model administrator)
 void setSessionContext(javax.ejb.SessionContext context)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdminSessionBean

public AdminSessionBean()
Method Detail

getModels

public java.util.Collection getModels()
                               throws hero.util.HeroException
Get admin workflow models (admin is the role of the model administrator)

Throws:
hero.util.HeroException

getListCnt

public int getListCnt(java.lang.String type,
                      java.util.HashMap filter)
               throws hero.util.HeroException
Get number of total admin workflow models (admin is the role of the model administrator)

Throws:
hero.util.HeroException

getInstances

public java.util.Collection getInstances()
                                  throws hero.util.HeroException
Get instances list for models in which this user is admin (admin is the role of the model administrator)

Throws:
hero.util.HeroException

getInstances

public java.util.Collection getInstances(java.util.HashMap filter)
                                  throws hero.util.HeroException
Get filtered instances list for models in which this user is admin (admin is the role of the model administrator)

Throws:
hero.util.HeroException

getFinderByFilter

public java.util.Collection getFinderByFilter(java.lang.String type,
                                              java.util.HashMap filter)
                                       throws hero.util.HeroException
Get filtered instances list for models in which this user is admin (admin is the role of the model administrator)

Throws:
hero.util.HeroException

getCountByFilter

public int getCountByFilter(java.lang.String type,
                            java.util.HashMap filter)
                     throws hero.util.HeroException
Get filtered instances count

Throws:
hero.util.HeroException

cvStateToNum

public java.lang.String cvStateToNum(java.lang.String state)
                              throws hero.util.HeroException
Convert alpha state string to numeric state string as used in DB

Throws:
hero.util.HeroException

getInstanceUsers

public java.util.Collection getInstanceUsers()
                                      throws hero.util.HeroException
Get filtered instances list for models for users

Throws:
hero.util.HeroException

getInstanceCreators

public java.util.Collection getInstanceCreators()
                                         throws hero.util.HeroException
Get filtered instances list of models for creators

Throws:
hero.util.HeroException

getInstanceRoles

public java.util.Collection getInstanceRoles()
                                      throws hero.util.HeroException
Get filtered instances list of models for creators

Throws:
hero.util.HeroException

getInstanceStates

public java.util.Collection getInstanceStates()
                                       throws hero.util.HeroException
Get filtered instances list of models for states

Throws:
hero.util.HeroException

getListAsPK

public java.util.Collection getListAsPK(java.lang.String type,
                                        java.util.HashMap filter)
                                 throws hero.util.HeroException
Get subset instances list for models in which this user is admin (admin is the role of the model administrator)

Throws:
hero.util.HeroException

getListByPK

public java.util.Collection getListByPK(java.lang.String type,
                                        java.util.Collection list,
                                        int offset,
                                        int numrows)
                                 throws hero.util.HeroException
Get subset instances list (by PK)for models in which this user is admin (admin is the role of the model administrator)

Throws:
hero.util.HeroException

getActivities

public java.util.Collection getActivities()
                                   throws hero.util.HeroException
Get activities for instances/cooperatives projects in which this user is admin (admin is the role of the model administrator)

Throws:
hero.util.HeroException

getActivities

public java.util.Collection getActivities(java.util.HashMap filter)
                                   throws hero.util.HeroException
Get filtered activities for instances/cooperatives projects in which this user is admin (admin is the role of the model administrator)

Throws:
hero.util.HeroException

getActivityProcesses

public java.util.Collection getActivityProcesses()
                                          throws hero.util.HeroException
Get filtered activities list for processes

Throws:
hero.util.HeroException

getActivityState

public java.util.Collection getActivityState()
                                      throws hero.util.HeroException
Get filtered activities list for processes

Throws:
hero.util.HeroException

getActivityExecutor

public java.util.Collection getActivityExecutor()
                                         throws hero.util.HeroException
Get filtered activities list for processes

Throws:
hero.util.HeroException

getActivityPerformer

public java.util.Collection getActivityPerformer()
                                          throws hero.util.HeroException
Get filtered activities list for processes

Throws:
hero.util.HeroException

getJavaHooks

public java.util.Collection getJavaHooks(java.lang.String eventType)
This method retrieve the list of hooks deployed on the server


getCustomMappers

public java.util.Collection getCustomMappers()
                                      throws hero.util.HeroException
This method retrieve the list of mappers deployed on the server

Throws:
hero.util.HeroException

getCallbackPerformers

public java.util.Collection getCallbackPerformers()
                                           throws hero.util.HeroException
This method retrieve the list of performer assignments deployed on the server

Throws:
hero.util.HeroException

getCustomInitiators

public java.util.Collection getCustomInitiators()
                                         throws hero.util.HeroException
This method retrieve the list of Initiator Mappers deployed on the server

Throws:
hero.util.HeroException

ejbCreate

public void ejbCreate()
               throws javax.ejb.CreateException
Create the AdminSession Bean

Throws:
javax.ejb.CreateException

setSessionContext

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

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