ClientSocket.java

/*
** Module   : ClientSocket.java
** Abstract : Implementation of OpenEdge.Net.ServerConnection.ClientSocket 
**            builtin class.
**
** Copyright (c) 2019-2024, Golden Code Development Corporation.
**
** -#- -I- --Date-- ---------------------------------------Description---------------------------------------
** 001 MP  20200528 Created the first version, by converting the legacy skeleton .cls file and using that 
**                  output.
** 002 MP  20200611 Add missing methods as stubs taken by converting the skeleton using FWD.
**     CA  20210219 OO input parameter definitions for functions/procedures must not register with  ObjectOps 
**                  - TypeFactory.initInput will take care of this.
** 003 CA  20210221 Fixed 'qualified', 'extent' and 'returns' annotations at the legacy signature.
**     ME  20210426 Fixed properties initial values (class not implemented, http client used instead).
**     OM  20210917 Code maintenance.
**     CA  20220513 Fixed legacy signature for 'writeData'.
** 004 CA  20230817 Removed ObjectOps.register, as this registration is handled by runtime.
** 005 ME  20230503 Reconvert skeleton, remove setter for connected, set connect params on ctor (#6410).
** 006 CA  20231113 The 'execute' method must be annotated with LegacySignature Type.Execute, and also can be
**                  dropped if is a no-op.
** 007 GBB 20240610 Comments left to remind of setting client type.
*/

/*
** 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.oo.net.serverconnection;

import com.goldencode.p2j.util.*;
import com.goldencode.p2j.util.BlockManager.Action;
import com.goldencode.p2j.util.BlockManager.Condition;
import com.goldencode.p2j.oo.core.serverconnection.IserverConnection;
import com.goldencode.p2j.oo.logging.ISupportLogging;
import com.goldencode.p2j.oo.lang.*;
import com.goldencode.p2j.oo.core.serverconnection.IconnectionParameters;
import com.goldencode.p2j.oo.logging.IlogWriter;
import com.goldencode.p2j.oo.lang._BaseObject_;
import com.goldencode.p2j.oo.net.Uri;

import static com.goldencode.p2j.report.ReportConstants.*;
import static com.goldencode.p2j.util.BlockManager.*;
import static com.goldencode.p2j.util.InternalEntry.Type;

/**
 * Business logic (converted to Java from the 4GL source code
 * in OpenEdge/Net/ServerConnection/ClientSocket.cls).
 */
