Class MicroAgentDescriptor
- All Implemented Interfaces:
Serializable
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 Summary
ConstructorsConstructorDescriptionMicroAgentDescriptor(String name, String displayName, String desc, MethodDescriptor[] methods) Constructs a microagent descriptor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares this object against the specified object.longReturns the checksum of this descriptor.Returns a description of the microagent.Returns the display name of the microagent.Returns the descriptors for the methods supported by this microagent.getName()Returns the name of the microagent.voidsetDisplayName(String displayName) sets the display name of the microagentvoidSets the name of the microagent.Returns a formatted string representation of this descriptor.toString()Returns a string representation of this descriptor.
-
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 tonamefor 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 microagentmethods- 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
Returns the name of the microagent.- Returns:
- The name of the microagent
-
setName
Sets the name of the microagent.- Parameters:
name-
-
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
sets the display name of the microagent- Parameters:
displayName-
-
getDescription
Returns a description of the microagent.- Returns:
- A description of the microagent
-
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
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.)
-
toString
Returns a string representation of this descriptor. -
toFormattedString
Returns a formatted string representation of this descriptor.
-