com.ibm.redback.redbeansejb
Class RBEntityEJB

java.lang.Object
  |
  +--com.ibm.redback.redbeansejb.RedBeansEJB
        |
        +--com.ibm.redback.redbeansejb.RBEntityEJB
All Implemented Interfaces:
java.io.Serializable

public class RBEntityEJB
extends RedBeansEJB
implements java.io.Serializable

Class that provides main behavior for entity beans.

See Also:
Serialized Form

Field Summary
 javax.ejb.EntityContext ec
           
 java.lang.String objName
           
 RBState ourState
           
protected  java.util.Vector rbNames
           
protected  RecordSet rs
           
 java.lang.String sessionId
           
 java.lang.String URL
           
 
Fields inherited from class com.ibm.redback.redbeansejb.RedBeansEJB
sc
 
Constructor Summary
RBEntityEJB()
           
 
Method Summary
 void callMethod(java.lang.String methodName)
          Calls an RBO method on the RBO Server.
 void createObj()
          Called when the client wants to create the RBO instance.
 void ejbActivate()
          ejbActivate - method required for Entity Beans.
 void ejbLoad()
          ejbLoad - method required for Entity Beans.
 void ejbPassivate()
          ejbPassivate - method required for Entity Beans.
 void ejbRemove()
          ejbRemove - method required for Entity Beans.
 void ejbStore()
          ejbStore - method required for Entity Beans.
 javax.ejb.EntityContext getEntityContext()
          Returns Entity Contect.
 java.lang.String[] getFirstRowMatch(java.lang.String propName, java.lang.String propVal)
          This method gets one row from the already retrieved record set depending on the property name and property value passed.
 boolean getIsFirstTime()
          Returns boolean value depending on selected RBO is already been created .
 java.lang.String[][] getMatchRowDetails(java.lang.String propName, java.lang.String propVal)
          This method gets all the rows matching to the selected criteria from already retrieved record set depending on the property name and property value passed.
 boolean getNotFound()
          Get the boolean depending on serch result in record set.
 java.lang.String getProperty(java.lang.String name)
          Gets the property value from the current state.
 RecordSet getRecordSet()
          Gets the record set current state.
 java.lang.String getRsProperty(java.lang.String prop)
          Gets the property value from the record set depending on property name selected.
 boolean isBOF()
          Returns the boolean value depending upon the end of the retrived record set end.
 boolean isEOF()
          Returns the boolean value depending upon the end of the retrived record set end.
 void move(int pos)
          This method takes the pointer to the spesific row number in the record set.
 void moveFirst()
          This method takes the pointer to the first row in the record set.
 void moveLast()
          This method takes the pointer to the last row in the record set.
 void moveNext()
          This method takes the pointer to the next row in the record set.
 void movePrevious()
          This method takes the pointer to the previous row in the record set.
 void Refresh()
          This method calls select method and gets latest data from the RBO server.
 void Select()
          Calls method callLookupMethod by passing method name and retrieves the record set.
 void setDebugOn(boolean flag)
          Sets the debug flag on or off
 void setEntityContext(javax.ejb.EntityContext ctx)
          Standard EJB method, invoked when the EJB Container instantiates the Entity bean
 void setIsFirstTime(boolean isFirstTime)
          This method is called when RBO is created for the first time and boolean value is set to false.
 void setNotFound(boolean notfound)
          This method sets boolean value to true if serch for the property value in the record set fails.
 void setProperty(java.lang.String name, java.lang.String value)
          Sets a property with a given value for the current state.
 void setRecordSet(RecordSet rs)
          Updates current state by setting record set in the current state.
 void unsetEntityContext()
          Unsets the Entity context by assigning it to null.
 
Methods inherited from class com.ibm.redback.redbeansejb.RedBeansEJB
callMethod, createObj, createObj, getProperty, getRecordSet, getSessionContext, setProperty, setRecordSet, setSessionContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ec

public javax.ejb.EntityContext ec

objName

public java.lang.String objName

sessionId

public java.lang.String sessionId

URL

public java.lang.String URL

ourState

public RBState ourState

rs

protected RecordSet rs

rbNames

protected java.util.Vector rbNames
Constructor Detail

RBEntityEJB

public RBEntityEJB()
Method Detail

callMethod

public void callMethod(java.lang.String methodName)
                throws RbException
Calls an RBO method on the RBO Server. All current state will be passed to the RBO Server and state on the RBO Server will be updated.
Parameters:
methodName - the RBO method to call
Throws:
RbException - thrown if the RedObject returns an exception or if the client state is not valid

createObj

