Datasports on Software Development

Articles and updates from Datasports about the craft of software

Archive for the ‘Adapters’ Category

Datasports WebServiceListener Adapter

with one comment

1. Overview

NOTE: This article documents a component that is available via the StreamBase Component Exchange (SBX).

The Datasports WebServiceListener adapater is a sample adapter that shows how to create an input adapter which exposes a webservice. It is not a general-purpose component as-is, since the webservice interface is not particularly useful and is specified in code. It is meant as a guide or tutorial used in conjunction with this article.

The adapter features a configurable URI for the webservice, optional run time control interface, and a webservice that exposes 2 methods, with a corresponding output port for each. A remote call to either webmethod results in a tuple being sent out from the corresponding output port. The methods signatures are:

	
public boolean NewMessage(String notificationMessage)
public boolean SetValue(String key, String value)

Both methods return a boolean indicating success in processing the call. For instructional and experimental purposes, both methods will fail (and return false) if the first parameter contains the string literal “FAIL” (case insensitive).

In addition to the adapter project and a StreamBase application that contains it, this package includes both Java and .Net clients for testing. The Java client is a non-GUI application with hard-coded test values, the .Net client is a WinForms application that lets the user enter parameters, invoke methods, and see results through a GUI.
Read the rest of this entry »

Advertisements

Written by datasports

Nov 16, 2010 at 8:07 PM

Posted in Adapters, SBX, Tutorials

Datasports DirectoryWatcher Adapter

with one comment

1. Overview

NOTE: This article documents a component that is available via the StreamBase Component Exchange (SBX).

The Datasports DirectoryWatcher adapter is a general-purpose solution to perform a common task – watch a directory structure and raise events (in the form of StreamBase tuples) when changes occur in that directory structure. These changes include creation, update, deletion, and re-naming of files and directories.

The adapter makes use of the JNotify library, a cross-platform Java library released under the GNU Library or Lesser General Public License (LGPL) which uses a set of native libs to hook into the OS on Windows, Linux, and Mac OS.

This article will document the creation and usage of the adapter. The source for the adapter and a test application which uses it is available from the StreamBase Component Exchange. To load it, choose File | StreamBase Component Exchange…, and type DirectoryWatcher in the “Find in Title” field. Check the checkbox beside the title of the project, and choose Finish. This will import the project with all source into your current StreamBase Studio Workspace.
Read the rest of this entry »

Written by datasports

Sep 27, 2010 at 5:06 PM

Posted in Adapters, SBX, Tutorials