DOFConfigBuilder ClassOpenDOF Object Access Library
This class enables you to customize the configuration of a DOF.
Inheritance Hierarchy

SystemObject
  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

  NameDescription
Public methodDOFConfigBuilder
Constructs a Builder with configuration parameters set to their defaults.
Public methodDOFConfigBuilder(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.

Public methodDOFConfigBuilder(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.

Top
Methods

  NameDescription
Public methodbuild
Builds a Config object based on the parameters set in this Builder.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodsetConnectionLimit
Sets the maximum number of simultaneous connections, both inbound and outbound, that a DOF can support.
Public methodsetName
Sets the name that will be used to identify a DOF in logging.
Public methodsetParameterValidation
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.
Public methodsetProtocolFactory
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.
Public methodsetRank
Sets the node's desire to manage a secure multicast group.
Public methodsetRouter
Sets whether a DOF will route operations other than those it directly requests or provides.
Public methodsetSourceID
Sets the identifier that is used for a DOF's operations in the unsecured domain.
Public methodsetThreadPoolSize
Sets the maximum number of threads that a DOF can create to process operations.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks

This class enables you to customize the configuration of a DOF. The default constructor for the Builder returns a Builder with all the configuration parameters for a DOF set to their defaults. You can then use the Builder methods to change the initial configuration parameters. You do not need to set any configuration parameters that you wish to leave at their default settings.

When you have finished setting configuration parameters, you use build() to create an immutable Config object that stores all the chosen settings. Pass that Config to DOF.DOF(Config) to create your customized DOF.

For example, by default DOFs cannot be proxies. To create a DOF that is capable of being a proxy node, you must set routing to true, as in the following example:

  final DOF.Config config = new DOF.Config.Builder()
            .setRouter(true)
            .build();
            DOF dof = new DOF(config);
The following are the default configuration parameters:

You can also use DOF.Config.Builder.Builder(DOF.Config) and DOF.Config.Builder.Builder(DOF.State) to create Builders whose initial configuration parameters are based on another DOF.Config or on another DOF's state, rather than on the defaults. Just as with the default Builder, you would then change any configuration parameters that need to be changed, and then build a new DOF.Config with the new settings.

See Also

Reference