org.fosstrak.ale.server
Class ALE

java.lang.Object
  extended by org.fosstrak.ale.server.ALE

public class ALE
extends java.lang.Object

This class represents the application level events interface. All ale operations are executed by this class.

Author:
regli, sawielan, haennimi

Constructor Summary
ALE()
           
 
Method Summary
static void close()
          This method closes the ale and remove all input generators and there objects on the reader devices.
static void define(java.lang.String specName, org.fosstrak.ale.xsd.ale.epcglobal.ECSpec spec)
          With this method an ec specification can be defined.
static org.fosstrak.ale.xsd.ale.epcglobal.ECSpec getECSpec(java.lang.String specName)
          This method returns an ec specification depending on a given name.
static java.lang.String[] getECSpecNames()
          This method returns the names of all defined ec specifications.
static java.lang.String getStandardVersion()
          This method returns the standard version to which this implementation is compatible.
static java.lang.String[] getSubscribers(java.lang.String specName)
          This method returns all subscribers to a given ec specification name.
static java.lang.String getVendorVersion()
          This method returns the vendor version of this implementation.
static org.fosstrak.ale.xsd.ale.epcglobal.ECReports immediate(org.fosstrak.ale.xsd.ale.epcglobal.ECSpec spec)
          With this method a undefined ec specifcation can be executed.
static void initialize()
          This method initializes the ALE by loading properties from default properties file and creating input generators.
static void initialize(java.lang.String propertiesFilePath)
          This method initalizes the ALE by loading properties from file and creating input generators.
static boolean isReady()
          This method indicates if the ALE is ready or not.
static void main(java.lang.String[] args)
          With this method the ALE can be started.
static org.fosstrak.ale.xsd.ale.epcglobal.ECReports poll(ReportsGenerator reportGenerator)
           
static org.fosstrak.ale.xsd.ale.epcglobal.ECReports poll(java.lang.String specName)
          With this method a defined ec specification can be polled.
static void subscribe(java.lang.String specName, java.lang.String notificationURI)
          With this method a notification uri can be subscribed to a defined ec specification.
static void undefine(java.lang.String specName)
          With this method an ec specification can be undefined.
static void unsubscribe(java.lang.String specName, java.lang.String notificationURI)
          With this method a notification uri can be unsubscribed from a defined ec specification.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ALE

public ALE()
Method Detail

initialize

public static void initialize(java.lang.String propertiesFilePath)
                       throws org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse
This method initalizes the ALE by loading properties from file and creating input generators.

Parameters:
propertiesFilePath - the filepath to the properties file
Throws:
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationException - if properties could not be loaded or input generator could not be created
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse

initialize

public static void initialize()
                       throws org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse
This method initializes the ALE by loading properties from default properties file and creating input generators.

Throws:
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationException - if properties could not be loaded or input generator could not be created
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse

isReady

public static boolean isReady()
This method indicates if the ALE is ready or not.

Returns:
true if the ALE is ready and false otherwise

define

public static void define(java.lang.String specName,
                          org.fosstrak.ale.xsd.ale.epcglobal.ECSpec spec)
                   throws org.fosstrak.ale.wsdl.ale.epcglobal.DuplicateNameExceptionResponse,
                          org.fosstrak.ale.wsdl.ale.epcglobal.ECSpecValidationExceptionResponse,
                          org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse
With this method an ec specification can be defined.

Parameters:
specName - of the ec specification
spec - to define
Throws:
org.fosstrak.ale.wsdl.ale.epcglobal.DuplicateNameException - if a ec specification with the same name is already defined
org.fosstrak.ale.wsdl.ale.epcglobal.ECSpecValidationException - if the ec specification is not valid
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationException - if an implementation exception occurs
org.fosstrak.ale.wsdl.ale.epcglobal.DuplicateNameExceptionResponse
org.fosstrak.ale.wsdl.ale.epcglobal.ECSpecValidationExceptionResponse
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse

undefine

public static void undefine(java.lang.String specName)
                     throws org.fosstrak.ale.wsdl.ale.epcglobal.NoSuchNameExceptionResponse
With this method an ec specification can be undefined.

Parameters:
specName - of the ec specification to undefine
Throws:
org.fosstrak.ale.wsdl.ale.epcglobal.NoSuchNameException - if there is no ec specification with this name defined
org.fosstrak.ale.wsdl.ale.epcglobal.NoSuchNameExceptionResponse

getECSpec

public static org.fosstrak.ale.xsd.ale.epcglobal.ECSpec getECSpec(java.lang.String specName)
                                                           throws org.fosstrak.ale.wsdl.ale.epcglobal.NoSuchNameExceptionResponse
This method returns an ec specification depending on a given name.

Parameters:
specName - of the ec specification to return
Returns:
ec specification with the specified name
Throws:
org.fosstrak.ale.wsdl.ale.epcglobal.NoSuchNameException - if no such ec specification exists
org.fosstrak.ale.wsdl.ale.epcglobal.NoSuchNameExceptionResponse

getECSpecNames

public static java.lang.String[] getECSpecNames()
This method returns the names of all defined ec specifications.

Returns:
string array with names

subscribe

public static void subscribe(java.lang.String specName,
                             java.lang.String notificationURI)
                      throws org.fosstrak.ale.wsdl.ale.epcglobal.NoSuchNameExceptionResponse,
                             org.fosstrak.ale.wsdl.ale.epcglobal.InvalidURIExceptionResponse,
                             org.fosstrak.ale.wsdl.ale.epcglobal.DuplicateSubscriptionExceptionResponse
