SienaXML (v.2.0.0) API documentation

siena.xml
Class XMLSubscriptionHandler

java.lang.Object
  extended by siena.xml.XMLSubscriptionHandler
All Implemented Interfaces:
Subject

public class XMLSubscriptionHandler
extends java.lang.Object
implements Subject

This class handles the processing of an XPath statement and runging it into a set of filters that can be used as a subscription to a XML notification. This class also makes sure that any XML notification that is recieved from a server does match the XPath that was used to generate the subscription.


Nested Class Summary
static class XMLSubscriptionHandler.TEST
          White box testing class for XMLSubscriptionHandler
 
Constructor Summary
XMLSubscriptionHandler(Notifiable notifiable)
          This is the constructor for this object.
 
Method Summary
 void attach(Observer observer)
          Attach an observer to this object
 Filter[] buildFilter(java.lang.String subscription)
          This method processes the XPath expression passed in and returns a SIENA filter that will correctly subscribe to the events that are generated from an XML Notification based on the XSchema given to this object.
 void detach(Observer observer)
          Remove an observer from the list of observers.
 Notifiable getNotifiable()
          Returns the notifiable object
 java.lang.String getNotification()
          Returns the XML notification received from the SIEAN servers.
 void inform()
          Used to inform observers of a XML notification that was recieved from the SEINA servers.
 void notify(Notification notification)
          This function is used to notify this object of an SIEAN notification that matches the SIENA subscriptions generated by this command.
 java.util.Enumeration observers()
          Return a enumeration of observers for this object
 void setStylesheet(java.lang.String filename)
          This sets the style sheet for the handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLSubscriptionHandler

public XMLSubscriptionHandler(Notifiable notifiable)
                       throws java.io.IOException
This is the constructor for this object.

Parameters:
notifiable - The object to be notified when an XML notification is returned by the SIENA servers.
Throws:
IOException - If there is a problem in opening the default rules file this exception is thrown.
Method Detail

notify

public void notify(Notification notification)
            throws SienaException
This function is used to notify this object of an SIEAN notification that matches the SIENA subscriptions generated by this command.

Parameters:
notification - The notification that was returned by the SIENA servers.
Throws:
SienaException - If there is a problem extracting the XML notification from the SIENA notification this exception is thrown.

attach

public void attach(Observer observer)
Attach an observer to this object

Specified by:
attach in interface Subject
Parameters:
observer - The object to include in the list of observing objects.

detach

public void detach(Observer observer)
Remove an observer from the list of observers.

Specified by:
detach in interface Subject
Parameters:
observer - The object/observer to remove from the list.

inform

public void inform()
Used to inform observers of a XML notification that was recieved from the SEINA servers.

Specified by:
inform in interface Subject

observers

public java.util.Enumeration observers()
Return a enumeration of observers for this object

Returns:
Enumeration object containing the observers for this object.

getNotification

public java.lang.String getNotification()
Returns the XML notification received from the SIEAN servers.

Returns:
String containing the XML notification.

getNotifiable

public Notifiable getNotifiable()
Returns the notifiable object

Returns:
The Notifiable object

buildFilter

public Filter[] buildFilter(java.lang.String subscription)
                     throws siena.SienaException
This method processes the XPath expression passed in and returns a SIENA filter that will correctly subscribe to the events that are generated from an XML Notification based on the XSchema given to this object.

Parameters:
subscription - The subscription, or XPath, statement to be converted into filters.
Returns:
Array of filters to be used as subscriptions.
Throws:
SienaException - If no filters can be created this exception is thrown.

setStylesheet

public void setStylesheet(java.lang.String filename)
                   throws siena.SienaException
This sets the style sheet for the handler.

Parameters:
filename - Name of the file containing the XSchema
Throws:
SienaException - If there is a problem opening or parsing the file this exception is thrown.

SienaXML (v.2.0.0) API documentation

Copyright © 2000-2002 University of Colorado.
This documentation is maintained by Antonio Carzaniga