context.arch.discoverer
Class ComponentDescription

java.lang.Object
  extended bycontext.arch.discoverer.ComponentDescription
All Implemented Interfaces:
java.lang.Cloneable

public class ComponentDescription
extends java.lang.Object
implements java.lang.Cloneable

This class allows to store a component's description Has changed Vectors into ArrayList all server and widget att merged all callback / service of widget and server merged

Author:
Agathe
See Also:
BaseObject

Field Summary
 java.lang.String classname
          To component classname
 java.lang.String hostaddress
          The component hostaddress
 java.lang.String hostname
          The component hostname
 java.lang.String id
          The component id
 java.lang.String location
          The component location
 int port
          The component port
 java.lang.String type
          The component type : Discoverer.APPLICATION or Discoverer.WIDGET or Discoverer.SERVER or Discoverer.INTERPRETER
 java.lang.String version
          The component version
 
Constructor Summary
ComponentDescription()
          The constructor that creates a new ComponentDescription with no parameters
 
Method Summary
 java.lang.Object clone()
           
static ComponentDescription dataObjectToComponentDescription(DataObject dataObject)
          This method allows to return the ComponentDescription version of a DataObject
 boolean equals(ComponentDescription otherComponent)
          This method allows to compare 2 ComponentDescription objects.
 java.util.SortedSet getAllAttributes()
          Returns an enumeration of the all non constant attributes (non constant and constant)
 DataObject getBasicDataObject()
          This method allows to return a DataObject containing : - the component id - the component hostname - the component port
 java.util.SortedSet getCallbacks()
          Returns an enumeration of the callbacks
 java.util.SortedSet getConstantAttributeNames()
          Returns an enumeration of the constant attributes names
 java.util.SortedSet getConstantAttributeNameValues()
           
 java.util.SortedSet getConstantAttributes()
          Returns an enumeration of the constant attribute names&values
 java.util.SortedSet getConstantAttributeValues()
           
 java.util.SortedSet getInAttributes()
          Returns an enumeration of the incoming attributes
 java.util.SortedSet getJustNameOfWidgetCallbacks()
          Returns an enumeration of the widget callbacks, but if the callback name contains an underscore, then it returns just the last word.
 java.util.SortedSet getNonConstantAttributes()
          Returns an enumeration of the non constant attributes
 java.util.SortedSet getOutAttributes()
          Returns an enumeration of the outgoing attributes
 java.util.SortedSet getServices()
          Returns an enumeration of the widget services
 java.util.SortedSet getSubscribers()
          Returns an enumeration of thesubscribers
 Error setClassname(DataObject data)
          Sets the classname.
 void setConstantAttribute(AttributeNameValue data)
          Adds the data parameter to the constant attributes
 Error setConstantAttributes(DataObject data)
          Adds a set of attribute names to the constant attributes.
 Error setHostaddress(DataObject data)
          Sets the component hostaddress.
 Error setHostname(DataObject data)
          Sets the component hostname.
 Error setId(DataObject data)
          Sets the id.
 void setInAttribute(Attribute data)
          Adds the data parameter to the incoming attributes
 Error setInAttributes(DataObject data)
          Adds a set of incoming attribute names to the cincoming attributes.
 Error setLocation(DataObject data)
          Sets the component location.
 void setNonConstantAttribute(Attribute data)
          Adds the data parameter to the non constant attributes
 Error setNonConstantAttributes(DataObject data)
          Adds a set of attribute names to the non constant attributes.
 void setOutAttribute(Attribute data)
          Adds the data parameter to the outgoing attributes
 Error setOutAttributes(DataObject data)
          Adds a set of outgoing attributes to the outgoing attributes.
 Error setPort(DataObject data)
          Sets the component port.
 void setServerCallback(java.lang.String data)
          Adds the data parameter to the server callbacks
 Error setServerCallbacks(DataObject data)
          Adds a set of server callback names.
 void setServerConstantAttribute(Attribute data)
          Adds the data parameter to the server constant attributes
 Error setServerConstantAttributes(DataObject data)
          Adds a set of server constant attributes to the server attributes.
 void setServerNonConstantAttribute(Attribute data)
          Adds the data parameter to the server non constant attributes
 Error setServerNonConstantAttributes(DataObject data)
          Adds a set of server non constant attributes to the server attributes.
 void setServerService(java.lang.String data)
          Adds the data parameter to the server services
 Error setServerServices(DataObject data)
          Adds a set of server service names.
 void setSubscriber(java.lang.String data)
          Adds the data parameter to the subscriber attributes
 Error setSubscribers(DataObject data)
          Adds a set of subscriber names to thesubscriber attributes.
 Error setType(DataObject data)
          Sets the component type.
 Error setVersion(DataObject data)
          Sets the component version.
 void setWidgetCallback(java.lang.String data)
          Adds the data parameter to the widget callbacks
 Error setWidgetCallbacks(DataObject data)
          Adds a set of widget callback names to the callback.
 void setWidgetService(java.lang.String data)
          Adds the data parameter to the widget services
 Error setWidgetServices(DataObject data)
          Adds a set of service names.
 DataObject toDataObject()
           
 java.lang.String toSmallString()
           
 java.lang.String toSmallStringNL()
           
 java.lang.String toString()
          Returns a printable version of ComponentDescription
 java.lang.String toStringNL()
          Returns a printable version of ComponentDescription with new lines
 Error updateDescription(DataObject data)
          This method allows to get the modified descriptions fields and update the component Fields that can be modified : the non constant attributes (widget, server) and the subscribers, It gets a NON_CONSTANT_ATTRIBUTE_NAME_VALUES The default update type is the add type (Discoverer.UPDATE_ADD_TYPE)
 Error updateDescription(DataObject data, java.lang.String updateType)
          This method allows to get the modified descriptions fields and update the component Fields that can be modified : the non constant attributes (widget, server) and the subscribers, It gets a NON_CONSTANT_ATTRIBUTE_NAME_VALUES
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

