public static final class DOFConnection.Config.BuilderGroup
extends java.lang.Object
DOFConnection.Type.GROUP
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 |
---|
BuilderGroup(DOFGroupAddress groupAddress,
DOFCredentials credentials)
Construct a new builder based on a group address and credentials.
|
Modifier and Type | Method and Description |
---|---|
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 ucastAddress,
DOFAddress mcastAddress)
This is a convenience method for creating the connection with the implied
DOFConnection.Config . |
DOFConnection.Config.BuilderGroup |
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.BuilderGroup |
setMulticastAddress(DOFAddress mcastAddress)
Set the multicastAddress to be used by
createConnection(DOF) . |
T |
setName(java.lang.String name)
Set this connection's name to be used in logging.
|
DOFConnection.Config.BuilderGroup |
setPermissions(DOFPermissionSet perms)
Set the initial permissions of the connection.
|
DOFConnection.Config.BuilderGroup |
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.BuilderGroup |
setProtocolNegotiator(DOFProtocolNegotiator negotiator)
Set the protocol negotiator to use on the connection.
|
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.
|
T |
setTunnelDomains(boolean isTunnelDomains)
Set whether or not the connection is allowed to tunnel remote domains.
|
DOFConnection.Config.BuilderGroup |
setUnicastAddress(DOFAddress ucastAddress)
Set the unicastAddress to be used by
createConnection(DOF) . |
public BuilderGroup(DOFGroupAddress groupAddress, DOFCredentials credentials)
groupAddress
- The address to connect to. Must not be null.credentials
- The credentials for this connection.public DOFConnection.Config.BuilderGroup setAddress(DOFGroupAddress groupAddress)
groupAddress
- The target address of the connection. Must not be null.public DOFConnection.Config.BuilderGroup 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.BuilderGroup setPermissionsExtendAllowed(boolean isPermissionsExtendAllowed)
isPermissionsExtendAllowed
- Whether or not the connection is allowed to request additional permissions.public DOFConnection.Config.BuilderGroup setProtocolNegotiator(DOFProtocolNegotiator negotiator)
DOFProtocolNegotiator.createDefault()
.negotiator
- The protocol negotiator to use on the connection. null
means default.public DOFConnection.Config.BuilderGroup setUnicastAddress(DOFAddress ucastAddress)
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 ucastAddress and mcastAddress
parameters you will need to call createConnection. If that is not your use case, then just call createConnection(DOF, DOFAddress, DOFAddress)
.ucastAddress
- The unicastAddress.createConnection(DOF)
public DOFConnection.Config.BuilderGroup setMulticastAddress(DOFAddress mcastAddress)
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 ucastAddress and mcastAddress
parameters you will need to call createConnection. If that is not your use case, then just call createConnection(DOF, DOFAddress, DOFAddress)
.mcastAddress
- The multicastAddress.createConnection(DOF)
public DOFConnection createConnection(DOF dof)
DOFConnection.Config
.
The unicastAddress and multicastAddress must have been previously set explicitly with setUnicastAddress(org.opendof.core.oal.DOFAddress)
and setMulticastAddress(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 ucastAddress and mcastAddress
parameters you will need to call createConnection(DOF, DOFAddress, DOFAddress)
. If that is not your use case, then just call
createConnection(DOF, DOFAddress, DOFAddress) or the 2 setters.dof
- The DOF to use to create the connection.setUnicastAddress(DOFAddress)
,
setMulticastAddress(DOFAddress)
public DOFConnection createConnection(DOF dof, DOFAddress ucastAddress, DOFAddress mcastAddress)
DOFConnection.Config
.dof
- The DOF to use to create the connection.ucastAddress
- The address of the base unicast-DATAGRAM server. Usually, you will use this: InetTransport.createAddress("0.0.0.0", 0)
mcastAddress
- The address of the related multicast-DATAGRAM server. Usually, you will use this: InetTransport.createAddress(InetTransport.DEFAULT_MULTICAST_ADDRESS_IPV4, InetTransport.DEFAULT_MULTICAST_PORT);
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()