com.deltavsoft.rcfproto

## Class RcfProtoChannel

- java.lang.Object
- - com.deltavsoft.rcfproto.RcfProtoChannel

-     public class RcfProtoChannel
      extends java.lang.Object

  Represents a single RPC connection to a server.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RcfProtoChannel(Endpoint endpoint)` Constructs a RPC channel from an endpoint.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `callMethod(MethodDescriptor method, RpcController controller, Message request, Message responsePrototype, done)`
    `void` | `connect()` Connects to the server.
    `void` | `delete()`
    `void` | `disconnect()` Disconencts from the server.
    `java.lang.String` | `errorText()` If Failed() is true, returns a human-readable description of the error.
    `boolean` | `failed()` After a call has finished, returns true if the call failed.
    `protected void` | `finalize()`
    `Certificate` | `getCaCertificate()` Gets the certificate authority for the channel.
    `Certificate` | `getCertificate()` Gets the SSL certificate for the channel.
    `CertificateValidationCallback` | `getCertificateValidationCallback()`
    `long` | `getConnectTimeoutMs()` Gets the connect timeout value, in milliseconds.
    `boolean` | `getEnableAsynchronousRpc()` Gets the enable synchronous RPC setting.
    `boolean` | `getEnableCompression()` Returns the transport level compression setting for this connection.
    `java.lang.String` | `getEnableSchannelCertificateValidation()` Gets the Schannel certificate validation setting.
    `java.lang.String` | `getHttpProxy()` Returns the network address of the HTTP proxy server.
    `int` | `getHttpProxyPort()` Returns the port number of the HTTP proxy server.
    `java.lang.String` | `getKerberosSpn()` Returns the Kerberos SPN to use when connecting.
    `java.lang.String` | `getOpenSslCipherSuite()` Gets the OpenSSL cipher suite.
    `java.lang.String` | `getPassword()` Returns the Windows password to use when connecting.
    `int` | `getPingBackIntervalMs()` Returns the ping back interval of the connection.
    `long` | `getRemoteCallTimeoutMs()` Gets the remote call timeout value, in milliseconds.
    `Message` | `getResponse()`
    `SslImplementation` | `getSslImplementation()` Gets the SSL implementation.
    `TransportProtocol` | `getTransportProtocol()` Gets the transport protocol being used by the channel.
    `TransportType` | `getTransportType()` Returns the transport type of the connection.
    `java.lang.String` | `getUsername()` Returns the Windows username to use when connecting.
    `void` | `setCaCertificate(Certificate certificatePtr)` Sets the certificate authority for the channel.
    `void` | `setCertificate(Certificate certificatePtr)` Sets the SSL certificate for the channel.
    `void` | `setCertificateValidationCallback(CertificateValidationCallback certValidationCallback)`
    `void` | `setConnectTimeoutMs(long connectTimeoutMs)` Sets the connect timeout value, in milliseconds.
    `void` | `setEnableAsynchronousRpc(boolean enable)` Sets the enable asynchronous RPC setting.
    `void` | `setEnableCompression(boolean enableCompression)` Sets the transport level compression setting for this connection.
    `void` | `setEnableSchannelCertificateValidation(java.lang.String peerName)` Sets the Schannel certificate validation setting.
    `void` | `setHttpProxy(java.lang.String httpProxy)` Sets the network address of the HTTP proxy server, through which to route remote calls.
    `void` | `setHttpProxyPort(int httpProxyPort)` Sets the port number of the HTTP proxy server, through which to route remote calls.
    `void` | `setKerberosSpn(java.lang.String kerberosSpn)` Sets the Kerberos SPN to use when connecting.
    `void` | `setOpenSslCipherSuite(java.lang.String cipherSuite)` Sets the OpenSSL cipher suite.
    `void` | `setPassword(java.lang.String password)` Sets the Windows password to use when connecting.
    `void` | `setPingBackIntervalMs(int pingBackIntervalMs)` Sets the ping back interval of the connection, in milliseconds.
    `void` | `setRemoteCallTimeoutMs(long remoteCallTimeoutMs)` Sets the remote call timeout value, in milliseconds.
    `void` | `setSslImplementation(SslImplementation sslImplementation)` Sets the SSL implementation to be used by the channel.
    `void` | `setTransportProtocol(TransportProtocol protocol)` Sets the transport protocol being used by the channel.
    `void` | `setUsername(java.lang.String username)` Sets the Windows username to use when connecting.
    `void` | `startCancel()` Advises the RPC system that the caller desires that the RPC call be canceled.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RcfProtoChannel

          public RcfProtoChannel(Endpoint endpoint)

      Constructs a RPC channel from an endpoint.

  - ### Method Detail

    - #### callMethod

          public void callMethod(MethodDescriptor method,
                        RpcController controller,
                        Message request,
                        Message responsePrototype,
                         done)

    - #### getResponse

          public Message getResponse()

    - #### setCertificateValidationCallback

          public void setCertificateValidationCallback(CertificateValidationCallback certValidationCallback)

    - #### getCertificateValidationCallback

          public CertificateValidationCallback getCertificateValidationCallback()

    - #### finalize

          protected void finalize()

      Overrides:
        `finalize` in class `java.lang.Object`

    - #### delete

          public void delete()

    - #### failed

          public boolean failed()

      After a call has finished, returns true if the call failed. The possible reasons for failure depend on the RPC implementation. Failed() must not be called before a call has finished. If Failed() returns true, the contents of the response message are undefined.

    - #### errorText

          public java.lang.String errorText()

      If Failed() is true, returns a human-readable description of the error.

    - #### startCancel

          public void startCancel()

      Advises the RPC system that the caller desires that the RPC call be canceled. The RPC system may cancel it immediately, may wait awhile and then cancel it, or may not even cancel the call at all. If the call is canceled, the "done" callback will still be called and the RpcController will indicate that the call failed at that time.

    - #### connect

          public void connect()

      Connects to the server.

    - #### disconnect

          public void disconnect()

      Disconencts from the server.

    - #### setRemoteCallTimeoutMs

          public void setRemoteCallTimeoutMs(long remoteCallTimeoutMs)

      Sets the remote call timeout value, in milliseconds.

    - #### getRemoteCallTimeoutMs

          public long getRemoteCallTimeoutMs()

      Gets the remote call timeout value, in milliseconds.

    - #### setConnectTimeoutMs

          public void setConnectTimeoutMs(long connectTimeoutMs)

      Sets the connect timeout value, in milliseconds.

    - #### getConnectTimeoutMs

          public long getConnectTimeoutMs()

      Gets the connect timeout value, in milliseconds.

    - #### setTransportProtocol

          public void setTransportProtocol(TransportProtocol protocol)

      Sets the transport protocol being used by the channel.

    - #### getTransportProtocol

          public TransportProtocol getTransportProtocol()

      Gets the transport protocol being used by the channel.

    - #### setEnableAsynchronousRpc

          public void setEnableAsynchronousRpc(boolean enable)

      Sets the enable asynchronous RPC setting. By default asynchronous RPC is disabled.

    - #### getEnableAsynchronousRpc

          public boolean getEnableAsynchronousRpc()

      Gets the enable synchronous RPC setting.

    - #### setPingBackIntervalMs

          public void setPingBackIntervalMs(int pingBackIntervalMs)

      Sets the ping back interval of the connection, in milliseconds. Ping backs are sent from the server back to the client, while a remote call is in progress.

    - #### getPingBackIntervalMs

          public int getPingBackIntervalMs()

      Returns the ping back interval of the connection.

    - #### setHttpProxy

          public void setHttpProxy(java.lang.String httpProxy)

      Sets the network address of the HTTP proxy server, through which to route remote calls. Only valid when using a HTTP or HTTPS endpoint.

    - #### getHttpProxy

          public java.lang.String getHttpProxy()

      Returns the network address of the HTTP proxy server.

    - #### setHttpProxyPort

          public void setHttpProxyPort(int httpProxyPort)

      Sets the port number of the HTTP proxy server, through which to route remote calls. Only valid when using a HTTP or HTTPS endpoint.

    - #### getHttpProxyPort

          public int getHttpProxyPort()

      Returns the port number of the HTTP proxy server.

    - #### getTransportType

          public TransportType getTransportType()

      Returns the transport type of the connection.

    - #### setUsername

          public void setUsername(java.lang.String username)

      Sets the Windows username to use when connecting. Only valid for NTLM and Kerberos transport protocols.

    - #### getUsername

          public java.lang.String getUsername()

      Returns the Windows username to use when connecting.

    - #### setPassword

          public void setPassword(java.lang.String password)

      Sets the Windows password to use when connecting. Only valid for NTLM and Kerberos transport protocols.

    - #### getPassword

          public java.lang.String getPassword()

      Returns the Windows password to use when connecting.

    - #### setKerberosSpn

          public void setKerberosSpn(java.lang.String kerberosSpn)

      Sets the Kerberos SPN to use when connecting. Only valid for Kerberos transport protocols.

    - #### getKerberosSpn

          public java.lang.String getKerberosSpn()

      Returns the Kerberos SPN to use when connecting.

    - #### setEnableCompression

          public void setEnableCompression(boolean enableCompression)

      Sets the transport level compression setting for this connection.

    - #### getEnableCompression

          public boolean getEnableCompression()

      Returns the transport level compression setting for this connection.

    - #### setCertificate

          public void setCertificate(Certificate certificatePtr)

      Sets the SSL certificate for the channel.

    - #### getCertificate

          public Certificate getCertificate()

      Gets the SSL certificate for the channel.

    - #### setCaCertificate

          public void setCaCertificate(Certificate certificatePtr)

      Sets the certificate authority for the channel.

    - #### getCaCertificate

          public Certificate getCaCertificate()

      Gets the certificate authority for the channel.

    - #### setOpenSslCipherSuite

          public void setOpenSslCipherSuite(java.lang.String cipherSuite)

      Sets the OpenSSL cipher suite. Only applicable when using OpenSSL as the SSL implementation.

    - #### getOpenSslCipherSuite

          public java.lang.String getOpenSslCipherSuite()

      Gets the OpenSSL cipher suite.

    - #### setEnableSchannelCertificateValidation

          public void setEnableSchannelCertificateValidation(java.lang.String peerName)

      Sets the Schannel certificate validation setting. Only applicable when using Schannel as the SSL implementation. If this setting is non-empty, it will be used by Schannel to automatically validate peer certificates.

    - #### getEnableSchannelCertificateValidation

          public java.lang.String getEnableSchannelCertificateValidation()

      Gets the Schannel certificate validation setting.

    - #### setSslImplementation

          public void setSslImplementation(SslImplementation sslImplementation)

      Sets the SSL implementation to be used by the channel.

    - #### getSslImplementation

          public SslImplementation getSslImplementation()

      Gets the SSL implementation.