public java.lang.String id
The component id


classname

public java.lang.String classname
To component classname


hostname

public java.lang.String hostname
The component hostname


hostaddress

public java.lang.String hostaddress
The component hostaddress


location

public java.lang.String location
The component location


type

public java.lang.String type
The component type : Discoverer.APPLICATION or Discoverer.WIDGET or Discoverer.SERVER or Discoverer.INTERPRETER


version

public java.lang.String version
The component version


port

public int port
The component port

Constructor Detail

ComponentDescription

public ComponentDescription()
The constructor that creates a new ComponentDescription with no parameters

Method Detail

dataObjectToComponentDescription

public static ComponentDescription dataObjectToComponentDescription(DataObject dataObject)
This method allows to return the ComponentDescription version of a DataObject

Parameters:
dataObject - The DataObject containing the description of a context object
Returns:
ComponentDescription The ComponentDescription version

toDataObject

public DataObject toDataObject()

toString

public java.lang.String toString()
Returns a printable version of ComponentDescription

Returns:
String The string version of the ComponentDescription

toSmallString

public java.lang.String toSmallString()

toSmallStringNL

public java.lang.String toSmallStringNL()

toStringNL

public java.lang.String toStringNL()
Returns a printable version of ComponentDescription with new lines

Returns:
String The string version of the ComponentDescription

setConstantAttribute

public void setConstantAttribute(AttributeNameValue data)
Adds the data parameter to the constant attributes

Parameters:
data - The name of the constant attribute
See Also:
Attributes

setConstantAttributes

public Error setConstantAttributes(DataObject data)
Adds a set of attribute names to the constant attributes. Gets a DISCOVERER_CONSTANT_ATTRIBUTE_NAME_VALUES DataObject

Parameters:
data - The DataObject containing a set of constant attribute names
Returns:
Error The error code
See Also:
Attributes

setNonConstantAttribute

public void setNonConstantAttribute(Attribute data)
Adds the data parameter to the non constant attributes

Parameters:
data - The non constant attribute
See Also:
Attribute

setNonConstantAttributes

public Error setNonConstantAttributes(DataObject data)
Adds a set of attribute names to the non constant attributes. Gets a DISCOVERER_NON_CONSTANT_ATTRIBUTE_NAME_VALUES DataObject

Parameters:
data - The DataObject containing a set of non constant attribute names
Returns:
Error The error code
See Also:
Attribute

setInAttribute

public void setInAttribute(Attribute data)
Adds the data parameter to the incoming attributes

Parameters:
data - The incoming attribute
See Also:
Attribute

setInAttributes

public Error setInAttributes(DataObject data)
Adds a set of incoming attribute names to the cincoming attributes. Gets a INCOMING_DISCOVERER_ATTRIBUTE_NAME_VALUES DataObject

Parameters:
data - The DataObject containing a set of incoming attribute names
Returns:
Error The error code
See Also:
Attribute

setOutAttribute

