public static final class DOFServer.Config.BuilderAS
extends java.lang.Object
DOFServer.Type.DATAGRAM
server configurations.
This class creates an unsecure DOFServer.Type.STREAM
server configuration for an Authentication Server.
It may be made secure and the connection type may be changed.
These configurations are immutable once built, and so
the builder allows them to be created (and modified) up until they are built.Constructor and Description |
---|
BuilderAS(DOFAddress listenAddress)
Create a simple, unsecure server on the target address.
|
Modifier and Type | Method and Description |
---|---|
T |
addCredentials(java.util.Collection<DOFCredentials> credentials)
Add credentials to the server.
|
T |
addCredentials(DOFCredentials... credentials)
Add variable number of credentials to the server.
|
T |
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.
|
T |
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.
|
T |
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.
|
T |
addTrustedDomains(java.util.Collection<DOFObjectID.Domain> domains)
Add in a configured TRP route without credentials.
|
T |
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 |
createServer(DOF dof)
This is a convenience method for creating the server with the implied
DOFServer.Config . |
T |
setAddress(DOFAddress listenAddress)
Set this server's listening address.
|
T |
setAuditorListener(DOFAuditListener auditListener)
Set this server's audit listener.
|
T |
setBridge(DOFOperation.Bridge.Config bridge)
Set the bridge of the server.
|
T |
setConnectionLimit(int connectionLimit)
Set the maximum number of inbound connections that the server can support.
|
T |
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. |
T |
setDomainDiscoveryCredentials(DOFCredentials credentials)
Set the credentials used for remote domain discovery.
|
T |
setMaxReceiveSilence(int maxReceiveSilence)
Set this server's max receive silence.
|
T |
setMaxSendSilence(int maxSendSilence)
Set this server's max send silence.
|
T |
setName(java.lang.String name)
Set this server's name used for logging purposes.
|
T |
setPermissions(DOFObjectID.Domain domain,
DOFPermissionSet perms)
Set the initial permissions for a domain.
|
T |
setProtocolNegotiator(DOFProtocolNegotiator negotiator)
Set this server's protocol negotiator.
|
T |
setReceiveFilter(DOFOperation.Filter receiveFilter)
Set the receive filter of the server.
|
T |
setSecurityDesire(DOF.SecurityDesire desire)
Set this server's security desire.
|
T |
setSendFilter(DOFOperation.Filter sendFilter)
Set the send filter of the server.
|
DOFServer.Config.BuilderAS |
setServerType(DOFServer.Type type)
Set this server's type.
|
T |
setTransportConfig(org.opendof.core.transport.ServerConfig config)
Set this server's transport configuration.
|
T |
setTunnelDomains(boolean isTunnelDomains)
Set whether or not connections to this server are allowed to tunnel remote domains.
|
T |
setWildcardCredentials(DOFCredentials credentials)
Set the credentials for a connection in any domain not specifically set using
addCredentials(DOFCredentials...) . |
T |
setWildcardPermissions(DOFPermissionSet perms)
Set the permissions for the wildcard credential.
|
public BuilderAS(DOFAddress listenAddress)
DOFServer.Type.STREAM
.
The DOFProtocolNegotiator.createDefaultASOnly()
is used by default.listenAddress
- The listening address of the server. Null is not allowed.public DOFServer.Config.BuilderAS setServerType(DOFServer.Type type)
type
- The server type. This must not be null.public T setSecurityDesire(DOF.SecurityDesire desire)
desire
- The desire to set on this server.public T addCredentials(DOFCredentials... credentials)
credentials
- The credentials for this server. Must not be null.public T addCredentials(java.util.Collection<DOFCredentials> credentials)
credentials
- The credentials for this server. Must not be null.public T setWildcardCredentials(DOFCredentials credentials)
addCredentials(DOFCredentials...)
.credentials
- The wildcard credentials for this server. null
means none (default).public T setDomainDiscoveryCredentials(DOFCredentials credentials)
credentials
- the domain discovery credentials for this server. null
means none (default).public T addDomains(DOFDomain.Config... domainConfigs)
domainConfigs
- The domains to be authorized. Must not be null. Must not contain nulls.public T addDomains(java.util.Collection<DOFDomain.Config> domainConfigs)
domainConfigs
- The domains to be authorized. Must not be null. Must not contain nulls.public T addDomain(DOFDomain.Config domainConfig)
domainConfig
- The domain to be authorized. Must not be null.public T addTrustedDomains(DOFObjectID.Domain... domains)
domains
- Variable number of domain identifiers for the server to use for routing purposes. Must not be null.public T addTrustedDomains(java.util.Collection<DOFObjectID.Domain> domains)
domains
- The domain identifier for the server to use for routing purposes. Must not be null.public T 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 T setTunnelDomains(boolean isTunnelDomains)
isTunnelDomains
- Whether or not connections to this server are allowed to tunnel remote domains.public T 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 T setWildcardPermissions(DOFPermissionSet perms)
perms
- The initial permissions for the wildcard credential.public DOFServer.Config build()
public DOFServer createServer(DOF dof)
DOFServer.Config
.dof
- The DOF to use to create the server.public T setAddress(DOFAddress listenAddress)
listenAddress
- The address to set on this server. This must not be null.public T setMaxSendSilence(int maxSendSilence)
maxSendSilence
- The max send silence to set on this server, in milliseconds. Must be greater than 0.public T setConnectionLimit(int connectionLimit)
connectionLimit
- The connection limit. Must be >= 0. Default is DOF.UNLIMITED
.public T setMaxReceiveSilence(int maxReceiveSilence)
maxReceiveSilence
- The max receive silence to set on this server, in milliseconds. Must be greater than 0.public T 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 T setBridge(DOFOperation.Bridge.Config bridge)
bridge
- The bridge for this server. null
means none (default).public T setSendFilter(DOFOperation.Filter sendFilter)
sendFilter
- The server's send filter. null
means none.public T setReceiveFilter(DOFOperation.Filter receiveFilter)
receiveFilter
- The server's receive filter. null
means none.public T setTransportConfig(org.opendof.core.transport.ServerConfig config)
config
- The transport configuration to set on this server's configuration. null
means none (default).public T setName(java.lang.String name)
name
- The server's name.public T setAuditorListener(DOFAuditListener auditListener)
auditListener
- The server's audit listener. null
means none (default).