Class Connection

java.lang.Object
com.progress.open4gl.javaproxy.Connection
All Implemented Interfaces:
IPoolProps, AutoCloseable

public class Connection extends Object implements AutoCloseable, IPoolProps
The Connection class holds configuration and state data for a client connection to the application server. This class represents a logical connection to the application server and provides setters for the open client application to configure how the java open client is to behave.

When created, the Connection is pre-configured to an initial state using values copied from RunTimeProperties.

Progress Application Server Example:

To run a procedure named "ping.p" on the application server which takes no parameters, use the following exmaple.

var conn = new Connection("http://localhost:8810/apsv/", "", "", "");
var appobj = new OpenAppObj(conn);
var paramset  = new ParameterSet(0);
appobj.runProcedure("ping.p", paramset);
 

  • Constructor Details

    • Connection

      public Connection()
    • Connection

      public Connection(Connection parent, boolean multiUser)
    • Connection

      public Connection(Connection parent)
    • Connection

      public Connection(String urlString, String userId, String password, String appServerInfo)
    • Connection

      public Connection(String urlString, String userId, String password, String appServerInfo, boolean multiUser)
    • Connection

      public Connection(String userId, String password, String appServerInfo)
    • Connection

      public Connection(String userId, String password, String appServerInfo, boolean multiUser)
  • Method Details

    • getSessionPool

      public SessionPool getSessionPool()
      Specified by:
      getSessionPool in interface IPoolProps
    • addReference

      public void addReference(SessionPool sessionPool)
      Specified by:
      addReference in interface IPoolProps
    • releaseConnection

      public void releaseConnection() throws Open4GLException
      Specified by:
      releaseConnection in interface IPoolProps
      Throws:
      Open4GLException
    • close

      public void close()
      release the connection. This is here to support AutoCloseable
      Specified by:
      close in interface AutoCloseable
    • setLocalProperty

      public void setLocalProperty(String propName, Object propValue)
      Specified by:
      setLocalProperty in interface IPoolProps
    • setProperty

      public void setProperty(String propName, Object propValue)
      Specified by:
      setProperty in interface IPoolProps
    • setStringProperty

      public Object setStringProperty(String propName, String propValue)
      Specified by:
      setStringProperty in interface IPoolProps
    • setIntProperty

      public Object setIntProperty(String propName, int propValue)
      Specified by:
      setIntProperty in interface IPoolProps
    • setLongProperty

      public Object setLongProperty(String propName, long propValue)
      Specified by:
      setLongProperty in interface IPoolProps
    • setBooleanProperty

      public Object setBooleanProperty(String propName, boolean propValue)
      Specified by:
      setBooleanProperty in interface IPoolProps
    • getProperty_prev

      public Object getProperty_prev(String propName)
    • getProperty

      public Object getProperty(String propName)
      Specified by:
      getProperty in interface IPoolProps
    • getStringProperty

      public String getStringProperty(String propName)
      Specified by:
      getStringProperty in interface IPoolProps
    • getIntProperty

      public int getIntProperty(String propName)
      Specified by:
      getIntProperty in interface IPoolProps
    • getLongProperty

      public long getLongProperty(String propName)
      Specified by:
      getLongProperty in interface IPoolProps
    • getBooleanProperty

      public boolean getBooleanProperty(String propName)
      Specified by:
      getBooleanProperty in interface IPoolProps
    • setProperties

      public void setProperties(Properties props)
    • getProperties

      @Deprecated public Hashtable getProperties()
      Deprecated.
      Use IPoolProps.getAsProperties() instead. Hashtable is an old java 1.1 style class and should no longer be used.
      Fetch a copy of the internal properties of this connection. Changes to the returned Hashtable will not be reflected in the connection object. Use the setter functions to affect changes in this object.
      Returns:
      a hashtable containing a copy of all the properties stored in this connection
    • getUrl

      public String getUrl()
    • setUrl

      public void setUrl(String url)
    • getUserId

      public String getUserId()
    • setUserId

      public void setUserId(String userid)
    • getPassword

      public String getPassword()
    • setPassword

      public void setPassword(String password)
    • getAppServerInfo

      public String getAppServerInfo()
    • setAppServerInfo

      public void setAppServerInfo(String appServerInfo)
    • getWaitIfBusy

      public boolean getWaitIfBusy()
      Returns the current "Wait If Busy" setup. Returns false by default or if setNoWaitIfBusy() was called. Returns true if setWaitIfBusy() was called.
      See Also:
    • setWaitIfBusy

      public void setWaitIfBusy()
      Method calls will wait if the connection is busy. If setWaitIfBusy() was called then a request to execute a method in an Application Object, a subApplication Object or a Procedure Object will wait until the connection is not busy. The connection is busy while another method is executing or while there is an open output result set. By default, setNoWaitIfBusy() is on (a BusySessionException method is thrown).
      See Also:
    • setNoWaitIfBusy

      public void setNoWaitIfBusy()
      Method calls will throw an exception if the connection is busy. If setNoWaitIfBusy() was called then A BusySessionException will be thrown for an attempt to execute a method while the connection is busy.
      See Also:
    • getProxyHost

      public String getProxyHost()
      Method Returns the proxy host
      Returns:
      Proxy host
    • setProxyHost

      public void setProxyHost(String host) throws Open4GLException
      Method Set the proxy host. Used if a proxy server is known to be in between the Open Client and the Internet.
      Parameters:
      host - The host name
      Throws:
      Open4GLException
    • getProxyPort

      public int getProxyPort()
      Method Returns the proxy port
      Returns:
      Proxy port
    • setProxyPort

      public void setProxyPort(int port) throws Open4GLException
      Method Set the proxy port. Used if a proxy server is known to be in between the Open Client and the Internet.
      Parameters:
      port - The port number
      Throws:
      Open4GLException
    • getCertificateStore

      public String getCertificateStore()
      Method Returns the certicate store list
      Returns:
      The certicate store list as a comma separated string of directory/file values.
    • setCertificateStore

      public void setCertificateStore(String certStoreList) throws Open4GLException
      Method Set the CertificateStore. Allows the developer to specify storage locations for digital certificates. These are used when the AppServer connect URL uses the https protocol.
      Parameters:
      certStoreList - Directory and/or file name[s]. If more than one directory/file is specified then the list will be separated by semi-colons. The format of the parameter is <file>:password and/or <directory>:password. Password may have the word 'null' in place of an actual password.
      Throws:
      Open4GLException
    • getNoHostVerify

      public boolean getNoHostVerify()
      Method returns the optional HTTPS (SSL) server domain authentication . option value.
      Returns:
      The boolean value HTTP/S authentication bitmask
    • setNoHostVerify

      public void setNoHostVerify(boolean trueFalseState) throws Open4GLException
      Method sets the optional HTTPS (SSL) server domain authentication option.
      Parameters:
      trueFalseState - The boolean value that holds the new authentication state.
      Throws:
      Open4GLException
    • getNoSslSessionReuse

      public boolean getNoSslSessionReuse()
      Get the current state of SSL session reuse.
      Returns:
      a boolean value
    • setNoSslSessionReuse

      public void setNoSslSessionReuse(boolean trueFalseState) throws Open4GLException
      Turns on or off SSL session reuse.
      Parameters:
      trueFalseState - a boolean value
      Throws:
      Open4GLException - if an error occurs
    • setServerName

      public void setServerName(String servername)
      Parameters:
      servername - is set the server name indiication .
    • getServerName

      public String getServerName()
      Returns:
      String SNI name
    • setSslVersions

      public void setSslVersions(String version)
      set ssl protocol versions.
      Parameters:
      version - a String value
    • getSslVersions

      public String getSslVersions()
      Method Returns SSL protocol versions
      Returns:
      String SSL version
    • setSslCiphers

      public void setSslCiphers(String ciphers)
      set SSL ciphers.
      Parameters:
      ciphers - a String value
    • getSslCiphers

      public String getSslCiphers()
      Method Returns SSL ciphers list
      Returns:
      String SSL ciphers
    • getProxyUserId

      public String getProxyUserId()
      Method Returns the proxy authentication user-id
      Returns:
      String user-id
    • setProxyUserId

      public void setProxyUserId(String userId) throws Open4GLException
      Method Set the proxy user id. Used if a proxy server is known to be in between the Open Client and the Internet and it requires HTTP Basic authentication.
      Parameters:
      userId - The userId for authentication
      Throws:
      Open4GLException
    • getProxyPassword

      public String getProxyPassword()
      Method Returns the proxy authentication password
      Returns:
      String user-id's password
    • setProxyPassword

      public void setProxyPassword(String pwd) throws Open4GLException
      Method Set the proxy user-id's password. Used if a proxy server is known to be in between the Open Client and the Internet and it requires HTTP Basic authentication.
      Parameters:
      pwd - The user-id password for authentication
      Throws:
      Open4GLException
    • getSessionModel

      public int getSessionModel()
      Method Returns the session model
      Returns:
      int session model
    • setSessionModel

      public void setSessionModel(int model)
      Method Set the sessionModel
      Parameters:
      model - The sessionModel
    • getInitialConnections

      public int getInitialConnections()
      Method Returns the number of initial connections to be made
      Returns:
      int initialConnections
    • setInitialConnections

      public void setInitialConnections(int nConnections)
      Method Set the number of initial connections to be made
      Parameters:
      nConnections - number of connections
    • getMinConnections

      public int getMinConnections()
      Method Returns the minimum number of connections to be made
      Returns:
      int minConnections
    • setMinConnections

      public void setMinConnections(int nMinConnections)
      Method Set the minimum number of connections to be made
      Parameters:
      nMinConnections - minimum number of connections
    • getMaxConnections

      public int getMaxConnections()
      Method Returns the maximum number of connections to be made
      Returns:
      int maxConnections
    • setMaxConnections

      public void setMaxConnections(int nMaxConnections)
      Method Set the maximum number of connections to be made
      Parameters:
      nMaxConnections - maximum number of connections
    • getIdleConnectionTimeout

      public int getIdleConnectionTimeout()
      Method Returns the Idle Connection Timeout
      Returns:
      int idleConnectionTimeout
    • setIdleConnectionTimeout

      public void setIdleConnectionTimeout(int nSeconds)
      Method Set the Idle Connection Timeout
      Parameters:
      nSeconds - Idle Connection Timeout
    • getConnectionLifetime

      public int getConnectionLifetime()
      Method Returns the connection lifetime
      Returns:
      int connectionLifetime
    • setConnectionLifetime

      public void setConnectionLifetime(int nSeconds)
      Method Set the connection lifetime
      Parameters:
      nSeconds - connectionLifetime
    • getNsClientMinPort

      public int getNsClientMinPort()
      Method Returns the minimum nameserver client port
      Returns:
      int nsClientMinPort
    • setNsClientMinPort

      public void setNsClientMinPort(int port)
      Method Set the minimum nameserver client port
      Parameters:
      port - port number
    • getNsClientMaxPort

      public int getNsClientMaxPort()
      Method Returns the maximum nameserver client port
      Returns:
      int nsClientMaxPort
    • setNsClientMaxPort

      public void setNsClientMaxPort(int port)
      Method Set the maximum nameserver client port
      Parameters:
      port - port number
    • getNsClientPortRetry

      public int getNsClientPortRetry()
      Method Returns the number of times the nameserver client should retry connecting to the nameserver
      Returns:
      int nRetries
    • setNsClientPortRetry

      public void setNsClientPortRetry(int nRetries)
      Method sets the number of times the nameserver client should retry connecting to the nameserver
      Parameters:
      nRetries - number of retries
    • getNsClientPortRetryInterval

      public int getNsClientPortRetryInterval()
      Method Returns the number of seconds the nameserver client should wait between retrying to connect to the nameserver
      Returns:
      int nSeconds
    • setNsClientPortRetryInterval

      public void setNsClientPortRetryInterval(int nSeconds)
      Method sets the number of seconds the nameserver client should wait between retrying to connect to the nameserver
      Parameters:
      nSeconds - number of seconds
    • getNsClientPicklistSize

      public int getNsClientPicklistSize()
      Method Returns the number of broker definitions the nameserver client should retrieve from the nameserver each time
      Returns:
      int nPickListSize
    • setNsClientPicklistSize

      public void setNsClientPicklistSize(int nPicklistSize)
      Method sets the number of broker definitions the nameserver client should retrieve from the nameserver each time
      Parameters:
      nPicklistSize - number of brokers
    • getRequestWaitTimeout

      public int getRequestWaitTimeout()
      Method Returns the number of seconds the client should wait for a connection to become available to run a request
      Returns:
      int nRqWaitSec
    • setRequestWaitTimeout

      public void setRequestWaitTimeout(int nRqWaitSec)
      Method sets the number of seconds the client should wait for a connection to become available to run a request
      Parameters:
      nRqWaitSec - number of seconds
    • getUUID

      public String getUUID()
      Method Returns the uuid
      Returns:
      String uuid
    • setUUID

      public void setUUID(String uuid)
      Method sets the uuid
      Parameters:
      uuid - the unique uuid
    • getLogfileName

      public String getLogfileName()
      Method Returns the logfileName
      Returns:
      String logfileName
    • setLogfileName

      public void setLogfileName(String logfileName)
      Method sets the logfileName
      Parameters:
      logfileName - the logfileName
    • getTraceLevel

      public int getTraceLevel()
      Method Returns the trace level
      Returns:
      int traceLevel
    • setTraceLevel

      public void setTraceLevel(int traceLevel)
      Method sets the traceLevel
      Parameters:
      traceLevel - the trace level
    • getLogEntryTypes

      public String getLogEntryTypes()
      Method Returns the log entry types
      Returns:
      string logEntryTypes
    • setLogEntryTypes

      public void setLogEntryTypes(String logEntryTypes)
      Method sets the logEntryTypes
      Parameters:
      logEntryTypes - the log entry types
    • getAppServerKeepalive

      public String getAppServerKeepalive()
      Method Returns the Keep Alive Capabilities setting
      Returns:
      String keepAliveCaps
    • setAppServerKeepalive

      public void setAppServerKeepalive(String keepAliveCap)
      Method sets the keep Alive Capabilities value
      Parameters:
      keepAliveCap - the keep alive value
    • getClientASKActivityTimeout

      public int getClientASKActivityTimeout()
      Method Returns the client Keep Alive activity timeout
      Returns:
      String keepAliveActTimeout
    • setClientASKActivityTimeout

      public void setClientASKActivityTimeout(int keepAliveActTimeout)
      Method sets the client Keep Alive activity timeout
      Parameters:
      keepAliveActTimeout - the client keep alive activity timeout
    • getClientASKResponseTimeout

      public int getClientASKResponseTimeout()
      Method Returns the client Keep Alive response timeout
      Returns:
      String keepAliveRespTimeout
    • setClientASKResponseTimeout

      public void setClientASKResponseTimeout(int keepAliveRespTimeout)
      Method sets the client Keep Alive Response Timeout
      Parameters:
      keepAliveRespTimeout - the client keep alive response timeout
    • setDatasetNullInitials

      public void setDatasetNullInitials(boolean value)
      Method sets the behavior for initial values for int/int64/boolean fields on a dataset Must be set before building ProDataObjectMetaData object.
      Parameters:
      value - True if wants to change default behavior and have integer, int64 and boolean fields on a dataset to initialize to null.
    • getDatasetNullInitials

      public boolean getDatasetNullInitials()
      Method gets the dataset null initials setting
      Returns:
      boolean datasetSetNullInitials
    • setPostponeRelationInfo

      public void setPostponeRelationInfo(boolean value)
      Method sets the behavior for whether the relational info is built when loading the ProDataGraph's data.
      Parameters:
      value - True if wants to change default behavior and postpone building the relational info until getChildRows() is called for a particular ProDataObject
    • getPostponeRelationInfo

      public boolean getPostponeRelationInfo()
      Method gets whether the behavior for whether the relational info is built when loading the ProDataGraph's data. If true, building relational info is postponed until getChildRows(). When getChildRows() is called, the child rows for this particular row are hooked up (referenced)
      Returns:
      boolean postponeRelationInfo
    • setUseDeprecatedGetChanges

      public void setUseDeprecatedGetChanges(boolean value)
      Method sets the behavior for whether you want to want to use the original/deprecated ProChangeSummary.getChanges() functionality or current functionality
      Parameters:
      value - True if you want to use the original/deprecated ProChangeSummary.getChanges() functionality. It's defaulted to False.
    • getUseDeprecatedGetChanges

      public boolean getUseDeprecatedGetChanges()
      Method Returns true if the functionality of ProChangeSummary.getChanges() has been reverted to the original/deprecated functionality, or false if it performs the current (default) functionality.
      Returns:
      boolean useDeprecatedGetChanges
    • getCompressionEnabled

      public boolean getCompressionEnabled()
      Returns true if compression is enabled for this connection
      Returns:
    • getCompressionLevel

      public int getCompressionLevel()
      Returns the compression level set for this connection
      Returns:
    • getCompressionThreshold

      public int getCompressionThreshold()
      returns the minimum size in bytes of the message body before compression will be done for a particular message.
      Returns:
    • setCompressionEnabled

      public void setCompressionEnabled(boolean enabled)
      Enable message body compression
      Parameters:
      enabled -
    • setCompressionThreshold

      public void setCompressionThreshold(int threshold)
      Set the minimum size in bytes for messages before compression is used on the message body. Minimum value is 256.
      Parameters:
      threshold -
    • setCompressionLevel

      public void setCompressionLevel(int level)
      Set the compression level used to compress messages. Valid values are 1 - 9 inclusive.
      Parameters:
      level -
    • getRemoteMajorVersion

      public String getRemoteMajorVersion()
      Method get the remote major version
      Returns:
      majorVersion
    • getRemoteMinorVersion

      public String getRemoteMinorVersion()
      Method get the remote minor version
      Returns:
      minorVersion
    • getRemoteMaintVersion

      public String getRemoteMaintVersion()
      Method get the remote maint version
      Returns:
      maintVersion
    • getRemoteVersionInfo

      public OEVersionInfo getRemoteVersionInfo()
    • getLocalMajorVersion

      public String getLocalMajorVersion()
      Method get the local major version
      Returns:
      majorVersion
    • getLocalMinorVersion

      public String getLocalMinorVersion()
      Method get the local minor version
      Returns:
      minorVersion
    • getLocalMaintVersion

      public String getLocalMaintVersion()
      Method get the local maint version
      Returns:
      maintVersion
    • getLocalVersionInfo

      public OEVersionInfo getLocalVersionInfo()
    • setClientContextID

      public void setClientContextID(String clientContextID)
      Method set the clientContextID
      Parameters:
      clientContextID -
    • getClientContextID

      public String getClientContextID()
      Method get the clientContextID
    • getClientType

      public int getClientType()
      Method get the client type
    • setClientType

      public void setClientType(int clientType)
      Method set the client type
      Parameters:
      clientType -
    • getServerType

      public int getServerType()
      Method get the server type
    • getClientPrincipal

      public com.progress.auth.ClientPrincipal getClientPrincipal()
      Method get the client principal
    • setClientPrincipal

      public void setClientPrincipal(com.progress.auth.ClientPrincipal clientPrincipal)
      Method set the client principal
      Parameters:
      clientPrincipal -
    • getNetworkBufferSize

      public int getNetworkBufferSize()
      Method get the network buffer size
    • setNetworkBufferSize

      public void setNetworkBufferSize(int bufferSize)
      Method set the network buffer size
      Parameters:
      bufferSize -
    • getAsProperties

      public Properties getAsProperties()
      Specified by:
      getAsProperties in interface IPoolProps