DOF ClassOpenDOF Object Access Library
The DOF class represents a DOF networking node.
Inheritance Hierarchy

SystemObject
  org.opendof.core.oalDOF

Namespace: org.opendof.core.oal
Assembly: dof-oal (in dof-oal.dll) Version: 7.0.1.2
Syntax

C#
public sealed class DOF

The DOF type exposes the following members.

Constructors

  NameDescription
Public methodDOF
Creates a DOF instance with a default config.
Public methodDOF(DOFConfig)
Creates a DOF instance that uses the specified configuration.
Top
Methods

  NameDescription
Public methodaddDomainListener
Adds a DomainListener to the DOF, which is used to monitor the DOF's known security domains.
Public methodaddInterestListener
Adds a InterestListener to the DOF. Interest listeners are used by nodes (usually providers or proxies) that want to monitor all interest requests.
Public methodaddPermissionListener
Add a PermissionListener to the DOF, which will be notified of permission grants and denials.
Public methodaddUncaughtExceptionListener
Adds a UncaughtExceptionListener to the DOF. Uncaught exception listeners are called when an application callback throws an exception. This can be a System.Exception or an System.Exception .
Public methodcancelAllOperations
Cancels all outstanding operations sourced by this DOF.
Public methodclose
Forces a connection to close.
Public methodcreateAuthenticator
Creates a DOFAuthenticator that uses the specified configuration. The DOFAuthenticator class must be implemented on nodes that need to perform as Authentication Servers. All secure domains must have at least one Authentication Server.

Each authenticator created must be destroyed when it is no longer needed. See DOFAuthenticator.destroy() and destroy() .

Public methodcreateConnection
Creates a DOFConnection that uses the specified configuration. The connection is associated with the DOF instance that creates it, and only that DOF can route operations through it (see DOF).

This method may be used to create the following types of connections:

  • Type.STREAM
  • Type.DATAGRAM
  • Type.DATAGRAM_STATELESS
This method may not be used to create the following types of connections:
  • Type.GROUP . Use DOFServer.createConnection(Config) .
  • Type.HUB . Use DOFServer.createConnection(Config) .
  • Type.POINT . Use DOFConnection.createConnection(Config)
For more information about these connection types, see Type .

Connections do not connect automatically when created. After creating the connection, call DOFConnection.connect(int) or DOFConnection.beginConnect(int) . To disconnect temporarily, call DOFConnection.disconnect() . Disconnected connections can be reconnected using DOFConnection.connect or DOFConnection.beginConnect. When the DOFConnection instance is no longer needed, it must be destroyed. See DOFConnection.destroy() and destroy() . Destroyed connections cannot be reconnected.

The internal library tracks references to duplicate connections, so this method can safely be called multiple times with the same configuration without consuming extra resources. Such duplicate connections are frequently needed, especially by nodes that create connections dynamically in response to other method calls.

Public methodcreateDomain
Creates a DOFDomain that uses the specified configuration. The DOFDomain can be used to monitor connectivity to a secure domain's Authentication Server.

The internal library tracks references to duplicate domains, so this method can safely be called multiple times with the same configuration without consuming extra resources. Multiple references to a DOFDomain can easily occur, because the library automatically creates DOFDomain instances when you pass a DOFDomain.Config in the following methods:

  • Builder.addDomain(Config)
  • Builder.addDomains(Config[])
  • DOFConnection.addDomain(Config)
  • Builder.addDomain(Config)
  • Builder.addDomains(Config[])
Each domain created must be destroyed when it is no longer needed. See DOFDomain.destroy() and destroy() .

Public methodcreateServer
Creates a DOFServer that uses the specified configuration. The server is associated with the DOF instance that creates it, and only that DOF can accept connections or route operations through it (see DOF).

Servers do not start automatically when created. After creating the server, call DOFServer.start(int) or DOFServer.beginStart(int) . To stop the server temporarily, call DOFServer.stop() . Stopped servers can be restarted using DOFServer.start or DOFServer.beginStart. Each DOFServer instance must be destroyed when it is no longer needed. See DOFServer.destroy() and destroy() . Destroyed servers cannot be restarted.

The internal library tracks references to duplicate servers, so this method can safely be called multiple times with the same configuration without consuming extra resources. Such duplicate servers are frequently needed, especially by nodes that create servers dynamically in response to other method calls.

This method may be used to create unicast servers, but not to create multicast servers. Use DOFServer.createServer(Config) to create multicast servers.

