Adding Developer Notes

Within agent code, agent developers can include developer notes for GUI developers. For example, when changing the agent, the agent developer can include a developer note so the GUI developer can change the GUI accordingly. We recommend mentioning the version in which each such change occurs.

Developer notes appear when viewing API documentation in developer mode.

Procedure

  • Add developer notes at any level within the agent code.
    The form for adding a note depends on the level to which the note applies.
    Level Description
    TeaAgentServer Call the method withDocumentation on your agent's server instance (before registering the instance). Supply your notes as a string argument.
    TeaAgentServlet In your class that extends TeaAgentServlet, override the getDeveloperNotes method to return your notes as a string.
    TeaObjectType Interface Style In your class that extends BaseTeaObject, implement the withDocumentation interface. Code the getDeveloperNotes method to return your notes as a string.
    TeaObjectType Annotation Style In the annotation @TeaObjectType, supply the attribute developerNotes="my_notes".
    TeaOperation In the annotation @TeaOperation, supply the attribute developerNotes="my_notes".
    TeaParam In the annotation @TeaParam, supply the attribute developerNotes="my_notes".
        private static void setupTomcatAgent(final TomcatAgentConfig tomcatAgentConfig)
                throws Exception {
            final TeaAgentServer server = new TeaAgentServer("tomcat", "7.0.42",
                    tomcatAgentConfig.getAgentInfo(), tomcatAgentConfig.getPort(),
                    "/tomcatagent", true);
            server.withDocumentation("Compiled and tested against agent libr V5.");
            server.registerInstance(new TomcatAgent(tomcatAgentConfig, server));
            server.registerInstance(new TomcatServer(tomcatAgentConfig, server));
            ...
    @TeaObjectType(name = TomcatAgentUtil.SERVER,
        concept = TeaConcept.PROCESS, description = "Tomcat Server",
        developerNotes="Unchanged in V5.")
    public class TomcatServer {
    
        private final TomcatAgentConfig tomcatAgentConfig;
        private final TeaAgentServer teaAgentServer;
    
        public TomcatServer(final TomcatAgentConfig tomcatAgentConfig,
                            final TeaAgentServer server) {
            this.tomcatAgentConfig = tomcatAgentConfig;
            this.teaAgentServer = server;
        }
    
        // http://host:port/tomcatagent/server/{key}/changeport?port=8080
        @Customize(value = "label:Change port;icon:edit_16x16.png")
            @TeaOperation(name = "changePort", objectType = "server",
                    description = "Change the server port",
                 developerNotes="From v4 onward, throws IOException.")
        @TeaRequires(value = { TomcatAgent.UPDATE_PERMISSION })
        public void changePort(@KeyParam final String key,
            @TeaParam(name = "port", description = "",
                developerNotes="In V5, added validation that value is in range [1000-2000].")
            @Customize(value = "label=Port") final int port)