public static final class DOFConnection.Config.BuilderPoint
extends java.lang.Object
DOFConnection.Type.POINT
connection configurations.
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 |
---|
BuilderPoint(DOFGroupAddress groupAddress,
DOFCredentials credentials)
Construct a new builder based on an address an credentials.
|
Modifier and Type | Method and Description |
---|---|
DOFConnection.Config.BuilderPoint |
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.BuilderPoint |
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.BuilderPoint |
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.BuilderPoint |
addTrustedDomains(java.util.Collection<DOFObjectID.Domain> domains)
Add in a configured TRP route without credentials.
|
DOFConnection.Config.BuilderPoint |
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 |
createConnection(DOF dof)
This is a convenience method for creating the connection with the implied
DOFConnection.Config . |
DOFConnection |
createConnection(DOF dof,
DOFAddress hubAddress)
This is a convenience method for creating the connection with the implied
DOFConnection.Config . |
DOFConnection.Config.BuilderPoint |
setAddress(DOFGroupAddress groupAddress)
Set the target address of the connection.
|
T |
setAuditorListener(DOFAuditListener auditListener)
Set this connection's audit listener.
|
T |
setBridge(DOFOperation.Bridge.Config bridge)
Set the bridge of the connection.
|
T |
setCredentials(DOFCredentials credentials)
Set the credentials of the connection.
|
DOFConnection.Config.BuilderPoint |
setDomainDiscoveryCredentials(DOFCredentials discoveryCredentials)
Set the domain discovery credentials for this connection.
|
DOFConnection.Config.BuilderPoint |
setDomains(java.util.Collection<DOFDomain.Config> domainConfigs)
Set the collection of static domains.
|
DOFConnection.Config.BuilderPoint |
setDomains(DOFDomain.Config... domainConfigs)
Set the collection of static domains.
|
DOFConnection.Config.BuilderPoint |
setHubAddress(DOFAddress hubAddress)
Set the hubAddress to be used by
createConnection(DOF) . |
DOFConnection.Config.BuilderPoint |
setMaxSendSilence(int maxSendSilence)
Set the maximum send silence time.
|
T |
setName(java.lang.String name)
Set this connection's name to be used in logging.
|
DOFConnection.Config.BuilderPoint |
setPermissions(DOFPermissionSet perms)
Set the initial permissions of the connection.
|
DOFConnection.Config.BuilderPoint |
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.
|
T |
setReceiveFilter(DOFOperation.Filter receiveFilter)
Set the receive filter of the connection.
|
T |
setSendFilter(DOFOperation.Filter sendFilter)
Set the send filter of the connection.
|
T |
setStreamRequestListener(DOFConnection.StreamRequestListener listener)
Set this connection's stream-request listener.
|
T |
setTransportConfig(org.opendof.core.transport.ConnectionConfig config)
Set the transport configuration associated with the connection.
|
DOFConnection.Config.BuilderPoint |
setTrustedDomains(java.util.Collection<DOFObjectID.Domain> domains)
Set the collection of trusted domains.
|
DOFConnection.Config.BuilderPoint |
setTrustedDomains(DOFObjectID.Domain... domains)
Set the collection of trusted domains.
|
T |
setTunnelDomains(boolean isTunnelDomains)
Set whether or not the connection is allowed to tunnel remote domains.
|
public BuilderPoint(DOFGroupAddress groupAddress, DOFCredentials credentials)
groupAddress
- The address to connect to. Must not be null.credentials
- The credentials for this connection.public DOFConnection.Config.BuilderPoint setAddress(DOFGroupAddress groupAddress)
groupAddress
- The target address of the connection. Must not be null.public DOFConnection.Config.BuilderPoint 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.BuilderPoint setPermissionsExtendAllowed(boolean isPermissionsExtendAllowed)
isPermissionsExtendAllowed
- Whether or not the connection is allowed to request additional permissions.public DOFConnection.Config.BuilderPoint setMaxSendSilence(int maxSendSilence)
DOFConnection.Config.DEFAULT_HUB_POINT_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.
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.public DOFConnection.Config.BuilderPoint addDomain(DOFDomain.Config domainConfig)
domainConfig
- The domain to be authorized. Must not be null.public DOFConnection.Config.BuilderPoint addDomains(java.util.Collection<DOFDomain.Config> domainConfigs)
domainConfigs
- The domains to be authorized. Must not be null. Must not contain nulls.public DOFConnection.Config.BuilderPoint addDomains(DOFDomain.Config... domainConfigs)
domainConfigs
- The domains to be authorized. Must not be null. Must not contain nulls.public DOFConnection.Config.BuilderPoint addTrustedDomains(DOFObjectID.Domain... domains)
domains
- The domain identifiers for the domains to use for routing purposes. Must not be null.public DOFConnection.Config.BuilderPoint addTrustedDomains(java.util.Collection<DOFObjectID.Domain> domains)
domains
- The domain identifiers to use for routing purposes.public DOFConnection.Config.BuilderPoint setDomains(java.util.Collection<DOFDomain.Config> domainConfigs)
addDomains(java.util.Collection<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.BuilderPoint setDomains(DOFDomain.Config... domainConfigs)
addDomains(java.util.Collection<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.BuilderPoint setDomainDiscoveryCredentials(DOFCredentials discoveryCredentials)
discoveryCredentials
- The domain discovery credentials to use. null
means none (default).public DOFConnection.Config.BuilderPoint 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.BuilderPoint 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.BuilderPoint setHubAddress(DOFAddress hubAddress)
createConnection(DOF)
. This is a convenience so that you don't have to keep the address
around until createConnection is called. The default is null, so if this method is not called, createConnection(DOF) will throw
IllegalArgumentException.
This method is only useful if you plan on calling createConnection much later and don't want to pass around the hubAddress
parameter you will need to call createConnection. If that is not your use case, then just call createConnection(DOF, DOFAddress)
.hubAddress
- The hubAddress.createConnection(DOF)
public DOFConnection createConnection(DOF dof)
DOFConnection.Config
.
The hubAddress must have been set explicitly with setHubAddress(org.opendof.core.oal.DOFAddress)
.
This method signature is only useful if you plan on calling it much later than the constructor and don't want to pass around the hubAddress
parameter you will need to call createConnection(DOF, DOFAddress)
. If that is not your use case, then just call
createConnection(DOF, DOFAddress) or the setter.dof
- The DOF to use to create the connection.setHubAddress(DOFAddress)
public DOFConnection createConnection(DOF dof, DOFAddress hubAddress)
DOFConnection.Config
.dof
- The DOF to use to create the connection.hubAddress
- The server address of the hub. Usually, you will use this: InetTransport.createAddress(hubAddr, hubPort)
public T setTunnelDomains(boolean isTunnelDomains)
isTunnelDomains
- Whether or not the connection is allowed to tunnel remote domains.public T setCredentials(DOFCredentials credentials)
credentials
- The credentials for this connection.public T setBridge(DOFOperation.Bridge.Config bridge)
bridge
- The bridge for this connection. null
means none (default).public T setSendFilter(DOFOperation.Filter sendFilter)
sendFilter
- The connection's send filter. null
means none.public T setReceiveFilter(DOFOperation.Filter receiveFilter)
receiveFilter
- The connection's receive filter. null
means none.public T setTransportConfig(org.opendof.core.transport.ConnectionConfig config)
config
- The transport configuration associated with the connection. null
means none(default).public T setName(java.lang.String name)
name
- The connection's name.public T setAuditorListener(DOFAuditListener auditListener)
auditListener
- The connection's audit listener. null
means none (default).public T setStreamRequestListener(DOFConnection.StreamRequestListener listener)
listener
- The connection's stream-request listener. Pass null to clear the listener.public DOFConnection.Config build()