Class AlfrescoGrpcChannels

java.lang.Object
org.saidone.unrest.client.AlfrescoGrpcChannels

public final class AlfrescoGrpcChannels extends Object
Creates channels to the unrest-platform module.
  • Method Details

    • create

      public static io.grpc.ManagedChannel create(String host, int port, String trustCertificate, String authorityOverride) throws IOException
      A channel to host:port. It connects lazily, on the first call; shut it down when done.
      Parameters:
      trustCertificate - PEM CA certificate used to verify the server; null or blank means plaintext (the Alfresco module only accepts plaintext on loopback addresses)
      authorityOverride - TLS host name to verify instead of host; null or blank to use host
      Throws:
      IOException
    • plaintext

      public static io.grpc.ManagedChannel plaintext(String host, int port) throws IOException
      A plaintext channel: only for an Alfresco module listening on a loopback address.
      Throws:
      IOException
    • createPool

      public static AlfrescoGrpcChannelPool createPool(String host, int port, String trustCertificate, String authorityOverride, int size) throws IOException
      Creates a bounded pool of independently reusable channels to the same endpoint. Channels connect lazily. A size of one retains single-channel operation. Creation failures close every already allocated channel.
      Parameters:
      host - gRPC hostname
      port - gRPC port
      trustCertificate - PEM CA certificate, or blank for loopback plaintext
      authorityOverride - TLS hostname override, or blank to use host
      size - fixed channel count in 1..64; includes the primary metadata/authentication channel
      Returns:
      an owning pool; the application must close it once after stopping callers
      Throws:
      IOException - if TLS credentials cannot be loaded