SienaXML (v.2.0.0) API documentation

siena.xml
Class XMLClient

java.lang.Object
  extended by siena.ThinClient
      extended by siena.xml.XMLClient
All Implemented Interfaces:
Observer

public class XMLClient
extends siena.ThinClient
implements Observer

This is a client based on the example ThinClient class in Siena. It can be used as a front end to the XML translation process so that a user of the class can simply ask it to publish and XML notification and it will do the rest.

Since:
11-05-2001
See Also:
XMLProcessor

Constructor Summary
XMLClient(java.lang.String server)
          This a generic constructor for the class.
 
Method Summary
 void clearUserRules()
          This method will clear the user rules and use only the default rules when procsesing XML notifications.
 void publish(java.lang.String xmlNotification)
          This method takes a XML notification and publishes it to the Siena server.
 void setStyleSheet(java.lang.String filename)
          This method sets the stylesheet used by the XML notification.
 void setUserRules(java.lang.String filename)
          This method sets the user's rules.
 void subscribe(java.lang.String xpath, Notifiable n)
          This method is used to subscribe to the XML notifications.
 void unsubscribe(java.lang.String xpath, Notifiable n)
          This method unsubscribes and XPath from the SIENA servers.
 void update(XMLSubscriptionHandler handler)
          This method is used by the XMLSubscriptionHandler to notify the client when an XML notification has been matched to the subscription this client generated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLClient

public XMLClient(java.lang.String server)
          throws siena.comm.InvalidSenderException
This a generic constructor for the class.

Parameters:
server - the uri of the server to connect to (e.g., "senp://host.domain.net:7654")
Throws:
InvalidSenderException - Is thrown when there is a problem connecting to the SIENA server
Since:
11-07-2001
Method Detail

publish

public void publish(java.lang.String xmlNotification)
             throws siena.SienaException
This method takes a XML notification and publishes it to the Siena server.

Parameters:
xmlNotification - This is the XML notification to be sent through the SIENA server network
Throws:
SienaException - This is thrown if there are problems translating the XML notification or sending it to a SIENA server
Since:
11-05-2001

setStyleSheet

public void setStyleSheet(java.lang.String filename)
                   throws java.io.IOException
This method sets the stylesheet used by the XML notification.

Parameters:
filename - The name of the file that contains the XSchema
Throws:
IOException - An IOException is thrown if processing the file containing the XSchema has a problem.

setUserRules

public void setUserRules(java.lang.String filename)
                  throws siena.SienaException
This method sets the user's rules.

Parameters:
filename - The name of the file that contains the users rules.
Throws:
SienaException - Thrown if a problem occurs when processing the user rules file.
See Also:
Rules#

clearUserRules

public void clearUserRules()
This method will clear the user rules and use only the default rules when procsesing XML notifications.


update

public void update(XMLSubscriptionHandler handler)
This method is used by the XMLSubscriptionHandler to notify the client when an XML notification has been matched to the subscription this client generated.

Specified by:
update in interface Observer
Parameters:
handler - Reference to the XMLSubscriptionHandler that was being observered which issued the update.

subscribe

public void subscribe(java.lang.String xpath,
                      Notifiable n)
               throws siena.SienaException
This method is used to subscribe to the XML notifications.

Parameters:
n - The notifiable object which should be notified when an XML Notification has been recieved that matches the subscription.
xpath - A String containing the XPath subscription
Throws:
siena.SienaException - This is thrown when there is a problem translating the XPath into SIENA subscriptions.

unsubscribe

public void unsubscribe(java.lang.String xpath,
                        Notifiable n)
                 throws siena.SienaException
This method unsubscribes and XPath from the SIENA servers.

Parameters:
xpath - The XPath subscription to remove
n - The notifiable object that was associated with the XPath
Throws:
SienaException - This is thrown if an error occurs when trying to unsubscribe the subscription(s) from the SIENA server.

SienaXML (v.2.0.0) API documentation

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