@LegacyResource(resource = "OpenEdge.Net.ServerConnection.ClientSocket")
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
public class ClientSocket
extends BaseObject
implements IserverConnection,
           ISupportLogging
{
   @LegacySignature(type = Type.PROPERTY, name = "Connected")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   private logical connected = TypeFactory.logical();

   @LegacySignature(type = Type.PROPERTY, name = "ConnectionParameters")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   private object<? extends IconnectionParameters> connectionParameters = TypeFactory.object(IconnectionParameters.class);

   @LegacySignature(type = Type.PROPERTY, name = "DefaultReadTimeout")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   private integer defaultReadTimeout = TypeFactory.integer();

   @LegacySignature(type = Type.PROPERTY, name = "KeepAlive")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   private logical keepAlive = TypeFactory.logical(null);

   @LegacySignature(type = Type.PROPERTY, name = "LingerTime")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   private integer lingerTime = TypeFactory.integer(-1L);

   @LegacySignature(type = Type.PROPERTY, name = "Logger")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   private object<? extends IlogWriter> logger = TypeFactory.object(IlogWriter.class);

   @LegacySignature(type = Type.PROPERTY, name = "NoDelay")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   private logical noDelay = TypeFactory.logical(null);

   @LegacySignature(type = Type.PROPERTY, name = "ReadBufferSize")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   private integer readBufferSize = TypeFactory.integer();

   @LegacySignature(type = Type.PROPERTY, name = "ReceiveBufferSize")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   private integer receiveBufferSize = TypeFactory.integer(null);

   @LegacySignature(type = Type.PROPERTY, name = "ReceiveTimeout")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   private integer receiveTimeout = TypeFactory.integer(null);

   @LegacySignature(type = Type.PROPERTY, name = "ReuseAddress")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   private logical reuseAddress = TypeFactory.logical(null);
   
   @LegacySignature(type = Type.PROPERTY, name = "RemoteHost")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   private character remoteHost = TypeFactory.character();

   @LegacySignature(type = Type.PROPERTY, name = "RemotePort")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   private integer remotePort = TypeFactory.integer();
   
   @LegacySignature(type = Type.PROPERTY, name = "LocalHost")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   private character localHost = TypeFactory.character();

   @LegacySignature(type = Type.PROPERTY, name = "LocalPort")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   private integer localPort = TypeFactory.integer();

   @LegacySignature(type = Type.PROPERTY, name = "SendBufferSize")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   private integer sendBufferSize = TypeFactory.integer(null);

   @LegacySignature(type = Type.PROPERTY, name = "server")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   private object<? extends _BaseObject_> server = TypeFactory.object(_BaseObject_.class);
   
   @LegacySignature(type = Type.PROPERTY, name = "SslServerName")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   private character sslServerName = TypeFactory.character();

   @LegacySignature(type = Type.EVENT, name = "DataReceived", parameters = 
   {
      @LegacyParameter(name = "p1", type = "OBJECT", qualified = "openedge.net.serverconnection.clientsocket", mode = "INPUT"),
      @LegacyParameter(name = "p2", type = "OBJECT", qualified = "openedge.net.serverconnection.socketreadeventargs", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   private ClassEvent dataReceived = new ClassEvent(ClientSocket.this, "DataReceived", "dataReceived");

   @LegacySignature(type = Type.EVENT, name = "ReadTerminated", parameters = 
   {
      @LegacyParameter(name = "p1", type = "OBJECT", qualified = "openedge.net.serverconnection.clientsocket", mode = "INPUT"),
      @LegacyParameter(name = "p2", type = "OBJECT", qualified = "openedge.net.serverconnection.socketreadeventargs", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   private ClassEvent readTerminated = new ClassEvent(ClientSocket.this, "ReadTerminated", "readTerminated");

   @LegacySignature(type = Type.EVENT, name = "ReadTimeout", parameters = 
   {
      @LegacyParameter(name = "p1", type = "OBJECT", qualified = "openedge.net.serverconnection.clientsocket", mode = "INPUT"),
      @LegacyParameter(name = "p2", type = "OBJECT", qualified = "openedge.net.serverconnection.socketreadeventargs", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   private ClassEvent readTimeout = new ClassEvent(ClientSocket.this, "ReadTimeout", "readTimeout");

   /**
    * Execute method
    */
   @LegacySignature(type = Type.EXECUTE)
   public void __net_serverconnection_ClientSocket_execute__()
   {
      onBlockLevel(Condition.ERROR, Action.THROW);
   }

   @LegacySignature(returns = "LOGICAL", type = Type.GETTER, name = "Connected")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public logical getConnected()
   {
      return function(ClientSocket.class, this, "Connected", logical.class, new Block((Body) () -> 
      {
         returnNormal(connected);
      }));
   }

   @LegacySignature(returns = "OBJECT", qualified = "OpenEdge.Core.ServerConnection.IConnectionParameters", type = Type.GETTER, name = "ConnectionParameters")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public object<? extends IconnectionParameters> getConnectionParameters()
   {
      return function(ClientSocket.class, this, "ConnectionParameters", object.class, new Block((Body) () -> 
      {
         returnNormal(connectionParameters);
      }));
   }

   @LegacySignature(type = Type.SETTER, name = "ConnectionParameters", parameters = 
   {
      @LegacyParameter(qualified = "OpenEdge.Core.ServerConnection.IConnectionParameters", name = "var", type = "OBJECT", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void setConnectionParameters(final object<? extends IconnectionParameters> _var)
   {
      object<? extends IconnectionParameters> var = TypeFactory.initInput(_var);
      
      internalProcedure(ClientSocket.class, this, "ConnectionParameters", new Block((Body) () -> 
      {
         connectionParameters.assign(var);
      }));
   }
   
   @LegacySignature(returns = "CHARACTER", type = Type.GETTER, name = "LocalHost")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public character getLocalHost()
   {
      return function(ClientSocket.class, this, "LocalHost", character.class, new Block((Body) () -> 
      {
         returnNormal(localHost);
      }));
   }

   @LegacySignature(returns = "INTEGER", type = Type.GETTER, name = "LocalPort")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public integer getLocalPort()
   {
      return function(ClientSocket.class, this, "LocalPort", integer.class, new Block((Body) () -> 
      {
         returnNormal(localPort);
      }));
   }

   @LegacySignature(returns = "CHARACTER", type = Type.GETTER, name = "RemoteHost")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public character getRemoteHost()
   {
      return function(ClientSocket.class, this, "RemoteHost", character.class, new Block((Body) () -> 
      {
         returnNormal(remoteHost);
      }));
   }

   @LegacySignature(returns = "INTEGER", type = Type.GETTER, name = "RemotePort")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public integer getRemotePort()
   {
      return function(ClientSocket.class, this, "RemotePort", integer.class, new Block((Body) () -> 
      {
         returnNormal(remotePort);
      }));
   }

   @LegacySignature(returns = "INTEGER", type = Type.GETTER, name = "DefaultReadTimeout")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public integer getDefaultReadTimeout()
   {
      return function(ClientSocket.class, this, "DefaultReadTimeout", integer.class, new Block((Body) () -> 
      {
         returnNormal(defaultReadTimeout);
      }));
   }

   @LegacySignature(type = Type.SETTER, name = "DefaultReadTimeout", parameters = 
   {
      @LegacyParameter(name = "var", type = "INTEGER", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void setDefaultReadTimeout(final integer _var)
   {
      integer var = TypeFactory.initInput(_var);
      
      internalProcedure(ClientSocket.class, this, "DefaultReadTimeout", new Block((Body) () -> 
      {
         defaultReadTimeout.assign(var);
      }));
   }

   @LegacySignature(returns = "LOGICAL", type = Type.GETTER, name = "KeepAlive")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public logical getKeepAlive()
   {
      return function(ClientSocket.class, this, "KeepAlive", logical.class, new Block((Body) () -> 
      {
         returnNormal(keepAlive);
      }));
   }

   @LegacySignature(type = Type.SETTER, name = "KeepAlive", parameters = 
   {
      @LegacyParameter(name = "var", type = "LOGICAL", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void setKeepAlive(final logical _var)
   {
      logical var = TypeFactory.initInput(_var);
      
      internalProcedure(ClientSocket.class, this, "KeepAlive", new Block((Body) () -> 
      {
         keepAlive.assign(var);
      }));
   }

   @LegacySignature(returns = "INTEGER", type = Type.GETTER, name = "LingerTime")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public integer getLingerTime()
   {
      return function(ClientSocket.class, this, "LingerTime", integer.class, new Block((Body) () -> 
      {
         returnNormal(lingerTime);
      }));
   }

   @LegacySignature(type = Type.SETTER, name = "LingerTime", parameters = 
   {
      @LegacyParameter(name = "var", type = "INTEGER", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void setLingerTime(final integer _var)
   {
      integer var = TypeFactory.initInput(_var);
      
      internalProcedure(ClientSocket.class, this, "LingerTime", new Block((Body) () -> 
      {
         lingerTime.assign(var);
      }));
   }

   @LegacySignature(returns = "OBJECT", qualified = "OpenEdge.Logging.ILogWriter", type = Type.GETTER, name = "Logger")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public object<? extends IlogWriter> getLogger()
   {
      return function(ClientSocket.class, this, "Logger", object.class, new Block((Body) () -> 
      {
         returnNormal(logger);
      }));
   }

   @LegacySignature(type = Type.SETTER, name = "Logger", parameters = 
   {
      @LegacyParameter(qualified = "OpenEdge.Logging.ILogWriter", name = "var", type = "OBJECT", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void setLogger(final object<? extends IlogWriter> _var)
   {
      object<? extends IlogWriter> var = TypeFactory.initInput(_var);
      
      internalProcedure(ClientSocket.class, this, "Logger", new Block((Body) () -> 
      {
         logger.assign(var);
      }));
   }

   @LegacySignature(returns = "LOGICAL", type = Type.GETTER, name = "NoDelay")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public logical getNoDelay()
   {
      return function(ClientSocket.class, this, "NoDelay", logical.class, new Block((Body) () -> 
      {
         returnNormal(noDelay);
      }));
   }

   @LegacySignature(type = Type.SETTER, name = "NoDelay", parameters = 
   {
      @LegacyParameter(name = "var", type = "LOGICAL", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void setNoDelay(final logical _var)
   {
      logical var = TypeFactory.initInput(_var);
      
      internalProcedure(ClientSocket.class, this, "NoDelay", new Block((Body) () -> 
      {
         noDelay.assign(var);
      }));
   }

   @LegacySignature(returns = "INTEGER", type = Type.GETTER, name = "ReadBufferSize")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public integer getReadBufferSize()
   {
      return function(ClientSocket.class, this, "ReadBufferSize", integer.class, new Block((Body) () -> 
      {
         returnNormal(readBufferSize);
      }));
   }

   @LegacySignature(type = Type.SETTER, name = "ReadBufferSize", parameters = 
   {
      @LegacyParameter(name = "var", type = "INTEGER", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void setReadBufferSize(final integer _var)
   {
      integer var = TypeFactory.initInput(_var);
      
      internalProcedure(ClientSocket.class, this, "ReadBufferSize", new Block((Body) () -> 
      {
         readBufferSize.assign(var);
      }));
   }

   @LegacySignature(returns = "INTEGER", type = Type.GETTER, name = "ReceiveBufferSize")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public integer getReceiveBufferSize()
   {
      return function(ClientSocket.class, this, "ReceiveBufferSize", integer.class, new Block((Body) () -> 
      {
         returnNormal(receiveBufferSize);
      }));
   }

   @LegacySignature(type = Type.SETTER, name = "ReceiveBufferSize", parameters = 
   {
      @LegacyParameter(name = "var", type = "INTEGER", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void setReceiveBufferSize(final integer _var)
   {
      integer var = TypeFactory.initInput(_var);
      
      internalProcedure(ClientSocket.class, this, "ReceiveBufferSize", new Block((Body) () -> 
      {
         receiveBufferSize.assign(var);
      }));
   }

   @LegacySignature(returns = "INTEGER", type = Type.GETTER, name = "ReceiveTimeout")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public integer getReceiveTimeout()
   {
      return function(ClientSocket.class, this, "ReceiveTimeout", integer.class, new Block((Body) () -> 
      {
         returnNormal(receiveTimeout);
      }));
   }

   @LegacySignature(type = Type.SETTER, name = "ReceiveTimeout", parameters = 
   {
      @LegacyParameter(name = "var", type = "INTEGER", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void setReceiveTimeout(final integer _var)
   {
      integer var = TypeFactory.initInput(_var);
      
      internalProcedure(ClientSocket.class, this, "ReceiveTimeout", new Block((Body) () -> 
      {
         receiveTimeout.assign(var);
      }));
   }

   @LegacySignature(returns = "LOGICAL", type = Type.GETTER, name = "ReuseAddress")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public logical getReuseAddress()
   {
      return function(ClientSocket.class, this, "ReuseAddress", logical.class, new Block((Body) () -> 
      {
         returnNormal(reuseAddress);
      }));
   }

   @LegacySignature(type = Type.SETTER, name = "ReuseAddress", parameters = 
   {
      @LegacyParameter(name = "var", type = "LOGICAL", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void setReuseAddress(final logical _var)
   {
      logical var = TypeFactory.initInput(_var);
      
      internalProcedure(ClientSocket.class, this, "ReuseAddress", new Block((Body) () -> 
      {
         reuseAddress.assign(var);
      }));
   }

   @LegacySignature(returns = "INTEGER", type = Type.GETTER, name = "SendBufferSize")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public integer getSendBufferSize()
   {
      return function(ClientSocket.class, this, "SendBufferSize", integer.class, new Block((Body) () -> 
      {
         returnNormal(sendBufferSize);
      }));
   }

   @LegacySignature(type = Type.SETTER, name = "SendBufferSize", parameters = 
   {
      @LegacyParameter(name = "var", type = "INTEGER", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void setSendBufferSize(final integer _var)
   {
      integer var = TypeFactory.initInput(_var);
      
      internalProcedure(ClientSocket.class, this, "SendBufferSize", new Block((Body) () -> 
      {
         sendBufferSize.assign(var);
      }));
   }

   @LegacySignature(returns = "OBJECT", qualified = "Progress.Lang.Object", type = Type.GETTER, name = "server")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public object<? extends _BaseObject_> getServer()
   {
      return function(ClientSocket.class, this, "server", object.class, new Block((Body) () -> 
      {
         returnNormal(server);
      }));
   }

   @LegacySignature(type = Type.SETTER, name = "server", parameters = 
   {
      @LegacyParameter(qualified = "Progress.Lang.Object", name = "var", type = "OBJECT", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void setServer(final object<? extends _BaseObject_> _var)
   {
      object<? extends _BaseObject_> var = TypeFactory.initInput(_var);
      
      internalProcedure(ClientSocket.class, this, "server", new Block((Body) () -> 
      {
         server.assign(var);
      }));
   }
   
   @LegacySignature(returns = "CHARACTER", type = Type.GETTER, name = "SslServerName")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public character getSslServerName()
   {
      return function(ClientSocket.class, this, "SslServerName", character.class, new Block((Body) () -> 
      {
         returnNormal(sslServerName);
      }));
   }

   @LegacySignature(type = Type.CONSTRUCTOR)
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
   public void __net_serverconnection_ClientSocket_constructor__()
   {
      internalProcedure(ClientSocket.class, this, "__net_serverconnection_ClientSocket_constructor__", new Block((Body) () -> 
      {
         __lang_BaseObject_constructor__();
         readBufferSize.assign(8192);
      }));
   }

   @LegacySignature(type = Type.CONSTRUCTOR, parameters = 
   {
      @LegacyParameter(name = "p1", type = "OBJECT", qualified = "openedge.net.serverconnection.clientsocketconnectionparameters", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void __net_serverconnection_ClientSocket_constructor__(final object<? extends ClientSocketConnectionParameters> _p1)
   {
      object<? extends ClientSocketConnectionParameters> p1 = TypeFactory.initInput(_p1);
      
      internalProcedure(ClientSocket.class, this, "__net_serverconnection_ClientSocket_constructor__", new Block((Body) () -> 
      {
         __lang_BaseObject_constructor__();
         connectionParameters.assign(p1);
      }));
   }

   @LegacySignature(type = Type.METHOD, name = "Connect")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void connect()
   {
      internalProcedure(ClientSocket.class, this, "Connect", new Block((Body) () -> 
      {
         // on implementation mark the appserver-agent session with 
         // SessionUtils.setClientType(ClientType._.NETCLIENT");
         UnimplementedFeature.missing("ClientSocket:Connect3 METHOD");
      }));
   }

   @LegacySignature(type = Type.METHOD, name = "Connect", parameters = 
   {
      @LegacyParameter(name = "p1", type = "OBJECT", qualified = "openedge.net.serverconnection.clientsocketconnectionparameters", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void connect(final object<? extends ClientSocketConnectionParameters> _p1)
   {
      object<? extends ClientSocketConnectionParameters> p1 = TypeFactory.initInput(_p1);
      
      internalProcedure(ClientSocket.class, this, "Connect", new Block((Body) () -> 
      {
         // on implementation mark the appserver-agent session with 
         // SessionUtils.setClientType(ClientType._.NETCLIENT");
         UnimplementedFeature.missing("ClientSocket:Connect2 METHOD");
      }));
   }

   @LegacySignature(type = Type.METHOD, name = "Connect", parameters = 
   {
      @LegacyParameter(name = "p1", type = "OBJECT", qualified = "openedge.net.uri", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void connect_1(final object<? extends Uri> _p1)
   {
      object<? extends Uri> p1 = TypeFactory.initInput(_p1);
      
      internalProcedure(ClientSocket.class, this, "Connect", new Block((Body) () -> 
      {
         // on implementation mark the appserver-agent session with 
         // SessionUtils.setClientType(ClientType._.NETCLIENT");
         UnimplementedFeature.missing("ClientSocket:Connect METHOD");
      }));
   }

   @LegacySignature(type = Type.METHOD, name = "CreateServer")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void createServer()
   {
      internalProcedure(ClientSocket.class, this, "CreateServer", new Block((Body) () -> 
      {
         UnimplementedFeature.missing("ClientSocket:CreateServer METHOD");
      }));
   }

   @LegacySignature(type = Type.METHOD, name = "DestroyServer")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void destroyServer()
   {
      internalProcedure(ClientSocket.class, this, "DestroyServer", new Block((Body) () -> 
      {
         UnimplementedFeature.missing("ClientSocket:DestroyServer METHOD");
      }));
   }

   @LegacySignature(type = Type.METHOD, name = "Disconnect")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void disconnect()
   {
      internalProcedure(ClientSocket.class, this, "Disconnect", new Block((Body) () -> 
      {
         UnimplementedFeature.missing("ClientSocket:Disconnect METHOD");
      }));
   }

   @LegacySignature(returns = "LOGICAL", type = Type.METHOD, name = "IsConnected")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   protected logical isConnected()
   {
      return function(ClientSocket.class, this, "IsConnected", logical.class, new Block((Body) () -> 
      {
         UnimplementedFeature.missing("ClientSocket:IsConnected METHOD");
      }));
   }

   @LegacySignature(type = Type.METHOD, name = "OnDataReceived", parameters = 
   {
      @LegacyParameter(name = "p1", type = "OBJECT", qualified = "openedge.net.serverconnection.socketreadeventargs", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   protected void onDataReceived(final object<? extends SocketReadEventArgs> _p1)
   {
      object<? extends SocketReadEventArgs> p1 = TypeFactory.initInput(_p1);
      
      internalProcedure(ClientSocket.class, this, "OnDataReceived", new Block((Body) () -> 
      {
         UnimplementedFeature.missing("ClientSocket:OnDataReceived METHOD");
      }));
   }

   @LegacySignature(type = Type.METHOD, name = "OnReadTerminated", parameters = 
   {
      @LegacyParameter(name = "p1", type = "OBJECT", qualified = "openedge.net.serverconnection.socketreadeventargs", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   protected void onReadTerminated(final object<? extends SocketReadEventArgs> _p1)
   {
      object<? extends SocketReadEventArgs> p1 = TypeFactory.initInput(_p1);
      
      internalProcedure(ClientSocket.class, this, "OnReadTerminated", new Block((Body) () -> 
      {
         UnimplementedFeature.missing("ClientSocket:OnReadTerminated METHOD");
      }));
   }

   @LegacySignature(type = Type.METHOD, name = "OnReadTimeout", parameters = 
   {
      @LegacyParameter(name = "p1", type = "OBJECT", qualified = "openedge.net.serverconnection.socketreadeventargs", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   protected void onReadTimeout(final object<? extends SocketReadEventArgs> _p1)
   {
      object<? extends SocketReadEventArgs> p1 = TypeFactory.initInput(_p1);
      
      internalProcedure(ClientSocket.class, this, "OnReadTimeout", new Block((Body) () -> 
      {
         UnimplementedFeature.missing("ClientSocket:OnReadTimeout METHOD");
      }));
   }

   @LegacySignature(type = Type.METHOD, name = "ReadResponseHandler")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void readResponseHandler()
   {
      internalProcedure(ClientSocket.class, this, "ReadResponseHandler", new Block((Body) () -> 
      {
         UnimplementedFeature.missing("ClientSocket:ReadResponseHandler METHOD");
      }));
   }

   @LegacySignature(type = Type.METHOD, name = "SetSocketOptions", parameters = 
   {
      @LegacyParameter(name = "p1", type = "HANDLE", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void setSocketOptions(final handle _p1)
   {
      handle p1 = TypeFactory.initInput(_p1);
      
      internalProcedure(ClientSocket.class, this, "SetSocketOptions", new Block((Body) () -> 
      {
         UnimplementedFeature.missing("ClientSocket:SetSocketOptions METHOD");
      }));
   }

   @LegacySignature(type = Type.METHOD, name = "WaitForResponse")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void waitForResponse()
   {
      internalProcedure(ClientSocket.class, this, "WaitForResponse", new Block((Body) () -> 
      {
         UnimplementedFeature.missing("ClientSocket:WaitForResponse METHOD");
      }));
   }
   
   @LegacySignature(type = Type.METHOD, name = "StartTls", parameters = 
   {
      @LegacyParameter(name = "pCertificatSubjectName", type = "CHARACTER", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void startTls(final character _pCertificatSubjectName)
   {
      character pCertificatSubjectName = TypeFactory.initInput(_pCertificatSubjectName);
      
      internalProcedure(ClientSocket.class, this, "StartTls", new Block((Body) () -> 
      {
         UnimplementedFeature.missing("ClientSocket:StartTls METHOD");
      }));
   }

   @LegacySignature(type = Type.METHOD, name = "WaitForResponse", parameters = 
   {
      @LegacyParameter(name = "p1", type = "DECIMAL", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void waitForResponse(final decimal _p1)
   {
      decimal p1 = TypeFactory.initInput(_p1);
      
      internalProcedure(ClientSocket.class, this, "WaitForResponse", new Block((Body) () -> 
      {
         UnimplementedFeature.missing("ClientSocket:WaitForResponse METHOD");
      }));
   }

   @LegacySignature(type = Type.METHOD, name = "WaitForResponseAsync", parameters = 
   {
      @LegacyParameter(name = "p1", type = "DECIMAL", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void waitForResponseAsync(final decimal _p1)
   {
      decimal p1 = TypeFactory.initInput(_p1);
      
      internalProcedure(ClientSocket.class, this, "WaitForResponseAsync", new Block((Body) () -> 
      {
         UnimplementedFeature.missing("ClientSocket:WaitForResponseAsync METHOD");
      }));
   }

   @LegacySignature(type = Type.METHOD, name = "WriteData", parameters = 
   {
      @LegacyParameter(qualified = "OpenEdge.Core.Memptr", name = "p1", type = "OBJECT", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void writeData(final object<? extends com.goldencode.p2j.oo.core.Memptr> _p1)
   {
      object<? extends com.goldencode.p2j.oo.core.Memptr> p1 = TypeFactory.initInput(_p1);
      
      internalProcedure(ClientSocket.class, this, "WriteData", new Block((Body) () -> 
      {
         UnimplementedFeature.missing("ClientSocket:WriteData METHOD");
      }));
   }

   @LegacySignature(type = Type.PUBLISH, name = "DataReceived", parameters = 
   {
      @LegacyParameter(name = "p1", type = "OBJECT", qualified = "openedge.net.serverconnection.clientsocket", mode = "INPUT"),
      @LegacyParameter(name = "p2", type = "OBJECT", qualified = "openedge.net.serverconnection.socketreadeventargs", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   private void publish_dataReceived(object p1, object p2)
   {
      dataReceived.publish(p1, p2);
   }

   @LegacySignature(type = Type.SUBSCRIBE, name = "DataReceived", parameters = 
   {
      @LegacyParameter(name = "p1", type = "handle", mode = "INPUT"),
      @LegacyParameter(name = "p2", type = "character", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void subscribe_dataReceived(handle h, character procName)
   {
      dataReceived.subscribe(h, procName);
   }

   @LegacySignature(type = Type.SUBSCRIBE, name = "DataReceived", parameters = 
   {
      @LegacyParameter(name = "p1", type = "object", mode = "INPUT", qualified = "progress.lang.object"),
      @LegacyParameter(name = "p2", type = "character", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void subscribe_dataReceived(object<? extends com.goldencode.p2j.oo.lang._BaseObject_> ref, character methName)
   {
      dataReceived.subscribe(ref, methName);
   }

   @LegacySignature(type = Type.UNSUBSCRIBE, name = "DataReceived", parameters = 
   {
      @LegacyParameter(name = "p1", type = "handle", mode = "INPUT"),
      @LegacyParameter(name = "p2", type = "character", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void unsubscribe_dataReceived(handle h, character procName)
   {
      dataReceived.unsubscribe(h, procName);
   }

   @LegacySignature(type = Type.UNSUBSCRIBE, name = "DataReceived", parameters = 
   {
      @LegacyParameter(name = "p1", type = "object", mode = "INPUT", qualified = "progress.lang.object"),
      @LegacyParameter(name = "p2", type = "character", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void unsubscribe_dataReceived(object<? extends com.goldencode.p2j.oo.lang._BaseObject_> ref, character methName)
   {
      dataReceived.unsubscribe(ref, methName);
   }

   @LegacySignature(type = Type.PUBLISH, name = "ReadTerminated", parameters = 
   {
      @LegacyParameter(name = "p1", type = "OBJECT", qualified = "openedge.net.serverconnection.clientsocket", mode = "INPUT"),
      @LegacyParameter(name = "p2", type = "OBJECT", qualified = "openedge.net.serverconnection.socketreadeventargs", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   private void publish_readTerminated(object p1_1, object p2_1)
   {
      readTerminated.publish(p1_1, p2_1);
   }

   @LegacySignature(type = Type.SUBSCRIBE, name = "ReadTerminated", parameters = 
   {
      @LegacyParameter(name = "p1", type = "handle", mode = "INPUT"),
      @LegacyParameter(name = "p2", type = "character", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void subscribe_readTerminated(handle h, character procName)
   {
      readTerminated.subscribe(h, procName);
   }

   @LegacySignature(type = Type.SUBSCRIBE, name = "ReadTerminated", parameters = 
   {
      @LegacyParameter(name = "p1", type = "object", mode = "INPUT", qualified = "progress.lang.object"),
      @LegacyParameter(name = "p2", type = "character", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void subscribe_readTerminated(object<? extends com.goldencode.p2j.oo.lang._BaseObject_> ref, character methName)
   {
      readTerminated.subscribe(ref, methName);
   }

   @LegacySignature(type = Type.UNSUBSCRIBE, name = "ReadTerminated", parameters = 
   {
      @LegacyParameter(name = "p1", type = "handle", mode = "INPUT"),
      @LegacyParameter(name = "p2", type = "character", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void unsubscribe_readTerminated(handle h, character procName)
   {
      readTerminated.unsubscribe(h, procName);
   }

   @LegacySignature(type = Type.UNSUBSCRIBE, name = "ReadTerminated", parameters = 
   {
      @LegacyParameter(name = "p1", type = "object", mode = "INPUT", qualified = "progress.lang.object"),
      @LegacyParameter(name = "p2", type = "character", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void unsubscribe_readTerminated(object<? extends com.goldencode.p2j.oo.lang._BaseObject_> ref, character methName)
   {
      readTerminated.unsubscribe(ref, methName);
   }

   @LegacySignature(type = Type.PUBLISH, name = "ReadTimeout", parameters = 
   {
      @LegacyParameter(name = "p1", type = "OBJECT", qualified = "openedge.net.serverconnection.clientsocket", mode = "INPUT"),
      @LegacyParameter(name = "p2", type = "OBJECT", qualified = "openedge.net.serverconnection.socketreadeventargs", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   private void publish_readTimeout(object p1_2, object p2_2)
   {
      readTimeout.publish(p1_2, p2_2);
   }

   @LegacySignature(type = Type.SUBSCRIBE, name = "ReadTimeout", parameters = 
   {
      @LegacyParameter(name = "p1", type = "handle", mode = "INPUT"),
      @LegacyParameter(name = "p2", type = "character", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void subscribe_readTimeout(handle h, character procName)
   {
      readTimeout.subscribe(h, procName);
   }

   @LegacySignature(type = Type.SUBSCRIBE, name = "ReadTimeout", parameters = 
   {
      @LegacyParameter(name = "p1", type = "object", mode = "INPUT", qualified = "progress.lang.object"),
      @LegacyParameter(name = "p2", type = "character", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void subscribe_readTimeout(object<? extends com.goldencode.p2j.oo.lang._BaseObject_> ref, character methName)
   {
      readTimeout.subscribe(ref, methName);
   }

   @LegacySignature(type = Type.UNSUBSCRIBE, name = "ReadTimeout", parameters = 
   {
      @LegacyParameter(name = "p1", type = "handle", mode = "INPUT"),
      @LegacyParameter(name = "p2", type = "character", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void unsubscribe_readTimeout(handle h, character procName)
   {
      readTimeout.unsubscribe(h, procName);
   }

   @LegacySignature(type = Type.UNSUBSCRIBE, name = "ReadTimeout", parameters = 
   {
      @LegacyParameter(name = "p1", type = "object", mode = "INPUT", qualified = "progress.lang.object"),
      @LegacyParameter(name = "p2", type = "character", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUB)
   public void unsubscribe_readTimeout(object<? extends com.goldencode.p2j.oo.lang._BaseObject_> ref, character methName)
   {
      readTimeout.unsubscribe(ref, methName);
   }
}