![]() ![]() ![]() ![]() ![]() ![]() ![]() |
The following sections describe the asynchronous notification mechanisms WebLogic RFID Edge Server uses to deliver reports to client applications:
You can define specifications (ECSpec, PCSpec, and EPCCacheSpec) for your applications and later subscribe the application to asynchronous delivery of corresponding reports (ECReports, PCWriteReport, EPCCacheReport). WebLogic RFID Edge Server provides a number of ways to deliver asynchronous reports. A subscription specifies a delivery address in the form of a Uniform Resource Identifier (URI). The URI specifies a particular method of notification delivery, and provides parameters that further identify the receiver.
In addition to out-of-the-box event delivery drivers that are applicable in a wide range of circumstances, the WebLogic RFID Edge Server provides an extensible mechanism for adding new delivery mechanisms. The following sections define the delivery mechanisms supported out-of-the-box by BEA, and describe how to construct the URIs to provide to the subscribe method of the ALE interface in order to use them.
All of the notification delivery mechanisms described below encode reports into XML. For additional information, see:
ECSpec
and ECReports
objects)PCSpec
, PCWriteReport
, EPCCacheSpec
, and EPCCacheReport
objects)
The RFID Edge Server can deliver reports by sending an HTTP POST request, where the payload is the report instance encoded in XML. The general form of the subscription URI is:
http://host:port/remainder-of-URL
The notification payload is the XML-encoded report instance (ECReports, PCWriteReport, EPCCacheReport) for the subscribed event or programming cycle.
The response code returned by the HTTP server is used to determine whether the notification succeeded or not. A response code of 200 through 299 indicates success; any other response code indicates failure.
The Edge Server can deliver reports by opening a TCP socket to a designated receiver, sending an XML report, then closing the connection. The general form of the subscription URI is:
tcp://host:port
The notification payload is the XML-encoded report instance (ECReports, PCWriteReport, EPCCacheReport) for the subscribed event or programming cycle.
The Edge Server can deliver event cycle reports by sending a JMS Message to a JMS Topic or a JMS Queue where the message is a javax.jms.TextMessage
that contains the ECReports
instance encoded using XML.
The general form of the URI is:
jms:/topic/conn_factory/topic_name[?queryParams]
jms:/queue/conn_factory/queue_name[?queryParams]
Optional segments are enclosed in square brackets [].
Table 3-3
The RFID Server also adds three additional properties to the TextMessage
.
The driver sends JMS messages in a non-transactional context.
Note: | All string values in the various segments of the URI have to be properly URI escaped. For example, to specify a forward slash (/) character in the URI, where that character is part of either the JNDI name or the connection factory, or the JNDI name of the queue or the topic, you need to use %2F instead of the forward slash character. For more information, see RFC 2396 at http://www.ietf.org/rfc/rfc2396.txt. |
In the following example the Edge Server is instructed to send XML reports through JMS to a queue named MyECReportSpecQueue
. The JNDI service is accessed using iiop
at jms.example.com
through port 1099
. The JNDI name of the connection factory to be used is ConnectionFactory
.
jms:/queue/ConnectionFactory/MyECReportSpecQueue?jndi:java.naming.provider.url=iiop://jms.example.com:1099
In the following example the Edge Server is instructed to send XML reports through JMS to a topic named MyECReportSpecTopic
. The JNDI service is accessed using iiop
at jms.example.com
via port 1099. The JNDI name of the connection factory to be used is called ConnectionFactory
.
jms:/topic/ConnectionFactory/MyECReportSpecTopic?jndi:java.naming.provider.url=iiop://jms.example.com:1099
The following example is more complex. This example incorporates JMS security as well as JNDI service security while using a queue. It uses the jndi:
query parameters to set a security principal and security credential of guest/PasswordForGuest
to access the JNDI service, and uses the username and password combination of bob/PasswordForBob
to open a connection to the queue.
jms:/queue/ConnectionFactory/MyECReportSpecQueue?username=bob&password=PasswordForBob&
jndi:java.naming.provider.url=iiop://jms.example.com:1099&
jndi:java.naming.security.principal=guest&
jndi:java.naming.security.credentials=PasswordForGuest
The following example uses all the elements of the previous example while overriding the default naming context factory class being used by the JMS driver. The class org.jnp.interfaces.NamingContextFactory
will be used instead of the one the driver is configured with when performing JNDI lookups.
jms:/queue/ConnectionFactory/MyECReportSpecQueue?username=bob&password=PasswordForBob&secPrincipal=guest&jndi:java.naming.provider.url=iiop://jms.example.com:1099&jndi:java.naming.security.principal=guest&jndi:java.naming.security.credentials=PasswordForGuest&jndi:java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
The following example adds additional query parameters, field1
and field2
that will be added onto the JMS text message.
jms:/queue/ConnectionFactory/MyECReportSpecQueue?username=bob&password=PasswordForBob&secPrincipal=guest&jndi:java.naming.provider.url=iiop://jms.example.com:1099&jndi:java.naming.security.principal=guest&jndi:java.naming.security.credentials=PasswordForGuest&jndi:java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory&field1=value1&field2=value2
The Edge Server can deliver event or programming cycle reports by creating or appending XML to files in the Edge Server's local file system. The general form of the subscription URI is:
file:///filename
where filename
is either the name of a file, a directory, or a pattern as described below.
If filename
names a specific file that already exists, the ECReports, PCWriteReport, or EPCCacheReport instance is encoded as XML and appended to the file. If more than one cycle completes, the resulting file is not a well-formed XML document, but a concatenation of XML documents.
If filename
does not name an existing file but the directory portion names an existing directory, then the file is created, and the ECReports, PCWriteReport, or EPCCacheReport instance is encoded as XML and written to the file. If another cycle completes, the prior case applies and the file will be a concatenation of XML documents.
If filename
names a directory, then the ECReports, PCWriteReport, or EPCCacheReport instance is written as a new file in that directory with a unique name of the form:
specName-yyyyMMddhhmmssSSS.xml
where specName
is the name of the ECSpec
, PCSpec
, or EPCCacheSpec
that defined the cycle, and yyyyMMddhhmmssSSS
is the timestamp in the ECReports
, PCWriteReport
, or EPCCacheReport
instance, in the local timezone (SSS
is the millisecond, which helps ensure the uniqueness of the filename even if several reports are generated per second).
If filename
contains parentheses, the text within the parentheses is considered to be a pattern string for the timestamp, and the resulting filename after substitution is treated as above. For example, given this subscription URI:
file:///mydir/myprefix-(yyyy-MM-dd).xml
then all reports generated on December 28, 2005 would be appended to the file
/mydir/myprefix-2005-12-28.xml
In all cases, the XML is as described in:
ECSpec
and ECReports
objects)PCSpec
, PCWriteReport
, EPCCacheSpec
, and EPCCacheReport
objects)
The WebLogic RFID Edge Server can deliver event cycle reports by displaying XML in the console window where the Edge Server was started. This is typically useful only in debugging situations. The general form of the subscription URI is:
console:heading
where heading is an arbitrary text string conforming to URI syntax restrictions. The heading is printed prior to each report instance: ECReports
, PCWriteReport
, or EPCCacheReport
. This might be useful to distinguish reports arising from different subscriptions. URI syntax restrictions prohibit the heading from being empty.
A workflow is a series of actions triggered by the observation of an EPC. The WebLogic RFID Edge Server can deliver ECReport data to workflow modules. Because the current release does not expose the workflow configuration APIs, use the Edge Server Administration Console for that purpose.
![]() ![]() ![]() |