public void createObj()
               throws RbException
Called when the client wants to create the RBO instance. Will create the RedObject and do all initialisation required

ejbActivate

public void ejbActivate()
ejbActivate - method required for Entity Beans.
Overrides:
ejbActivate in class RedBeansEJB

ejbLoad

public void ejbLoad()
ejbLoad - method required for Entity Beans.

ejbPassivate

public void ejbPassivate()
ejbPassivate - method required for Entity Beans.
Overrides:
ejbPassivate in class RedBeansEJB

ejbRemove

public void ejbRemove()
ejbRemove - method required for Entity Beans.
Overrides:
ejbRemove in class RedBeansEJB

ejbStore

public void ejbStore()
ejbStore - method required for Entity Beans.

getEntityContext

public javax.ejb.EntityContext getEntityContext()
Returns Entity Contect.

getIsFirstTime

public boolean getIsFirstTime()
Returns boolean value depending on selected RBO is already been created .

getNotFound

public boolean getNotFound()
Get the boolean depending on serch result in record set. Returns boolean value if selected propery value is found in record set or not.

getProperty

public java.lang.String getProperty(java.lang.String name)
                             throws RbException
Gets the property value from the current state.
Parameters:
name - the property name
Throws:
RbException - thrown if the property name cannot be found

getRecordSet

public RecordSet getRecordSet()
Gets the record set current state.
Parameters:
name - the property name
Throws:
RbException - thrown if the property name cannot be found

getRsProperty

public java.lang.String getRsProperty(java.lang.String prop)
Gets the property value from the record set depending on property name selected.
Parameters:
name - the property name
Throws:
RbException - thrown if the property name cannot be found

isEOF

public boolean isEOF()
Returns the boolean value depending upon the end of the retrived record set end.
Throws:
thrown - error in getting end status.

isBOF

public boolean isBOF()
Returns the boolean value depending upon the end of the retrived record set end.
Throws:
thrown - error in getting end status.

moveNext

public void moveNext()
This method takes the pointer to the next row in the record set.
Throws:
thrown - if error in moving to the next line in the record set.

movePrevious

public void movePrevious()
This method takes the pointer to the previous row in the record set.
Throws:
thrown - if error in moving to the next line in the record set.

moveFirst

public void moveFirst()
This method takes the pointer to the first row in the record set.
Throws:
thrown - if error in moving to the next line in the record set.

moveLast

public void moveLast()
This method takes the pointer to the last row in the record set.
Throws:
thrown - if error in moving to the next line in the record set.

move

public void move(int pos)
This method takes the pointer to the spesific row number in the record set.
Throws:
thrown - if error in moving to the next line in the record set.

Refresh

public void Refresh()
This method calls select method and gets latest data from the RBO server.

Select

public void Select()
Calls method callLookupMethod by passing method name and retrieves the record set.
Throws:
RbException - thrown if error in getting data.

setEntityContext

public void setEntityContext(javax.ejb.EntityContext ctx)
                      throws java.rmi.RemoteException
Standard EJB method, invoked when the EJB Container instantiates the Entity bean

setIsFirstTime

public void setIsFirstTime(boolean isFirstTime)
This method is called when RBO is created for the first time and boolean value is set to false.

setNotFound

public void setNotFound(boolean notfound)
This method sets boolean value to true if serch for the property value in the record set fails.

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
                 throws RbException
Sets a property with a given value for the current state. The value is set in the client state and will not update the RBO Server state until a CallMethod is invoked
Parameters:
name - the property name
value - the value to set
Throws:
RbException - thrown if the property name cannot be found

setRecordSet

public void setRecordSet(RecordSet rs)
Updates current state by setting record set in the current state.
Parameters:
record - set to be set.

unsetEntityContext

public void unsetEntityContext()
                        throws java.rmi.RemoteException
Unsets the Entity context by assigning it to null. This required method for entity bean
Throws:
throws - remote exception.

setDebugOn

public void setDebugOn(boolean flag)
Sets the debug flag on or off
Parameters:
flag, - true will switch on logging, false will switch it off

getFirstRowMatch

public java.lang.String[] getFirstRowMatch(java.lang.String propName,
                                           java.lang.String propVal)
This method gets one row from the already retrieved record set depending on the property name and property value passed.
Throws:
thrown - if error getting the data.

getMatchRowDetails

public java.lang.String[][] getMatchRowDetails(java.lang.String propName,
                                               java.lang.String propVal)
This method gets all the rows matching to the selected criteria from already retrieved record set depending on the property name and property value passed.
Throws:
thrown - if error getting the data.