com.edustructures.sifworks
Interface TopicFactory


public interface TopicFactory

Creates Topic objects and provides access to the topics that have been created during this session of the agent.

Agents exchange data with SIF zones via Zone and Topic objects, which can be obtained with the ZoneFactory and TopicFactory classes. These factories are available by calling the Agent.getZoneFactory and Agent.getTopicFactory methods.

Topics are used to aggregate publish, subscribe, and query activity from multiple zones. An Agent may have only one Topic instance per SIF Data Object type (e.g. "StudentPersonal", "BusInfo", or "LibraryPatronStatus"), but a Topic can be joined with any number of Zones.

Topic instances are returned by calling the getInstance method, which returns the same Topic object for a given object type. Topic instances are cached by the factory. getAllTopics returns all topics in the cache. A Topic remains in the cache for as long as the agent is running.

Version:
ADK 1.0

Method Summary
 java.util.Collection<SIFContext> getAllSupportedContexts()
          Gets all SIF Contexts that have topics created for them
 java.util.Collection<Topic> getAllTopics(SIFContext context)
          Gets all Topic instances in the factory cache for the specified context
 Topic getInstance(ElementDef objectType)
          Gets a Topic instance within the default SIF Context for a SIF object type.
 Topic getInstance(ElementDef objectType, SIFContext context)
          Gets a Topic instance for a SIF object type.
 Topic lookupInstance(ElementDef objectType, SIFContext context)
          Looks up an existing Topic withing the given SIFContext for the given object type.
 

Method Detail

getInstance

Topic getInstance(ElementDef objectType)
Gets a Topic instance within the default SIF Context for a SIF object type. If the Topic does not exist, it is created

Parameters:
objectType - The ElementDef identifying a top-level SIF Data Object defined by the SIFDTD class (e.g. ADK.DTD().STUDENTPERSONAL)
Returns:
A new or cached Topic instance
Throws:
java.lang.IllegalArgumentException - is thrown if the object type is not a root-level object for the version of SIF in use by the agent

getInstance

Topic getInstance(ElementDef objectType,
                  SIFContext context)
Gets a Topic instance for a SIF object type. If the Topic does not exist, it is created

Parameters:
objectType - The ElementDef identifying a top-level SIF Data Object defined by the SIFDTD class (e.g. ADK.DTD().STUDENTPERSONAL)
context - Lookup a Topic instance for the given SIF Context
Returns:
A new or cached Topic instance
Throws:
java.lang.IllegalArgumentException - is thrown if the object type is not a root-level object for the version of SIF in use by the agent

lookupInstance

Topic lookupInstance(ElementDef objectType,
                     SIFContext context)
Looks up an existing Topic withing the given SIFContext for the given object type. If the topic does not exist, null is returned

Parameters:
objectType - The ElementDef identifying the top-level SIF Data Object
context - The SIF Context to look in
Returns:
A Topic instance for the specified object type and SIFContext

getAllTopics

java.util.Collection<Topic> getAllTopics(SIFContext context)
Gets all Topic instances in the factory cache for the specified context

Parameters:
context - A SIFContext to return all topics for
Returns:
an array of Topics

getAllSupportedContexts

java.util.Collection<SIFContext> getAllSupportedContexts()
Gets all SIF Contexts that have topics created for them

Returns:
A collection of SIFContext instances that have topics joined to them


Copyright © 2001-2007 Edustructures LLC. All Rights Reserved. SIFWorks® and ADK® are registered trademarks of Edustructures LLC. SIF™ and Schools Interoperability Framework are trademarks of the Schools Interoperability Framework Association.