context.arch.discoverer.dataModel
Class DiscovererDataModel

java.lang.Object
  extended bycontext.arch.discoverer.dataModel.AbstractDataModel
      extended bycontext.arch.discoverer.dataModel.DiscovererDataModel

public class DiscovererDataModel
extends AbstractDataModel

This class stores the ComponentDescriptions of the CTK object that register to the discoverer. It stores the complete ComponentDescription in a Hashtable and maintain a set of IndexTableIF that allows to search more quickly for particular CTK objects. They are index on each of the description element.

Author:
Agathe

Field Summary
 java.lang.String CALLBACK_INDEX
           
 java.lang.String CLASSNAME_INDEX
           
 java.lang.String CST_ATT_NAME_INDEX
           
 java.lang.String CST_ATT_NAME_VALUE_INDEX
           
 java.lang.String CST_ATT_VALUE_INDEX
           
 java.lang.String HOSTNAME_INDEX
           
 java.lang.String ID_INDEX
           
 java.lang.String IN_ATT_INDEX
           
 java.lang.String NON_CST_ATT_INDEX
           
 java.lang.String OUT_ATT_INDEX
           
 java.lang.String PORT_INDEX
           
 java.lang.String SERVICE_INDEX
           
 java.lang.String SUBSCRIBER_INDEX
           
 java.lang.String TYPE_INDEX
           
 
Fields inherited from class context.arch.discoverer.dataModel.AbstractDataModel
nameToIndexTableIF
 
Constructor Summary
DiscovererDataModel()
          Creates new DiscovererDataModel
 
Method Summary
 java.lang.Object add(java.lang.Object componentDescription)
          Adds the ComponentDescription object to the list of components, and updates the index tables based on the component description.
 void addToIndexTableIF(ComponentDescription comp, java.lang.Integer index)
           
 java.lang.Object getEmptyArray()
          Returns a empty hashmap that contains as key the index of the currently stored components, and as value, false.
 java.util.Enumeration getIndexKeys()
           
 java.lang.Object getIndexOf(java.lang.Object stringOrInteger)
          Return the index corresponding to the id of a component
 java.lang.Object getObjectAt(java.lang.Object stringOrInteger)
           
static void main(java.lang.String[] args)
           
 java.lang.Object remove(java.lang.Object objectIndexOrId)
           
 void removeFromIndexTableIF(ComponentDescription comp, java.lang.Integer index)
          This method allows to remove the reference to a component description from the IndexTableIF tables.
 java.lang.String toString()
           
 java.lang.Object update(java.lang.Object componentDescription)
          Update all hashtable (general and index tables) to add a new component
 
Methods inherited from class context.arch.discoverer.dataModel.AbstractDataModel
decNbElements, getIndexTableIFCorrespondingTo, getNbElements, getNumberOfElements, incNbElements
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID_INDEX

public final java.lang.String ID_INDEX
See Also:
Constant Field Values

CLASSNAME_INDEX

public final java.lang.String CLASSNAME_INDEX
See Also:
Constant Field Values

HOSTNAME_INDEX

public final java.lang.String HOSTNAME_INDEX
See Also:
Constant Field Values

TYPE_INDEX

public final java.lang.String TYPE_INDEX
See Also:
Constant Field Values

PORT_INDEX

public final java.lang.String PORT_INDEX
See Also:
Constant Field Values

CST_ATT_NAME_VALUE_INDEX

public final java.lang.String CST_ATT_NAME_VALUE_INDEX
See Also:
Constant Field Values

CST_ATT_NAME_INDEX

public final java.lang.String CST_ATT_NAME_INDEX
See Also:
Constant Field Values

CST_ATT_VALUE_INDEX

public final java.lang.String CST_ATT_VALUE_INDEX
See Also:
Constant Field Values

NON_CST_ATT_INDEX

public final java.lang.String NON_CST_ATT_INDEX
See Also:
Constant Field Values

CALLBACK_INDEX

public final java.lang.String CALLBACK_INDEX
See Also:
Constant Field Values

SERVICE_INDEX

public final java.lang.String SERVICE_INDEX
See Also:
Constant Field Values

SUBSCRIBER_INDEX

public final java.lang.String SUBSCRIBER_INDEX
See Also:
Constant Field Values

IN_ATT_INDEX

public final java.lang.String IN_ATT_INDEX
See Also:
Constant Field Values

OUT_ATT_INDEX

public final java.lang.String OUT_ATT_INDEX
See Also:
Constant Field Values
Constructor Detail

DiscovererDataModel

public DiscovererDataModel()
Creates new DiscovererDataModel

Method Detail

add

public java.lang.Object add(java.lang.Object componentDescription)
Adds the ComponentDescription object to the list of components, and updates the index tables based on the component description.

Specified by:
add in class AbstractDataModel
Parameters:
componentDescription - ComponentDescription object
Returns:
Integer

update

public java.lang.Object update(java.lang.Object componentDescription)
Update all hashtable (general and index tables) to add a new component

Specified by:
update in class AbstractDataModel
Parameters:
componentDescription - The new component to add
Returns:
the Integer corresponding to the index of the component

getIndexOf

public java.lang.Object getIndexOf(java.lang.Object stringOrInteger)
Return the index corresponding to the id of a component

Specified by:
getIndexOf in class AbstractDataModel
Returns:
Integer

getObjectAt

public java.lang.Object getObjectAt(java.lang.Object stringOrInteger)
Specified by:
getObjectAt in class AbstractDataModel
Returns:
Object (ComponentDescription)

getIndexKeys

public java.util.Enumeration getIndexKeys()
Specified by:
getIndexKeys in class AbstractDataModel

remove

public java.lang.Object remove(java.lang.Object objectIndexOrId)
Specified by:
remove in class AbstractDataModel
Returns:
Object The removed object (ComponentDescription)

addToIndexTableIF

public void addToIndexTableIF(ComponentDescription comp,
                              java.lang.Integer index)

removeFromIndexTableIF

public void removeFromIndexTableIF(ComponentDescription comp,
                                   java.lang.Integer index)
This method allows to remove the reference to a component description from the IndexTableIF tables.


toString

public java.lang.String toString()
Specified by:
toString in class AbstractDataModel

getEmptyArray

public java.lang.Object getEmptyArray()
Returns a empty hashmap that contains as key the index of the currently stored components, and as value, false.

Specified by:
getEmptyArray in class AbstractDataModel
Returns:
HashMap

main

public static void main(java.lang.String[] args)