Package org.saidone.unrest.client
Class AlfrescoGrpcChannels
java.lang.Object
org.saidone.unrest.client.AlfrescoGrpcChannels
Creates channels to the unrest-platform module.
-
Method Summary
Modifier and TypeMethodDescriptionstatic io.grpc.ManagedChannelA channel tohost:port.static AlfrescoGrpcChannelPoolcreatePool(String host, int port, String trustCertificate, String authorityOverride, int size) Creates a bounded pool of independently reusable channels to the same endpoint.static io.grpc.ManagedChannelA plaintext channel: only for an Alfresco module listening on a loopback address.
-
Method Details
-
create
public static io.grpc.ManagedChannel create(String host, int port, String trustCertificate, String authorityOverride) throws IOException A channel tohost: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 ofhost; null or blank to usehost- Throws:
IOException
-
plaintext
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 hostnameport- gRPC porttrustCertificate- PEM CA certificate, or blank for loopback plaintextauthorityOverride- TLS hostname override, or blank to use hostsize- 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
-