com.edustructures.sifworks
Interface ZoneFactory


public interface ZoneFactory

Creates Zone objects and provides access to the Zones created by an 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.

An Agent may have one Zone object per SIF zone to which it is connected.

Zone instances are returned by calling the getInstance method. When no properties are specified for a zone, the agent's defaults are used. Default properties are returned by the Agent.getProperties method. For a explanation of the various properties that affect zones, refer to the AgentProperties class description.

The getInstance method returns the same Zone object for a given zone identifier for as long as it remains in the factory's cache. getAllZones returns all zones in the cache. A Zone remains in the cache until its disconnect method is called, at which point it is removed and can no longer be used by agent. (Calling the Zone.connect method on a disconnected zone throws an exception.) To reconnect to a zone after calling its disconnect method, obtain a fresh Zone instance from the ZoneFactory.

Version:
ADK 1.0

Method Summary
 Zone[] getAllZones()
          Gets all zones in the factory cache
 Zone getInstance(java.lang.String zoneId, java.lang.String zoneUrl)
          Gets a Zone instance with default properties
 Zone getInstance(java.lang.String zoneId, java.lang.String zoneUrl, AgentProperties props)
          Gets a Zone instance with custom properties
 Zone getZone(java.lang.String zoneId)
          Gets a Zone previously created by a call to getInstance
 void removeZone(Zone zone)
          Remove a zone from the ZoneFactory
 

Method Detail

getInstance

Zone getInstance(java.lang.String zoneId,
                 java.lang.String zoneUrl)
                 throws ADKException
Gets a Zone instance with default properties

Parameters:
zoneId - The zone identifier
zoneUrl - The URL of the Zone Integration Server that manages this zone. The format of the URL is specific to the ZIS product and the transport protocol used to communicate with the ZIS
Returns:
A new or cached Zone instance
Throws:
ADKException

getInstance

Zone getInstance(java.lang.String zoneId,
                 java.lang.String zoneUrl,
                 AgentProperties props)
                 throws ADKException
Gets a Zone instance with custom properties

Parameters:
zoneId - The zone identifier
zoneUrl - The URL of the Zone Integration Server that manages this zone. The format of the URL is specific to the ZIS product and the transport protocol used to communicate with the ZIS
props - Properties for the factory to use when creating a new Zone object
Returns:
A new or cached Zone instance
Throws:
ADKException

getZone

Zone getZone(java.lang.String zoneId)
Gets a Zone previously created by a call to getInstance

Parameters:
zoneId - The zone identifier
Returns:
The Zone instance

getAllZones

Zone[] getAllZones()
Gets all zones in the factory cache

Returns:
An array of Zones

removeZone

void removeZone(Zone zone)
Remove a zone from the ZoneFactory

This method can only be called on a zone that is in the disconnected state.

Parameters:
zone - The zone to remove


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.