Difference between revisions of "ResultSet Framework"

From Gcube Wiki
Jump to: navigation, search
(Creating an RS)
(Creating an RS)
Line 43: Line 43:
 
:<span style="color:green">/*Create a new writer with the default parametrizable values*/</span>
 
:<span style="color:green">/*Create a new writer with the default parametrizable values*/</span>
 
:RSXMLWriter writer=RSXMLWriter.getRSXMLWriter();
 
:RSXMLWriter writer=RSXMLWriter.getRSXMLWriter();
:<span style="color:green">/*Create a new writer which should have as a condition for paging inserted results either having
+
:<span style="color:green">/*Create a new writer which should have as a condition for paging inserted results either having</span>
:30 records per page or having a total size surpasing 1024 bytes */</span>
+
:<span style="color:green">30 records per page or having a total size surpasing 1024 bytes */</span>
://writer=RSXMLWriter.getRSXMLWriter(30,1024);
+
:<span style="color:green">//writer=RSXMLWriter.getRSXMLWriter(30,1024);
 
:<span style="color:green">/*Create a new writer and set a lifetime property of 1000 millisecs. Also set that the paging
 
:<span style="color:green">/*Create a new writer and set a lifetime property of 1000 millisecs. Also set that the paging
 
:condition will be having 10 records per page or a total size surpasing teh default value*/</span>
 
:condition will be having 10 records per page or a total size surpasing teh default value*/</span>
://writer=RSXMLWriter.getRSXMLWriter(new PropertyElementBase[]{new PropertyElementLifeSpanGC(1000)});
+
:<span style="color:green">//writer=RSXMLWriter.getRSXMLWriter(new PropertyElementBase[]{new PropertyElementLifeSpanGC(1000)});</span>
://writer.setRecsPerPart(10);
+
:<span style="color:green">//writer.setRecsPerPart(10);</span>
 
:<span style="color:green">/*Add a new result with the given id, collection, rank and payload*/</span>
 
:<span style="color:green">/*Add a new result with the given id, collection, rank and payload*/</span>
 
:writer.addResults(new ResultElementGeneric("id1","collection1","rank1","payload"));
 
:writer.addResults(new ResultElementGeneric("id1","collection1","rank1","payload"));

Revision as of 10:46, 7 February 2007

ResultSet Framework

Introduction

The ResultSet Framework provides the enabling mechanism to pass by reference data between components and / or services that can be hosted in the same or remote nodes. It utilizes the WSRF Framework for keeping state and offers value adding opeartions for encapsulating remote and local calls, paging of content, data movement, remote processing and much more fun stuf which you can discover your self instead of me having to right them down you lazy bum (J).......

Implementation Overview

The framework consists of 4 sub components :

  1. the ResultSet library
  2. the ResultSet Service
  3. the ResultSet Client
  4. the ResultSet Garbage Collector


  • The ResultSet is the enabling element that creates a linked list of pages holding the records that are part of the specific result set. It can iterate over the created parts and perform various operations on the structure of the list and the contents themselves. Its operations are mosty part specific bu they can also affect the entire result chain. Once a page of content has been created and the next in line has been initialized the part cannot be altered. Once it has been declared that the authoring of a result set has finished, the entire chain of it is immutible.
  • The ResultSet Service is merely a WS front-end to the ResultSet library. It creates and manages WS-Resources holding rferences to instances of the ResultSet components. These instances are responsible to hold state regarding the iteration over the chain of pages and for accessing / modifying / querying the data held.
  • The ResultSet Client is a library giving access to both high and low level operations that can be performed on a specific ResultSet component instance and its underlying data. It enables handling of ResultSets that are both wrapped through a WS front-end and that are locally manipulated though direct java invocations (within JVM).
  • The ResultSet Garbage Collector is a deamon-like program that can be initialized to clear up resources used by the ResultSet Framework (removing filesystem resources and destroying created WS-Resources)

Dependencies

  • ResultSetLibrary
    • jdk 1.5
    • WS-Core
  • ResultSetService
    • jdk 1.5
    • WS-Core
    • ResultSetLibrary
  • ResultSetClient
    • jdk 1.5
    • WS-Core
    • ResultSetLibrary
    • ResultSetService
  • ResultSetGarbageCollector
    • jdk 1.5
    • WS-Core
    • ResultSetLibrary
    • ResultSetService stubs

Usage Example

Creating an RS

/*A method that creates a new RSXMLWriter and populates it with som results*/
public RSXMLWriter createRSWriter() throws Exception{

/*Create a new writer with the default parametrizable values*/
RSXMLWriter writer=RSXMLWriter.getRSXMLWriter();
/*Create a new writer which should have as a condition for paging inserted results either having
30 records per page or having a total size surpasing 1024 bytes */
//writer=RSXMLWriter.getRSXMLWriter(30,1024);
/*Create a new writer and set a lifetime property of 1000 millisecs. Also set that the paging
condition will be having 10 records per page or a total size surpasing teh default value*/
//writer=RSXMLWriter.getRSXMLWriter(new PropertyElementBase[]{new PropertyElementLifeSpanGC(1000)});
//writer.setRecsPerPart(10);
/*Add a new result with the given id, collection, rank and payload*/
writer.addResults(new ResultElementGeneric("id1","collection1","rank1","payload"));
/*Add a new result with the given id, collection, rank and payload*/
writer.addResults(new ResultElementGeneric("id2","collection1","rank2","payload"));
/*Add an array of results with the given id, collection, rank and payload*/
writer.addResults(new ResultElementBase[]{new ResultElementGeneric("id3","collection1","rank3","payload"),
new ResultElementGeneric("id4","collection1","rank4","payload")});
/*Give back the writer*/
return writer;

} </tt>

Retrieving a locator

Creating an RS

Reading an RS

Extending Base elements

==== Complex Operations ====