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
 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 getInstances()
          Get instances list for models in which this user is admin (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

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

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

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