Class GrpcServer
The module's Spring context invokes start() after repository services are available and stop() during shutdown. One bounded worker pool serves all registered repository adapters. Each adapter uses
the same TicketInterceptor; only credential authentication bypasses the ticket check. Content
downloads use a separate bounded pool, with at most one active transfer per configured repository worker.
A certificate and private key enable server-side TLS. Plaintext listeners are restricted to loopback addresses unless explicitly enabled for isolated benchmarks. Lifecycle methods are synchronized and repeated start/stop calls are safe.
-
Constructor Summary
ConstructorsConstructorDescriptionGrpcServer(org.alfresco.service.ServiceRegistry services, boolean enabled, String host, int port, int threads, int maxMessageSize, String certificate, String privateKey) Creates a listener configuration; no network socket or worker pool is allocated until start is called.GrpcServer(org.alfresco.service.ServiceRegistry services, org.alfresco.repo.rendition2.SynchronousTransformClient transforms, org.alfresco.repo.node.archive.NodeArchiveService archive, boolean enabled, String host, int port, int threads, int maxMessageSize, String certificate, String privateKey) Creates a listener configuration; no network socket or worker pool is allocated until start is called.GrpcServer(org.alfresco.service.ServiceRegistry services, org.alfresco.repo.rendition2.SynchronousTransformClient transforms, org.alfresco.repo.node.archive.NodeArchiveService archive, boolean enabled, String host, int port, int threads, int maxMessageSize, String certificate, String privateKey, boolean allowInsecureRemote) Creates a listener with an explicit plaintext exception for isolated benchmark networks. -
Method Summary
-
Constructor Details
-
GrpcServer
public GrpcServer(org.alfresco.service.ServiceRegistry services, boolean enabled, String host, int port, int threads, int maxMessageSize, String certificate, String privateKey) Creates a listener configuration; no network socket or worker pool is allocated until start is called.- Parameters:
services- Alfresco service registry; repository work uses its secured servicesenabled- whether the listener should start when requestedhost- bind hostname or IP address; plaintext requires a resolved loopback addressport- TCP port in 1..65535threads- positive worker count for the bounded execution poolmaxMessageSize- maximum inbound message size in bytes, at least 1024certificate- PEM certificate path, or blank for plaintextprivateKey- PEM private-key path, or blank for plaintext
-
GrpcServer
public GrpcServer(org.alfresco.service.ServiceRegistry services, org.alfresco.repo.rendition2.SynchronousTransformClient transforms, org.alfresco.repo.node.archive.NodeArchiveService archive, boolean enabled, String host, int port, int threads, int maxMessageSize, String certificate, String privateKey) Creates a listener configuration; no network socket or worker pool is allocated until start is called.- Parameters:
services- Alfresco service registry; repository work uses its secured servicestransforms- synchronous text-transform client, or null to disable non-plain-text extractionarchive- node archive service, or null to disable the trashcan serviceenabled- whether the listener should start when requestedhost- bind hostname or IP address; plaintext requires a resolved loopback addressport- TCP port in 1..65535threads- positive worker count for the bounded execution poolmaxMessageSize- maximum inbound message size in bytes, at least 1024certificate- PEM certificate path, or blank for plaintextprivateKey- PEM private-key path, or blank for plaintext
-
GrpcServer
public GrpcServer(org.alfresco.service.ServiceRegistry services, org.alfresco.repo.rendition2.SynchronousTransformClient transforms, org.alfresco.repo.node.archive.NodeArchiveService archive, boolean enabled, String host, int port, int threads, int maxMessageSize, String certificate, String privateKey, boolean allowInsecureRemote) Creates a listener with an explicit plaintext exception for isolated benchmark networks.- Parameters:
services- secured Alfresco servicestransforms- optional transform clientarchive- optional archive serviceenabled- whether to start the listenerhost- bind addressport- listener portthreads- repository worker countmaxMessageSize- maximum inbound message bytescertificate- TLS certificate path, or blankprivateKey- TLS private-key path, or blankallowInsecureRemote- explicitly allow remote plaintext for isolated benchmarks; default false
-
-
Method Details
-
start
Starts the listener unless disabled or already running. Validates configuration, allocates a bounded worker pool and registers every repository adapter with ticket interception.TLS requires both a certificate and key. Without TLS, the resolved bind address must be loopback unless the isolated-benchmark exception is explicitly enabled. Startup failures after executor allocation shut down that executor before propagating the error.
- Throws:
IllegalArgumentException- if listener limits or TLS settings are invalid, or plaintext binds outside loopback without the explicit exceptionException- if address resolution, TLS setup or listener startup fails
-
stop
public void stop()Stops the listener and its worker pool. Allows up to ten seconds for graceful server termination, then forces shutdown. Restores the interrupt flag if interrupted and clears lifecycle state so another start is possible.
-