Changes to the agent

Certain changes to the agent will require you to make corresponding changes to the Java client code. If the structural changes are complex, or if you want to start over without customizations you have made, you can delete any or all of the Java source files before saving the agent.

The following table describes required modifications to the Java client source files after certain agent changes are made in the Agent Builder when the agent is saved.

Table 33. Changes to an agent requiring modifications to the Java source
Agent change What the Agent Builder does Manual changes needed in the Java source
Change of the main class package name

Generates all classes in the new package structure

Removes all helper classes from the old package

Migrate main and attribute group class content from the classes in the old package to the classes in the new package

Remove the classes from the old package after migration is complete

Change of the main class name

Creates new main classes

Removes old main helper class

Migrate main class content to the new class

Update references to the class name from the attribute group classes

Addition of a Java API attribute group

Creates classes for the new attribute group

Adds registration for the new attribute group in the main helper class

Overwrite sample code with custom logic in the attribute group class
Removal of a Java API attribute group Removes registration from the main helper class

Remove the attribute group class or migrate customized logic to some other class

Remove the attribute group helper class

Renaming of a Java API attribute group

Creates classes for the new name of the attribute group

Updates registration for the renamed attribute group in the main helper class

Migrate customized logic in the attribute group class with the old name to the attribute group class with the new name

Remove the attribute group class with the old name

Remove the attribute group helper class with the old name

Addition of an attribute to a Java API attribute group Updates the Attributes inner class in the attribute group helper class Collect data for the new attribute in the attribute group class
Removal of an attribute from a Java API attribute group Updates the Attributes class in the attribute group helper class Remove data collection for the former attribute in the attribute group class
Renaming of an attribute in a Java API attribute group Updates the attribute name in the Attributes class in the attribute group helper class Update any references to the attribute name in the Attributes class (often there are no references because the Attributes constructor, with positional arguments, is used)
Reordering of attributes in a Java API attribute group Updates the attribute order in the Attributes class in the attribute group helper class Update the argument order in any calls to the Attributes constructor

Note that some of the changes mentioned above can be streamlined if you use the Eclipse Refactor - Rename action on all the affected names (including helper class names) before saving the changed agent.