public void setOutAttribute(Attribute data)
Adds the data parameter to the outgoing attributes

Parameters:
data - The outgoing attribute
See Also:
Attribute

setOutAttributes

public Error setOutAttributes(DataObject data)
Adds a set of outgoing attributes to the outgoing attributes. Gets a OUTGOING_DISCOVERER_CONSTANT_ATTRIBUTE_NAME_VALUES DataObject

Parameters:
data - The DataObject containing a set of outgoing attribute names
Returns:
Error The error code
See Also:
Attribute

setServerConstantAttributes

public Error setServerConstantAttributes(DataObject data)
Adds a set of server constant attributes to the server attributes. Gets a Discoverer.SERVER_CONSTANT_ATTRIBUTES DataObject

Parameters:
data - The DataObject containing a set of server attribute names
Returns:
Error The error code
See Also:
Attribute

setServerNonConstantAttributes

public Error setServerNonConstantAttributes(DataObject data)
Adds a set of server non constant attributes to the server attributes. Gets a Discoverer.SERVER_NON_CONSTANT_ATTRIBUTES DataObject

Parameters:
data - The DataObject containing a set of server attribute names
Returns:
Error The error code
See Also:
Attribute

setServerConstantAttribute

public void setServerConstantAttribute(Attribute data)
Adds the data parameter to the server constant attributes

Parameters:
data - The server constant attribute
See Also:
Attribute

setServerNonConstantAttribute

public void setServerNonConstantAttribute(Attribute data)
Adds the data parameter to the server non constant attributes

Parameters:
data - The servernopn constant attribute
See Also:
Attribute

setSubscriber

public void setSubscriber(java.lang.String data)
Adds the data parameter to the subscriber attributes

Parameters:
data - The name of the subscriber attribute
See Also:
Attribute

setSubscribers

public Error setSubscribers(DataObject data)
Adds a set of subscriber names to thesubscriber attributes. Gets a DISCOVERER_CONSTANT_ATTRIBUTE_NAME_VALUES DataObject

Parameters:
data - The DataObject containing a set of subscriber attribute names
Returns:
Error The error code
See Also:
Attribute

setServerService

public void setServerService(java.lang.String data)
Adds the data parameter to the server services

Parameters:
data - The name of the server services
See Also:
Attribute

setServerServices

public Error setServerServices(DataObject data)
Adds a set of server service names. Gets a SERVER_SERVICES DataObject

Parameters:
data - The DataObject containing a set of server services names
Returns:
Error The error code
See Also:
Attribute

setWidgetCallback

public void setWidgetCallback(java.lang.String data)
Adds the data parameter to the widget callbacks

Parameters:
data - The name of the widget callbacks
See Also:
Attribute

setWidgetCallbacks

public Error setWidgetCallbacks(DataObject data)
Adds a set of widget callback names to the callback. Gets a WIDGET_CALLBACKS DataObject

Parameters:
data - The DataObject containing a set of widget callback names
Returns:
Error The error code
See Also:
Attribute

setWidgetService

public void setWidgetService(java.lang.String data)
Adds the data parameter to the widget services

Parameters:
data - The name of the widget services
See Also:
Attribute

setWidgetServices

public Error setWidgetServices(DataObject data)
Adds a set of service names. Gets a WIDGET_SERVICES DataObject

Parameters:
data - The DataObject containing a set of widget services names
Returns:
Error The error code
See Also:
Attribute

setServerCallback

public void setServerCallback(java.lang.String data)
Adds the data parameter to the server callbacks

Parameters:
data - The name of the server callbacks
See Also:
Attribute

setServerCallbacks

public Error setServerCallbacks(DataObject data)
Adds a set of server callback names. Gets a SERVER_CALLBACKS DataObject

Parameters:
data - The DataObject containing a set of server callback names
Returns:
Error The error code
See Also:
Attribute

setId

public Error setId(DataObject data)
Sets the id. Gets an ID DataObject

Parameters:
data - The DataObject containing the id
Returns:
Error The error code
See Also:
BaseObject.ID

setClassname

public Error setClassname(DataObject data)
Sets the classname. Gets a COMPONENT_CLASSNAME DataObject

Parameters:
data - The DataObject containing the classname
Returns:
Error The error code
See Also:
Discoverer

setType

public Error setType(DataObject data)
Sets the component type. Gets a TYPE DataObject

Parameters:
data - The DataObject containing the type
Returns:
Error The error code
See Also:
Discoverer

