at.spardat.xma.boot.transport
Class Transport

java.lang.Object
  extended byat.spardat.xma.boot.transport.Transport
Direct Known Subclasses:
HTTPTransport

public abstract class Transport
extends java.lang.Object

this is the interface for the low level xma transport layer used on xma-client side. At this time only an implementation for HTTP is provided, but additional protocols may be added in the future.


Constructor Summary
Transport()
           
 
Method Summary
abstract  byte[] callServerEvent(IRtXMASessionClient session, XMA_URI eventHandler, byte[] input)
          Calls a server side event.
abstract  Result getResource(IRtXMASessionClient session, XMA_URI resource, long modifiedSince, java.lang.String etag)
          Loads a resource from a server if it has been changed since modifiedSince.
static Transport getTransport()
          Get an implementation of Transport.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Transport

public Transport()
Method Detail

getResource

public abstract Result getResource(IRtXMASessionClient session,
                                   XMA_URI resource,
                                   long modifiedSince,
                                   java.lang.String etag)
                            throws CommunicationException
Loads a resource from a server if it has been changed since modifiedSince.

Parameters:
session - the session this event belongs to. may be null.
resource - unique identification of the resource.
modifiedSince - timestamp of last modification.
Returns:
a result that indicates the server response. If a new resource is loaded, the data is stored within the result. the content-length is set, and the buffer can be read by using the method getContent. If no resource is loaded, the result will only contain informational data about the request. e.g. a new expiration date.
Throws:
ConnectException - if anything goes wrong in the communication with the server, befor the server changed its state.
ServerException - if anything goes wrong in the communication with the server, after the server propably changed its state.
CommunicationException

callServerEvent

public abstract byte[] callServerEvent(IRtXMASessionClient session,
                                       XMA_URI eventHandler,
                                       byte[] input)
                                throws CommunicationException
Calls a server side event.

Parameters:
session - the session this event belongs to.
eventHandler - unique identification of the eventhandler.
input - All data that can be read from this InputStream is propagated to the eventhandler.
Returns:
an InputStream pointing to the data send back by the enventhandler.
Throws:
ConnectException - if anything goes wrong in the communication with the server, befor the server changed its state.
ServerException - if anything goes wrong in the communication with the server, after the server propably changed its state.
CommunicationException

getTransport

public static Transport getTransport()
Get an implementation of Transport. The implementation to use can be configured by the property boot.transport.defaultimpl in the file at/spardat/xma/boot/bootcfg.properties which names the fully qualified class name of the implementation class.

Returns:
a Transport - object.