IBM Branch Transformation Toolkit Javadoc

com.ibm.btt.cha.ejb
Interface CHAInstance

All Superinterfaces:
javax.ejb.EJBObject, java.rmi.Remote
All Known Subinterfaces:
CHAInstanceForRoot, CHAInstanceForSession

public interface CHAInstance
extends javax.ejb.EJBObject

Remote interface for Enterprise Bean: CHAInstance


Field Summary
static java.lang.String COPYRIGHT
           
 
Method Summary
 void addElement(java.io.Serializable anElement)
          Adds an element to the Context
 void clearKeyedCollection()
          Clears the context (current level only) by destroying the current keyed collection associated and replacing it with a new one.
 void clearKeyedCollection(boolean keepKCollStatus, boolean clearOnlyValues)
          This method clears both the typed and non-typed elements in the context keyed collection.
 Vector fields()
          Returns all the data fields, which are addressable from this context.
 java.lang.String getAncestorByName(java.lang.String aContextName)
          Searches the context tree for an ancestor Context named aContextName and returns the first matching context.
 byte[] getContext()
          Get accessor for persistent attribute: context
 java.lang.String getContextByType(java.lang.String aTypeName)
          Returns the instanceID of the first context that matches its type to aTypeName.
 java.io.Serializable getElementAt(java.lang.String aCompositeKey, boolean isReadOnly)
          Returns the element of its keyedCollection,or keyedCollections of the upper contexts which is located at aCompositeKey path.
 javax.ejb.EntityContext getEntityContext()
          getEntityContext
 java.lang.String getInstanceID()
          Get accessor for persistent attribute: instanceID
 boolean getIsRoot()
          Get accessor for persistent attribute: isRoot
 KeyedCollection getKeyedCollection()
          Returns the keyedCollection attribute.
 java.lang.String getLevel()
          We can define an attribute --level-- in dsectxt.xml file to indicate level of the context.
 java.lang.String getName()
          Get accessor for persistent attribute: name
 java.lang.String getParentID()
          Get accessor for persistent attribute: parentID
 Context getRealContext()
          Returns the _context.
 java.lang.String getTypeName()
          Get accessor for persistent attribute: typeName
 boolean isAddToDynamicKColl()
          Returns the value of the addToDynamicKColl property.
 boolean isChained()
          return true/false based on the existence of a parent ID
 boolean isReadOnly()
          If the definition of this context in dsetxt.xml has the attribute readonly="true", this method will return true, otherwise, false is returned.
 DataElement removeAt(java.lang.String aCompositeKey)
          Removes aCompositeKey element of its keyedCollection.
 DataElement removeAtAnyLevel(java.lang.String aCompositeKey)
          Removes an element of its keyedCollection, or the keyedCollections in the upper contexts, located in the aCompositeKey path.
 void setAddToDynamicKColl(boolean newValue)
          Sets the value of the addToDynamicKColl property.
 void setContext(byte[] newContext)
          Set accessor for persistent attribute: context
 void setInstanceID(java.lang.String newInstanceID)
          Set accessor for persistent attribute: instanceID
 void setIsRoot(boolean newIsRoot)
          Set accessor for persistent attribute: isRoot
 void setKCollDynamic(boolean aValue)
          Set the value to the attribute dynamic for the keyedCollection in this context.
 void setKeyedCollection(java.io.Serializable akeyedCollection)
          set the context's KeyedCollection.
 void setName(java.lang.String newName)
          Set accessor for persistent attribute: name
 void setParentID(java.lang.String newParentID)
          Set accessor for persistent attribute: parentID
 void setRealContext(Context context)
          Sets the _context.
 void setTypeName(java.lang.String newTypeName)
          Set accessor for persistent attribute: typeName
 int setValueAt(SortedTable aSortedTable)
          The function is similiar to setValueAt(String, Object) except that set pairs of keys and values stored in aSortedTable via one method.
 void setValueAt(java.lang.String aKey, java.io.Serializable aValue)
          Adds a value to the Context
 Vector toStrings()
          Returns a visual representation of this context.
 int trySetElementAt(java.lang.String aCompositeKey, java.io.Serializable aValue)
          Set the value of the element of its keyedCollection, or keyedCollections of the upper contexts which is located at aCompositeKey path.
 
Methods inherited from interface javax.ejb.EJBObject
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values
Method Detail

getName

public java.lang.String getName()
                         throws java.rmi.RemoteException
Get accessor for persistent attribute: name

Throws:
java.rmi.RemoteException

setName

public void setName(java.lang.String newName)
             throws java.rmi.RemoteException
Set accessor for persistent attribute: name

