net.kwfgrid.gwes.uiproxy
Interface UIProxy

All Known Implementing Classes:
UIProxyImpl

public interface UIProxy

Version:
$Id: UIProxy.java 1419 2010-11-01 14:12:17Z hoheisel $
Author:
Andreas Hoheisel (www.andreas-hoheisel.de)

Method Summary
 void disposeBuffer(String clientid, String bufferid)
          Dispose a buffer.
 void disposeClient(String clientid)
          Dispose a whole client.
 String[] poll(String clientid, String bufferid)
          Poll all buffered notifications for the specified client and buffer.
 void renewLease(String clientid)
          Renew the lease for the specified client.
 void setBufferProperty(String clientid, String bufferid, String key, String value)
          Set a property of a buffer.
 String subscribe(String clientid, String subscription, String buffertype, String[] propkeys, String[] propvalues)
          Subscribe for messages at a publisher.
 

Method Detail

subscribe

String subscribe(String clientid,
                 String subscription,
                 String buffertype,
                 String[] propkeys,
                 String[] propvalues)
                 throws SubscriptionFailed
Subscribe for messages at a publisher. This will instantiate a buffer which stores the notification provided by the publisher. The specification of the subuscription must conform to the format which is defined by the SubscriptionHandler of the UIProxy.

Parameters:
clientid - The UUID of the client.
subscription - Specification of the subscription.
buffertype - The type of the buffer to be created.
propkeys - The keys of the properties of the buffer, same index as propvalues.
propvalues - The values of the properties of the buffer, same index as propkeys.
Returns:
The UUID of the newly created buffer. Needed to poll notifications from that buffer.
Throws:
SubscriptionFailed - If the subscription failed.

renewLease

void renewLease(String clientid)
Renew the lease for the specified client. If the client is unknown the request is silently discarded.

Parameters:
clientid - The UUID of the client.

setBufferProperty

void setBufferProperty(String clientid,
                       String bufferid,
                       String key,
                       String value)
                       throws BufferException
Set a property of a buffer. Calling this method will also renew the lease for the specified client. If the client is not the creator of the buffer, this method will silently discard the request.

Parameters:
clientid - The UUID of the client.
bufferid - The UUID of the buffer.
key - The name of the property.
value - The value of the property
Throws:
BufferException - If an exception occured when setting the property.

disposeBuffer

void disposeBuffer(String clientid,
                   String bufferid)
Dispose a buffer. Calling this method will also renew the lease for the specified client. If the client is not the creator of the buffer, this method will silently discard the request.

Parameters:
clientid - The UUID of the client.
bufferid - The UUID of the buffer.

disposeClient

void disposeClient(String clientid)
Dispose a whole client. This will free all resources associated with the client. If the client is unknown the request will be silently discarded.

Parameters:
clientid - The UUID of the client.

poll

String[] poll(String clientid,
              String bufferid)
              throws CodecException,
                     BufferException,
                     UnknownClientException,
                     UnknownBufferException
Poll all buffered notifications for the specified client and buffer. Calling this method will also renew the lease for the specified client. If the client is not the creator of the buffer, this method will silently discard the request and return an empty collection.

Returns:
A collection of all buffered notifications from the specified buffer.
Throws:
BufferException - If a exception occured at the buffer when handling a message. In that case the client will have to create a new Buffer.
UnknownClientException - If the specified client is unknown to the UIProxy. This may also happen if the lease has timed out for the specified client.
UnknownBufferException - If the specified buffer is unknown to the UIProxy. This may also happen if the buffer previously encountered a BufferException. specified client.
CodecException


Copyright © 2005-2011 Fraunhofer FIRST. All Rights Reserved.