This class enables you to customize the configuration of a DOF.
Inheritance Hierarchy
org.opendof.core.oalDOFConfigBuilder
Namespace: org.opendof.core.oal
Assembly: dof-oal (in dof-oal.dll) Version: 7.0.1.2
Syntax
C#
public sealed class Builder
The DOFConfigBuilder type exposes the following members.
Constructors
Name | Description | |
---|---|---|
![]() | DOFConfigBuilder | Constructs a Builder with configuration parameters set to their defaults.
|
![]() | DOFConfigBuilder(DOFConfig) |
Copies configuration parameters from a
Config
and constructs a Builder with the same initial configuration
parameters.
Because each DOF must have a unique name and a unique source identifier, they are reset to null. You can set a
new name using
setName(string)
and a new source identifier using
setSourceID(Source)
. If you leave the name or sourceID value at null,
a unique name or source identifier will be randomly generated when a DOF is created from the new DOF.Config.
|
![]() | DOFConfigBuilder(DOFState) |
Copies configuration parameters from a
State
and constructs a Builder with the same initial configuration
parameters.
Because each DOF must have a unique name and a unique source identifier, they are reset to null. You can set a
new name using
setName(string)
and a new source identifier using
setSourceID(Source)
. If you leave the name or sourceID value at null,
a unique name or source identifier will be randomly generated when a DOF is created from the new DOF.Config.
|
Methods
Name | Description | |
---|---|---|
![]() | build |
Builds a
Config
object based on the parameters set in this Builder.
|
![]() | Equals | (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | setConnectionLimit | Sets the maximum number of simultaneous connections, both inbound and outbound, that a DOF can support.
|
![]() | setName | Sets the name that will be used to identify a DOF in logging. |
![]() | setParameterValidation |
Sets whether the DOF validates
DOFValue
objects to verify that their associated
DOFType
matches the type required for an interface item. The default is true. If you set validation to false, the
library will bypass its normal type checking, so you should ensure that the application is using valid types.
|
![]() | setProtocolFactory |
Sets the
DOFProtocolFactory
. Defining and using protocol factories is a very advanced
use case. You should not change the default value for this parameter without a detailed knowledge
of DOF protocol specifications.
|
![]() | setRank | Sets the node's desire to manage a secure multicast group. |
![]() | setRouter | Sets whether a DOF will route operations other than those it directly requests or provides.
|
![]() | setSourceID | Sets the identifier that is used for a DOF's operations in the unsecured domain.
|
![]() | setThreadPoolSize | Sets the maximum number of threads that a DOF can create to process operations.
|
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
Remarks
final DOF.Config config = new DOF.Config.Builder() .setRouter(true) .build(); DOF dof = new DOF(config);The following are the default configuration parameters:
- Unlimited connections. Use setConnectionLimit(int) to set a different value.
- Config.DEFAULT_THREADPOOL_SIZE . Use setThreadPoolSize(short) to set a different value.
- The default for the name is null. This means a name will be randomly generated (following the pattern dof1, dof2, and so on) when a DOF is created from the DOF.Config. Use setName(string) to set a different value.
- The default for the source identifier is null. This means a GUID will be randomly generated and used as an identifier when a DOF is created from the DOF.Config. Use setSourceID(Source) to set a different value.
- Config.DEFAULT_RANK . Use setRank(short) to set a different value.
- By default, the DOF validates DOFValues to ensure they match required types. Use setParameterValidation(bool) to disable validation.
- By default, the DOF is not set to be a router. Use setRouter(bool) to set routing to true.
- DefaultProtocolFactory . Use setProtocolFactory(DOFProtocolFactory) to set a different protocol factory.
See Also