SIFWorks ADK 2.0
Agent Class
NamespacesEdustructures.SifWorksAgent

[This is preliminary documentation and is subject to change.]

The base class for a SIF Agent. Derive your own class from this one and pass the SourceId to the superclass constructor. Call the initialize method to initialize the agent prior to use.
Declaration Syntax
C#Visual BasicVisual C++
public class Agent
Public Class Agent
public ref class Agent
Members
All MembersConstructorsMethodsPropertiesFields



IconMemberDescription
AgentAgentNew(String)
Constructor

AddMessagingListener(IMessagingListener)
Register a MessagingListener to listen to messages received by the message handlers of this class. NOTE: Agents may register a MessagingListener with the Agent or IZone classes. When a listener is registered with both classes, it will be called twice. Consequently, it is recommended that most implementations choose to register MessagingListeners with only one of these classes depending on whether the agent is interested in receiving global notifications or notifications on only a subset of zones.

DefaultHttpProperties
Convenience method to get the default HTTP transport properties

DefaultHttpsProperties
Convenience method to get the default HTTPS transport properties

DefaultZoneProperties
Gets the default properties for Zones created by the IZoneFactory.

ErrorHandler
Gets or sets the IUndeliverableMessageHandler to be called when a dispatching error occurs on a zone but no handler is registered with that zone.

GetDefaultTransportProperties(String)
Gets the default properties for a transport protocol. Each transport protocol supported by the Adk is represented by a class that implements the Transport interface. Transports are identified by a string such as "http" or "https". Like Zones, each Transport instance is associated with a set of properties specific to the transport protocol. Such properties may include IP address, port, SSL security attributes, and so on. The default properties for a given transport protocol may be obtained by calling this method.

static memberGetLog()()
Gets the root logging Category for this agent.

static memberGetLog(IZone)
Gets the logging framework Category for a specific zone.

GetPublisher(IElementDef)
Gets the global IPublisher message handler registered with the Agent for the specified SIF object type.

GetQueryResults(IElementDef)
Gets the global IQueryResults message handler registered with the Agent for the specified SIF object type.

static memberGetServerLog()()
Gets the agent-global ServerLog instance. Agents that wish to customize server-side logging may call this method to obtain the global Agent ServerLog instance. Call any of the following methods to set up the chain of loggers that will be inherited by all Zones:
  • addLogger
  • removeLogger
  • clearLoggers
  • getLoggers
Unlike client-side logging, server logging requires a connection to a IZone Integration Server. Because the current SIF 1.x infrastructure does not allow connections to servers independent of a zone, the logging methods of ServerLog are useful only when called within the context of a zone. Therefore, calling any of the logging methods on the ServerLog instance returned by this method will result in an IllegalStateException. This method is provided only to set up the ServerLog logger chain at the global Agent level.

static memberGetServerLog(IZone)
Gets the ServerLog for a specific zone. This form of getServerLog is provided for consistency with the getLog method. Note you may also call the IZone.getServerLog method directly to obtain a ServerLog for for a zone.

GetSubscriber(IElementDef)
Gets the global ISubscriber message handler registered with the Agent for the specified SIF object type.

HomeDir
Gets the agent's home directory. By default, the home directory is the directory the agent was started from (if defined, the "adk.home" System property overrides this value.) You may override this method to return a home directory specific to your product's installation directory structure. The Agent Runtime creates all work directories and files relative to the home directory. In some cases the Class Framework creates workspaces even when the Agent Runtime is not enabled.

Id
Gets or sets the agent's SourceId

Initialize()()
Initialize the agent. An application must call this method to initialize the class framework and runtime. No other methods can be called until the agent has been successfully initialized. When the agent exits it is important that the shutdown method be called to safely release the resources allocated by the runtime. If an application overrides this method, it should call the superclass implementation after performing its own initialization.

Initialized
Determines if the agent has been initialized

IsShutdown
Determines if the agent has been shutdown.

IZoneFactory
Gets the IZoneFactory for this agent. The IZoneFactory is used to create IZone instances to represent logical SIF zones. An application can also call IZoneFactory methods to enumerate the Zones that have been created.

static memberLOG_IDENTIFIER
The Identifier that is used to identify the ADK itself for logging operations ("ADK")

static memberMakeGUID()()
Utility method to generate a GUID for SIF Data Objects and messages

MessagingListeners
Return a list of all MessagingListeners registered with the agent

Name
Gets or sets the descriptive name of the SIF Agent.

Properties
Gets the properties for this agent. The agent properties serve as defaults for new IZone objects created by the IZoneFactory. Properties may be customized on a zone-by-zone basis. If a property is not specified for a given zone, its value is inherited from the AgentProperties object returned by this method. Note this method returns the same object as getDefaultZoneProperties. Agent properties should be set prior to calling the Agent.initialize method.

PurgeQueue(Boolean, Boolean)
RemoveMessagingListener(IMessagingListener)
Remove a MessagingListener previously registered with the addMessagingListener method.

ReportPublisher
Gets or sets the global ReportPublisher message handler registered with the Agent.

