例: Parent property (Name - Java™)

次のエージェントは、Name オブジェクトの親ユーザー名を表示します。

import lotus.domino.*;

public class JavaAgent extends AgentBase {

  public void NotesMain() {

    try {
      Session session = getSession();
      AgentContext agentContext = session.getAgentContext();

      // (Your code goes here) 
      
      // Create a hierarchical name
      Name nam = session.createName(
        "CN=John B Goode/OU=Sales/OU=East/O=Acme/C=US");

      // Display name and user name for parent session
      displayNames(nam);

    } catch(Exception e) {
      e.printStackTrace();
    }
  }

  void displayNames(Name n) {
    try {
      System.out.println(
        "Received name = " + n.getCommon());
      System.out.println(
        "Current user name = " + n.getParent().getCommonUserName());
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}