Difference between revisions of "Application Level Events (ALE) User's Guide"
From RifidiWiki
|  (→ALE Operations Basic Flow) |  (→ALE Operations Basic Flow) | ||
| Line 53: | Line 53: | ||
| Here is an example of the basic flow for using ALE operations to get tag reads (current tags, addition and deletion) from a defined set of logical readzone(s) and the difference between using poll and immediate operations. | Here is an example of the basic flow for using ALE operations to get tag reads (current tags, addition and deletion) from a defined set of logical readzone(s) and the difference between using poll and immediate operations. | ||
| − | + | ==1. Start Rifidi server== | |
| − | + | ||
| − | + | ||
| Start the Rifidi server | Start the Rifidi server | ||
Revision as of 21:31, 4 February 2016
Note: Leverage similar approach to REST - below is just my thoughts - open to other ways to approach
Contents
- 1 Introduction
- 2 Configuration
- 3 How to Test ALE Operations
- 4 ALE Operations Basic Flow
- 5 ALE Implementation
- 5.1 Ale Operations
- 5.1.1 getEndpoint()
- 5.1.2 setEndpoint(String endPointName)
- 5.1.3 define(String specName, String specFilePath)
- 5.1.4 undefine(String specName)
- 5.1.5 getECSpec(String specName)
- 5.1.6 getECSpecNames()
- 5.1.7 subscribe(String specName, String notificationURI)
- 5.1.8 unsubscribe(String specName, String notificationURI)
- 5.1.9 poll(String specName)
- 5.1.10 immediate(String specFilePath)
- 5.1.11 getSubscribers(String specName)
- 5.1.12 getStandardVersion()
- 5.1.13 getVendorVersion()
 
- 5.2 Error conditions
 
- 5.1 Ale Operations
- 6 ALELR Operations
- 6.1 getEndpoint()
- 6.2 setEndpoint(String endPointName)
- 6.3 define(String readerName, LRSpec spec)
- 6.4 undefine(String readerName)
- 6.5 update(String readerName, LRSpec spec)
- 6.6 getLogicalReaderNames()
- 6.7 getLRSpec(String readerName)
- 6.8 addReaders(String readerName, String[] readers)
- 6.9 setReaders(String readerName, String[] readers)
- 6.10 removeReaders(String readerName, String[] readers)
- 6.11 setProperties(String readerName, LRProperty[] properties)
- 6.12 getPropertyValue(String readerName, String propertyName)
- 6.13 getStandardVersion()
- 6.14 getVendorVersion()
 