setHostname

public Error setHostname(DataObject data)
Sets the component hostname. Gets a HOSTNAME DataObject

Parameters:
data - The DataObject containing the hostname
Returns:
Error The error code
See Also:
Discoverer

setHostaddress

public Error setHostaddress(DataObject data)
Sets the component hostaddress. Gets a HOSTADDRESS DataObject

Parameters:
data - The DataObject containing the hostaddress
Returns:
Error The error code
See Also:
Discoverer

setPort

public Error setPort(DataObject data)
Sets the component port. Gets a PORT DataObject

Parameters:
data - The DataObject containing the port
Returns:
Error The error code
See Also:
Discoverer

setLocation

public Error setLocation(DataObject data)
Sets the component location. Gets a LOCATION DataObject

Parameters:
data - The DataObject containing the location
Returns:
Error The error code
See Also:
Discoverer

setVersion

public Error setVersion(DataObject data)
Sets the component version. Gets a VERSION DataObject

Parameters:
data - The DataObject containing the version
Returns:
Error The error code
See Also:
Discoverer

updateDescription

public Error updateDescription(DataObject data)
This method allows to get the modified descriptions fields and update the component Fields that can be modified : the non constant attributes (widget, server) and the subscribers, It gets a NON_CONSTANT_ATTRIBUTE_NAME_VALUES The default update type is the add type (Discoverer.UPDATE_ADD_TYPE)

Parameters:
data - The DataObject containing the modified fields
Returns:
Error The error code
See Also:
DataObject, Discoverer

updateDescription

public Error updateDescription(DataObject data,
                               java.lang.String updateType)
This method allows to get the modified descriptions fields and update the component Fields that can be modified : the non constant attributes (widget, server) and the subscribers, It gets a NON_CONSTANT_ATTRIBUTE_NAME_VALUES

Parameters:
data - The DataObject containing the modified fields
Returns:
Error The error code
See Also:
DataObject, Discoverer

getConstantAttributes

public java.util.SortedSet getConstantAttributes()
Returns an enumeration of the constant attribute names&values

Returns:
Enumeration The list of constant attribute objects, as a list of Attribute objects

getNonConstantAttributes

public java.util.SortedSet getNonConstantAttributes()
Returns an enumeration of the non constant attributes

Returns:
Collection The list of non constant attributes, as a list of Attribute objects

getAllAttributes

public java.util.SortedSet getAllAttributes()
Returns an enumeration of the all non constant attributes (non constant and constant)

Returns:
Enumeration The list of non constant attributes, as a list of Attribute objects

getInAttributes

public java.util.SortedSet getInAttributes()
Returns an enumeration of the incoming attributes

Returns:
Enumeration The list of incoming attributes, as a list of Attribute objects

getOutAttributes

public java.util.SortedSet getOutAttributes()
Returns an enumeration of the outgoing attributes

Returns:
Enumeration The list of outgoing attributes, as a list of Attribute objects

getConstantAttributeNames

public java.util.SortedSet getConstantAttributeNames()
Returns an enumeration of the constant attributes names

Returns:
Enumeration The list of widget/server constant attributes names

getConstantAttributeValues

public java.util.SortedSet getConstantAttributeValues()

getConstantAttributeNameValues

public java.util.SortedSet getConstantAttributeNameValues()

getCallbacks

public java.util.SortedSet getCallbacks()
Returns an enumeration of the callbacks

Returns:
Enumeration The list of callbacks

getJustNameOfWidgetCallbacks

public java.util.SortedSet getJustNameOfWidgetCallbacks()
Returns an enumeration of the widget callbacks, but if the callback name contains an underscore, then it returns just the last word. For example : for widgetName_callbackName we just return callbackName

Returns:
Enumeration The list of callbacks

getServices

public java.util.SortedSet getServices()
Returns an enumeration of the widget services

Returns:
Enumeration The list of widget services

getSubscribers

public java.util.SortedSet getSubscribers()
Returns an enumeration of thesubscribers

Returns:
Enumeration The list of subscribers

getBasicDataObject

public DataObject getBasicDataObject()
This method allows to return a DataObject containing : - the component id - the component hostname - the component port

Returns:
DataObject The data object containing the information

equals

public boolean equals(ComponentDescription otherComponent)
This method allows to compare 2 ComponentDescription objects.

Parameters:
otherComponent - The ComponentDescription to compare to
Returns:
boolean The result of the comparison

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Throws:
java.lang.CloneNotSupportedException