hero.session
Class HistorySessionBean

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

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

The History Session Bean, is an stateless session bean that provides the user API to get information on historic instance and activity properties.


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


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

import hero.interfaces.HistorySessionLocalHome;
import hero.interfaces.HistorySessionLocal;
import hero.interfaces.HistorySessionHome;
import hero.interfaces.HistorySession;
import hero.interfaces.HistorySessionUtil;

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

Like this if you want to use local interfaces:

HistorySessionLocalHome historyh = (HistorySessionLocalHome)hero.interfaces.HistorySessionUtil.getLocalHome();
HistorySessionLocal historysession = historyh.create();

or like this if you use remote interfaces:

HistorySessionHome historyh = (HistorySessionHome)hero.interfaces.HistorySessionUtil.getHome();
HistorySession historysession = historyh.create();


Now you can call all History Sessions methods...

Author:
D. Parisek
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface hero.util.EventConstants
ADDEDGE, ADDITERATION, ADDNODE, ADDROLE, ADDUSERPROJECT, ANTICIPATING, CANCELED, CHANGEROLE, DEFAULTPROJECTVERSION, 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
HistorySessionBean()
           
 
Method Summary
 void ejbActivate()
          Internal Enterprise Java Beans method.
 void ejbCreate()
          Creates the History Session Bean.
 void ejbPassivate()
          Internal Enterprise Java Beans method.
 void ejbRemove()
          Internal Enterprise Java Beans method.
 hero.historic.ProjectHistoric getHistoryInstance(java.lang.String instanceName)
          Get instance history attributes.
 java.util.Collection getHistoryInstanceActivityList(java.lang.String instanceName)
          Get instance activity history list.
 java.util.Collection getHistoryInstancesList(java.lang.String projectName)
          Get instance activity history list w/o pagination.
 java.util.Collection getHistoryInstancesList(java.lang.String projectName, int startindex, int nrows)
          Get instance activity history list w/ pagination.
 java.util.Collection getHistoryProjectList()
          Get list of project histories by project name w/o pagination.
 java.util.Collection getHistoryProjectList(int startindex, int nrows)
          Get list of project histories by project name w/ pagination.
 void setSessionContext(javax.ejb.SessionContext context)
          Internal Enterprise Java Beans method.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HistorySessionBean

public HistorySessionBean()
Method Detail

getHistoryProjectList

public java.util.Collection getHistoryProjectList()
                                           throws hero.util.HeroException
Get list of project histories by project name w/o pagination.

Returns:
a Collection of projects that have history
Throws:
hero.util.HeroException

getHistoryProjectList

public java.util.Collection getHistoryProjectList(int startindex,
                                                  int nrows)
                                           throws hero.util.HeroException
Get list of project histories by project name w/ pagination.

Parameters:
startindex -
nrows -
Returns:
a Collection of projects that have history
Throws:
hero.util.HeroException

getHistoryInstance

public hero.historic.ProjectHistoric getHistoryInstance(java.lang.String instanceName)
                                                 throws hero.util.HeroException
Get instance history attributes.

Parameters:
instanceName -
Returns:
a ProjectHistoric object - get project attrs
Throws:
hero.util.HeroException

getHistoryInstanceActivityList

public java.util.Collection getHistoryInstanceActivityList(java.lang.String instanceName)
                                                    throws hero.util.HeroException
Get instance activity history list.

Parameters:
projectName -
instanceName -
Returns:
a Collection of activity names
Throws:
hero.util.HeroException

getHistoryInstancesList

public java.util.Collection getHistoryInstancesList(java.lang.String projectName)
                                             throws hero.util.HeroException
Get instance activity history list w/o pagination.

Parameters:
projectName -
Returns:
a Collection of activity names
Throws:
hero.util.HeroException

getHistoryInstancesList

public java.util.Collection getHistoryInstancesList(java.lang.String projectName,
                                                    int startindex,
                                                    int nrows)
                                             throws hero.util.HeroException
Get instance activity history list w/ pagination.

Parameters:
projectName -
startindex -
nrows -
Returns:
a Collection of activity names
Throws:
hero.util.HeroException

ejbCreate

public void ejbCreate()
               throws javax.ejb.CreateException
Creates the History Session Bean. This method is the first one to invoke in order to use HistorySession API. If the user is not authorized this method throws an exception.

Throws:
javax.ejb.CreateException

setSessionContext

public void setSessionContext(javax.ejb.SessionContext context)
Internal Enterprise Java Beans method.

Specified by:
setSessionContext in interface javax.ejb.SessionBean

ejbRemove

public void ejbRemove()
Internal Enterprise Java Beans method.

Specified by:
ejbRemove in interface javax.ejb.SessionBean

ejbActivate

public void ejbActivate()
Internal Enterprise Java Beans method.

Specified by:
ejbActivate in interface javax.ejb.SessionBean

ejbPassivate

public void ejbPassivate()
Internal Enterprise Java Beans method.

Specified by:
ejbPassivate in interface javax.ejb.SessionBean