/**
   * Create the validate Netconf operation.
   *
   * @param session The active session.
   * @param source The source Container.
   * @throws CapabilityException Throw this exception if the server does not have the :validate:1.0
   *     capability. Throw this exception if the server does not have the :candidate:1.0 capability
   *     and the source container is 'candidate'.. Throw this exception if the server does not have
   *     the :startup:1.0 capability and the source container is 'startup'.
   */
  public Validate(Session session, Datastore source) throws CapabilityException {
    super(session);
    if (!Session.VALIDATE_1_0.isPresentOnServer(session))
      throw new CapabilityException(
          "This capability is not supported by server: "
              + Session.VALIDATE_1_0
              + "; Please don't use this class with any operation.");

    if (source.equals(Datastore.candidate) && !Session.CANDIDATE_1_0.isPresentOnServer(session))
      throw new CapabilityException(
          "This capability is not supported by server: "
              + Session.CANDIDATE_1_0
              + "; Please don't specific a <candidate> container as target or source in any operation.");

    if (source.equals(Datastore.startup) && !Session.STARTUP_1_0.isPresentOnServer(session))
      throw new CapabilityException(
          "This capability is not supported by server: "
              + Session.STARTUP_1_0
              + "; Please don't specific a <startup> container as target or source in any operation.");

    operation = new Rpc(Session.VALIDATE_1_0, "validate");

    Container sou;
    sou = operation.getInput().linkContainer(operation.createContainer("source"));
    Leaf s = sou.linkLeaf(operation.createLeaf(source.getName()));
    sou.assignLeaf(s, "");
  }