Represents the agent environment of the current program, if an agent is running it.
public class AgentContext extends Base
Contained by: Session
Contains: Agent, Database, DateTime, Document, DocumentCollection
CurrentAgent through getCurrentAgent
CurrentDatabase through getCurrentDatabase
DocumentContext through getDocumentContext
EffectiveUserName through getEffectiveUserName
LastExitStatus through getLastExitStatus
LastRun through getLastRun
SavedData through getSavedData
UnprocessedDocuments through getUnprocessedDocuments
Use getAgentContext in Session to get the AgentContext object for the current agent.
You can create a Java agent by importing files or by writing and compiling the code in Lotus Domino Designer. In the latter case, Lotus Domino Designer provides template code that creates a Session object named session and an AgentContext object named agentContext. The complete template code appears as follows:
import lotus.domino.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext =
session.getAgentContext();
// (Your code goes here)
} catch(Exception e) {
e.printStackTrace();
}
}
}
See examples