Throws:
java.rmi.RemoteException

getParentID

public java.lang.String getParentID()
                             throws java.rmi.RemoteException
Get accessor for persistent attribute: parentID

Throws:
java.rmi.RemoteException

setParentID

public void setParentID(java.lang.String newParentID)
                 throws java.rmi.RemoteException
Set accessor for persistent attribute: parentID

Throws:
java.rmi.RemoteException

getContext

public byte[] getContext()
                  throws java.rmi.RemoteException
Get accessor for persistent attribute: context

Throws:
java.rmi.RemoteException

setContext

public void setContext(byte[] newContext)
                throws java.rmi.RemoteException
Set accessor for persistent attribute: context

Throws:
java.rmi.RemoteException

addElement

public void addElement(java.io.Serializable anElement)
                throws CHAException,
                       java.rmi.RemoteException
Adds an element to the Context

Throws:
CHAException
java.rmi.RemoteException

clearKeyedCollection

public void clearKeyedCollection()
                          throws CHAException,
                                 java.rmi.RemoteException
Clears the context (current level only) by destroying the current keyed collection associated and replacing it with a new one.

Throws:
CHAException
java.rmi.RemoteException

clearKeyedCollection

public void clearKeyedCollection(boolean keepKCollStatus,
                                 boolean clearOnlyValues)
                          throws CHAException,
                                 java.rmi.RemoteException
This method clears both the typed and non-typed elements in the context keyed collection. It can clear only the elements of the kColl and keep the kColl attributes. For the kColl elements it is possible to clear only the values or to clear all the attributes.

Parameters:
keepKCollStatus - boolean (false - clear also the context kColl attributes; true - keep the context kColl attributes and clear only the kColl data elements)
clearOnlyValues - boolean (false - clear all attributes of the context kColl data elements; true - clear only kColl data elements values)
Throws:
IOException - - If keepKCollStatus or clearOnlyValues are false and the keyed collection has not been defined in the generic data file or in the generic types file
CHAException
java.rmi.RemoteException

getEntityContext

public javax.ejb.EntityContext getEntityContext()
                                         throws java.rmi.RemoteException
getEntityContext

Throws:
java.rmi.RemoteException

getInstanceID

public java.lang.String getInstanceID()
                               throws java.rmi.RemoteException
Get accessor for persistent attribute: instanceID

Throws:
java.rmi.RemoteException

isChained

public boolean isChained()
                  throws CHAException,
                         java.rmi.RemoteException
return true/false based on the existence of a parent ID

Throws:
CHAException
java.rmi.RemoteException

setInstanceID

public void setInstanceID(java.lang.String newInstanceID)
                   throws java.rmi.RemoteException
Set accessor for persistent attribute: instanceID

Throws:
java.rmi.RemoteException

setKeyedCollection

public void setKeyedCollection(java.io.Serializable akeyedCollection)
                        throws CHAException,
                               java.rmi.RemoteException
set the context's KeyedCollection. Warning: parameter value can be large. Also any existing keyedCollection in the Context object is immediately replaced.

Throws:
CHAException
java.rmi.RemoteException

setValueAt

public void setValueAt(java.lang.String aKey,
                       java.io.Serializable aValue)
                throws CHAException,
                       java.rmi.RemoteException
Adds a value to the Context

Throws:
CHAException
java.rmi.RemoteException

getRealContext

public Context getRealContext()
                       throws java.rmi.RemoteException
Returns the _context.

Returns:
com.ibm.btt.base.Context
Throws:
java.rmi.RemoteException

setRealContext

public void setRealContext(Context context)
                    throws java.rmi.RemoteException
Sets the _context.

Throws:
java.rmi.RemoteException

getKeyedCollection

public KeyedCollection getKeyedCollection()
                                   throws CHAException,
                                          java.rmi.RemoteException
Returns the keyedCollection attribute.

Throws:
CHAException
java.rmi.RemoteException

fields

public Vector fields()
              throws CHAException,
                     java.rmi.RemoteException
Returns all the data fields, which are addressable from this context. This includes all the data fields of this context and the upper context.

Returns:
Vector
Throws:
CHAException
java.rmi.RemoteException

getAncestorByName

public java.lang.String getAncestorByName(java.lang.String aContextName)
                                   throws CHAException,
                                          java.rmi.RemoteException
Searches the context tree for an ancestor Context named aContextName and returns the first matching context.

Parameters:
aContextName - java.lang.String
Returns:
String instanceID
Throws:
CHAException
java.rmi.RemoteException

isAddToDynamicKColl

public boolean isAddToDynamicKColl()
                            throws CHAException,
                                   java.rmi.RemoteException