With this method a notification uri can be subscribed to a defined ec specification.

Parameters:
specName - of the ec specification
notificationURI - to subscribe
Throws:
org.fosstrak.ale.wsdl.ale.epcglobal.NoSuchNameException - if there is no ec specification with the given name defined
org.fosstrak.ale.wsdl.ale.epcglobal.InvalidURIException - if the specified notification uri is invalid
org.fosstrak.ale.wsdl.ale.epcglobal.DuplicateSubscriptionException - if the same subscription is already done
org.fosstrak.ale.wsdl.ale.epcglobal.NoSuchNameExceptionResponse
org.fosstrak.ale.wsdl.ale.epcglobal.InvalidURIExceptionResponse
org.fosstrak.ale.wsdl.ale.epcglobal.DuplicateSubscriptionExceptionResponse

unsubscribe

public static void unsubscribe(java.lang.String specName,
                               java.lang.String notificationURI)
                        throws org.fosstrak.ale.wsdl.ale.epcglobal.NoSuchNameExceptionResponse,
                               org.fosstrak.ale.wsdl.ale.epcglobal.NoSuchSubscriberExceptionResponse,
                               org.fosstrak.ale.wsdl.ale.epcglobal.InvalidURIExceptionResponse
With this method a notification uri can be unsubscribed from a defined ec specification.

Parameters:
specName - of the ec specification
notificationURI - to unsubscribe
Throws:
org.fosstrak.ale.wsdl.ale.epcglobal.NoSuchNameException - if there is no ec specification with the given name defined
org.fosstrak.ale.wsdl.ale.epcglobal.NoSuchSubscriberException - if the specified notification uri is not subscribed to the ec specification.
org.fosstrak.ale.wsdl.ale.epcglobal.InvalidURIException - if the specified notification uri is invalid
org.fosstrak.ale.wsdl.ale.epcglobal.NoSuchNameExceptionResponse
org.fosstrak.ale.wsdl.ale.epcglobal.NoSuchSubscriberExceptionResponse
org.fosstrak.ale.wsdl.ale.epcglobal.InvalidURIExceptionResponse

poll

public static org.fosstrak.ale.xsd.ale.epcglobal.ECReports poll(java.lang.String specName)
                                                         throws org.fosstrak.ale.wsdl.ale.epcglobal.NoSuchNameExceptionResponse
With this method a defined ec specification can be polled. Polling is the same as subscribe to a ec specification, waiting for one event cycle and then unsubscribe with the difference that the report is the result of the method instead of sending it to an uri.

Parameters:
specName - of the ec specification which schould be polled
Returns:
ec report of the next event cycle
Throws:
org.fosstrak.ale.wsdl.ale.epcglobal.NoSuchNameException - if there is no ec specification with the given name defined
org.fosstrak.ale.wsdl.ale.epcglobal.NoSuchNameExceptionResponse

immediate

public static org.fosstrak.ale.xsd.ale.epcglobal.ECReports immediate(org.fosstrak.ale.xsd.ale.epcglobal.ECSpec spec)
                                                              throws org.fosstrak.ale.wsdl.ale.epcglobal.ECSpecValidationExceptionResponse,
                                                                     org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse
With this method a undefined ec specifcation can be executed. It's the same as defining the ec specification, polling and undefining it afterwards.

Parameters:
spec - ec specification to execute
Returns:
ec report of the next event cycle
Throws:
org.fosstrak.ale.wsdl.ale.epcglobal.ECSpecValidationException - if the ec specification is not valid
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationException - if an implementation exception occures
org.fosstrak.ale.wsdl.ale.epcglobal.ECSpecValidationExceptionResponse
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse

getSubscribers

public static java.lang.String[] getSubscribers(java.lang.String specName)
                                         throws org.fosstrak.ale.wsdl.ale.epcglobal.NoSuchNameExceptionResponse
This method returns all subscribers to a given ec specification name.

Parameters:
specName - of which the subscribers should be returned
Returns:
array of string with notification uris
Throws:
org.fosstrak.ale.wsdl.ale.epcglobal.NoSuchNameException - if there is no ec specification with the given name is defined
org.fosstrak.ale.wsdl.ale.epcglobal.NoSuchNameExceptionResponse

getStandardVersion

public static java.lang.String getStandardVersion()
This method returns the standard version to which this implementation is compatible.

Returns:
standard version

getVendorVersion

public static java.lang.String getVendorVersion()
This method returns the vendor version of this implementation.

Returns:
vendor version

close

public static void close()
This method closes the ale and remove all input generators and there objects on the reader devices.


main

public static void main(java.lang.String[] args)
                 throws org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse
With this method the ALE can be started.

Parameters:
args - can contain the properties file path
Throws:
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationException - if an implementation exception occures
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse

poll

public static org.fosstrak.ale.xsd.ale.epcglobal.ECReports poll(ReportsGenerator reportGenerator)
                                                         throws org.fosstrak.ale.wsdl.ale.epcglobal.NoSuchNameExceptionResponse
Throws:
org.fosstrak.ale.wsdl.ale.epcglobal.NoSuchNameExceptionResponse


Copyright © 2009. All Rights Reserved.