- 7 Example Rifidi App/Client
Introduction
Configuration
such as JVM args with explanation
How to Test ALE Operations
Set up testing
Execute
1. Start Rifidi server
Start the Rifidi server
2. Start Rifidi emulator
Start the Rifidi emulator, create an LLRP reader type, start it, and then create some Gen2 tags, and drag and drop some of them to emulated reader's antenna
3. Validate ALE and ALELR Web services are running
To validate ALE Web service, go to http://localhost:8112/aleservice?wsdl and you should see the web service definition
To validate ALELR Web service, go to http://localhost:8112/alelrservice?wsdl and you should see the web service definition
If you do not get web service response, make sure you have set required JVM arguments, as described in previous steps
4. Open web client application
Point your web browser to http://localhost:8081/fc-webclient-1.2.0/services/ALEWebClient.jsp and you should see the web application to test ale and alelr web services:
5. Call setEndPoint(String endPointName) for ALE
Call setEndPoint(String endPointName) for ALE: Clic on setEndPoint(String endPointName) link in left ALE panel, then type the url http://localhost:8112/aleservice as the endpoint attribute, then clic Invoke
After this, verify the end point was appropriate set, by calling getEndPoint(), and you should see the endpoint address you set before:
6. Call setEndPoint(String endPointName) for ALELR
Call setEndPoint(String endPointName) for ALELR: Click on setEndPoint(String endPointName) linl in left ALELR panel, then type the url http://localhost:8112/alelrservice as the endpoint attribute, then clic Invoke
After this, verify the end point was appropriate set, by calling getEndPoint(), and you should see the endpoint address you set before:
Validate
ALE Operations Basic Flow
Here is an example of the basic flow for using ALE operations to get tag reads (current tags, addition and deletion) from a defined set of logical readzone(s) and the difference between using poll and immediate operations.
1. Start Rifidi server
Start the Rifidi server
2. Start Rifidi emulator
Start the Rifidi emulator, create an LLRP reader type, start it, and then create some Gen2 tags, and drag and drop some of them to emulated reader's antenna
3. Validate ALE and ALELR Web services are running
To validate ALE Web service, go to http://localhost:8112/aleservice?wsdl and you should see the web service definition
To validate ALELR Web service, go to http://localhost:8112/alelrservice?wsdl and you should see the web service definition
If you do not get web service response, make sure you have set required JVM arguments, as described in previous steps
4. Open web client application
Point your web browser to http://localhost:8081/fc-webclient-1.2.0/services/ALEWebClient.jsp and you should see the web application to test ale and alelr web services:
5. Call setEndPoint(String endPointName) for ALE
Call setEndPoint(String endPointName) for ALE: Clic on setEndPoint(String endPointName) link in left ALE panel, then type the url http://localhost:8112/aleservice as the endpoint attribute, then clic Invoke
After this, verify the end point was appropriate set, by calling getEndPoint(), and you should see the endpoint address you set before:
6. Call setEndPoint(String endPointName) for ALELR
Call setEndPoint(String endPointName) for ALELR: Click on setEndPoint(String endPointName) linl in left ALELR panel, then type the url http://localhost:8112/alelrservice as the endpoint attribute, then clic Invoke
After this, verify the end point was appropriate set, by calling getEndPoint(), and you should see the endpoint address you set before:
ALE Implementation
Note: for each operation example request/response/wsdl
Ale Operations
getEndpoint()
setEndpoint(String endPointName)
define(String specName, String specFilePath)
Creates a new ECSpec having the name specName, according to spec
undefine(String specName)
Removes the ECSpec named specName that was previously created by the define method
getECSpec(String specName)
Returns the ECSpec that was provided when the ECSpec named specName was created by the define method.
getECSpecNames()
Returns an unordered list of the names of all ECSpecs that are visible to the caller.
subscribe(String specName, String notificationURI)
Adds a subscriber having the specified notificationURI to the set of current subscribers of the ECSpec named specName.  The notificationURI parameter both identifies a specific binding of the ALECallback interface and specifies addressing information meaningful to that binding.
unsubscribe(String specName, String notificationURI)
Removes a subscriber having the specified notificationURI from the set of current subscribers of the ECSpec named specName.
poll(String specName)
Requests an activation of the ECSpec named specName, returning the results from the next event cycle to complete.
After calling poll service, the expected response is an xml like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns3:ECReports specName="ReportGenerator_0_0" date="2016-01-17T21:36:40.966-05:00" ALEID="RIFIDI-ALE604974863" totalMilliseconds="9500" terminationCondition="DURATION" xmlns:ns2="urn:epcglobal:ale:wsdl:1" xmlns:ns3="urn:epcglobal:ale:xsd:1"> <reports> <report reportName="Cycle_1"> <group> <groupList> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> </groupList> </group> </report> </reports> </ns3:ECReports>
immediate(String specFilePath)
Creates an unnamed ECSpec according to spec, and immediately requests its activation.
After calling immediate service, the expected response is an xml like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns2:ECReports specName="ReportGenerator_0_0" date="2016-01-18T16:32:36.500-05:00" ALEID="RIFIDI-ALE-293181330" totalMilliseconds="9500" terminationCondition="DURATION" xmlns:ns2="urn:epcglobal:ale:xsd:1" xmlns:ns3="urn:epcglobal:ale:wsdl:1"> <reports> <report reportName="Cycle_1"> <group> <groupList> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> <member><epc>300e34d6e51161826493ff7e</epc></member> </groupList> </group> </report> </reports> </ns2:ECReports>
getSubscribers(String specName)
Returns an unordered, possibly empty list of the notification URIs corresponding to each of the current subscribers for the ECSpec named specName.
getStandardVersion()
Returns a string that identifies what version of the specification this implementation of the Reading API complies with.
getVendorVersion()
Returns a string that identifies what vendor extensions this implementation of the Reading API provides.
Error conditions
Methods of the ALE Reading API signal error conditions to the client by means of exceptions.  The following exceptions are defined.  All the exception types in the following table are extensions of a common ALEException base type, which contains one string element giving the reason for the exception.
SecurityException
The operation was not permitted due to an access control violation or other security concern.
DuplicateNameException
The specified ECSpec name already exists. Note that the existence of a CCSpec having the same name does not cause this exception; ECSpecs and CCSpecs are in different namespaces.
ECSpecValidationException
The specified ECSpec is invalid. The define and immediate methods of the ALE API SHALL raise an ECSpecValidationException if any of the following are true:
- The specified specNameis an empty string or is not accepted by the implementation
- The logicalReadersparameter ofECSpecis null, omitted, is an empty list, or contains any logical reader names that are not known to the implementation.
- The boundarySpecparameter ofECSpecis null or omitted.
- The duration,stableSetInterval, orrepeatPeriodparameter ofECBoundarySpecis negative.
- The value of the startTriggerorstopTriggerparameter ofECBoundarySpec, or any element of thestartTriggerListorstopTriggerListparameter ofECBoundarySpecdoes not conform to URI syntax as defined by [RFC2396], or is a URI that is not supported by the ALE implementation. Note that an empty string does not conform to URI syntax as defined by [RFC2396].
- No stopping condition is specified in ECBoundarySpec; i.e.,stopTriggeris omitted or null,stopTriggerListis empty,whenDataAvailableis false, and neitherdurationnorstableSetIntervalnor any vendor extension stopping condition is specified.
- The reportSpecsparameter ofECSpecis null, omitted, or empty.
- Any ECReportSpecinstance has areportNamethat is an empty string or that is not accepted by the implementation.
- Two ECReportSpecinstances have identical values for theirreportNamefields.
- Any member of includePatternsorexcludePatternswithinECFilterSpecdoes not conform to theepc-tagformat’s filter syntax
- Two members of the fieldListparameter of anyECReportOutputSpecinstance have the same name.
- The fieldspecparameter of anyECFilterListMemberinstance is invalid.
- The patListparameter of anyECFilterListMemberinstance is empty, null, or omitted, or any element ofpatListdoes not conform to the syntax rules for patterns implied by the specifiedfieldspec.
- The fieldspecparameter ofECGroupSpecis invalid.
- The fieldspecparameter ofECGroupSpecimplies a datatype and format for which no grouping pattern syntax is defined.
- Any grouping pattern within the patternListparameter ofECGroupSpecdoes not conform to the syntax for grouping patterns implied by the specifiedfieldspec.
- Any two grouping patterns within the patternListparameter ofECGroupSpecare not disjoint, according to the definition of disjointedness defined by the datatype and format implied by the specifiedfieldspec.
- Any member of the fieldListparameter withinECReportOutputSpecis an invalid fieldspec.
- Any member of the primaryKeyFieldsparameter ofECSpecis not a known fieldname.
- The implementation does not support the specified primaryKeyFieldsvalue ofECSpecwith the specified logical readers. An implementation SHALL NOT, however, raise the exception ifprimaryKeyFieldsis omitted or its value is a list consisting of the single elementepc.
- For any ECReportOutputSpecinstance, all five booleansincludeEPC,includeTag,includeRawHex,includeRawDecimal, andincludeCountare false,fieldListis empty or omitted, and there is no vendor extension toECReportOutputSpec.
- Any value of ECStatProfileNameis not recognized, or is recognized but the 2693 specified statistics report is not supported.
InvalidURIException
The URI specified for a subscriber does not conform to URI syntax as specified in [RFC2396], does not name a binding of the ALECallback interface recognized by the implementation, or violates syntax or other rules imposed by a particular binding.
NoSuchNameException
The specified ECSpec name does not exist.
NoSuchSubscriberException
The specified subscriber does not exist.
DuplicateSubscriptionException
The specified ECSpec name and subscriber URI is identical to a previous subscription that was created and not yet unsubscribed.
ImplementationException
A generic exception raised by the implementation for reasons that are implementation-specific. This exception contains one additional element: a severity member whose values are either ERROR or SEVERE. ERROR indicates that the ALE implementation is left in the same state it had before the operation was attempted. SEVERE indicates that the ALE implementation is left in an indeterminate state.
ALELR Operations
getEndpoint()
setEndpoint(String endPointName)
define(String readerName, LRSpec spec)
Creates a new logical reader named name according to spec.
undefine(String readerName)
Removes the logical reader named name
update(String readerName, LRSpec spec)
Changes the definition of the logical reader named name to match the specification in the spec parameter. This is different than calling undefine followed by define, because update may be called even if there are defined ECSpecs, CCSpecs, or other logical readers that refer to this logical reader.
getLogicalReaderNames()
Returns an unordered list of the names of all logical readers that are visible to the caller. This list SHALL include both composite readers and base readers.
getLRSpec(String readerName)
Returns an LRSpec that describes the logical reader named name.
addReaders(String readerName, String[] readers)
Adds the specified logical readers to the list of component readers for the composite logical reader named name.  This is equivalent to calling getLRSpec, modifying the LRSpec that is returned to include the specified logical readers in the reader list, and then calling update with the modified LRSpec.
setReaders(String readerName, String[] readers)
Changes the list of component readers for the composite logical reader named name to the specified list.  This is equivalent to calling getLRSpec, modifying the LRSpec that is returned by replacing the reader list with the specified list of logical readers, and then calling update with the modified LRSpec.
removeReaders(String readerName, String[] readers)
Removes the specified logical readers from the list of component readers for the composite logical reader named name.  Any reader name within readers that is not currently among the component readers of the specified logical reader is ignored.   This is equivalent to calling getLRSpec, modifying the LRSpec that is returned by removing any references to logical readers in the specified reader list, and then calling update with the modified LRSpec.
setProperties(String readerName, LRProperty[] properties)
Changes properties for the logical reader named name to the specified list.  This is equivalent to calling getLRSpec, modifying the properties in the LRSpec according to the table below, and then calling update with the modified LRSpec.
getPropertyValue(String readerName, String propertyName)
Returns the current value of the specified property for the specified reader, or null if the specified reader does not have a property with the specified name.
getStandardVersion()
Returns a string that identifies what version of the specification this implementation of the ALE Logical Reader API complies with.
getVendorVersion()
Returns a string that identifies what vendor extensions of the ALE Logical Reader API this implementation provides.






