|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.edustructures.sifworks.Event
public class Event
Encapsulates a SIF Event.
An Event is a notification to subscribing agents that a data object has been added, changed, or deleted in the reporting application's database. In the Schools Interoperability Framework, any agent may report SIF_Event messages for any object, even if that agent is not the authoritative publisher of the object.
Reporting SIF Events
To report a SIF_Event to a zone, construct an Event instance and call the
Zone.reportEvent(Event) method. Supply a
SIFDataObject instance and an action code to the Event constructor. You may
also call alternative forms of the reportEvent method that accept
SIFDataObjects and an action code as parameters. Note Events cannot be reported
to a Topic because the ADK cannot determine which of its zones should receive
the event. If you're using Topics, you must report events to the specific Zone
or Zones to which the data applies.
Subscribing to SIF Events
To subscribe to SIF_Events for a specific object type, register a Subscriber
message handler with Zone or Topic instances. Call the setSubscriber
method repeatedly for each object type you wish to subscribe to. When the ADK
connects to a zone, it sends SIF_Subscribe messages for each object type. When a
SIF_Event message is received by the ADK, it is dispatched to your
Subscriber.onEvent(Event, Zone, MessageInfo)
method for processing. Refer to that method for more information.
| Constructor Summary | |
|---|---|
Event(DataObjectInputStream data,
EventAction action,
ElementDef objectType)
Constructs an Event object to encapsulate an inbound SIF Event. |
|
Event(DataObjectInputStream data,
java.lang.String action,
ElementDef objectType)
Constructs an Event object to encapsulate an inbound SIF Event. |
|
Event(SIFDataObject[] data,
java.lang.String action)
Constructs an Event object to encapsulate an outbound SIF Event, which describes one or more SIF Data Objects that have been added, changed, or deleted by the local application. |
|
Event(SIFDataObject data,
EventAction action)
Constructs an Event object to encapsulate an outbound SIF Event, which describes one or more SIF Data Objects that have been added, changed, or deleted by the local application. |
|
Event(SIFDataObject data,
EventAction action,
SIFContext... contexts)
Constructs an Event object to encapsulate an outbound SIF Event, which describes one or more SIF Data Objects that have been added, changed, or deleted by the local application. |
|
| Method Summary | |
|---|---|
EventAction |
getAction()
Gets the action code identifying how the data in the Event payload has changed |
java.lang.String |
getActionString()
Gets the action string that was assigned to the SIF_Event/@Action attribute |
SIFContext[] |
getContexts()
Gets the SIF Contexts that this event applies to. |
DataObjectInputStream |
getData()
Gets the SIF Data Objects in the Event payload |
ElementDef |
getObjectType()
Identifies the type of SIF Data Object contained in the Event payload |
Zone |
getZone()
Gets the Zone from which an inbound event originated. |
void |
setContexts(SIFContext... contexts)
Sets the SIF Contexts to which this event applies. |
void |
setZone(Zone zone)
Called internally by the ADK to track the zone from which this event originated. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Event(DataObjectInputStream data,
EventAction action,
ElementDef objectType)
data - A DataObjectInputStream that returns SIFDataObjects, all of
which must be of the same class typeaction - Describes how the data has changed. One of the
following flags: ADD, CHANGE, or DELETEobjectType - An ElementDef constant from the SIFDTD class that
identifies the type of SIF Data Object contained in the eventEventAction
public Event(DataObjectInputStream data,
java.lang.String action,
ElementDef objectType)
data - A DataObjectInputStream that returns SIFDataObjects, all of
which must be of the same class typeaction - Describes how the data has changedobjectType - An ElementDef constant from the SIFDTD class that
identifies the type of SIF Data Object contained in the event
public Event(SIFDataObject data,
EventAction action)
data - A SIFDataObjectaction - Describes how the data has changed. One of the
following flags: ADD, CHANGE, or DELETEEventAction,
Zone.reportEvent(Event)
public Event(SIFDataObject data,
EventAction action,
SIFContext... contexts)
data - action - contexts -
public Event(SIFDataObject[] data,
java.lang.String action)
data - An array of SIFDataObjects, all of which must be of the same class typeaction - Describes how the data has changed: in SIF, this string should
be "Add", "Change", or "Delete"Zone.reportEvent(Event)| Method Detail |
|---|
public DataObjectInputStream getData()
public ElementDef getObjectType()
public EventAction getAction()
UNDEFINED
is returned if the ADK could not parse the value of the @Action
attribute specified in the SIF_Event message (call getActionString()
to inspect the actual Action attribute value)EventAction,
getActionString()public java.lang.String getActionString()
SIF_Event/@Action attribute
getAction()public void setZone(Zone zone)
zone - The Zone the SIF_Event message was received frompublic Zone getZone()
public void setContexts(SIFContext... contexts)
fContexts - One or more contexts to which this event appliesSIFContext.DEFAULTpublic SIFContext[] getContexts()
SIFContext.DEFAULT
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||