Download presentation
Presentation is loading. Please wait.
1
XML-Tuples & XML-Spaces V0.7 By David “Uncle Dave” Moffat Presented by: Shurug Al-Khalifa
2
2 Outline Overview of Tuple Spaces and XML-Spaces. Basic XML-Spaces & XML-Tuples operations. Database operations on XML-Spaces. Extended Database Queries on XML-Spaces.
3
3 Introduction Implementation of tuples and tuple-spaces using XML. Tuple list of values (“Sam”, 7, 48.1). Tuple Space public repository that contains tuples. Template tuple set up for matching. Using XML for the tuples and the commands.
4
4 Definitions XML-tuple list of data fields in an XML format. Data field XML-tagged data. Ralph XML-tuple field values are strings. XML-space tuple space with XML tuples. An XML-space: – Referenced by a name. – Located on a server.
5
5 Creating and Communicating with an XML-Space “do” method. Commands and parameters expressed in XML. XMLSpace xs = new XMLSpace (“MySpace”,“server.mine.org”);
6
6 Writing XML-Tuples to an XML- Space String strTuple=“ ”+ “ Ralph ”+ “ 33 ”+ “ 190.7 ”+ “ ”; String strResult; strResult=xs.do(strTuple); Returns with If error, message with
7
7 Writing Several XML-Tuples at Once Concatenate several into one string. Ralph 33 190.7 :
8
8 Matching XML-Tuples Create a template. Template XML-Tuple where fields may or may not have value in them.
9
9 Reading XML-Tuples from an XML- Space Read only. Match a template. 33 Returns with If not Found, NULL is returned. If error, message with
10
10 Reading XML-Tuples from an XML- Space Read and remove. Match a template. 33 Returns with If not Found, NULL is returned. If error, message with
11
11 Reading XML-Tuples from an XML- Space If client has to find a match. Read Read and remove xs.do returns: Tuple if a match is found. If a match is not found, waits until tuple exists then returns it.
12
12 Reading Several XML-Tuples at Once Read only. Match a template. 33 Returns list of tuples with If not Found, NULL is returned. If error, message with
13
13 Reading Several XML-Tuples at Once Read and remove. Match a template. 33 Returns list of tuples with If not Found, NULL is returned. If error, message with
14
14 Counting the Number of Matching XML-Tuples Match a template. 33 Returns number of tuples found with If error, message with
15
15 Registering for XML-Space Events Event operation on an XML-space. 1. XMLSpaceListener interface. 2. Register as a Listener. 3. Give a template to the space.
16
16 Registering for XML-Space Events . XMLSpaceListener interface. Interface XMLSpaceListener { handleXMLSpaceEvent(String tuple, String space, String host, long lNum, boolean bErr); } If error, message with in “tuple”.
17
17 Registering for XML-Space Events . Register as a Listener. 3. Give a template to the space. xs.addXMLSpaceListner(this,tplt) Can register for different operations and templates Template
18
18 XML-Space Queries Basic query = scan 33 Returns a tuple or a list of tuples with If not Found, NULL is returned. If error, message with
19
19 ANDing XML-Space Queries Match with two given query templates. : : Returns a tuple or a list of tuples with If not Found, NULL is returned. If error, message with
20
20 ORing XML-Space Queries Match with one or both given query templates. : : Returns a tuple or a list of tuples with If not Found, NULL is returned. If error, message with
21
21 Range Queries Match with values within template range. : : Returns a tuple or a list of tuples with If not Found, NULL is returned. If error, message with Upper Limit Lower Limit
22
Nested Queries : : : :
23
23 XML-Space Transactions Used to perform an operation only if it is successful. : : Everything is OK Anything is unsuccessful
24
24 Matching to Different “Depths” A field: - have content but not subfields. 33 - be Null and have subfields. Karl Martin - have content and subfields. 123 456 789 221
25
25 Partial XML-Tuple Templates Partial Template does not specify all the fields or the subfields. Ann Arbor
26
26 Partial XML-Tuple Templates with Wildcards Used to match upper-level fields of template. Breadth-wise Ann Arbor Depth-wise Ann Arbor
27
27 Conclusion Tuple Spaces and XML-Spaces. Operations on XML-Spaces & XML-Tuples. Querying XML-Spaces.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.