org.openmms.ejb.server
Class MM2StorageBean

java.lang.Object
  |
  +--org.openmms.ejb.server.MM2StorageBean
All Implemented Interfaces:
javax.ejb.EnterpriseBean, java.io.Serializable, javax.ejb.SessionBean

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

Title: MM2StorageBean

Description: This class implements methods for communicating with EJB and the Mysql database.

Copyright: Copyright (c) 2003 OpenMMS.org

See Also:
Serialized Form

Constructor Summary
MM2StorageBean()
          Constructor which creates a new MM2StorageBean
 
Method Summary
 boolean deleteMM(java.lang.String ID)
          Boolean function, which deletes an MM, given it's unique-ID
 void ejbActivate()
          Activates the ejb
 void ejbCreate()
          required function for creating an ejb-database connection
 void ejbPassivate()
          sets the ejb-status to standby again
 void ejbRemove()
          Removes the ejb-instance of the bean
 MM_Data fetchMM(java.lang.String ID, MM_Data mmd)
          Fetches an MM from storage given a unique ID
 void setSessionContext(javax.ejb.SessionContext sc)
          Sets the session context
 boolean storeMM(java.lang.String ID, MM_Data mm, java.lang.String expiry, java.lang.String deliveryTime, java.lang.String deliveryReportValue, java.lang.String readReportValue)
          Boolean function, which stores an MM in the database
 boolean updateMM(java.lang.String ID, MM_Data mm, java.lang.String expiry, java.lang.String deliveryTime, java.lang.String deliveryReportValue, java.lang.String readReportValue)
          Boolean function, which updates a given row in the database, based on its unique-ID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MM2StorageBean

public MM2StorageBean()
Constructor which creates a new MM2StorageBean

Method Detail

storeMM

public boolean storeMM(java.lang.String ID,
                       MM_Data mm,
                       java.lang.String expiry,
                       java.lang.String deliveryTime,
                       java.lang.String deliveryReportValue,
                       java.lang.String readReportValue)
                throws java.rmi.RemoteException,
                       OpenMMSException
Boolean function, which stores an MM in the database

Parameters:
ID -
mm -
expiry -
deliveryTime -
deliveryReportValue -
readReportValue -
Returns:
true if data is stored, false otherwise.
Throws:
java.rmi.RemoteException
OpenMMSException

fetchMM

public MM_Data fetchMM(java.lang.String ID,
                       MM_Data mmd)
                throws java.rmi.RemoteException,
                       OpenMMSException
Fetches an MM from storage given a unique ID

Parameters:
ID -
mmd -
Returns:
MM_Data object
Throws:
java.rmi.RemoteException
OpenMMSException

updateMM

public boolean updateMM(java.lang.String ID,
                        MM_Data mm,
                        java.lang.String expiry,
                        java.lang.String deliveryTime,
                        java.lang.String deliveryReportValue,
                        java.lang.String readReportValue)
                 throws java.rmi.RemoteException,
                        OpenMMSException
Boolean function, which updates a given row in the database, based on its unique-ID

Parameters:
ID -
mm -
expiry -
deliveryTime -
deliveryReportValue -
readReportValue -
Returns:
true if update is successfull, false otherwise
Throws:
java.rmi.RemoteException
OpenMMSException

deleteMM

public boolean deleteMM(java.lang.String ID)
                 throws java.rmi.RemoteException,
                        OpenMMSException
Boolean function, which deletes an MM, given it's unique-ID

Parameters:
ID -
Returns:
true if delete is successful, false otherwise
Throws:
java.rmi.RemoteException
OpenMMSException

ejbCreate

public void ejbCreate()
required function for creating an ejb-database connection


setSessionContext

public void setSessionContext(javax.ejb.SessionContext sc)
                       throws javax.ejb.EJBException,
                              java.rmi.RemoteException
Sets the session context

Specified by:
setSessionContext in interface javax.ejb.SessionBean
Parameters:
sc -
Throws:
EJBException
java.rmi.RemoteException

ejbRemove

public void ejbRemove()
               throws javax.ejb.EJBException,
                      java.rmi.RemoteException
Removes the ejb-instance of the bean

Specified by:
ejbRemove in interface javax.ejb.SessionBean
Throws:
EJBException
java.rmi.RemoteException

ejbPassivate

public void ejbPassivate()
                  throws javax.ejb.EJBException,
                         java.rmi.RemoteException
sets the ejb-status to standby again

Specified by:
ejbPassivate in interface javax.ejb.SessionBean
Throws:
EJBException
java.rmi.RemoteException

ejbActivate

public void ejbActivate()
                 throws javax.ejb.EJBException,
                        java.rmi.RemoteException
Activates the ejb

Specified by:
ejbActivate in interface javax.ejb.SessionBean
Throws:
EJBException
java.rmi.RemoteException