Returns the value of the addToDynamicKColl property.

Returns:
boolean - The current value of addToDynamicKColl
Throws:
CHAException
java.rmi.RemoteException

setAddToDynamicKColl

public void setAddToDynamicKColl(boolean newValue)
                          throws CHAException,
                                 java.rmi.RemoteException
Sets the value of the addToDynamicKColl property.

Parameters:
newValue - boolean The new value of the property.
Throws:
CHAException
java.rmi.RemoteException

toStrings

public Vector toStrings()
                 throws java.rmi.RemoteException
Returns a visual representation of this context.

Returns:
Vector
Throws:
java.rmi.RemoteException

setKCollDynamic

public void setKCollDynamic(boolean aValue)
                     throws CHAException,
                            java.rmi.RemoteException
Set the value to the attribute dynamic for the keyedCollection in this context.

Parameters:
aValue -
Throws:
CHAException
java.rmi.RemoteException

removeAt

public DataElement removeAt(java.lang.String aCompositeKey)
                     throws CHAException,
                            java.rmi.RemoteException
Removes aCompositeKey element of its keyedCollection.

Throws:
CHAException
java.rmi.RemoteException

removeAtAnyLevel

public DataElement removeAtAnyLevel(java.lang.String aCompositeKey)
                             throws CHAException,
                                    java.rmi.RemoteException
Removes an element of its keyedCollection, or the keyedCollections in the upper contexts, located in the aCompositeKey path.

Throws:
CHAException
java.rmi.RemoteException

trySetElementAt

public int trySetElementAt(java.lang.String aCompositeKey,
                           java.io.Serializable aValue)
                    throws CHAException,
                           java.rmi.RemoteException
Set the value of the element of its keyedCollection, or keyedCollections of the upper contexts which is located at aCompositeKey path.

Throws:
CHAException
java.rmi.RemoteException

setValueAt

public int setValueAt(SortedTable aSortedTable)
               throws java.rmi.RemoteException
The function is similiar to setValueAt(String, Object) except that set pairs of keys and values stored in aSortedTable via one method. Behind this method, when this context is a distributed context, the pairs of keys and values stored in aSortedTable will be sent to CHA server a time, thus improving performance.

Parameters:
aSortedTable -
Returns:
int = 0 : success int = 1,2,...,n: a value is failed to set which is indicated by return int value. For example, if return value is 1, the first value in aSortedTable can not be set successfully. if return value is 2, the first value is set successfully, but the second value is failed to be set and subsequent pairs of the keys and values will not be set .
Throws:
java.rmi.RemoteException

isReadOnly

public boolean isReadOnly()
                   throws CHAException,
                          java.rmi.RemoteException
If the definition of this context in dsetxt.xml has the attribute readonly="true", this method will return true, otherwise, false is returned.

Returns:
boolean
Throws:
CHAException
java.rmi.RemoteException

getTypeName

public java.lang.String getTypeName()
                             throws java.rmi.RemoteException
Get accessor for persistent attribute: typeName

Throws:
java.rmi.RemoteException

setTypeName

public void setTypeName(java.lang.String newTypeName)
                 throws java.rmi.RemoteException
Set accessor for persistent attribute: typeName

Throws:
java.rmi.RemoteException

getIsRoot

public boolean getIsRoot()
                  throws java.rmi.RemoteException
Get accessor for persistent attribute: isRoot

Throws:
java.rmi.RemoteException

setIsRoot

public void setIsRoot(boolean newIsRoot)
               throws java.rmi.RemoteException
Set accessor for persistent attribute: isRoot

Throws:
java.rmi.RemoteException

getLevel

public java.lang.String getLevel()
                          throws CHAException,
                                 java.rmi.RemoteException
We can define an attribute --level-- in dsectxt.xml file to indicate level of the context. The context can be devided into three levels:root, session, normal.

Returns:
"root", "session", "normal". If this attribute is not difined, return null ;
Throws:
CHAException
java.rmi.RemoteException

getElementAt

public java.io.Serializable getElementAt(java.lang.String aCompositeKey,
                                         boolean isReadOnly)
                                  throws CHAException,
                                         java.rmi.RemoteException
Returns the element of its keyedCollection,or keyedCollections of the upper contexts which is located at aCompositeKey path.

Throws:
CHAException
java.rmi.RemoteException

getContextByType

public java.lang.String getContextByType(java.lang.String aTypeName)
                                  throws CHAException,
                                         java.rmi.RemoteException
Returns the instanceID of the first context that matches its type to aTypeName.

Throws:
CHAException
java.rmi.RemoteException

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005