public static final class DOFConnection.Config.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder(DOFConnection.Config config)
Construct a new builder based on another configuration.
|
Builder(DOFConnection.State state)
Construct a builder based on an existing configuration.
|
Builder(DOFConnection.Type type,
DOFAddress target)
Construct a new builder based on a type and address.
|
Modifier and Type | Method and Description |
---|---|
DOFConnection.Config.Builder |
addDomain(DOFDomain.Config domainConfig)
Add a static domain, which is used on a connection that supports authentication,
to verify that the host being connected to is authorized to process authentication requests in
the domain that is specified.
|
DOFConnection.Config.Builder |
addDomains(java.util.Collection<DOFDomain.Config> domainConfigs)
Add the collection of static domains, which are used on a connection that supports authentication,
to verify that the host being connected to is authorized to process authentication requests in
the domains that are specified.
|
DOFConnection.Config.Builder |
addDomains(DOFDomain.Config... domainConfigs)
Add the static domains, which are used on a connection that supports authentication, to verify that the host
being connected to is authorized to process authentication requests in the domains specified.
|
DOFConnection.Config.Builder |
addTrustedDomains(java.util.Collection<DOFObjectID.Domain> domains)
Add in a configured TRP route without credentials.
|
DOFConnection.Config.Builder |
addTrustedDomains(DOFObjectID.Domain... domains)
Add in a configured TRP route without credentials.
|
DOFConnection.Config |
build()
Return a configuration based on the current settings of the builder.
|
DOFConnection.Config.Builder |
setAddress(DOFAddress target)
Set the target address of the connection.
|
DOFConnection.Config.Builder |
setAuditorListener(DOFAuditListener auditListener)
Set this connection's audit listener.
|
DOFConnection.Config.Builder |
setBridge(DOFOperation.Bridge.Config bridge)
Set the bridge of the connection.
|
DOFConnection.Config.Builder |
setConnectionType(DOFConnection.Type type)
Set the type of the connection.
|
DOFConnection.Config.Builder |
setCredentials(DOFCredentials credentials)
Set the credentials of the connection.
|
DOFConnection.Config.Builder |
setDomainDiscoveryCredentials(DOFCredentials discoveryCredentials)
Set the domain discovery credentials for this connection.
|
DOFConnection.Config.Builder |
setDomains(java.util.Collection<DOFDomain.Config> domainConfigs)
Set the collection of static domains.
|
DOFConnection.Config.Builder |
setDomains(DOFDomain.Config... domainConfigs)
Set the collection of static domains.
|
DOFConnection.Config.Builder |
setMaxReceiveSilence(int maxReceiveSilence)
Set the maximum receive silence.
|
DOFConnection.Config.Builder |
setMaxSendSilence(int maxSendSilence)
Set the maximum send silence time.
|
DOFConnection.Config.Builder |
setName(java.lang.String name)
Set this connection's name to be used in logging.
|
DOFConnection.Config.Builder |
setPermissions(DOFPermissionSet perms)
Set the initial permissions of the connection.
|
DOFConnection.Config.Builder |
setPermissionsExtendAllowed(boolean isPermissionsExtendAllowed)
Set whether or not the connection is allowed to request additional permissions
from the Authentication Server aside from the initial permission set.
|
DOFConnection.Config.Builder |
setProtocolNegotiator(DOFProtocolNegotiator negotiator)
Set the protocol negotiator to use on the connection.
|
DOFConnection.Config.Builder |
setReceiveFilter(DOFOperation.Filter receiveFilter)
Set the receive filter of the connection.
|
DOFConnection.Config.Builder |
setSecurityDesire(DOF.SecurityDesire desire)
Set this connection's security desire.
|
DOFConnection.Config.Builder |
setSendFilter(DOFOperation.Filter sendFilter)
Set the send filter of the connection.
|
DOFConnection.Config.Builder |
setStreamRequestListener(DOFConnection.StreamRequestListener listener)
Set this connection's stream-request listener.
|
DOFConnection.Config.Builder |
setTransportConfig(org.opendof.core.transport.ConnectionConfig config)
Set the transport configuration associated with the connection.
|
DOFConnection.Config.Builder |
setTrustedDomains(java.util.Collection<DOFObjectID.Domain> domains)
Set the collection of trusted domains.
|
DOFConnection.Config.Builder |
setTrustedDomains(DOFObjectID.Domain... domains)
Set the collection of trusted domains.
|
DOFConnection.Config.Builder |
setTunnelDomains(boolean isTunnelDomains)
Set whether or not the connection is allowed to tunnel remote domains.
|
public Builder(DOFConnection.Config config)
newConfig = new DOFConnection.Config.Builder(config)
.setConnectionType(DOFConnection.Type.STREAM)
.build();
Note that the name is not copied. Users must decide whether to set the name or not.config
- The existing configuration. Must not be null.setName(String)
public Builder(DOFConnection.State state)
state
- The connection state to use for builder initial state. Must not be null.setName(java.lang.String)
public Builder(DOFConnection.Type type, DOFAddress target)
type
- The type of connection to build. Must not be null.target
- The address to connect to. Must not be null.public DOFConnection.Config.Builder setConnectionType(DOFConnection.Type type)
type
- The type of the connection. Must not be null.public DOFConnection.Config.Builder setAddress(DOFAddress target)
target
- The target address of the connection. Must not be null.public DOFConnection.Config.Builder setPermissions(DOFPermissionSet perms)
perms
- The initial permissions of the connection. If all of these permissions
cannot be obtained, the connection will fail. null
means default.public DOFConnection.Config.Builder setPermissionsExtendAllowed(boolean isPermissionsExtendAllowed)
isPermissionsExtendAllowed
- Whether or not the connection is allowed to request additional permissions.public DOFConnection.Config.Builder setTunnelDomains(boolean isTunnelDomains)
isTunnelDomains
- Whether or not the connection is allowed to tunnel remote domains.public DOFConnection.Config.Builder setMaxSendSilence(int maxSendSilence)
DOFConnection.Config.DEFAULT_MAX_SEND_SILENCE
or
DOFConnection.Config.DEFAULT_HUB_POINT_MAX_SEND_SILENCE
, depending on the
DOFConnection.Type
.
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.
This does not apply to connections of type DOFConnection.Type.GROUP
or DOFConnection.Type.HUB
.maxSendSilence
- The maximum send silence in milliseconds. Must be greater than 0.setMaxReceiveSilence(int)
public DOFConnection.Config.Builder setMaxReceiveSilence(int maxReceiveSilence)
DOFConnection.Config.DEFAULT_MAX_RECEIVE_SILENCE
or
DOFConnection.Config.DEFAULT_HUB_POINT_MAX_RECEIVE_SILENCE
, depending on the
DOFConnection.Type
.
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.
This does not apply to connections of type DOFConnection.Type.GROUP
or DOFConnection.Type.POINT
.maxReceiveSilence
- The maximum receive silence in milliseconds. Must be greater than zero.setMaxSendSilence(int)
public DOFConnection.Config.Builder setCredentials(DOFCredentials credentials)
credentials
- The credentials for this connection.public DOFConnection.Config.Builder addDomains(DOFDomain.Config... domainConfigs)
domainConfigs
- The domains to be authorized. Must not be null. Must not contain nulls.public DOFConnection.Config.Builder addDomains(java.util.Collection<DOFDomain.Config> domainConfigs)
domainConfigs
- The domains to be authorized. Must not be null. Must not contain nulls.public DOFConnection.Config.Builder addDomain(DOFDomain.Config domainConfig)
domainConfig
- The domain to be authorized. Must not be null.public DOFConnection.Config.Builder setDomains(java.util.Collection<DOFDomain.Config> domainConfigs)
addDomains(org.opendof.core.oal.DOFDomain.Config...)
.
If these static routes fail to refresh, then the connection closes.domainConfigs
- The domains to authorize. Null will be treated as an empty collection. Must not contain nulls.public DOFConnection.Config.Builder setDomains(DOFDomain.Config... domainConfigs)
addDomains(org.opendof.core.oal.DOFDomain.Config...)
.
If these static routes fail to refresh, then the connection closes.domainConfigs
- The domains. Must not be null. Must not contain nulls.public DOFConnection.Config.Builder setDomainDiscoveryCredentials(DOFCredentials discoveryCredentials)
discoveryCredentials
- The domain discovery credentials to use. null
means none (default).public DOFConnection.Config.Builder addTrustedDomains(DOFObjectID.Domain... domains)
domains
- The domain identifiers for the domains to use for routing purposes. Must not be null.public DOFConnection.Config.Builder addTrustedDomains(java.util.Collection<DOFObjectID.Domain> domains)
domains
- The domain identifiers to use for routing purposes. Must not be null. Must not contain nulls.public DOFConnection.Config.Builder setTrustedDomains(java.util.Collection<DOFObjectID.Domain> domains)
addTrustedDomains(org.opendof.core.oal.DOFObjectID.Domain...)
.domains
- The trusted domains. Null will be treated as an empty collection. Must not contain nulls.public DOFConnection.Config.Builder setTrustedDomains(DOFObjectID.Domain... domains)
addTrustedDomains(org.opendof.core.oal.DOFObjectID.Domain...)
.domains
- The trusted domains. Must not be null. Must not contain nulls.public DOFConnection.Config.Builder setProtocolNegotiator(DOFProtocolNegotiator negotiator)
DOFProtocolNegotiator.createDefault()
.negotiator
- The protocol negotiator to use on the connection. null
means default.public DOFConnection.Config.Builder setSecurityDesire(DOF.SecurityDesire desire)
desire
- The desire to set on this connection. null
means default. If DOFConnection.Type is DATAGRAM_STATELESS, this cannot be secure.public DOFConnection.Config.Builder setBridge(DOFOperation.Bridge.Config bridge)
bridge
- The bridge for this connection. null
means none (default).public DOFConnection.Config.Builder setSendFilter(DOFOperation.Filter sendFilter)
sendFilter
- The connection's send filter. null
means none.public DOFConnection.Config.Builder setReceiveFilter(DOFOperation.Filter receiveFilter)
receiveFilter
- The connection's receive filter. null
means none.public DOFConnection.Config.Builder setTransportConfig(org.opendof.core.transport.ConnectionConfig config)
config
- The transport configuration associated with the connection. null
means none(default).public DOFConnection.Config.Builder setName(java.lang.String name)
name
- The connection's name.public DOFConnection.Config.Builder setAuditorListener(DOFAuditListener auditListener)
auditListener
- The connection's audit listener. null
means none (default).public DOFConnection.Config.Builder setStreamRequestListener(DOFConnection.StreamRequestListener listener)
listener
- The connection's stream-request listener. Pass null to clear the listener.public DOFConnection.Config build()