GetAvailableCommands method (LLMReq - Java)

Returns an Vector<String> of commands that are available for use with Domino IQ.

Defined in

LLMReq

Data type

java.util.Vector<String>; list of commands

Syntax

public java.util.Vector<String> getAvailableCommands(String server)

throws NotesException

Parameters

String Server

The Domino Server IQ name that is needed to send the request. If empty, the request will be routed to the Domino IQ server configured to service the command.

boolean suppressErrors

It is optional parameter, if true, the query will suppress (not throw exception) if an internal notes error happen, only return null Vector.

Usage

Method will Throws a NotesException if the availability of a request can't be determined due to lower-level failures you can susspress the Exception by passing true value to suppressErrors parameter.

Each element of vector is represented of a command in configure database.

If your agent uses this method on Notes Client, keep in mind that Notes Client will catch the command list until it is restarted. To ensure the method return up-to-date command list, you need to restart Notes Client after making any updates.

Example

import lotus.domino.*;
public class JavaAgent extends AgentBase {
    public void NotesMain() {
      try {
          Session session = getSession();
          AgentContext agentContext = session.getAgentContext();
          LLMReq llmreq = session.createLLMRequest();
          java.util.Vector<String> commands = new java.util.Vector<String>(); 
          // Get all command configure for DominoIQ server name Test
           commands = llmreq.getAvailableCommands("Test");
          for (String element : commands) {
        	  System.out.println(element);
          } 
         
      } catch(Exception e) {
          e.printStackTrace();
       }
   }
}

In case of suppress error:

import lotus.domino.*;
public class JavaAgent extends AgentBase {
    public void NotesMain() {
      try {
          Session session = getSession();
          AgentContext agentContext = session.getAgentContext();
          LLMReq llmreq = session.createLLMRequest();
          java.util.Vector<String> commands = new java.util.Vector<String>(); 
          // Get all command configure for DominoIQ server name Test and suppress any error if happend
           commands = llmreq.getAvailableCommands("Test", true);
         if (commands != null)  {         
for (String element : commands) {
        		  System.out.println(element);
          	}
    } 
         
      } catch(Exception e) {
          e.printStackTrace();
       }
   }
}