MicroTAPAS
Class SubscribeCollection

java.lang.Object
  |
  +--MicroTAPAS.SubscribeCollection
All Implemented Interfaces:
java.io.Serializable

public class SubscribeCollection
extends java.lang.Object
implements java.io.Serializable

This is the main class that implements the PaP Subscribe functionality. There will be one instance of this class for each independent Subscribe service provider to be used (i.e. the instance of the class is a Subscribe Service Provider). Each Subscribe Service Provider is able to handle multiple clients of the service, and each client is the result of a 'SubscribeRequest' to the provider and is identified by its Subscribe Identifier until the client is cancelled by a 'SubscribeCancel' request to the provider. Different types of events are reported to, and registered by the provider, and these registrations are reported to clients ('SubscribeReport') according to what clients has specified. Registrations has a predefined set of event types to be used, and the format and content of the registrations depends on the event type. The class 'SubscribeRequest' defines the specification of a request for subscription, while the class 'SubscribeRequestServer' defines how each 'SubscribeRequest' shall be served.

See Also:
Serialized Form

Field Summary
private  MicroBaseFrame bf
          Defines trace information window.
private  ActorContext context
          The defined context for the service.
private  java.util.Hashtable subscriptions
          Keeps existing client instances
private  int unique
          Allocate unique identifiers for client instances
 
Constructor Summary
SubscribeCollection(ActorContext ctx, MicroBaseFrame frame)
          Initiation of the Subscribe Service Provider instance.
 
Method Summary
 java.lang.String addEntry(SubscribeRequest sr)
          Create and initiate a new subscribe client instance.
 void registerEvent(int et, GAI sc, java.lang.String at)
          Register an event at all existing subscription clients.
 boolean removeEntry(java.lang.String subsID)
          Terminate and remove an existing subscription client.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

private ActorContext context
The defined context for the service. Used to specify sender address when SubscribeReport


unique

private int unique
Allocate unique identifiers for client instances


subscriptions

private java.util.Hashtable subscriptions
Keeps existing client instances


bf

private MicroBaseFrame bf
Defines trace information window. Only temporary, used for debugging

Constructor Detail

SubscribeCollection

public SubscribeCollection(ActorContext ctx,
                           MicroBaseFrame frame)
Initiation of the Subscribe Service Provider instance.

Parameters:
ctx - Defined context for the service
frame - Debug trace window (temporary)
Method Detail

addEntry

public java.lang.String addEntry(SubscribeRequest sr)
Create and initiate a new subscribe client instance.

Parameters:
sr - The specification of the subscribe request
Returns:
The subscription identifier, or null if failed

removeEntry

public boolean removeEntry(java.lang.String subsID)
Terminate and remove an existing subscription client.

Parameters:
subsID - The unique identification of the client
Returns:
true if successfully removed, false if failed for some reason

registerEvent

public void registerEvent(int et,
                          GAI sc,
                          java.lang.String at)
Register an event at all existing subscription clients.

Parameters:
et - Event type
sc - Address identifier for the entity the event concerns
at - Application specific information


The Telematics Architecture for Plug-and-Play Systems (TAPAS) is a research project undertaken by the Norwegian University of Science and Technology's Telematics department which aims at developing an architecture for network-based service systems with a) flexibility and adaptability, b) robustness and survivability, and c) QoS awareness and resource control.

More information can be found at the project's homepage at http://tapas.item.ntnu.no and the project manager, Professor Finn Arve Aagesen, can be reached at finn.arve.aagesen@item.ntnu.no.