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
ConstructorDescriptionCentralDogmaBuilder
(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.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) Enables CORS with the specifiedCorsConfig
.Enables CORS with the specified allowed origins.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.management
(ManagementConfig managementConfig) Enables a management service with the specifiedManagementConfig
.maxFrameLength
(int maxFrameLength) Sets the maximum allowed content length of an incoming request.maxNumConnections
(int maxNumConnections) Sets the maximum allowed number of TCP/IP connections.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.numRepositoryWorkers
(int numRepositoryWorkers) Sets the number of worker threads dedicated to repository access.numWorkers
(int numWorkers) Sets the number of I/O worker threads.Returns thePluginConfig
s that have been added.pluginConfigs
(PluginConfig... pluginConfigs) Adds thePluginConfig
s.Adds thePlugin
s.Adds thePlugin
s.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.systemAdministrators
(Iterable<String> systemAdministrators) Adds system administrators to the set.systemAdministrators
(String... systemAdministrators) Adds system administrators to the set.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
.zone
(ZoneConfig zoneConfig) Specifies theZoneConfig
of the server.
-
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. -
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
. -
systemAdministrators
Adds system administrators to the set. -
systemAdministrators
Adds system 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
Enables CORS with the specified allowed origins. -
cors
Enables CORS with the specifiedCorsConfig
. -
pluginConfigs
Adds thePluginConfig
s. -
pluginConfigs
Returns thePluginConfig
s that have been added. -
plugins
Adds thePlugin
s. -
plugins
Adds thePlugin
s. -
management
Enables a management service with the specifiedManagementConfig
. -
zone
Specifies theZoneConfig
of the server. -
build
Returns a newly-createdCentralDogma
server.
-
repositoryCacheSpec(String)
.