SetPublisher(IPublisher)
Register a global IPublisher message handler with this agent for all SIF object types. Note agents typically register message handlers with Topics or with Zones instead of with the Agent. The message dispatcher first delivers messages to Topics, then to Zones, and finally to the Agent itself. In order to receive SIF_Request messages, the agent is expected to be registered as a Provider of one or more object types in at least one zone. This method does not send SIF_Provide messages to any zones.

SetPublisher(IPublisher, IElementDef)
Register a global IPublisher message handler with the agent for the specified SIF object type. Note agents typically register message handlers with Topics or with Zones instead of with the Agent. The message dispatcher first delivers messages to Topics, then to Zones, and finally to the Agent itself. In order to receive SIF_Request messages, the agent is expected to be registered as a Provider of one or more object types in at least one zone. This method does not send SIF_Provide messages to any zones.

SetQueryResults(IQueryResults)
Register a global IQueryResults message handler with this agent for all SIF object types. Note agents typically register message handlers with Topics or with Zones instead of with the Agent. The message dispatcher first delivers messages to Topics, then to Zones, and finally to the Agent itself.

SetQueryResults(IQueryResults, IElementDef)
Register a global IQueryResults message handler object with this agent for the specified SIF object type. Note agents typically register message handlers with Topics or with Zones instead of with the Agent. The message dispatcher first delivers messages to Topics, then to Zones, and finally to the Agent itself.

SetSubscriber(ISubscriber)
Register a global ISubscriber message handler with the agent for all SIF object types. Note agents typically register message handlers with Topics or with Zones instead of with the Agent. The message dispatcher first delivers messages to Topics, then to Zones, and finally to the Agent itself. In order to receive SIF_Event messages, the agent is expected to be registered as a ISubscriber of one or more object types in at least one zone. This method does not send SIF_Subscribe messages to any zones.

SetSubscriber(ISubscriber, IElementDef)
Register a global ISubscriber message handler with this agent for the specified SIF object type. Note agents typically register message handlers with Topics or with Zones instead of with the Agent. The message dispatcher first delivers messages to Topics, then to Zones, and finally to the Agent itself. In order to receive SIF_Event messages, the agent is expected to be registered as a ISubscriber of one or more object types in at least one zone. This method does not send SIF_Subscribe messages to any zones.

Shutdown()()
Shutdown the agent. This method should always be called before the application ends. It closes resources held by the class framework and runtime. Calling this form of shutdown does not send any provisioning messages.

Shutdown(ProvisioningFlags)
Shutdown the agent. This method should always be called before the application ends. It closes resources held by the Adk Class Framework and Adk Agent Runtime. Provisioning messages are sent as follows:
  • If the agent is using Adk-managed provisioning, a < SIF_Unregister> message is sent to each zone to which the agent is connected if the AdkFlags.PROV_UNREGISTER flag is specified. <SIF_Unsubscribe> and <SIF_Unprovide> messages are sent to each zone joined to a Topic when the AdkFlags.PROV_UNSUBSCRIBE and AdkFlags.PROV_UNPROVIDE flags are specified, respectively. When Adk-managed provisioning is disabled, no provisioning messages are sent to zones.
  • If Agent-managed provisioning is enabled, the ProvisioningOptions flags have no affect. The agent must explicitly call the IZone.sifUnregister, IZone.sifUnsubscribe, and IZone.sifUnprovide methods to manually send those messages to each zone.
  • If ZIS-managed provisioning is enabled, no provisioning messages are sent by the agent regardless of the ProvisioningOptions used and the methods are called.

Sleep()()
Puts all connected zones into sleep mode. For each zone in the connected state, a SIF_Sleep message is sent to the IZone Integration Server to request that this agent's queue be put into sleep mode for that zone. If successful, the ZIS should not deliver further messages to this agent until it is receives a SIF_Register or SIF_Wakeup message from the agent. Note the Adk keeps an internal sleep flag for each zone, which is initialized when the connect method is called by sending a SIF_Ping to the ZIS. This flag is set so that the Adk will return a Status Code 8 ("Receiver is sleeping") in response to any message received by the ZIS for the duration of the session.

TopicFactory
Gets the ITopicFactory for this agent. The ITopicFactory is used to create Topic instances to aggregate publish and subscribe activity for a given type of SIF data object across one or more zones. An application can also call ITopicFactory methods to enumerate the Topics that have been created.

Wakeup()()
Wakes up all connected zones if currently in sleep mode. For each connected zone, a SIF_Wakeup message is sent to the IZone Integration Server to request that sleep mode be removed from this agent's queue for that zone. Note the Adk keeps an internal sleep flag for each zone, which is initialized when the connect method is called by sending a SIF_Ping to the ZIS. This flag is cleared so that the Adk will no longer return a Status Code 8 ("Receiver is sleeping") in response to messages received by the ZIS.

WorkDir
ZoneFactory
Gets the ZoneFactory for this agent. The ZoneFactory is used to create Zone instances to represent logical SIF zones. An application can also call ZoneFactory methods to enumerate the Zones that have been created.

Inheritance Hierarchy
Object
Agent

Assembly: Edustructures.SifWorks.Adk (Module: Edustructures.SifWorks.Adk) Version: 2.0.0.10