org.fosstrak.ale.server
Class ReportsGenerator

java.lang.Object
  extended by org.fosstrak.ale.server.ReportsGenerator
All Implemented Interfaces:
java.lang.Runnable

public class ReportsGenerator
extends java.lang.Object
implements java.lang.Runnable

This class generates ec reports. It validates the ec specifications, starts and stops the event cycles and manages the subscribers.

Author:
regli, sawielan

Constructor Summary
ReportsGenerator(java.lang.String name, org.fosstrak.ale.xsd.ale.epcglobal.ECSpec spec)
          Constructor validates the ec specification and sets some parameters.
 
Method Summary
 java.lang.String getName()
          This method returns the name of this reports generator.
 org.fosstrak.ale.xsd.ale.epcglobal.ECReports getPollReports()
          This method delivers the ec reports which have been generated because of a poll.
 org.fosstrak.ale.xsd.ale.epcglobal.ECSpec getSpec()
          This method returns the ec specification of this generator.
 ReportsGeneratorState getState()
          This method returns the state of this report generator.
 java.util.List<java.lang.String> getSubscribers()
          This method return the notification uris of all the subscribers of this report generator.
 void notifySubscribers(org.fosstrak.ale.xsd.ale.epcglobal.ECReports reports)
          This method notifies all subscribers of this report generator about the specified ec reports.
 void poll()
          This method is invoked if somebody polls this report generator.
 void run()
          This method contains the main loop of the reports generator.
 void setState(ReportsGeneratorState state)
          This method sets the state of this report generator.
 void start()
          This method starts the main loop of the report generator.
 void stop()
          This method stops the main loop of the report generator.
 void subscribe(java.lang.String notificationURI)
          This method subscribes a notification uri of a subscriber to this report generator.
 void unsubscribe(java.lang.String notificationURI)
          This method unsubscribes a notification uri of a subscriber from this report generator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReportsGenerator

public ReportsGenerator(java.lang.String name,
                        org.fosstrak.ale.xsd.ale.epcglobal.ECSpec spec)
                 throws org.fosstrak.ale.wsdl.ale.epcglobal.ECSpecValidationExceptionResponse,
                        org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse
Constructor validates the ec specification and sets some parameters.

Parameters:
name - of this reports generator
spec - which defines how the reports of this generator should be build
Throws:
org.fosstrak.ale.wsdl.ale.epcglobal.ECSpecValidationException - if the ec specification is invalid
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationException - if an implementation exception occurs
org.fosstrak.ale.wsdl.ale.epcglobal.ECSpecValidationExceptionResponse
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse
Method Detail

getSpec

public org.fosstrak.ale.xsd.ale.epcglobal.ECSpec getSpec()
This method returns the ec specification of this generator.

Returns:
ec specification

setState

public void setState(ReportsGeneratorState state)
This method sets the state of this report generator. If the state changes from UNREQUESTED to REQUESTED, the report generators main loop will be started. If the state changes from REQUESTED to UNREQUESTED, the report generators main loop will be stoped.

Parameters:
state - to set

getState

public ReportsGeneratorState getState()
This method returns the state of this report generator.

Returns:
state

subscribe

public void subscribe(java.lang.String notificationURI)
               throws org.fosstrak.ale.wsdl.ale.epcglobal.DuplicateSubscriptionExceptionResponse,
                      org.fosstrak.ale.wsdl.ale.epcglobal.InvalidURIExceptionResponse
This method subscribes a notification uri of a subscriber to this report generator.

Parameters:
notificationURI - to subscribe
Throws:
org.fosstrak.ale.wsdl.ale.epcglobal.DuplicateSubscriptionException - if the specified notification uri is already subscribed
org.fosstrak.ale.wsdl.ale.epcglobal.InvalidURIException - if the notification uri is invalid
org.fosstrak.ale.wsdl.ale.epcglobal.DuplicateSubscriptionExceptionResponse
org.fosstrak.ale.wsdl.ale.epcglobal.InvalidURIExceptionResponse

unsubscribe

public void unsubscribe(java.lang.String notificationURI)
                 throws org.fosstrak.ale.wsdl.ale.epcglobal.NoSuchSubscriberExceptionResponse,
                        org.fosstrak.ale.wsdl.ale.epcglobal.InvalidURIExceptionResponse
This method unsubscribes a notification uri of a subscriber from this report generator.

Parameters:
notificationURI - to unsubscribe
Throws:
org.fosstrak.ale.wsdl.ale.epcglobal.NoSuchSubscriberException - if the specified notification uri is not yet subscribed
org.fosstrak.ale.wsdl.ale.epcglobal.InvalidURIException - if the notification uri is invalid
org.fosstrak.ale.wsdl.ale.epcglobal.NoSuchSubscriberExceptionResponse
org.fosstrak.ale.wsdl.ale.epcglobal.InvalidURIExceptionResponse

getSubscribers

public java.util.List<java.lang.String> getSubscribers()
This method return the notification uris of all the subscribers of this report generator.

Returns:
list of notification uris

notifySubscribers

public void notifySubscribers(org.fosstrak.ale.xsd.ale.epcglobal.ECReports reports)
This method notifies all subscribers of this report generator about the specified ec reports.

Parameters:
reports - to notify the subscribers about

poll

public void poll()
This method is invoked if somebody polls this report generator. The result of the polling can be picked up by the method getPollReports.


getPollReports

public org.fosstrak.ale.xsd.ale.epcglobal.ECReports getPollReports()
This method delivers the ec reports which have been generated because of a poll.

Returns:
ec reports

start

public void start()
This method starts the main loop of the report generator.


stop

public void stop()
This method stops the main loop of the report generator.


getName

public java.lang.String getName()
This method returns the name of this reports generator.

Returns:
name of reports generator

run

public void run()
This method contains the main loop of the reports generator. Here the event cycles will be generated and started.

Specified by:
run in interface java.lang.Runnable


Copyright © 2009. All Rights Reserved.