# AppserverInfo.java

    /*
    ** Module   : AppserverInfo.java
    ** Abstract : A descriptor that contains details regarding an appserver process.
    **
    ** Copyright (c) 2024-2025, Golden Code Development Corporation.
    **
    ** -#- -I- --Date-- ----------------------------Description------------------------------
    ** 001 GBB 20240930 Initial version.
    ** 002 GBB 20250403 Support for the new multi-session appserver.
    */
    /*
     ** This program is free software: you can redistribute it and/or modify
     ** it under the terms of the GNU Affero General Public License as
     ** published by the Free Software Foundation, either version 3 of the
     ** License, or (at your option) any later version.
     **
     ** This program is distributed in the hope that it will be useful,
     ** but WITHOUT ANY WARRANTY; without even the implied warranty of
     ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     ** GNU Affero General Public License for more details.
     **
     ** You may find a copy of the GNU Affero GPL version 3 at the following
     ** location: https://www.gnu.org/licenses/agpl-3.0.en.html
     **
     ** Additional terms under GNU Affero GPL version 3 section 7:
     **
     **   Under Section 7 of the GNU Affero GPL version 3, the following additional
     **   terms apply to the works covered under the License.  These additional terms
     **   are non-permissive additional terms allowed under Section 7 of the GNU
     **   Affero GPL version 3 and may not be removed by you.
     **
     **   0. Attribution Requirement.
     **
     **     You must preserve all legal notices or author attributions in the covered
     **     work or Appropriate Legal Notices displayed by works containing the covered
     **     work.  You may not remove from the covered work any author or developer
     **     credit already included within the covered work.
     **
     **   1. No License To Use Trademarks.
     **
     **     This license does not grant any license or rights to use the trademarks
     **     Golden Code, FWD, any Golden Code or FWD logo, or any other trademarks
     **     of Golden Code Development Corporation. You are not authorized to use the
     **     name Golden Code, FWD, or the names of any author or contributor, for
     **     publicity purposes without written authorization.
     **
     **   2. No Misrepresentation of Affiliation.
     **
     **     You may not represent yourself as Golden Code Development Corporation or FWD.
     **
     **     You may not represent yourself for publicity purposes as associated with
     **     Golden Code Development Corporation, FWD, or any author or contributor to
     **     the covered work, without written authorization.
     **
     **   3. No Misrepresentation of Source or Origin.
     **
     **     You may not represent the covered work as solely your work.  All modified
     **     versions of the covered work must be marked in a reasonable way to make it
     **     clear that the modified work is not originating from Golden Code Development
     **     Corporation or FWD.  All modified versions must contain the notices of
     **     attribution required in this license.
     */

    package com.goldencode.p2j.admin;

    import java.io.*;
    import java.util.*;

    /** A descriptor that contains details regarding an appserver process. */
    public class AppserverInfo
    implements Serializable
    {
       /** A descriptor that contains details regarding an appserver agent. */
       public static class AgentInfo
       extends TaggedName
       implements Serializable
       {
          /** The appserver name. */
          public String appserverName;

          /** Process id. */
          public Long pid;

          /** Agent id. */
          public Integer agentId;

          /** The agent startup time. */
          public Date agentStartTime;

          /** State - AVAILABLE or RUNNING. */
          public String state;

          /** Flag indicating the agent has been bound to the connection. Applicable to classic only. */
          public boolean bound;

          /** The time the currently running procedure on this agent started. Applicable to classic only. */
          public Date sessionStartTime;

          /** The currently running procedure on this agent. Applicable to classic only. */
          public String sessionProcedure;

          /** To be populated. Applicable to classic only.*/
          public String clientType;

          /** List of session infos. Applicable to multi-session agent appservers only. */
          public MultiSessionAgentSessionDef[] sessionInfos;

          /** Public constructor without args used for Serializable. */
          public AgentInfo()
          {
          }

          /**
           * Creates and returns a unique name for the agent.
           *
           * @return   A unique name for the agent.
           */
          @Override
          public String getName()
          {
             return appserverName + agentId;
          }
       }

       /** Appserver process name. */
       public String name = null;

       /** Appserver ID. */
       public Integer id;

       /** Flag to indicate multi-session agent appserver. */
       public Boolean isMultiSession;

       /** Flag to indicate new multi-session agent appserver implementation. */
       public Boolean isNewMultiSession;

       /** List of agent infos. */
       public AgentInfo[] agentInfos;

       /** The operating mode. */
       public String operatingMode;

       /** The scheduler mode. */
       public String autoStartTime;

       /** Appserver's explicit propath. */
       public String propath;

       /** LOG-MANAGER file name patterned. */
       public String logFilename;

       /** LOG-MANAGER logging level. */
       public Integer loggingLevel;

       /** LOG-MANAGER file threshold size. */
       public Integer logFileThresholdSize;

       /** LOG-MANAGER max files count. */
       public Integer logFilesMaxNumber;

       /** The OS user. */
       public String systemUser;

       /** The appserver process name. */
       public String fwdProcessName;

       /** Flag for enabling SSL validation. */
       public Boolean enableSsl;

       /** Private key alias. */
       public String privateKeyAlias;

       /** The number of agents to start initially. */
       public Integer initialServers;

       /** The minimum number of agents required for this appserver. */
       public Integer minServers;

       /** The maximum number of agents which can be alive. */
       public Integer maxServer;

       /**
        * The amount of time (in seconds) to wait for an agent to be available, before attempting
        * to auto-start a new one.
        */
       public Integer requestTimeout;

       /**
        * The number of seconds waiting before auto-trimming the agents, if they exceed the
        * minimum capacity.
        */
       public Integer autoTrimTimeout;

       /** The activate procedure; may be null/empty. */
       public String activateProc;

       /** The deactivate procedure; may be null/empty. */
       public String deactivateProc;

       /** The connect procedure; may be null/empty. */
       public String connectProc;

       /** The disconnect procedure; may be null/empty. */
       public String disconnectProc;

       /** The startup procedure; may be null/empty. */
       public String startupProc;

       /** The shutdown procedure; may be null/empty. */
       public String shutdownProc;

       /** The startup procedure; may be null/empty. */
       public String startupProcParams;

       /** Public constructor without args used for Serializable. */
       public AppserverInfo()
       {
       }
    }