Edge Management

From RifidiWiki

Revision as of 19:15, 3 June 2021 by Bppause (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Introduction

Starting in 3.1 Edge Management is now accessible though Restful Services (leveraging Restlet plugin. Restlet allows all Rifidi Edge Management operations available through workbench to be accessible via Restful Services.Prior to Rifidi 3.1 Edge Management is available through RMI (currently used by Rifidi Workbench if looking for code examples).

The types of operations available through Restful Services include:

  • All "session" commands (for stopping and starting reader/sensor sessions)
  • ExecuteCommand and deleteCommand (for commands supported by a sensor such as a tag read)
  • Readers (for getting a list of readers/sensors available on Edge Server instance)
  • Commands (for issuing command line operations such as saving the Edge Server Configuration currently in memory)
  • Get and Set Properties (for setting and getting sensor properties such as Setting the LLRP Reader Configuration dynamically)
  • Create Reader (for creating a new reader connection)
  • Managing Rifidi Applications (for stopping/starting, listing and deploying Rifidi Apps)

Additional features can be found on Restlet User Guide

Configuration

In rifidiserver.ini - A full list of Rifidi Edge configuration parameters can be found Edge_Server_Configuration

#Port can be set
-Dorg.rifidi.restlet.port=8111
#Restlet starts by default this can be changed 
-Dorg.rifidi.restlet.enabled=true

Source for Restful Rifidi Management Commands - https://transcends.svn.cloudforge.com/rifidi/rifidi/trunk/org.rifidi.edge/src/org/rifidi/edge/rest/

Configuration (HTTP over SSL) - Available as of version 3.1.1

A full list of Rifidi Edge configuration parameters can be found Edge_Server_Configuration

#SSL Port can be set
-Dorg.rifidi.restlet.ssl.port=8183
#Restlet starts by default this can be changed 
-Dorg.rifidi.restlet.ssl.enabled=true
#Keystore Path
-Dorg.rifidi.restlet.ssl.keystorepath=\config\serverX.jks
#Key store password
-Dorg.rifidi.restlet.ssl.keystorepassword=password
#Key Password
-Dorg.rifidi.restlet.ssl.keypassword=password
#Key store Type
-Dorg.rifidi.restlet.ssl.keystoretype=JKS

REST HTTP over SSL Example Application

link to https java client example - https://transcends.svn.cloudforge.com/rifidi/rifidi/trunk/org.rifidi.edge.rest/src/org/rifidi/edge/rest/test/HttpsTestClient.java

user can add this jvm parameter to see detailed messages if getting any 
trouble when running this example:
-Djavax.net.debug=all

In order to successful get the https response from stand alone java 
example, user must import the certificate into JVM:

open command windows as administrator and execute keytool -import, like:

keytool -import -alias localhost -keystore "C:\Program Files 
(x86)\Java\jdk1.6.0_45\jre\lib\security\cacerts" -file 
"D:\tmp\cert\localhost.cer"

if requested, default password is: changeit

Ensure to place the generated JKS file in the Rifidi \config folder so the server can start via SSL and find the cert

Restlet Logging

  • 1. Add an entry to the rifidiserver.ini (if using windows; when using linux you add this JVM argument in the rifidi-server executable):

-Djava.util.logging.config.file=d:/myLogging.properties

  • 2. Create logging properties file, for example like the below myLogging.properties

The entry in that file that determines where the log file will show up is the following: java.util.logging.FileHandler.pattern=d:/restlet.log

myLogging.properties
# ================================
    # ==                            ==
    # ==   Web Logging Properties   ==
    # ==                            ==
    # ================================


    # ------------------
    # General properties
    # ------------------


    # This defines a whitespace separated list of class names for handler classes to load and register as handlers on
    # the root Logger (the Logger named ""). Each class name must be for a Handler class which has a default constructor.
    # Note that these Handlers may be created lazily, when they are first used.
    handlers=java.util.logging.FileHandler
	# ------------------
    # Loggers properties
    # ------------------

    .level=WARNING
    org.mortbay.level=WARNING
    org.restlet.level=INFO
    com.noelios.level=WARNING

    com.noelios.web.WebComponent.www.level=INFO
    com.noelios.web.WebComponent.www.handlers=com.noelios.restlet.util.AccessLogFileHandler
    com.noelios.web.WebComponent.www.useParentHandlers=false
	# -------------------------
    # ConsoleHandler properties
    # -------------------------

    # Specifies the default level for the Handler  (defaults to Level.INFO).
    # java.util.logging.ConsoleHandler.level=WARNING

    # Specifies the name of a Filter class to use (defaults to no Filter).
    # java.util.logging.ConsoleHandler.filter=

    # Specifies the name of a Formatter class to use (defaults to java.util.logging.SimpleFormatter).
    # java.util.logging.ConsoleHandler.formatter=

    # The name of the character set encoding to use (defaults to the default platform encoding).
    # java.util.logging.ConsoleHandler.encoding=
	
	# ------------------------------
    # General FileHandler properties
    # ------------------------------

    # Specifies the default level for the Handler  (defaults to Level.ALL).
    # java.util.logging.FileHandler.level=ALL

    # Specifies the name of a Filter class to use (defaults to no Filter).
    # java.util.logging.FileHandler.filter=

    # Specifies the name of a Formatter class to use (defaults to java.util.logging.XMLFormatter)
    java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter

    # The name of the character set encoding to use (defaults to the default platform encoding).
    # java.util.logging.FileHandler.encoding=

    # Specifies an approximate maximum amount to write (in bytes) to any one file.
    # If this is zero, then there is no limit. (Defaults to no limit).
    java.util.logging.FileHandler.limit=10000000

    # Specifies how many output files to cycle through (defaults to 1).
    java.util.logging.FileHandler.count=100

    # Specifies a pattern for generating the output file name. (Defaults to "%h/java%u.log").
    # A pattern consists of a string that includes the following special components that will be replaced at runtime:
    #    "/" the local pathname separator
    #    "%t" the system temporary directory
    #    "%h" the value of the "user.home" system property
    #    "%g" the generation number to distinguish rotated logs
    #    "%u" a unique number to resolve conflicts
    #    "%%" translates to a single percent sign "%"
    java.util.logging.FileHandler.pattern=d:/restlet.log

    # Specifies whether the FileHandler should append onto any existing files (defaults to false).
    # java.util.logging.FileHandler.append=
	# -------------------------
    # LogFileHandler properties
    # -------------------------

    # Specifies the default level for the Handler  (defaults to Level.ALL).
    # org.restlet.engine.log.AccessLogFileHandler.level=ALL

    # Specifies the name of a Filter class to use (defaults to no Filter).
    # org.restlet.engine.log.AccessLogFileHandler.filter=

    # Specifies the name of a Formatter class to use (defaults to java.util.logging.XMLFormatter)
    org.restlet.engine.log.AccessLogFileHandler.formatter=com.noelios.restlet.util.AccessLogFormatter

    # The name of the character set encoding to use (defaults to the default platform encoding).
    # org.restlet.engine.log.AccessLogFileHandler.encoding=

    # Specifies an approximate maximum amount to write (in bytes) to any one file.
    # If this is zero, then there is no limit. (Defaults to no limit).
    org.restlet.engine.log.AccessLogFileHandler.limit=10000000

    # Specifies how many output files to cycle through (defaults to 1).
    org.restlet.engine.log.AccessLogFileHandler.count=100

    # Specifies a pattern for generating the output file name. (Defaults to "%h/java%u.log").
    # A pattern consists of a string that includes the following special components that will be replaced at runtime:
    #    "/" the local pathname separator
    #    "%t" the system temporary directory
    #    "%h" the value of the "user.home" system property
    #    "%g" the generation number to distinguish rotated logs
    #    "%u" a unique number to resolve conflicts
    #    "%%" translates to a single percent sign "%" .pattern=/home/prod/data/log/WebComponent-www-%u-%g.log

    # Specifies whether the FileHandler should append onto any existing files (defaults to false).
    # org.restlet.util.AccessLogFileHandler.append=

Restlet Tuning/Confguration (Jetty) as of Rifidi 3.4

As of Rifidi 3.4 Jetty was made the default HTTP container for Restlet to allow for extended performance and configuration of the REST interface.

The parameters can for configured in the Rifidi Server (ini) configuration

Examples:

  • -Dorg.rifidi.restlet.threadPool.minThreads=8 Thread pool minimum threads
  • -Dorg.rifidi.restlet.threadPool.maxThreads=200 Thread pool max threads

Full list of Jetty parameters using the same naming convention can be found here - http://restlet.com/technical-resources/restlet-framework/javadocs/snapshot/jse/ext/org/restlet/ext/jetty/JettyServerHelper.html

Commands

Command Code Snippet - start session - example how to use Rifidi API in a Java App

All Rifidi Management API Command Logic here - https://transcends.svn.cloudforge.com/rifidi/rifidi/trunk/org.rifidi.edge/src/org/rifidi/edge/rest/SensorManagerServiceRestletImpl.java

try {
sensorManagerService.startSession((String) request
	.getAttributes().get("readerID"), (String) request
		.getAttributes().get("sessionID"));
	response.setEntity(self.generateReturnString(self
		.generateSuccessMessage()), MediaType.TEXT_XML);
} catch (Exception e) {
	response.setEntity(e.getMessage(), MediaType.TEXT_PLAIN);
	}

Command Basic Flow Example

  1. Create a Reader - http://localhost:8111/createreader/LLRP/IpAddress=127.0.0.1;Port=5084
  2. Create a Session (on a reader/sensor) - http://localhost:8111/createsession/LLRP_1
  3. Create a Command (on a reader/sensor)) -/createcommand/{commandType}/{properties}
  • Note: some readers do not require create/executing a command as there is only one command hence for convenience is part of the create session/start session (Thinkify, CSL and Generic adapter (for handhelds/async push calls) are some examples of this)
  1. Set Command Properties - http://localhost:8111/setproperties/LLRP_Configure_1/Duration=2130
  2. Execute Command (on a given reader/sensor and session) - http://localhost:8111/executecommand/LLRP_1/1/LLRP_Configure_1/-1
  3. Start Session (to begin processing reads using associate command/reader/sensor configuration) - http://localhost:8111/startsession/LLRP_1/1
  4. Save Configuartion (optional - to save/persist config in case of a server restart) - http://localhost:8111/save

Command Example

Note: localhost can be substituted with IP address/Host name of Rifidi Edge Server. Port can be changed in Rifidi configuration


commandtypes command example

  • commandtypes - returns a list of available command types

Request (via HTTP Post/Get) "commandtypes" command like this:

http://localhost:8111/commandtypes

Response:

<response>
<commands>
<command>
<factoryID>LLRP-ADD_ROSPEC-File</factoryID>
<description>
Configure the LLRP reader via an XML file. Any changes made to the reader are determined by the contents of the file. To generate xml code for the commands you want to submit, check out LLRP Commander here: http://www.fosstrak.org/llrp/index.html
</description>
<readerFactoryID>LLRP</readerFactoryID>
</command>
<command>
<factoryID>ThingMagic-Poll</factoryID>
<description>
Poll the ThingMagic reader for its tags. For monitoring of the read zone, submit this command for recurring execution.
</description>
<readerFactoryID>ThingMagic</readerFactoryID>
</command>
<command>
<factoryID>Alien-Push-Start</factoryID>
<description>
Configure the Alien reader to send back tags using the autonomous mode. To monitor a read zone, configure an Alien autonomous reader to listen. Then submit this command for a one-time execution.
</description>
<readerFactoryID>Alien</readerFactoryID>
</command>
<command>
<factoryID>LLRP-Configure</factoryID>
<description>
Configure the LLRP reader to collect tags. By default, this command will cause the LLRP reader to push back tag reads automatically. If you would rather use the Poll mode, you will need to use the LLRP Poll command. To use the LLRP Configure command, submit it for a one-time execution
</description>
<readerFactoryID>LLRP</readerFactoryID>
</command>
<command>
<factoryID>LLRP-Push-Stop</factoryID>
<description>
Command the LLRP reader to stop sending back tags. To use, supply the RO Spec that is currently executing on the reader, and submit this command for a one-time execution.
</description>
<readerFactoryID>LLRP</readerFactoryID>
</command>
<command>
<factoryID>Awid2010-Poll</factoryID>
<description>
Configure the Awid reader to send back tags using the Gen 2 Portal ID command. To monitor a read zone, submit this command for a one-time execution.
</description>
<readerFactoryID>Awid2010</readerFactoryID>
</command>
<command>
<factoryID>Thingmagic6-Push</factoryID>
<description>
Sets the Thingmagic to push tags back to the edge server
</description>
<readerFactoryID>Thingmagic6</readerFactoryID>
</command>
<command>
<factoryID>Awid3014-Poll</factoryID>
<description>
Configure the Awid reader to send back tags using the Gen 2 Portal ID command. To monitor a read zone, submit this command for a one-time execution.
</description>
<readerFactoryID>Awid3014</readerFactoryID>
</command>
<command>
<factoryID>Awid3014-Push-Stop</factoryID>
<description>
Command the Awid reader to stop sending back tags. To use, submit this command for a one-time execution.
</description>
<readerFactoryID>Awid3014</readerFactoryID>
</command>
<command>
<factoryID>Alien-Poll</factoryID>
<description>
Poll the Alien reader for its tag list. For monitoring of the read zone, submit this command for recurring execution.
</description>
<readerFactoryID>Alien</readerFactoryID>
</command>
<command>
<factoryID>LLRP-Poll</factoryID>
<description>
Poll the LLRP reader for its tags. For monitoring of the read zone, first use the LLRP Configure command to configure the LLRP reader for Poll Mode. Then submit this command for recurring execution.
</description>
<readerFactoryID>LLRP</readerFactoryID>
</command>
<command>
<factoryID>Awid-Mask-Poll</factoryID>
<description>
Configure the Awid reader to send back tags using the Gen 2 Portal ID With Mask command. To monitor a read zone and read a specific memory bank, submit this command for a one-time execution.
</description>
<readerFactoryID>Awid2010</readerFactoryID>
</command>
<command>
<factoryID>Alien-Push-Stop</factoryID>
<description>
Command the Alien reader to stop sending back tags in autonomous mode. To use, submit this command for a one-time execution.
</description>
<readerFactoryID>Alien</readerFactoryID>
</command>
<command>
<factoryID>Awid2010-Push-Stop</factoryID>
<description>
Command the Awid reader to stop sending back tags. To use, submit this command for a one-time execution.
</description>
<readerFactoryID>Awid2010</readerFactoryID>
</command>
<command>
<factoryID>Awid-Read-Block-Data</factoryID>
<description>
Configure the Awid reader to send back memory bank tags using the Read Block Data commmand. To monitor a read zone and read a specific memory bank, submit this command for a one-time execution.
</description>
<readerFactoryID>Awid2010</readerFactoryID>
</command>
</commands>
</response>

readertypes command example

  • readertypes - returns a list of available reader/sensor types (such as LLRP, Alien, BarCode etc..)

Request (via HTTP Post/Get) "readertypes" command like this:

http://localhost:8111/readertypes

Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <sensors>
      <sensor>
         <factoryID>Generic</factoryID>
         <description>A generic Rifidi Adapter.</description>
      </sensor>
      <sensor>
         <factoryID>Opticon</factoryID>
         <description>The Rifidi Adapter for the Opticon Barcode Sensor</description>
      </sensor>
      <sensor>
         <factoryID>Alien-Autonomous</factoryID>
         <description>The Rifidi Alien autonomous adapter is an endpoint to passively receive tag reads from an Alien reader operating in autonomous mode. You cannot send any commands on the alien autonomous session</description>
      </sensor>
      <sensor>
         <factoryID>Awid2010</factoryID>
         <description>The Rifidi Awid adapater supports the Awid TCP/IP protocol on the 2010 and 3014</description>
      </sensor>
      <sensor>
         <factoryID>Thingmagic6</factoryID>
         <description>Sensor plugin for Thingmagic 6 readers</description>
      </sensor>
      <sensor>
         <factoryID>LLRP</factoryID>
         <description>The Rifidi LLRP adapter supports any reader that exposes a Low Level Reader Protocol (LLRP) interface. LLRP is a standard from EPCglobal.</description>
      </sensor>
      <sensor>
         <factoryID>Awid3014</factoryID>
         <description>The Rifidi Awid adapater supports the Awid TCP/IP protocol on the 2010 and 3014</description>
      </sensor>
      <sensor>
         <factoryID>Alien</factoryID>
         <description>The Rifidi Alien adapter supports the Alien ALR protocol on the 9900, 9800, 8800 readers.</description>
      </sensor>
      <sensor>
         <factoryID>Thinkify50</factoryID>
         <description>Sensor plugin for Thinkify TR50 readers</description>
      </sensor>
      <sensor>
         <factoryID>ThingMagic</factoryID>
         <description>The Rifidi ThingMagic adapater supports the ThingMagic RQL protocol on the Mercury 4 and Mercury 5 readers</description>
      </sensor>
   </sensors>
</response>

createreader command example

Note: The command is atomic so either all the parameters/properties in request are valid hence the reader/sensor adapter instance is created or the call fails therefore the reader/adapter instance is not created

  • createreader/{readerType}/{properties} -creates a reader/sensor configuration

Request (via HTTP Post/Get) "createreader" command like this (splitting all property key/value pairs by a semicolon):

Response success:

http://localhost:8111/createreader/LLRP/IpAddress=127.0.0.1;Port=5084

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <readerID>LLRP_1</readerID> Note: added in in 4.0 release
   <message>Success</message>
</response>

Response fail (if there is at least one non valid property, the reader is not created):

http://localhost:8111/createreader/LLRP/IpAddress=127.0.0.2;Port=5084;fakeProp=1234;anotherProp=ABC

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Fail</message>
   <description>Not valid properties: fakeProp=1234|anotherProp=ABC</description>
</response>

createreader overriding default readerID command example

The reader id is important for applications' read zones to appropriate operate, and this id is used to link read zones with sensors. This command enables one to set the readerId versus the system generating one (default behavior).


Note: To override the default reader id, there must be included the property readerID, in order to assign a specific reader id and override the default. Note: The command is atomic so either all the parameters/properties in request are valid hence the reader/sensor adapter instance is created or the call fails therefore the reader/adapter instance is not created

  • createreader/{readerType}/{properties} -creates a reader/sensor configuration

Request (via HTTP Post/Get) "createreader" command like this (splitting all property key/value pairs by a semicolon):

Response success:

http://localhost:8111/createreader/LLRP/IpAddress=127.0.0.1;Port=5084;readerID=myReaderID

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <readerID>LLRP_1</readerID> Note: added in in 4.0 release
   <message>Success</message>
</response>

Response fail (if there is at least one non valid property, the reader is not created):

http://localhost:8111/createreader/LLRP/IpAddress=127.0.0.2;Port=5084;fakeProp=1234;anotherProp=ABC;readerID=myReaderID

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Fail</message>
   <description>Not valid properties: fakeProp=1234|anotherProp=ABC</description>
</response>

deletereader command example (released in 3.2)

Note: The command is atomic so either all the parameters/properties in request are valid hence the reader/sensor adapter instance is created or the call fails therefore the reader/adapter instance is not created

  • deletereader/{readerID} -deletes a reader/sensor configuration


Response success:

http://localhost:8111/deletereader/LLRP_1

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Success</message>
</response>

Response fail (if there is at least one non valid property, the reader is not created):

http://localhost:8111/deletereader/LLRP

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Fail</message>
   <description>Not valid readerID: LLRP</description>
</response>

readers command example

Request (via HTTP Post/Get) "readers" command like this:

  • readers - returns a list of readers/senors managed by the Edge Server

http://localhost:8111/readers

Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <sensors>
      <sensor>
         <serviceID>Alien_1</serviceID>
         <factoryID>Alien</factoryID>
      </sensor>
      <sensor>
         <serviceID>Alien_2</serviceID>
         <factoryID>Alien</factoryID>
      </sensor>
   </sensors>
</response>


getproperties command example (to get reader properties)

  • getproperties/{readerID} - returns the reader/sensor properties

Request (via HTTP Post/Get) "getproperties" command like this, to get a reader properties:

http://localhost:8111/getproperties/LLRP_1


Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <attributes>
      <entry>
         <key>ReconnectionInterval</key>
         <value>500</value>
      </entry>
      <entry>
         <key>Port</key>
         <value>5084</value>
      </entry>
      <entry>
         <key>IpAddress</key>
         <value>192.168.1.48</value>
      </entry>
      <entry>
         <key>MaxNumConnectionAttempts</key>
         <value>10</value>
      </entry>
      <entry>
         <key>DisplayName</key>
         <value>null</value>
      </entry>
      <entry>
         <key>ReaderConfigPath</key>
         <value>config/SET_READER_CONFIG.llrp</value>
      </entry>
   </attributes>
</response>

getproperties command example (to get command properties)

  • getproperties/{commandID} - returns the command properties

Request (via HTTP Post/Get) "getproperties" command like this:

http://localhost:8111/getproperties/LLRP_Configure_1


Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <attributes>
      <entry>
         <key>ROSpecID</key>
         <value>1</value>
      </entry>
      <entry>
         <key>AntennaIDs</key>
         <value>0</value>
      </entry>
      <entry>
         <key>Duration</key>
         <value>1000</value>
      </entry>
      <entry>
         <key>TriggerType</key>
         <value>PUSH</value>
      </entry>
   </attributes>
</response>

setproperties command example (to set reader properties)

  • setproperties/{readerID}/{properties}" - sets the reader/sensor properties

Note: if there is an existing session for updated reader properties to take effect the session will need to be deleted and recreated so the properties are moved to the session

Request (via HTTP Post/Get) setproperties" like this (splitting all property key/value pairs by a semicolon):


Response success:

http://localhost:8111/setproperties/Alien_1/MaxNumConnectionAttempts=11;DisplayName=Alien_Name

<response><message>Success</message></response>


Response fail (valid properties are set, ignoring not valid ones):

http://localhost:8111/setproperties/LLRP_1/IpAddress=127.0.0.15;Port=4567;att1=aa;att2=bbb;attt3=YY

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Success</message>
   <state>Warning</state>
   <description>Not valid properties: att1=aa|att2=bbb|attt3=YY</description>
</response>

setproperties command example (to set command properties)

  • setproperties/{commandID}/{properties}" - sets the command properties

Request (via HTTP Post/Get) setproperties" like this (splitting all property key/value pairs by a semicolon):


Response success

http://localhost:8111/setproperties/LLRP_Configure_1/Duration=2130


<response><message>Success</message></response>


Response fail (valid properties are set, ignoring not valid ones):

http://localhost:8111/setproperties/LLRP_Configure_1/Duration=7500;cc=4;other=67

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Success</message>
   <state>Warning</state>
   <description>Not valid properties: cc=4|other=67</description>
</response>

commands command example

  • commands - returns a list of available commands

Request (via HTTP Post/Get) "commands" command like this:

http://localhost:8111/commands

Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <commands>
      <command>
         <commandID>LLRP_Configure_1</commandID>
         <factoryID>LLRP-Configure</factoryID>
      </command>
   </commands>
</response>

createcommand example

Note: The command is atomic so either all the parameters/properties in request are valid hence the command instance is created or the call fails therefore the rcommand instance is not created

  • createcomamnd/{commandType}/{properties} - creates a command to be executed on a reader session

Request (via HTTP Post/Get) "createcommand" command like this (splitting all property key/value pairs by a semicolon):

Response success:

http://localhost:8111/createcommand/LLRP-Configure/Duration=5000

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <commandID>Alien_Poll_2</commandID> Note: Added in 4.0 release
   <message>Success</message>
</response>

Response error (if there is at least one non valid property, the command is not created):

http://localhost:8111/createcommand/LLRP-Configure/Duration=4000;propX=123;prop2=AB

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Fail</message>
   <description>Not valid properties: propX=123|prop2=AB</description>
</response>

deletecommand command example (released in 3.2)

Note: The command is atomic so either all the parameters/properties in request are valid hence the reader/sensor adapter instance is created or the call fails therefore the reader/adapter instance is not created

  • deletecommand/{commandID} -deletes a reader/sensor configuration


Response success:

http://localhost:8111/deletecommand/LLRP_Configure_1

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Success</message>
</response>

Response fail (if there is at least one non valid property, the reader is not created):

http://localhost:8111/deletecommand/LLRP_Configure

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Fail</message>
   <description>Not valid commandID: LLRP_Configure</description>
</response>

createsession command example

  • createsession/{readerID} - creates a session (with corresponding reader/sensor configuration) and returns status code (such as successful)

Request (via HTTP Post/Get) "createsession" command like this:

http://localhost:8111/createsession/LLRP_1

Response: Success

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <sessionID>1</sessionID>
   <message>Success</message>
</response>

Response: Fail -already a session for sensor id

<?xml version="1.0" encoding="UTF-8"?>

<response>
 <message>Fail</message>
  <description>
     java.lang.Exception: Reader Alien_1 already has a session.
   </description>
</response>

startsession command example

  • startsession/{readerID}/{sessionID} - starts a session for a given reader/sensor and returns status code (such as successful)

Request (via HTTP Post/Get) "startsession" command like this:

http://localhost:8111/startsession/LLRP_1/1

Response: Success

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Success</message>
</response>

Response: Fail

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Error</message>
   <state>CONNECTING</state>
   <description>Unable to start session, current state is CONNECTING  - See Rifidi Edge Sever Log for details</description>
</response>

readerstatus command example

  • readerstatus/{readerID} - retuns teh status of a given reader/sensor

Request (via HTTP Post/Get) "readerstatus" command like this:

http://localhost:8111/readerstatus/LLRP_1

Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <sensor>
      <serviceID>LLRP_1</serviceID>
      <factoryID>LLRP</factoryID>
   </sensor>
   <sessions>
      <session>
         <ID>1</ID>
         <status>PROCESSING</status>

         <executingcommands>
            <executingcommand>
               <commandFactory>LLRP-Configure</commandFactory>
              <commandID>LLRP_Configure_1</commandID>
              <interval>0</interval>
            </executingcommand>
        </executingcommands>
      </session>
   </sessions>
</response>

stopsession command example

  • stopsession/{readerID}/{sessionID} - stops a session for a given reader/sensor and returns status code (such as successful)

Request (via HTTP Post/Get) "stopsession" command like this:

http://localhost:8111/stopsession/LLRP_1/1

Response success:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Success</message>
</response>

Response fail:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Error</message>
   <state>CREATED</state>
   <description>Unable to stop session, current state is CREATED  - See Rifidi Edge Sever Log for details</description>
</response>

resetsession command example (released in Rifidi 3.7)

  • /resetsession/{readerID}/{sessionID}

Used to stop and start an existing reader session

http://localhost:8111/resetsession/LLRP_1/1 (for recurring)

executecommand command example

  • executecommand/{readerID}/{sessionID}/{commandID}/{repeatInterval} - Executes a command for a given session

Request (via HTTP Post/Get) "executecommand" command like this:

http://localhost:8111/executecommand/LLRP_1/1/LLRP_Configure_1/-1 (for recurring)

http://localhost:8111/executecommand/LLRP_1/1/LLRP_Configure_1/0 (for single shot - one time execution)

Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Success</message>
</response>

deletesession command example

  • deletesession/{readerID}/{sessionID} - deletes a session and returns status code (such as successful)

Request (via HTTP Post/Get) "deletesession" command like this:

http://localhost:8111/deletesession/LLRP_1/1

Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Success</message>
</response>


save command example

  • save - Saves the current state of the Edge Server configuration (such as created readers/sensors, modified properties etc..

Request (via HTTP Post/Get) "save" command like this:

http://localhost:8111/save

Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Success</message>
</response>


Ping - Used by failover feature

  • ping - Returns a date/timestamp

Request (via HTTP Post/Get) "ping" command like this:

http://localhost:8111/ping

Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <timestamp>1414610247969</timestamp>
</response>

currenttags example (released in Rifidi 3.4)

  • currenttags/{readerID} - Returns a list of tags on a given reader

Note: timestamp, reader and RSSI added in 3.5.1

Request (via HTTP Post/Get) "currenttags" command like this:

http://localhost:8111/currenttags/LLRP_1

Response:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <currenttags>
        <tag><id>2f6a00ab13c1536b3085aba3</id><antenna>1</antenna><timestamp>1466736476986</timstamp><reader>LLRP_1</reader><rssir>-100</rssi></tag>
        <tag><id>2f6a00ab13c1536b3085aba3</id><antenna>1</antenna><timestamp>1466736476986</timstamp><reader>LLRP_1</reader><rssir>-100</rssi></tag>
   </currenttags>
</response>

readermetadata - Used by Web Administration Dashboard for Dynamic Reader & Command Properties/Wizard (released in 3.2)

  • readermetadata- Returns reader metadata

Request (via HTTP Post/Get) "readermetadata" command like this:

http://localhost:8111/readermetadata

Response:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><response>
<response>
 <readers>
  <reader>
   <properties>
    <property>
     <name>ReconnectionInterval</name>
     <displayName>Reconnection Interval</displayName>
     <defaultvalue>500</defaultvalue>
     <description>
     Upon connection failure, the time to wait between two connection attempts (ms)
     </description>
     <type>java.lang.Integer</type>
     <minvalue>0</minvalue>
     <category>connection</category>
     <writable>true</writable>
     <ordervalue>4.0</ordervalue>
    </property>
   <property>
     <name>Port</name>
     <displayName>Port</displayName>
     <defaultvalue>8090</defaultvalue>
     <description>Port of the Reader</description>
     <type>java.lang.Integer</type>
     <maxvalue>65535</maxvalue>
     <minvalue>0</minvalue>
     <category>connection</category>
     <writable>true</writable>
     <ordervalue>1.0</ordervalue>
    </property>

Thinkify RCS Command - Used for one time configuration of a Thinkify USB reader (Deprecated in 3.5.1)

  • rcs/{Thinkify Reader ID}/{sessionid}

request (via HTTP Post/Get) "rcs" command like this:

http://localhost:8111/rcs/ThinkifyUSB_1/1

startbundle OSGI command example (released in Rifidi 3.7)

  • /startbundle/{bundleID}

Used to stop a OSGI bundle

Request http://localhost:8111/startbundle/1

Response: success

stopbundle OSGI command example (released in Rifidi 3.7)

  • /stopbundle/{bundleID}

Used to install a OSGI bundle

Request http://localhost:8111/stopbundle/1

Response: success

installbundle OSGI command example (released in Rifidi 3.7)

  • /installbundle

(put the path in the request)

Used to start a OSGI bundle

Request http://localhost:8111/installbundle

Response: success

uninstallbundle OSGI command example (released in Rifidi 3.7)

  • /uninstallbundle/{bundleID}

(put the path in the request)

Used to uninstall a OSGI bundle

Request http://localhost:8111/uninstallbundle/1

Response: success

ss OSGI command example (released in Rifidi 3.7)

  • /ss

Used to list the OSGI bundles

Request http://localhost:8111/ss

Response:

<response>
<bundles>
<bundles>
<name>org.eclipse.osgi</name>
<id>0</id>
<state>ACTIVE</state>
</bundles>
<bundles>
<name>org.eclipse.equinox.weaving.hook</name>
<id>1</id>
<state>RESOLVED</state>
</bundles>
<bundles>
<name>org.eclipse.equinox.simpleconfigurator</name>
<id>2</id>
<state>ACTIVE</state>
</bundles>
<bundles>
<name>com.sun.mail.javax.mail</name>
<id>3</id>
<state>ACTIVE</state>
</bundles>

Set GPO Command Example (released in Rifidi 3.8.1)

  • /setgpo/{readerID}/{sessionID}/{ports}

Used to set gpo

Request http://localhost:8111/setgpo/LLRP_1/1/1,2,3

Response:

<response>
<message>Success</message>
</response>

Flash GPO Command Example (released in Rifidi 3.8.1)

  • //flashgpo/{readerID}/{sessionID}/{ports}/{duration in seconds}

Used to turn gpo on for a specified duration such as Flashing a light on for 4 seconds then turn it off again

Request http://localhost:8111/flashgpo/LLRP_1/1/1,2,3/4

Response:

<response>
<message>Success</message>
</response>


stopapp command example

  • //stopapp/{appID}

Used to stop a Rifidi App

Request http://localhost:8111/stopapp/1

Response:

<response>
<message>Success</message>
</response>

startapp command example

  • //startapp/{appID}

Used to start a Rifidi App

Request http://localhost:8111/startapp/1

Response:

<response>
<message>Success</message>
</response>


apps command example - List of Apps

  • //apps

Used to start a Rifidi App

Request http://localhost:8111/apps

Response:

response>
<apps>
<app>
<id>AppService:ReadZones</id>
<number>0</number>
<status>STARTED</status>
</app>
<app>
<id>AppService:ReadZones</id>
<number>1</number>
<status>STARTED</status>
</app>
<app>
<id>AppService:SensorStatus</id>
<number>2</number>
<status>STARTED</status>
</app>
<app>
<id>AppService:UniqueTagInterval</id>
<number>3</number>
<status>STARTED</status>
</app>
<app>
<id>AppService:StableSet</id>
<number>4</number>
<status>STARTED</status>
Personal tools