public static final class DOFServer.Config.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder(DOFServer.Config config)
Construct a builder based on an existing configuration.
|
Builder(DOFServer.State state)
Construct a builder based on an existing configuration.
|
Builder(DOFServer.Type type,
DOFAddress listenAddress)
Create a simple, unsecure server on the target address.
|
Modifier and Type | Method and Description |
---|---|
DOFServer.Config.Builder |
addCredentials(java.util.Collection<DOFCredentials> credentials)
Add credentials to the server.
|
DOFServer.Config.Builder |
addCredentials(DOFCredentials... credentials)
Add variable number of credentials to the server.
|
DOFServer.Config.Builder |
addDomain(DOFDomain.Config domainConfig)
Add a domain, which is used
to verify that the host being connected from is authorized to process authentication requests in
the domain that is specified.
|
DOFServer.Config.Builder |
addDomains(java.util.Collection<DOFDomain.Config> domainConfigs)
Add the collection of domains, which are used
to verify that the host being connected from is authorized to process authentication requests in
the domains that are specified.
|
DOFServer.Config.Builder |
addDomains(DOFDomain.Config... domainConfigs)
Add the domains, which are used to verify that the host
being connected from is authorized to process authentication requests in the domains specified.
|
DOFServer.Config.Builder |
addTrustedDomains(java.util.Collection<DOFObjectID.Domain> domains)
Add in a configured TRP route without credentials.
|
DOFServer.Config.Builder |
addTrustedDomains(DOFObjectID.Domain... domains)
Add in a configured TRP route without credentials.
|
DOFServer.Config |
build()
Build a configuration based on the current state of the builder.
|
DOFServer.Config.Builder |
setAddress(DOFAddress listenAddress)
Set this server's listening address.
|
DOFServer.Config.Builder |
setAuditorListener(DOFAuditListener auditListener)
Set this server's audit listener.
|
DOFServer.Config.Builder |
setBridge(DOFOperation.Bridge.Config bridge)
Set the bridge of the server.
|
DOFServer.Config.Builder |
setConnectionLimit(int connectionLimit)
Set the maximum number of inbound connections that the server can support.
|
DOFServer.Config.Builder |
setCredentialAssigner(DOFCredentialsAssigner assigner)
Set this server's credential assigner, which overrides any credentials
set with
addCredentials(DOFCredentials...) , and allows the
application to use different credentials for incoming requests based
on the domain of the requestor. |
DOFServer.Config.Builder |
setDomainDiscoveryCredentials(DOFCredentials credentials)
Set the credentials used for remote domain discovery.
|
DOFServer.Config.Builder |
setMaxReceiveSilence(int maxReceiveSilence)
Set this server's max receive silence.
|
DOFServer.Config.Builder |
setMaxSendSilence(int maxSendSilence)
Set this server's max send silence.
|
DOFServer.Config.Builder |
setName(java.lang.String name)
Set this server's name used for logging purposes.
|
DOFServer.Config.Builder |
setPermissions(DOFObjectID.Domain domain,
DOFPermissionSet perms)
Set the initial permissions for a domain.
|
DOFServer.Config.Builder |
setProtocolNegotiator(DOFProtocolNegotiator negotiator)
Set this server's protocol negotiator.
|
DOFServer.Config.Builder |
setReceiveFilter(DOFOperation.Filter receiveFilter)
Set the receive filter of the server.
|
DOFServer.Config.Builder |
setSecurityDesire(DOF.SecurityDesire desire)
Set this server's security desire.
|
DOFServer.Config.Builder |
setSendFilter(DOFOperation.Filter sendFilter)
Set the send filter of the server.
|
DOFServer.Config.Builder |
setServerType(DOFServer.Type type)
Set this server's type.
|
DOFServer.Config.Builder |
setTransportConfig(org.opendof.core.transport.ServerConfig config)
Set this server's transport configuration.
|
DOFServer.Config.Builder |
setTunnelDomains(boolean isTunnelDomains)
Set whether or not connections to this server are allowed to tunnel remote domains.
|
DOFServer.Config.Builder |
setWildcardCredentials(DOFCredentials credentials)
Set the credentials for a connection in any domain not specifically set using
addCredentials(DOFCredentials...) . |
DOFServer.Config.Builder |
setWildcardPermissions(DOFPermissionSet perms)
Set the permissions for the wildcard credential.
|
public Builder(DOFServer.Config config)
config
- The existing configuration to use for builder initial state. Must not be null.setName(String)
public Builder(DOFServer.State state)
state
- The server state to use for builder initial state. Must not be null.setName(java.lang.String)
public Builder(DOFServer.Type type, DOFAddress listenAddress)
type
- The type of server. Null is not allowed.listenAddress
- The listening address of the server. Null is not allowed.public DOFServer.Config.Builder setServerType(DOFServer.Type type)
type
- The server type. This must not be null.public DOFServer.Config.Builder setAddress(DOFAddress listenAddress)
listenAddress
- The address to set on this server. This must not be null.public DOFServer.Config.Builder setPermissions(DOFObjectID.Domain domain, DOFPermissionSet perms)
domain
- The domain to set permissions. Must not be null or broadcast.perms
- The initial permissions for a domain. null
means default.public DOFServer.Config.Builder setWildcardPermissions(DOFPermissionSet perms)
perms
- The initial permissions for the wildcard credential.public DOFServer.Config.Builder setMaxSendSilence(int maxSendSilence)
DOFConnection.Config.DEFAULT_MAX_SEND_SILENCE
.
Optimally, the max receive silence should be much greater (at least 20 seconds greater) than the max send silence on the other end of the connection.maxSendSilence
- The max send silence to set on this server, in milliseconds. Must be greater than 0.public DOFServer.Config.Builder setConnectionLimit(int connectionLimit)
connectionLimit
- The max connections. Must be >= 0. Default is DOF.UNLIMITED
.public DOFServer.Config.Builder setMaxReceiveSilence(int maxReceiveSilence)
DOFConnection.Config.DEFAULT_MAX_RECEIVE_SILENCE
.
Optimally, the max receive silence should be much greater (at least 20 seconds greater) than the max send silence on the other end of the connection.maxReceiveSilence
- The max receive silence to set on this server, in milliseconds. Must be greater than 0.public DOFServer.Config.Builder setProtocolNegotiator(DOFProtocolNegotiator negotiator)
negotiator
- The protocol negotiator to set on this server's configuration.The default is the same as calling this with
DOFProtocolNegotiator.createDefault()
.public DOFServer.Config.Builder setSecurityDesire(DOF.SecurityDesire desire)
desire
- The desire to set on this server.public DOFServer.Config.Builder setBridge(DOFOperation.Bridge.Config bridge)
bridge
- The bridge for this server. null
means none (default).public DOFServer.Config.Builder setSendFilter(DOFOperation.Filter sendFilter)
sendFilter
- The server's send filter. null
means none.public DOFServer.Config.Builder setReceiveFilter(DOFOperation.Filter receiveFilter)
receiveFilter
- The server's receive filter. null
means none.public DOFServer.Config.Builder setTransportConfig(org.opendof.core.transport.ServerConfig config)
config
- The transport configuration to set on this server's configuration. null
means none (default).public DOFServer.Config.Builder setName(java.lang.String name)
name
- The server's name.public DOFServer.Config.Builder setAuditorListener(DOFAuditListener auditListener)
auditListener
- The server's audit listener. null
means none (default).public DOFServer.Config.Builder addCredentials(DOFCredentials... credentials)
credentials
- The credentials for this server. Must not be null.public DOFServer.Config.Builder addCredentials(java.util.Collection<DOFCredentials> credentials)
credentials
- The credentials for this server. Must not be null.public DOFServer.Config.Builder setWildcardCredentials(DOFCredentials credentials)
addCredentials(DOFCredentials...)
.credentials
- The wildcard credentials for this server. null
means none (default).public DOFServer.Config.Builder setDomainDiscoveryCredentials(DOFCredentials credentials)
credentials
- the domain discovery credentials for this server. null
means none (default).public DOFServer.Config.Builder addDomains(DOFDomain.Config... domainConfigs)
domainConfigs
- The domains to be authorized. Must not be null. Must not contain nulls.public DOFServer.Config.Builder addDomains(java.util.Collection<DOFDomain.Config> domainConfigs)
domainConfigs
- The domains to be authorized. Must not be null. Must not contain nulls.public DOFServer.Config.Builder addDomain(DOFDomain.Config domainConfig)
domainConfig
- The domain to be authorized. Must not be null.public DOFServer.Config.Builder addTrustedDomains(DOFObjectID.Domain... domains)
domains
- Variable number of domain identifiers for the server to use for routing purposes. Must not be null.public DOFServer.Config.Builder addTrustedDomains(java.util.Collection<DOFObjectID.Domain> domains)
domains
- The domain identifier for the server to use for routing purposes. Must not be null.public DOFServer.Config.Builder setCredentialAssigner(DOFCredentialsAssigner assigner)
addCredentials(DOFCredentials...)
, and allows the
application to use different credentials for incoming requests based
on the domain of the requestor.assigner
- The credential assigner. null
means none (default).addCredentials(DOFCredentials...)
public DOFServer.Config.Builder setTunnelDomains(boolean isTunnelDomains)
isTunnelDomains
- Whether or not connections to this server are allowed to tunnel remote domains.public DOFServer.Config build()