Public methodcreateSystem
Creates a DOFSystem that uses the default configuration. Calling this overload is identical to calling createSystem(Config, int) and passing the arguments
(null, 0)
. For a full list of DOFSystem defaults, see DOFSystem.Config.Builder.Builder(). For more information about creating systems, see createSystem(DOFSystem.Config, int).
Public methodcreateSystem(DOFSystemConfig)
Creates a DOFSystem that uses the specified configuration. You must create DOFSystem instances in order to create DOFObject instances, which are needed to perform the majority of operations DOF provides. DOFSystems are associated with the DOF instance used to create them, and only that DOF can route its operations (see DOF).

Each DOFSystem instance must be destroyed when it is no longer needed. See DOFSystem.destroy() and destroy() .

This method will return immediately, but the system may not be authorized initially.

Public methodcreateSystem(DOFSystemConfig, Int32)
Creates a DOFSystem that uses the specified configuration. You must create DOFSystem instances in order to create DOFObject instances, which are needed to perform the majority of operations DOF provides. DOFSystems are associated with the DOF instance used to create them, and only that DOF can route its operations (see DOF).

Each DOFSystem instance must be destroyed when it is no longer needed. See DOFSystem.destroy() and destroy() .

This method will block until the system is authorized or timeout expires.

Public methoddestroy
Frees resources allocated during the creation of a DOF.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodgetAuthenticator
Gets an authenticator for a specified domain.
Public methodgetAuthenticators
Gets a list of all DOFAuthenticators known to the DOF.
Public methodgetDomains
Gets a list of all domains associated with the DOF.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodgetRuntime
Gets this DOF's runtime, which contains data about the internal runtime state of the DOF.
Public methodgetState
Creates a State object, which represents a snapshot of the DOF's configuration information as it exists at the moment when you call this method. After using this method to get the snapshot, you can use the getter methods of DOF.State to retrieve specific information about the DOF's configuration, as well as some runtime information. Because the DOF's configuration information and runtime statistics may change, you should call this method again each time you want updated information.
Public methodgetSystems
Gets a list of all systems associated with the DOF.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodremoveDomainListener
Removes a DomainListener from the DOF. When the listener is removed, this method causes DomainListener.removed(DOF, DOFException) to be called.
Public methodremoveInterestListener
Removes a InterestListener . When the listener is removed, this method causes InterestListener.removed(DOF, DOFException) to be called.
Public methodremovePermissionListener
Remove a PermissionListener from the DOF. //TODO should it call a removed method?
Public methodremoveUncaughtExceptionListener
Removes a UncaughtExceptionListener . When the listener is removed, this method causes UncaughtExceptionListener.removed(DOF, DOFException) to be called.
Public methodresolve
Attempts to resolve the given credentials.
Public methodsetConnectionLimit
Changes the maximum number of simultaneous connections the DOF supports.
Public methodsetName
Changes the name of a DOF.
Public methodsetNodeDown
Notifies the network that the DOF calling this method is about to be destroyed.
Public methodsetProtocolFactory
Changes the protocol factory.
Public methodsetRank
Changes the DOF's desire to manage a secure multicast group.
Public methodsetThreadPoolSize
Changes the maximum number of threads the DOF can create.
Public methodstop
Forces a server to stop.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodupdateAuthenticator
Updates an existing DOFAuthenticator with the specified configuration.
Top
Fields

  NameDescription
Public fieldStatic memberTIMEOUT_NEVER
Specifies an infinite timeout.
Public fieldStatic memberUNLIMITED
Integer.MAX_VALUE, so that the default number of simultaneous connections the DOF allows is at its maximum setting.
Top
Remarks

The DOF class represents a DOF networking node. Every program that uses DOF requires a DOF instance. The DOF controls routing between the components that form the basis of DOF connectivity: systems ( DOFSystem ), servers ( DOFServer ), and connections ( DOFConnection ). While systems initiate and process operations, it is the DOF that determines where to route those operations (which other systems, connections, or servers associated with that DOF will receive the traffic). The DOF uses operation state, routing tables, security constraints, and similar information to make this determination.

Because each DOF represents a separate networking node, even when two DOFs reside in the same application, each is a separate logical node in the network. So for example, while security-compatible systems on the same DOF can communicate directly, systems on separate DOFs require connections and servers to communicate--even if both DOFs are in the same application.

The DOF is created using its constructor ( DOF(Config) ) and is initialized during creation. Some configuration parameters can be changed after creation to modify the behavior of an existing DOF and any objects created by it (for example, see setConnectionLimit(int) ). However, changing other configuration parameters associated with the DOF requires taking the node down, destroying the DOF, and building a new DOF with a new configuration. For information about all configuration parameters, see Builder .

The DOF is used to create: Each DOF uses several threads internally. These are started when the DOF is created.
See Also

Reference