Class MicroAgentDescriptor

java.lang.Object
COM.TIBCO.hawk.talon.MicroAgentDescriptor
All Implemented Interfaces:
Serializable

public class MicroAgentDescriptor extends Object implements Serializable
This class is used to describe a microagent and its methods.

MicroAgentDescriptor objects are used by microagents to advertise their supported methods along with all the information required to invoke them.

By convention, every microagent should have a globally unique name. If two microagent instances have the same name they should also have the same MicroAgentDescriptor, which implies that they advertise support for the same methods with the same signatures.

See Also:
  • Constructor Details

    • MicroAgentDescriptor

      public MicroAgentDescriptor(String name, String displayName, String desc, MethodDescriptor[] methods)
      Constructs a microagent descriptor.
      Parameters:
      name - The name of the microagent. Must be a non-null non-empty string. All microagents should have unique names. It is recommended that all microagents have a name that is prefaced by their developing organization's Internet domain name. For example, microagents developed by TIBCO Software Inc. have names prefaced by "COM.TIBCO.".
      displayName - A name which may be used as an alternate to name for presentation purposes only. Because a microagent's name needs to be unique, it might be lengthy. The display name can be used to provide an abbreviated name which is intended for use for presentation purposes only.
      desc - A description of the microagent
      methods - An array of MethodDescriptor objects describing the methods supported by this microagent. All methods must have unique names. This array must contain at least 1 method descriptor. It may not contain null elements.
      Throws:
      IllegalArgumentException - If the parameter conditions are violated.
  • Method Details

    • getName

      public String getName()
      Returns the name of the microagent.
      Returns:
      The name of the microagent
    • setName

      public void setName(String name)
      Sets the name of the microagent.
      Parameters:
      name -
    • getDisplayName

      public String getDisplayName()
      Returns the display name of the microagent.

      Because a microagent's name needs to be unique, it might be lengthy. The display name can be used to provide an abreiviated name which is intended for use for presentation purposes only.

      If a display name was not supplied, this method will return the same value as getName();

      Returns:
      The display name of the microagent.
    • setDisplayName

      public void setDisplayName(String displayName)
      sets the display name of the microagent
      Parameters:
      displayName -
    • getDescription

      public String getDescription()
      Returns a description of the microagent.
      Returns:
      A description of the microagent
    • getMethodDescriptors

      public MethodDescriptor[] getMethodDescriptors()
      Returns the descriptors for the methods supported by this microagent.
      Returns:
      The descriptors for the methods supported by this microagent.
    • getChecksum

      public long getChecksum()
      Returns the checksum of this descriptor.

      The checksum is computed using a CRC-32 algorithm. It takes into account the microagent name and all method names and their signatures.

      The following attributes of the contained objects are not used to compute checksum as they are not considered part of the microagent's signature:

      • MicroAgentDescriptor - display name, description
      • MethodDescriptor - description
      • TabularDataDescriptor - description
      • CompositeDataDescriptor - description
      • DataDescriptor - description, default value, legal values, value choices

      The checksum is not collision proof. If two descriptors are the same, they will have the same checksum. If two descriptors have the same name and checksum then it is likely, but not guaranteed, that their method signatures match.

      Returns:
      The checksum of this descriptor.
    • equals

      public boolean equals(Object obj)
      Compares this object against the specified object.

      Two MicroAgentDescriptor objects are equal if they have the same name, display name, description, and method descriptors. (Note: two MicroAgentDescriptors may have the same checksum but not be equal.)

      Overrides:
      equals in class Object
      Returns:
      true if the two objects are equal.
      See Also:
    • toString

      public String toString()
      Returns a string representation of this descriptor.
      Overrides:
      toString in class Object
    • toFormattedString

      public String toFormattedString()
      Returns a formatted string representation of this descriptor.