Package com.linecorp.centraldogma.server
Class CentralDogmaBuilder
java.lang.Object
com.linecorp.centraldogma.server.CentralDogmaBuilder
Builds a
CentralDogma
server.
CentralDogmaBuilder builder = new CentralDogmaBuilder(new File("/tmp/dogma"));
builder.numRepositoryWorkers(32);
builder...;
CentralDogma dogma = builder.build();
dogma.start();
-
Constructor Summary
ConstructorsConstructorDescriptionCentralDogmaBuilder
(File dataDir) Creates a new builder with the specified data directory. -
Method Summary
Modifier and TypeMethodDescriptionaccessLogFormat
(String accessLogFormat) Configures a format of an access log.administrators
(Iterable<String> administrators) Adds administrators to the set.administrators
(String... administrators) Adds administrators to the set.authProviderFactory
(AuthProviderFactory authProviderFactory) Sets anAuthProviderFactory
instance which is used to create a newAuthProvider
.authProviderProperties
(Object authProviderProperties) Sets an additional properties for anAuthProviderFactory
.build()
Returns a newly-createdCentralDogma
server.Deprecated.caseSensitiveLoginNames
(boolean caseSensitiveLoginNames) Sets whether case-sensitive matching is performed when login names are compared.clientAddressSources
(Iterable<String> clientAddressSources) Adds the HTTP header names to be used for retrieving a client address.clientAddressSources
(String... clientAddressSources) Adds the HTTP header names to be used for retrieving a client address.cors
(CorsConfig corsConfig) Sets CORS related configurations.gracefulShutdownTimeout
(GracefulShutdownTimeout gracefulShutdownTimeout) Sets the graceful shutdown timeout.idleTimeout
(Duration idleTimeout) Sets the timeout for keeping an idle connection.idleTimeoutMillis
(long idleTimeoutMillis) Sets the timeout for keeping an idle connection, in milliseconds.maxFrameLength
(int maxFrameLength) Sets the maximum allowed content length of an incoming request.maxNumBytesPerMirror
(long maxNumBytesPerMirror) Sets the maximum allowed number of bytes in a mirrored tree.maxNumConnections
(int maxNumConnections) Sets the maximum allowed number of TCP/IP connections.maxNumFilesPerMirror
(int maxNumFilesPerMirror) Sets the maximum allowed number of files in a mirrored tree.maxRemovedRepositoryAge
(Duration maxRemovedRepositoryAge) Sets the maximum allowed age of removed projects and repositories before they are purged.maxRemovedRepositoryAgeMillis
(long maxRemovedRepositoryAgeMillis) Sets the maximum allowed age, in milliseconds of removed projects and repositories before they are purged.meterRegistry
(MeterRegistry meterRegistry) Sets theMeterRegistry
used to collect metrics.mirroringEnabled
(boolean mirroringEnabled) Sets whetherMirroringService
is enabled or not.numMirroringThreads
(int numMirroringThreads) Sets the number of worker threads dedicated to mirroring between repositories.numRepositoryWorkers
(int numRepositoryWorkers) Sets the number of worker threads dedicated to repository access.numWorkers
(int numWorkers) Sets the number of I/O worker threads.port
(int port, SessionProtocol protocol) Adds a port that serves the HTTP requests.port
(ServerPort port) Adds a port that serves the HTTP requests.port
(InetSocketAddress localAddress, SessionProtocol protocol) Adds a port that serves the HTTP requests.replication
(ReplicationConfig replicationConfig) Configures the replication.repositoryCacheSpec
(String repositoryCacheSpec) Sets the cache specification which determines the capacity and behavior of the cache for the return values of methods inRepository
of the server.requestTimeout
(Duration requestTimeout) Sets the timeout for handling an incoming request.requestTimeoutMillis
(long requestTimeoutMillis) Sets the timeout for handling an incoming request, in milliseconds.sessionCacheSpec
(String sessionCacheSpec) Sets the cache specification which determines the capacity and behavior of the cache forSession
of the server.sessionTimeout
(Duration sessionTimeout) Sets the session timeout for administrative web application.sessionTimeoutMillis
(long sessionTimeoutMillis) Sets the session timeout for administrative web application, in milliseconds.sessionValidationSchedule
(String sessionValidationSchedule) Sets a schedule for validating sessions.Sets aTlsConfig
for supporting TLS on the server.trustedProxyAddresses
(Iterable<String> exactOrCidrAddresses) Adds addresses or ranges of Classless Inter-domain Routing (CIDR) blocks of trusted proxy servers.trustedProxyAddresses
(String... exactOrCidrAddresses) Adds addresses or ranges of Classless Inter-domain Routing (CIDR) blocks of trusted proxy servers.webAppEnabled
(boolean webAppEnabled) Sets whether administrative web application is enabled or not.webAppTitle
(String webAppTitle) Sets the title text which is displayed on the navigation bar of the administrative web application.writeQuotaPerRepository
(int writeQuota, int timeWindowSeconds) Sets maximum allowed write requests pertimeWindowSeconds
for eachRepository
.
-
Constructor Details
-
CentralDogmaBuilder
Creates a new builder with the specified data directory.
-
-
Method Details
-
port
Adds a port that serves the HTTP requests. If unspecified, cleartext HTTP on port 36462 is used.- Parameters:
port
- the TCP/IP port numberprotocol
-SessionProtocol.HTTP
orSessionProtocol.HTTPS
-
port
Adds a port that serves the HTTP requests. If unspecified, cleartext HTTP on port 36462 is used.- Parameters:
localAddress
- the TCP/IP load address to bindprotocol
-SessionProtocol.HTTP
orSessionProtocol.HTTPS
-
port
Adds a port that serves the HTTP requests. If unspecified, cleartext HTTP on port 36462 is used. -
tls
Sets aTlsConfig
for supporting TLS on the server. -
trustedProxyAddresses
Adds addresses or ranges of Classless Inter-domain Routing (CIDR) blocks of trusted proxy servers.- Parameters:
exactOrCidrAddresses
- a list of addresses and CIDR blocks, e.g.10.0.0.1
for a single address or10.0.0.0/8
for a CIDR block
-
trustedProxyAddresses
Adds addresses or ranges of Classless Inter-domain Routing (CIDR) blocks of trusted proxy servers.- Parameters:
exactOrCidrAddresses
- a list of addresses and CIDR blocks, e.g.10.0.0.1
for a single address or10.0.0.0/8
for a CIDR block
-
clientAddressSources
Adds the HTTP header names to be used for retrieving a client address.Note that
"PROXY_PROTOCOL"
indicates the source address specified in a PROXY protocol message.Also note that if you configured trusted proxy addresses,
"forwarded"
,"x-forwarded-for"
and"PROXY_PROTOCOL"
will be used as client address sources by default.- Parameters:
clientAddressSources
- the HTTP header names or"PROXY_PROTOCOL"
to be used for retrieving a client address
-
clientAddressSources
Adds the HTTP header names to be used for retrieving a client address.Note that
"PROXY_PROTOCOL"
indicates the source address specified in a PROXY protocol message.Also note that if you configured trusted proxy addresses,
"forwarded"
,"x-forwarded-for"
and"PROXY_PROTOCOL"
will be used as client address sources by default.- Parameters:
clientAddressSources
- the HTTP header names or"PROXY_PROTOCOL"
to be used for retrieving a client address
-
numWorkers
Sets the number of I/O worker threads. Armeria default is used if unspecified. -
maxNumConnections
Sets the maximum allowed number of TCP/IP connections. If unspecified, no limit is enforced. -
requestTimeout
Sets the timeout for handling an incoming request. If it takes more than the specified timeout to handle a request, the server may respond with '503 Service Unavailable' or fail to respond. Armeria default is used if unspecified. -
requestTimeoutMillis
Sets the timeout for handling an incoming request, in milliseconds. If it takes more than the specified timeout to handle a request, the server may respond with '503 Service Unavailable' or fail to respond. Armeria default is used if unspecified. -
idleTimeout
Sets the timeout for keeping an idle connection. A connection is automatically closed when it stays idle without any requests in progress for more than the specified timeout. Armeria default is used if unspecified. -
idleTimeoutMillis
Sets the timeout for keeping an idle connection, in milliseconds. A connection is automatically closed when it stays idle without any requests in progress for more than the specified timeout. -
maxFrameLength
Sets the maximum allowed content length of an incoming request. -
numRepositoryWorkers
Sets the number of worker threads dedicated to repository access. If unspecified, 16 threads are created at maximum. -
maxRemovedRepositoryAge
Sets the maximum allowed age of removed projects and repositories before they are purged. Set0
to disable automatic purge. If unspecified, the default of 604800000L milliseconds is used. -
maxRemovedRepositoryAgeMillis
Sets the maximum allowed age, in milliseconds of removed projects and repositories before they are purged. Set0
to disable automatic purge. If unspecified, the default of 604800000L milliseconds is used. -
cacheSpec
Deprecated.Sets the cache specification which determines the capacity and behavior of the cache for the return values of methods inRepository
of the server. SeeCaffeineSpec
for the syntax of the spec. If unspecified, the default cache spec of "maximumWeight=134217728,expireAfterAccess=5m" is used. -
repositoryCacheSpec
Sets the cache specification which determines the capacity and behavior of the cache for the return values of methods inRepository
of the server. SeeCaffeineSpec
for the syntax of the spec. If unspecified, the default cache spec of "maximumWeight=134217728,expireAfterAccess=5m" is used. -
webAppEnabled
Sets whether administrative web application is enabled or not. If unspecified, the administrative web application is enabled. -
webAppTitle
Sets the title text which is displayed on the navigation bar of the administrative web application. -
mirroringEnabled
Sets whetherMirroringService
is enabled or not. If unspecified,MirroringService
is enabled. -
numMirroringThreads
Sets the number of worker threads dedicated to mirroring between repositories. If unspecified, 16 threads are created at maximum. -
maxNumFilesPerMirror
Sets the maximum allowed number of files in a mirrored tree. If unspecified, 8192 files are allowed at maximum. -
maxNumBytesPerMirror
Sets the maximum allowed number of bytes in a mirrored tree. If unspecified, 33554432L bytes are allowed at maximum. -
gracefulShutdownTimeout
Sets the graceful shutdown timeout. If unspecified, graceful shutdown is disabled. -
replication
Configures the replication. If unspecified orReplicationConfig.NONE
is specified, replication is disabled. -
accessLogFormat
Configures a format of an access log. It will work only if any logging framework is configured. Read the Writing an access log document for more information. -
authProviderFactory
Sets anAuthProviderFactory
instance which is used to create a newAuthProvider
. -
administrators
Adds administrators to the set. -
administrators
Adds administrators to the set. -
caseSensitiveLoginNames
Sets whether case-sensitive matching is performed when login names are compared. -
sessionCacheSpec
Sets the cache specification which determines the capacity and behavior of the cache forSession
of the server. SeeCaffeineSpec
for the syntax of the spec. If unspecified, the default cache spec of "maximumSize=8192,expireAfterWrite=604800s" is used. -
sessionTimeoutMillis
Sets the session timeout for administrative web application, in milliseconds. If unspecified, 604800000L is used. -
sessionTimeout
Sets the session timeout for administrative web application. If unspecified, 604800000L is used. -
sessionValidationSchedule
Sets a schedule for validating sessions. If unspecified, "0 30 */4 ? * *" is used. -
authProviderProperties
Sets an additional properties for anAuthProviderFactory
. -
writeQuotaPerRepository
Sets maximum allowed write requests pertimeWindowSeconds
for eachRepository
. -
meterRegistry
Sets theMeterRegistry
used to collect metrics. -
cors
Sets CORS related configurations. -
build
Returns a newly-createdCentralDogma
server.
-
repositoryCacheSpec(String)
.