Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 1 of 309
Service Discovery In Pervasive Systems By Steven R. Livingstone
The School of Information Technology and Electrical Engineering The University of Queensland
Submitted for the degree of Bachelor of Information Technology (Honours) October 17th 2003 Supervisors Associate Proffessor Jadwiga Indulska of UQ, Ted McFadden of DSTC
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 2 of 309
Acknowledgements
Staff at UQ Firstly, I would like to thank my thesis supervisor Jadwiga Indulska, for her excellent advice, guidance and enduring patience while reading the hundreds of pages of draught submissions. Secondly, I would like to thank Ted McFadden for his welcomed and insightful contribution towards this thesis. Mr McFadden’s worldly experience proved invaluable in helping to produce a polished and wellrounded thesis. Thirdly, I would like to thank Ricky Robinson. His experience in the field of service discovery, and willingness to provide thorough analysis of my literature review was greatly appreciated.
Family and Friends A massive thank-you to my mother and father. Without their unwavering support and sacrifice, this thesis and degree would never have been possible. To my friends at come.to/kewn. Thank you for providing me with the social relief that was so required during the hectic and harrowing year that has been ‘thesis’. Cheers.
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 3 of 309
Table of Contents Acknowledgements ............................................................................................................................................ 2 Staff at UQ ................................................................................................................................................... 2 Family and Friends ...................................................................................................................................... 2 Table of Contents ............................................................................................................................................... 3 Chapter 1 Introduction .................................................................................................................................... 6 1.1 What is Service Discovery? ..................................................................................................... 6 1.2 Proposed Solution .................................................................................................................... 7 Chapter 2 Thesis Outline ................................................................................................................................. 8 2.1 Thesis Goals ............................................................................................................................. 8 2.2 Thesis Structure and Methodology .......................................................................................... 8 2.2.1 Chapter 3 ...................................................................................................................................... 8 2.2.2 Chapter 4 ...................................................................................................................................... 8 2.2.3 Chapter 5 ...................................................................................................................................... 8 2.2.4 Chapter 6 ...................................................................................................................................... 9 2.2.5 Chapter 7 ...................................................................................................................................... 9 2.3 Project Timeline ....................................................................................................................... 9 Chapter 3 Discovery Protocol Literature Review ....................................................................................... 11 3.1 Literature Review Methodology ............................................................................................ 11 3.1.1 Protocol Selection ...................................................................................................................... 12 3.1.2 Protocol Selection Basis ............................................................................................................ 12 3.1.3 Grading Criteria ......................................................................................................................... 12 3.2 Protocol Review ..................................................................................................................... 14 3.2.1 Intentional Naming System ....................................................................................................... 14 3.2.2 Twine ......................................................................................................................................... 17 3.2.3 Superstring ................................................................................................................................. 19 3.2.4 Universal Plug and Play ............................................................................................................. 21 3.2.5 Bluetooth .................................................................................................................................... 25 3.2.6 Jini .............................................................................................................................................. 28 3.2.7 Salutation ................................................................................................................................... 30 3.3 Protocol Summary ................................................................................................................. 33 Chapter 4 Mapping Discovery Protocols Literature Review ..................................................................... 34 4.1 Literature Review Methodology ............................................................................................ 34 4.1.1 Mapping Solution Selection....................................................................................................... 35 4.1.2 Mapping Solution Selection Basis ............................................................................................. 35 4.2 Mapping Review .................................................................................................................... 35 4.2.1 Extended Service Discovery Profile for Universal Plug & Play (Bluetooth UPnP)............. 35 4.2.2 Mapping Salutation Architecture APIs to Bluetooth Service Discovery Layer (Salutation Bluetooth) .................................................................................................................................................. 41 4.2.3 JINI Discovers Bluetooth (JINI Bluetooth) .......................................................................... 49 4.2.4 Jini Meets UPnP: An Architecture for JINI/UPnP Interoperability (JINI UPnP) ................ 56 Chapter 5 Mapping Semantics...................................................................................................................... 59 5.1 Introduction ............................................................................................................................ 59 5.2 Jini .......................................................................................................................................... 59 5.2.1 Discovery ................................................................................................................................... 59 5.2.2 Lookup ....................................................................................................................................... 60 5.2.3 Service Query ............................................................................................................................ 63 5.3 Twine ..................................................................................................................................... 63
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 4 of 309
5.3.1 Discovery ................................................................................................................................... 63 5.3.2 Service Announcement .............................................................................................................. 64 5.3.3 Service Search ............................................................................................................................ 65 5.3.4 Service Query ............................................................................................................................ 66 5.4 Jini-Twine Bridge Mapping Proposal .................................................................................... 66 5.4.1 Name Mapping Schema ............................................................................................................. 66 5.4.2 Operational Mapping ................................................................................................................. 70 5.4.3 Bridge Scalability ...................................................................................................................... 76 5.4.4 High-level Class Diagram .......................................................................................................... 77 Chapter 6 Implementation Report ............................................................................................................... 78 6.1 Introduction ............................................................................................................................ 78 6.2 Design Modifications ............................................................................................................. 78 6.3.1 Major Modifications .................................................................................................................. 78 6.3.2 Minor Modifications/Design Details ......................................................................................... 80 6.4 Design Diagrams .................................................................................................................... 83 6.4.1 High Level Class Diagram ......................................................................................................... 83 6.4.2 Flow Diagrams ........................................................................................................................... 89 6.5 Asymptotic Evaluation .......................................................................................................... 93 6.6 Twine NameSpecifier Matching Properties ........................................................................... 97 Chapter 7 System Test Suite ......................................................................................................................... 98 7.1 SemanticConvertor Tests ....................................................................................................... 98 7.2 SemanticConvertor Test Result Summary ........................................................................... 101 7.3 Complete System Tests ........................................................................................................ 101 7.4 Complete System Test Result Summary ............................................................................. 103 Chapter 8 Conclusion .................................................................................................................................. 104 8.1 Summary of Work ............................................................................................................... 104 8.2 Time Management Review .................................................................................................. 105 8.2.1 Semester 1 ................................................................................................................................ 105 8.2.2 Semester 2 ................................................................................................................................ 105 8.2.3 Time Evaluation ....................................................................................................................... 105 8.3 Findings Review .................................................................................................................. 105 8.4 Future Directions ................................................................................................................. 106 Appendix A System Test Results ........................................................................................................... 107 A1.1 SemanticConvertor Test Results .......................................................................................... 107 A1.2 Complete System Test Results ............................................................................................ 152 Appendix B Source Code ........................................................................................................................ 164 B1.1 cygnusX1 Package ............................................................................................................... 164 B1.2 cygnusX1.apps Package ....................................................................................................... 167 B1.3 cygnusX1.apps.jiniApps Package ........................................................................................ 175 B1.4 cygnusX1.arch Package ....................................................................................................... 191 B1.5 cygnusX1.coms Package ..................................................................................................... 204 B1.6 cygnusX1.convertor Package ............................................................................................... 210 B1.7 cygnusX1.error Package ...................................................................................................... 223 B1.8 cygnusX1.tests Package ....................................................................................................... 225 Appendix C Script Files .......................................................................................................................... 230 C1.1 CygnusX1 Scripts ................................................................................................................ 230 C1.2 INS/Twine and Jini Scripts .................................................................................................. 231 Appendix D Help Files ............................................................................................................................ 234 D1.1 CygnusX1 Help .................................................................................................................... 234 D1.2 Jini Help ............................................................................................................................... 234
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003. D1.3 Appendix E Appendix F Appendix G G1.1 G1.2 G1.3 G1.4 G1.5 G1.6 G1.7 G1.8 References 308
Page 5 of 309
INS/Twine Help ................................................................................................................... 234 SemanticConvertor Test File ............................................................................................ 236 JiniHelloWorld Modifications .......................................................................................... 238 Java doc Files ..................................................................................................................... 239 cygnusX1 Package ............................................................................................................... 239 cygnusX1.apps Package ....................................................................................................... 242 cygnusX1.apps.jiniApps Package ........................................................................................ 250 cygnusX1.arch Package ....................................................................................................... 264 cygnusX1.coms Package ..................................................................................................... 282 cygnusX1.convertor Package ............................................................................................... 291 cygnusX1.error Package ...................................................................................................... 300 cygnusX1.tests Package ....................................................................................................... 306
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Chapter 1
Page 6 of 309
Introduction
As the limits of our species technological capacity recede, the density of interaction between humancomputer technologies increases. One day, common household devices will come shipped with standard ‘intelligence’. However, as human history has shown a single entity is of little use without the ability to interact with its surroundings. The same is true of technology. A networked, coordinated approach to human-computer technology is growing, fuelled by the growth of heterogenous networks. However, with the wide array of competing technologies, the ability for these devices to interact becomes increasingly difficult. This makes the study of resource discovery in pervasive systems both dynamic and complex. The rewards however, are boundless. The technological wizardry seen in such films and TV series as Star Trek and Babylon 5 are becoming a reality. The underlying philosophy of these tools is simple. A device, no matter how trivial, must be capable of integrating seamlessly with its surroundings, to form a ubiquitous cooperative network.
1.1
What is Service Discovery?
In the last 10 years, the trend in technology has been towards creating a ubiquitous computing environment. Essentially, this is where a myriad of devices interconnect in an ad-hoc fashion, across heterogenous domains. These pervasive computing systems are not like the common desktop pc network, but are composed of small-embedded devices, communicating in a wireless network independent of any global management. This is where the field of service discovery fits in. For a device to be truly mobile, it must be able to interface and co-ordinate with its surroundings without the user’s intervention. For this to happen, the service discovery protocol must be able to discover local resources and form an ad-hoc network. Thus, ubiquitous service discovery is the ability to discover and form an ad-hoc network without explicit user direction. While there exist a number of well-known service discovery protocols, as listed in table 1, none of these protocols are capable of communicating with one another, due to the lack of a standardised API.
Name
Commercial Source
Year
Name
1999/2000 1999
Superstring Twine
1997
Jini
Microsoft Bluetooth Special Interest Group IETF SVRLOC working group Sun Microsystems
1997/1998
Intentional Naming System Secure SDS
Salutation
Salutation Consortium
1995
LDAP
UPnP Bluetooth SLP
Table 1 – Well-known discovery protocols
Research Source The University of Queensland Massachusetts Institute of Technology Massachusetts Institute of Technology Berkeley, University of California University of Michigan
Year 2003 2000 1999 1999 1995
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
1.2
Page 7 of 309
Proposed Solution
While truly ubiquitous computing is not yet upon us, this thesis attempts to bring that reality a little closer. Given the wide-array of network types and requirements, a standardised service discovery API remains many years off. However, while current service discovery protocols/systems cannot inherently interact with one another, interaction can be achieved by deploying a bridge between the two networks. The task of the network bridge is to handle the semantic differences between the two networks, while hiding these differences to both network components, similar to a transparent proxy server. The net product will allow services under one domain to search and utilise devices in a neighbouring domain, while both networks/devices remain under the control of the two independent protocols.
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Chapter 2
2.1
Page 8 of 309
Thesis Outline
Thesis Goals
The primary aim of this thesis is the construction of a fully functional translation bridge. The bridge will be transparent, allowing two well-known service discovery protocols to communicate with each other, without having knowledge of the bridge’s existence. The bridge must be efficient in both lookup and connection to the neighbouring networks.
2.2
Thesis Structure and Methodology
For the above goals to be realised, this project follows a well-planned structure. In doing so, the delivery of a well designed, documented and functioning thesis is possible.
2.2.1 Chapter 3 The first stage is a complete literature review of the currently available service discovery protocols. This approach is required to gain an authoritative understanding of the different techniques employed by the various service discovery systems. Each protocol is summarised, detailing its ability to scale, richness of resource descriptions, ability to operate over TCP/IP and ability to map to other service discovery protocols. These factors provide an important gauge as to the viability of a protocol. The summary is the basis for protocol selection in this thesis.
2.2.2 Chapter 4 The second stage of the literature review is an analysis of existing service discovery mapping systems. A detailed analysis is performed to highlight the strengths and weaknesses of the various approaches. The summary evaluates the solution using several criterions, including degree of self-configuration, ability to match/map attribute and functional operations, degree of functionality loss when translation occurs and the overall quality of the solution. Following this, an evaluation of the solutions applicability to this thesis is provided. Solutions that are deemed to be of a high quality, and are applicable, form the general basis of this thesis’s solution.
2.2.3 Chapter 5 Chapter 5 forms the design component of the thesis. It provides a detailed analysis of the Jini and Twine service discovery protocols/systems. This details the API of both systems. The three key areas of a service discovery system are analysed. These include discovery: how a client/service locates the discovery system, announcement/registration: how a service/client registers with the discovery system, search: how a client searches the discovery system and query: how a client/service invokes another service registered with the discovery system. Following the analysis, a translation/mapping solution is proposed. The proposal details the two areas of mapping, attribute and operational mapping. The operational mapping section provides detailed UML
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 9 of 309
sequence diagrams. This allows the reader to gain an informed understanding of system flow. The section finishes with an overview of the proposed system’s architecture, in the form of a UML class diagram. The solution is named CygnusX1, after the black hole discovered in the constellation Cygnus. This name was chosen as it is functionally representative of this thesis, a gateway between two systems, with a potential to absorb all information from the outside world.
2.2.4 Chapter 6 Chapter 6 provides an implementation report on CyngusX1. It begins with a list of major and minor modifications to the system design. These modifications were a result of time constraints. Where operational mapping was affected, revised UML sequence diagrams are provided. Following this is a detailed description of system architecture in the form of UML class diagrams. Due to the size and complexity of the system structure, two class-flow diagrams are provided. These allow the reader to gain an understanding of the flow of events with respect to the static class structure without the complexity of collaboration diagrams. The final section examines how the Twine network performs service discovery/matching. This is required for an understanding of the testing report results that follow in chapter 7.
2.2.5 Chapter 7 Following system implementation, a rigorous testing program is carried out to ensure that CygnusX1 adheres to the standards stated in section 2.1. The chapter is divided into two main testing sections, the SemanticConvertor test suite and the complete system test suite. Each section details an example test case, allowing the reader to follow the expected/actual sequence of events. Each testing section is evaluated with a final listing of the pass/fail ratio.
2.3
Project Timeline
This section provides a time-guide for tasks and their expected completion dates. This section is reviewed at the completion of thesis in section 8.2. Week 1 2 3 4 5 6 7 8 9 10 11 12 13
Activity Organise thesis paperwork Research protocols Research protocols Begin Writing Annotated Bibliogrpahy Continue Annotated bibliography Revise first draft / Begin Chapter 3 Begin work-in progress paper Continue work-in progress paper Submit first draft for review / Review Chapter 3 Review draft / Begin Chapter 4 Begin Seminar preparations Review seminar Present seminar
Milestone
Finish protocol Research First draft complete Submit Annotated Bibliography First draft complete Submit Work-in-progress Chapter 3 complete / Chapter 4 complete
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003. Semester Break 1 Semester Break 2 Semester Break 3 Semester Break 4 1 2 3 4 5 6 7 8 9 10
Install and run Jini, INS, Twine, Chord, SFS / Begin Chapter 5 Install and run Jini, INS, Twine, Chord, SFS Install and run Jini, INS, Twine, Chord, SFS Install and run Jini, INS, Twine, Chord, SFS
Begin CygnusX1 Continue CygnusX1 Continue CygnusX1 Write chapter 6 Work on thesis paper / review chapter 6 Work on thesis paper (chapters 1 and 2) Continue thesis paper Begin Poster Complete Poster Finish thesis document / Write script and help files 11 Prepare demonstration 12 Prepare demonstration / Print and bind thesis 13 Present demonstartion Table 2.1 – Proposed time-guide of thesis
Page 10 of 309
Software installation complete and running / Chapter 5 complete
Chapter 6 complete
Submit Poster Review first thesis draft Finish Cygnus X1 Thesis Document completed Demonstration presented
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Chapter 3
Page 11 of 309
Discovery Protocol Literature Review
Increasingly, pervasive systems are becoming the dominant study in the field of networks. The day of bulky, wired computers is drawing to a close. One day, humans and computers will be so tightly interwoven it will be difficult to separate the two. While such technological feats remain in the distant future, one of the many obstacles to overcome is the issue of service discovery. For human technology to be seamlessly integrated into society, the task of discovery/management of device networks must be abstracted from the user. This is the task performed by a service discovery system. It provides the service of locating and searching devices connected to the network. The documents selected cover a wide spectrum of publication formats. This was done as the field of computer science is evolving at a staggering rate, when compared with traditional sciences. A book written last year may well be considered ‘old hat’ today. Thus, articles were drawn predominantly from conference research papers and Internet sources. A small selection of books dealing with older resource discovery systems was also used.
3.1
Literature Review Methodology
As the solution must be capable of operating in a heterogenous network, the review of existing discovery systems will examine their ability to act in a generic fashion. There are number of issues that must be considered when comparing the existing protocols. One day, resource discovery systems will form the backbone of any technology infrastructure. To this end, the ability of a protocol to scale is of critical importance. Each resource discovery protocol has its own service description system. With the increased range of service discovery systems, comes the increase in service types, and the complex expressions required to describe them. Thus, the richness of the resource description system is an important factor. In keeping with standards, the protocol must be capable of operating over TCP/IP. Lastly, as many of the existing discovery systems have been implemented in the commercial environment, their ability to map to other competing resource discovery protocols must also be investigated.
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 12 of 309
3.1.1 Protocol Selection The following table lists the protocols to be reviewed Name Creator Superstring The University of Queensland Twine Massachusetts Institute of Technology UPnP Microsoft Intentional Naming System Massachusetts Institute of Technology Bluetooth Bluetooth special interest group JINI Sun Microsystems Salutation Salutation Consortium Table 3.1 – Service Discovery Protocol Listing
Year of Inception 2003 2000 1999/2000 1999 1999 1997/1998 1995
3.1.2 Protocol Selection Basis There exist two primary reasons for the selection of the protocols listed in table 3.1. The first was the desire to investigate a mapping between two of the latest service discovery approaches, such as Twine and Superstring. As both of these systems are based loosely on the Intentional Naming System, it was necessary to investigate the Intentional Naming System. The second selection criterion was the availability of existing resource discovery mapping papers. In this criterion, Jini, Salutation and Bluetooth featured prominently. These three protocols were also mapped to SLP or UPnP.
3.1.3 Grading Criteria To establish the quality of a resource discovery protocol, it is necessary to introduce a grading system. The grading is subdivided into two sections, individual protocol criteria evaluation and summary protocol evaluation. Both are necessary to discern how well a protocol performs in service discovery. For the individual criteria evaluation, there are two forms of grading, a numeric grading scale of one through to five, and a binary system of pass/fail, where the protocol either meets the criteria or it does not. The numeric scale is applied to those criteria that vary on the level to which they fulfil the criterion; these include ‘Ability to scale’, ‘Richness of the resource description and operations’ and ‘Ability to map to other resource discovery protocols’. The Pass/fail mark is applied to ‘Ability to operate over TCP/IP’ only. Table 3.2 details how the grading system is applied to each of the numeric-evaluated criteria, along with the definition of the pass/fail marking system.
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003. Criteria Scalability
Type 1 2 3 4
5 Richness of Descriptions and Operations
1
2 3 4 5 Operates over TCP/IP Ability to map to other Protocols
Pass Fail 1
2
Page 13 of 309
Basis Protocol is inherently unscaleable. The protocol contains no features that promote scalability. Exhibits basic features that could allow the protocol to scale, but is restricted as a whole by non-scaling issues. The protocol makes a clear effort at providing a scalable solution. Typically, the ability to scale to a LAN network. The protocol has succeeded in providing a scalable solution, with only a small set of scalability issues. Typically, the ability to scale to a LAN/MAN network. The protocol has succeeded in providing a truly scalable solution. This is applied to protocols that can scale successfully to the MAN/WAN network. Provides a resource poor attribute description scheme, with minimal system functionality. Provides a basic attribute description scheme, with a limited set of operations. Provides a reasonable attribute description scheme, with a satisfactory range of protocol operations. Provides a rich attribute description scheme, with a wide array of system operations Provides a densely rich attribute description scheme, with an extensive array of system operations Protocol has the ability to operate over TCP/IP Protocol cannot operate over TCP/IP Protocol shows no promise of being mapped to another resource discovery protocol.
Protocol contains basic elements that aid protocol mapping, but would still be very difficult. 3 The basic functionality of the protocol can be mapped to another protocol, with difficulty. 4 The majority of the protocol functionality could be mapped to another protocol. 5 The protocol functionality can be almost completely mapped. Table 3.2 – Protocol Marking Scheme
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 14 of 309
Protocol summary evaluation exists to provide a quick overview of how well a protocol performs in resource discovery. The rating is based on the summation of the previous individual criteria scores. Table 3.3 details the scoring system. Score 1-5
Description Indicates an unsatisfactory resource discovery protocol, with little advantage over a typical name server. Fails in every evaluation criteria. 5-10 Fail The protocol has attempted to provide a resource discovery solution. Protocol achieves an average score in most evaluation criteria, with some failures. 10-12 Pass The protocol has succeeded in providing a quality, resource discovery protocol. Protocol passes every evaluation criteria. 13-15 Pass The protocol provides a high quality, resource discovery protocol. The Protocol excels in every evaluation criteria Table 3.3 – Pass/Fail Grading Criteria
3.2
Rating Fail
Protocol Review
Each protocol is subdivided into protocol name, and further sectioned into the evaluation criteria. The protocols are reviewed in an order that aids understanding. This is because the protocols Superstring and Twine require knowledge of the Intentional Naming System.
3.2.1 Intentional Naming System The Intentional Naming System (INS) is the first in the next generation of resource discovery protocols. INS is composed of four basic components, clients, services, Intentional Name Resolvers (INR) and Domain Space Resolvers (DSR) [1]. When the system is initiated, INR’s self-configure to form an application overlay. The overlay formed is decentralised, with no single node controlling the entire system. In INS, a client specifies the type of service they are looking for; the language used can be the Intentional Naming language or any other service description language. The INS language is small and lightweight, specifically designed to interoperate with other service languages. Intentional names are used to specify the function of a service, not the location of a service. INS employs a number of unique features that allow it to scale to large sized LAN networks. The first of these is late binding. When a client makes a request for a service, the binding between the intentional name and the network location (IP) is made at message delivery time; that is when a service is requested, not at name-address request resolution time. As a result, binding is best effort, as INS does not guarantee message delivery. Late binding allows for another unique feature, the ability for an application to specify service metrics. For example, an application may request the printer with the smallest print spool. This form of request is termed an intentional multicast, as it is delivered to a subset of name-matching services. The other form of request is intentional anycast, where the message is delivered all nodes service nodes matching the name. As the target environment is dynamic, a service may not always explicitly de-register itself, thus INS uses soft-state periodic advertisements. Here service periodically sends the resolver an “I’m alive” message. Any service names that are not refreshed within a certain period are deleted from the resolver. This allows INS to handle node failures gracefully. INR’s disseminate name information to neighbouring INR’s using a routing protocol that includes periodic and triggered updates.
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 15 of 309
INR’s store intentional names, called name-specifiers, as attribute-value pairs in an Attribute Value (AV) tree. This, along with a short description, can be seen in figure 3.1
Figure 3.1 – INS Attribute-Value tree [1] A common form of name lookup is to employ a hash table. When lookup occurs, the INR returns a namerecord, which includes the IP’s of destinations advertising the name along with a set of routes to next-hop INR’s. Included in the name record is the transport type required for the service, eg HTTP, RTP or TCP. The DSR, which can be replicated for fault tolerance, maintains a list of active INR’s in a particular domain. New INR’s register with the DSR and in turn obtain a list of other INR’s. Ability to scale INR has the ability to scale to a large LAN-sized network 1km, with roughly 103 resources. There exist two problems that at present will not allow INS to scale to MAN-sized networks, or the Internet. The first is excessive lookup requests on a particular INR. Spawning new INR’s for a particular namespace, for example an mp3 namespace, can solve this to an extent, but will not scale to a MAN-sized network. The second problem involves the periodic name updating. When the number of services grows, INR’s are saturated with these inter-INR periodic updates. This affects both bandwidth and available processing power in the INR’s. One solution is to partition namespaces into several virtual spaces. A virtual space has an applicationspecified set of names that share some common attributes, for example video. Here a resolver only has to route for the subset of active virtual spaces, effectively creating a secondary overlay network. An analogy is subnets for the Internet, which exists for large sized networks. When virtual spaces are employed and distributed among separate resolvers, processing time for updates reduces proportionally with the number of machines. Despite this, the relationship between processing time and number of names is still linear, as indicated by figure 3.2.
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 16 of 309
Figure 3.2 – Dissemination times for periodic updates [1]
Richness of the resource description and operations As stated, the naming language is lightweight, with the ability to interoperate with other more advanced service description languages. Protocol operations are rich and varied, providing a rich interface developers. Ability to operate over TCP/IP INS uses unmodified IP to communicate between resolvers. The client can also communicate with the service over the required protocol. Ability to map to other resource discovery protocols There exist a number of trouble points for protocol mapping, the first soft-state updating. Any mapping unit would have to periodically advertise its available services in order for them to be used in the INR network. The second problem involves masking the mapping entity as an INR and being able to handle the necessary DSR communication. With this, a mapping entity may not handle the partitioning into namespaces, as a mapping entity will store a heterogeneous collection of services and may end up belonging to a large set of virtual spaces. A third issue involves INS’s use of late binding. Late binding allows for the use of application metrics, a feature only available to the INS, Twine and Superstring.
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 17 of 309
Grading Grade Section Value Scalability 4 Operation Richness 5 TCP/IP Pass Mapping 3 Total Score 12/15 Final Judgement PASS Table 3.4 – INS Grading
3.2.2 Twine Twine, like Superstring, is based loosely on the architecture of the Intentional Naming System. While Twine maintains the query formats and INR overlay architecture of INS, the semantics of the discovery protocol are quite different. Twine has advanced the decentralised principle of INS by using a hash-based partitioning of resource descriptions across a collection of symmetric INR’s [2]. In a random service distribution set, each resolver will only hold a small subset of the total resource information. This is a key step forward from INS, where previously each resolver had knowledge about every service. The distribution is achieved through the use of a distributed hashing algorithm. Twine is implemented using the Chord algorithm, as it also came out of MIT. Like INS, an AV tree is used to describe services. In Twine however, the tree is decomposed into a collection of strands for the advertisement and query process. A strand represents a unique subset of the information extracted from the service description, as seen in figure 3.3.
Figure 3.3 – AV Tree to strand extraction [2] The process of service advertisement and service query (service usage) are similar. Service advertisement contains six steps and is described as follows. The initial stage has the client/service send a service description to an INR. The resolver passes this message to the AV storage/Query Engine. The advertisement is then stored locally. For service advertisements, the query is stored locally. The query engine returns a set of strands. These strand are passed to the strand mapper where they are hashed to produce a set of keys. The keys are then forwarded to the key router. The key router, which operates using the distributed hashing algorithm Chord, maps each key onto a particular INR. The final stage has the service advertisement forwarded to the INR with that key(s). The process of service query has the client sending a query to the resolver, containing either a service description or a known name record. The service description is passed to the query engine, which returns one of the longest strands matching the query. The result of query matching depends on the local query-processing engine attached to the resolver. Examples include an INS sub treematching algorithm, UnQL or the Xset query engine for XML. The strand is then hashed, the key passed to
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 18 of 309
the key router and the query passed to the appropriate resolver. Query results, step seven, are returned from foreign resolver, which is passed back to the client. The process’s can be seen in figure 3.4.
2
1
3 T - Message type, advertisement ____or query VRi- Value NRi- Name Record SiR- Strand I KiR- Key I RiR- Result
4
5
6 7 Query only
Legend Figure 3.4 – Twine strand hashing process [2] Ability to scale Twine has the capability to scale to MAN sized networks, 10km, with roughly 108 resources and 105 resolvers. There do exist some significant problems that prevent Twine from scaling to WAN-sized networks. The primary reason is the lack of load balancing for popular service types. For example, in some systems, the query traffic for an mp3 library service would be significant. Under Twine, after the query is hashed to determine the appropriate INR, that INR must handle the entire query. Richness of the resource description and operations Twine has a rich resource description capability, composed of simple naming attributes. Twine maintains a hierarchical attribute naming convention, which can interoperate with query languages like the INS sub treematching algorithm, UnQL or the Xset query engine for XML. As strands are based on the attribute-value pair, Twine is unable to support regular expressions or relational operations, for example [Laser printer dpi > 100]. This is because the hash of a strand containing a regular expression would result in the query being passed to the incorrect resolver. Ability to operate over TCP/IP As Twine has INS as it base architecture, Twine will also use unmodified IP to communicate between resolvers. While the INR selected to forward the packet is based on the distributed hashing algorithm, Chord as used in Twine, the INR, service and client communicate using TCP/IP.
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 19 of 309
Ability to map to other resource discovery protocols The process of mapping Twine to other resource discovery protocols will prove difficult, as no mapping involving the INS based architecture has yet been proposed. While Twine has the capability of storing queries in numerous formats, this does not relate to the attribute-naming standard. However, as INS uses a simple lightweight naming convention, built on previous attribute naming experience, it is likely that any mapping task will not prove to be insurmountable. The mapping difficulty lies in the INS feature crossover, such as soft-state periodic updates and late binding. The use of a distributed hash table over INS’s DSR simplifies the mapping process. Any mapping will not prove to be very scalable, as the mapping entity will hold the entire set of resource descriptions for the non-Twine network. This bridge will be responsible for forwarding/creating periodic updates to the Twine network. Grading Grade Section Value Scalability 5 Operation Richness 5 TCP/IP Pass Mapping 3 Total Score 13/15 Final Judgement PASS Table 3.5 – Twine Grading
3.2.3 Superstring Superstring is the latest in a line of protocols that is loosely based around the Intentional Naming System [3]. In 2000, Twine was released, which advanced the INS architecture through the use of a distributed hash table. From this, Superstring was created with the intent of providing a competitor to the Twine protocol. While Twine and Superstring are semantically similar, there are subtle yet important differences. While such differences would be irrelevant on small to mid-sized networks, Superstring can offer significant advantages in the wide-area network. Superstring is designed to address the highly dynamic networking environment. In any such environment, devices will enter and leave the network frequently. As such, the ratio of service advertisement to service usage (query) is high. Commonly there will exist a semi-permanent network structure, which will form a backbone connecting these devices to the Inter net. Superstring aims to reduce advertisement traffic, at the expense of query traffic. This is achieved by using a different form of tree structure. While Twine uses an AV-pair tree, a Superstring tree has all internal nodes (non-leaf nodes) as attributes, with the leaves containing the values. The number of Twine components = 2xAttributes (1 attribute, 1 value). As the number of strands produced, S, a function of C, means the number of resolvers contacted is O(Slog(n)). Under Superstring, the number of resolvers contacted is O(log(n) + C – 1 – V), where V is the number of leaf/value nodes. This can be seen in figure 3.5.
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 20 of 309
Figure 3.5 – Superstring lookup analysis [3] In the worst-case scenario, where the number of attributes describing a service is 1, Twine advertisement cost is equal to that of Superstring. However service descriptions are generally complex, composed of numerous attributes. As such, significantly less resolvers need to be contacted. As stated however, the reduced cost of advertisement comes at the price of a more expensive query. In Superstring, query results are propagated back up the tree, resulting in worst-case C –1 –V more traversals than Twine. The reason for this lies in that routing is performed during query time. When a description arrives at the resolver, the top-level component of the query is removed, resulting in a set of sub-trees being created. The query continues this creation of sub trees until all results are achieved. When complete, the process must be reversed, as every query result from the sub tree’s children are ‘intersected’, refining the number of query results until only the name record for the matching service remains when it reaches the root node. The process by which these sub-trees are created is the second important feature of Superstring. In the real world, some types of traffic will be far more popular than others, for example mp3. As such, Twine nodes that deal with the type ‘mp3’ will be forced to carry a heavy burden, specifically, when a common strand occurs frequently in the routing process. In Superstring, no single resolver stores the entire service description, rather it is distributed among a set of resolvers. This process is achieved through the creation of sub trees, as aforementioned. The result is load balancing at the cost of higher communication overhead, as more nodes need to be contacted in order to obtain a result. A reasonable trade-off considering that Superstring is designed with a high-bandwidth fixed backbone infrastructure. While Superstring alleviates the burden on specific nodes, it still does not address the issue that the root node, eg mp3-related, will be hit with a large amount of initial query traffic. Also, while the query resolution load is distributed to a subset of resolvers, a small subset of these will still to deal with the majority of queries. The third advantage of Superstring is its ability to use a content-rich query language. Twine uses a hash of its attribute-value pairs to create a key. This therefore limits the type of attributes that can be used. Superstring has the advantage that its values are stored in the leaf nodes, meaning that values are not hashed in either the advertisement or query process. An example of the type of value attribute that Superstring can offer is the use of inequalities, that is =
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 21 of 309
128kb/s. At present, Superstring does not provide the ability for scoped discovery, however the Superstring query format architecture does allow for such extensions. Scoped discovery relates to the use of a service based on its proximity to the client. An example of this is a client on the 12th floor of an office building, who requires the use of a printing service on the same floor as him/herself. Ability to scale While Superstring is effective at load distributing on popular node types, it does not completely resolve the problem. Thus at present Superstring will scale roughly equivalent with Twine, or about 108109 resources, over a range of 10km. Richness of the resource description and operations Superstring’s ability to include regular expressions and relations is an impressive step forward over Twine, as many desired services include the application metric ‘at least data rate’. However, the problem of scoped discovery is still to be resolved. While not yet specified, Superstring also provides the ability for scoped discovery, a significant advantage, where previously a user could access a printing resource, while being located on the other side of the city. Superstring, like Twine, will be capable of employing a number of different query storage formats such as the INS sub tree-matching algorithm, UnQL or the Xset query engine for XML. Ability to operate over TCP/IP As Superstring is loosely formed around INS, Superstring will also use unmodified IP to communicate between resolvers. Likewise, the client can also communicate with the service over the required protocol. Ability to map to other resource discovery protocols The difficulties of mapping Superstring to an existing commercial protocol will be similar to those found in a mapping between Twine (or INS) and a commercial protocol. These include late binding and soft state periodic updates. A mapping between Twine and Superstring is not simplistic, as Superstring provides the use of regular expressions and the ability to provide scoped discovery. Such features would be lost in any mapping to Twine. Aside from this, any query and advertisement traffic mapping would be trivial. Grading At this time, Superstring has not released a formal architectural standard, so grading is not possible.
3.2.4 Universal Plug and Play UPnP is the latest service discovery protocol, which is based on the pre-INS architecture. Consequently, UPnP is similar in design to the other commercial discovery protocols such as Jini, SLP and Salutation. UPnP is composed of three basic elements, control points, devices and services [4]. A Service is the smallest unit of control in the UPnP system. It represents any singular particular service being offered, for example a television tuner. A device represents a collection of services and/or embedded devices. An example of this is a video cassette player. The player would consist of tape manipulation service, a television tuning service and a clock service. An embedded device contains a collection of services. Extending the previous example, the clock service
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 22 of 309
could be considered an embedded device, offering both a counter service and a display device. A control point is a controller, which is capable of discovering and controlling other devices. A client thus interacts with a service through their control point. The UPnP protocol stack is illustrated in figure 3.6.
Figure 3.6 – UPnP protocol stack [5]. The Simple Service Discovery Protocol (SSDP) is the protocol used by UPnP for service discovery and brokering. SSDP is built on HTTPU and HTTPMU. A service can become known to a control point in two different ways, discovery request or service announcement. Service Announcement - There are two forms service announcement in which a control point can learn of a service. The first when new device is added to the network, it multicasts a number of messages, advertising any embedded devices and services it contains. The announcement is HTTP UDP packet to the SSDP multicast channel/port. In this way, control points learn of any newly added services. This reduces the number of searches a control point has to make. For example, if a new VCR is added to the network, the only way a client can discover when that service comes on line is by continually sending service discovery messages. However, with service announcement a client will learn of the device’s existence without intervention. The second form of registration occurs when a new control point is added to the network. Here the control point multicasts to the channel/port, searching for devices and services. A device will respond to the multicast message, with a unicast message containing device information Discovery Request - The second way a client can learn of a device is by performing a discovery request. Here a client sends a discovery request of the service type/description to the multicast channel/port. Any services, which match the request specification, will unicast a response. The two forms of service announcement are illustrated in figure 3.7.
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 23 of 309
Figure 3.7 – UPnP discovery flow [4] There exist six communication steps in UPnP. Note that only the first three points are concerned with service discovery: 1. Addressing – A device is assigned an IP address. When a device first connects to the network, it queries the local DHCP server for an unassigned IP address, or if no server exists, the device can use auto IP, which uses an intelligent method to assign an IP. 2. Discovery – Involves the device discovery process described in paragraph three of this section (see above). 3. Description – When the control point retrieves information about the device. This includes the UPnP device/service type, globally unique ID and a URL for the device’s UPnP description. The description is written in XML and contains information required for the control, eventing and presentation steps. 4. Control – When a client issues request to use a particular device, a control message is sent by the control point to the device. The control message is similar to a function call, which returns the runtime state of the service. 5. Eventing – When a control message is passed to the service, an action is undertaken which typically changes the state of the service. Any control point that stores this device description must be kept upto-date on the current state of the device, so as not to cause control conflicts.
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 24 of 309
6. Presentation – Once a device has been registered with a control point and the description URL has been retrieved (if exists), the control point loads the URL into a browser. Depending on the page capabilities, users can control/view details of the device. UPnP has strived to gain acceptance through the use of open network architecture. It uses widely accepted standards such as TCP/IP, HTML, XML, GENA and SOAP. As UPnP is designed to be independent of any particular programming language, operating system or physical medium, UPnP does not define the API’s an application will use. This is left to the operating system vendor to create a specific API. Ability to scale Firstly, the SSDP RFC [6] states that the protocol is not meant for use outside local area network, that is 1km and around a thousand clients. As the goal of SSDP was to make the protocol as simple as possible, advanced scaling features were not employed. The main scaling issue with SSDP is the use of multicasting to discover and announce devices. From the outset, it can be seen that if every client can end up learning about every device without requesting that information, the system cannot scale. As multicast is used, there is no form of load sharing. The example given in the SSDP RFC is reproduced here, to highlight the scaling problem. A regular sized network of around 5000 services and 100, 000 clients suffers a power outage. When the network comes back online, the clients will wish to refresh the printer cache, thus an impatient client will send out, worst case, three discovery messages with the device responding to all three messages. DR = 100,000 requesting clients RS = 5000 services AM = 512 bytes TP = 30 seconds ((100000*3+100000*9*5000)*512)/30 = 76805120000 bytes/s = 585976 Mb/s, or 73 Giga Bytes/second. Thus for the first 30 seconds of network uptime, the network will have to endure 73 GB/s of SSDP traffic. This number is horrendous. However, for a local network of around 1000 clients and 50 services, this figure drops to around 59 Mb/s, or 7.4 Mega Bytes/second. The SSDP RFC makes mention of a shut-off algorithm, but it is unclear if this is implemented in v1.0. Even with the presence of a shut-off algorithm, it can be seen that the multicast mechanism is unsustainable above the Local Area Network. Such an approach is highly undesirable, as this results in a complete denial of service. Such an approach is not acceptable, as this occurrence will be unknown to users. One feature of UPnP, which is required for scalability, is fault tolerance. UPnP employs service timeouts, akin to Jini leasing [3.2.6], where a service is required to renew its status by broadcasting ‘alive’ messages. In this way, UPnP is robust, catering for the loss of services without the need for explicit deregistration. Richness of the resource description and operations As UPnP uses XML to describe its devices and services, it provides resource-rich description architecture, using an open, commonly used Internet standard. It allows for both UPnP standardised device types, along with non-standard device types. This allows for a broad range of services. However, before the description can be used, it must first be downloaded. While XML is the standard of choice for object description, it is verbose; thus, the client must perform a large download before it can view a service’s description set. The range of base operations for the six stages is rich, offering 14 operations. Many of there are slight variances
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 25 of 309
on the base operation. While this is less than the number of operations offered by Salutation, UPnP operates using wire protocols, with control using SOAP and eventing using GENA. Ability to operate over TCP/IP UPnP has strived to use the Internet open standards, continuing in this path by using TCP/IP and UDP/IP over connections. Ability to map to other resource discovery protocols As UPnP uses XML for device/service description, the common difficulty of protocol attribute mapping can be overcome. UPnP is based purely on wired protocols, with no application pre-defined API’s. As a result, device usage is vastly simplified with simple commands being offered through the provided webpage. Such commands could be easily mapped if required. As the number of operations provided by UPnP is considerable, with the protocols HTTP, GENA and SOAP well documented, a mapping involving UPnP would be possible. Grading Grade Section Value Scalability 2 Operation Richness 3 TCP/IP Pass Mapping 4 Total Score 9/15 Final Judgement FAIL Table 3.6 – UPnP Grading
3.2.5 Bluetooth Bluetooth was created as a cable replacement solution for the mobile wireless network arena. It provides an open specification, which states how a technology can communicate over short-range wireless system [7]. It is specifically designed for short-range, typically 0) { theMatches = new ServiceMatches(matchArray, matchArray.length); } // Socket can be closed as there is no service invokation in v1.0 cygnusSocket.close(); } catch (IOException ioE) { ErrorOps.printError(ioE, "IO Exception Occurred ..."); } return theMatches; } }
B1.2.3
JiniServiceWrapper.java
package cygnusX1.apps; // CygnusX1 package imports import cygnusX1.coms.*; // Easy access to ports, IP's & packet char's import cygnusX1.convertor.*; // For Semantic Convertor import cygnusX1.error.*; // Exception helper methods // INS package imports import ins.namespace.*;
// Understand NameSpecifier objects
// Jini package imports import net.jini.core.lookup.ServiceItem; // j2sdk package imports import java.net.*;
// Used to srch for Jini services
// Required fo Inet
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003. import java.io.*;
// Required for streams
/** * This is the sibling class of JiniClientWrapper. It is a work around to * allow a Jini service to advertise its presence in the Twine network. * Version 1.0 only allows for the advertising of this service, not its * invokation. * @author Steven R. Livingstone, Bsc. 33708162 * @version 1.0 2003.09.02 * @see cygnusX1.coms.ComOps * @see cygnusX1.convertor.SemanticConvertor * @see cygnusX1.error.ErrorOps */ public class JiniServiceWrapper extends JiniWrapper implements Runnable { /** * Called by Jini Service Application desires to talk * to CygnusX1. Passes construction request back up to *
JiniWrapper
. Note the Jini Service writer is prevented * from saying yes to template search, yet passing in null. * @param cygnusIP The IP address to connect to CygnusX1 on. * @param serviceWrap The service item to be advertised in the Twine * network * @param classSearch The application must specify whether it wants to * advertise itself using its classname, as Jini ServiceItem will always * contain a .Class. This is different to a client, who implicitly * specifies a .Class search if a non-null parameter is specified. */ public JiniServiceWrapper(InetAddress cygnusIP,ServiceItem serviceWrap, boolean classSearch) { super(cygnusIP, serviceWrap, classSearch); Thread serviceThread = new Thread(this); serviceThread.start(); } /** * Main method for thread. Attempts a new
Socket
connection * with CygnusX1. If succesful, sends the NameSpecifier representation * of the
ServiceItem
. */ public void run() { // Initial check to see if IP socket can be created if (cygnusIP != null) { try { System.out.println("Servce Wrapper attempting connection to" + " CygnusX1 ... "); cygnusSocket = new Socket(cygnusIP, ComsOps.JINI_SERVER_PORT); ComsOps.printSocketDetails(cygnusSocket); outStream = new OutputStreamWriter(new BufferedOutputStream (cygnusSocket. getOutputStream())); inStream = new InputStreamReader(new BufferedInputStream (cygnusSocket. getInputStream())); System.out.println("\t******* SERVICE Sending NS ****\n\t\t" + jiniNameSpec.toString()); // Append "I'm a service" char, and end with NS end char
Page 173 of 309
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003. outStream.write(ComsOps.SERVICE_CHAR + jiniNameSpec.toString() + ComsOps.NS_END_CHAR); outStream.flush(); System.out.println("\t******* SERVICE Sent NS ****"); } catch (IOException ioE) { ErrorOps.printError(ioE, "IO Exception Occurred ..."); } catch (Exception eX) { ErrorOps.printError(eX, "General Exception Occurred..."); } } else { System.out.println("IP for CygnusX1 failed, program exiting ..."); System.exit(0); } } }
Page 174 of 309
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 175 of 309
B1.3 cygnusX1.apps.jiniApps Package This package contains modified Jini applications. The HelloWorld applications were extended from the code supplied in [9], chapter 5. HelloWorldService contains only 5 extra lines of code, the minimum required, while HelloWorldClient had significant modification to incorporate a GUI front-end. Note, HelloWorldService and HelloWorldService2 are identical, they differ only in that one advertises itself using it .Class type (identical, but myWrapper line contains true as the third parameter). There were two versions created to simplify demonstration of a working product. The two classes are identical, save for one parameter.
B1.3.1
HelloWorldService.java
package cygnusX1.apps.jiniApps; // CygnusX1 package imports import cygnusX1.apps.*; // Required for JiniWrapper import import import import import import import import
net.jini.discovery.DiscoveryListener; net.jini.discovery.DiscoveryEvent; net.jini.discovery.LookupDiscovery; net.jini.core.lookup.ServiceItem; net.jini.core.lookup.ServiceRegistrar; net.jini.core.lookup.ServiceRegistration; net.jini.core.entry.*; // Required to register a service net.jini.lookup.entry.*; // Provides more descriptive Entry types
// j2sdk packate imports import java.net.*; // For socket recognition import java.util.Hashtable; import java.io.IOException; import java.io.Serializable; import java.rmi.RemoteException; import java.rmi.RMISecurityManager; /** * THIS CODE IS NOT PART OF CYGNUSX1. This is class was taken from * Core Jini, W. K. Edwards, Prentice Hall, 1999. Chapter 5, * HelloWorldService. This class has been extended for use to demonstrate * the functionality of CygnusX1. All javadoc comments added by Steven R. * Livingstone. * @author W. K. Edwards * @author Steven R. Livingstone, Bsc. 33708162 * @version 1.0 2003.09.02 */ class HelloWorldServiceProxy implements Serializable, HelloWorldServiceInterface { public HelloWorldServiceProxy() { } public String getMessage() { return "Hello AlphaQuadrant! "+((int) (100*Math.random())); } } /** * THIS CODE IS NOT PART OF CYGNUSX1.
This is class was taken from
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 176 of 309
* W. K. Edwards, Core Jini, Prentice Hall, 1999. Chapter 5, * HelloWorldService. This class has been extended for use to demonstrate * the functionality of CygnusX1. All javadoc comments added by Steven R. * Livingstone. * HelloWorldService is the "wrapper" class that handles publishing the * service item. This Service object advertises itself using Entry [] * description * @author W. K. Edwards * @author Steven R. Livingstone, Bsc. 33708162 * @version 1.0 2003.09.02 */ public class HelloWorldService implements Runnable { // 10 minute leases protected final int LEASE_TIME = 10 * 60 * 1000; protected Hashtable registrations = new Hashtable(); protected ServiceItem item; protected LookupDiscovery disco; /* ****** CYGNUS X-1 modification BEGINS ****** */ protected JiniServiceWrapper myWrapper; // The wrapper for this service protected boolean discoveredLookup = false; // Found a single lookupSrvr protected InetAddress cygnusIP; // IP address of cygnusX1 /*
****** CYGNUS X-1 modification ENDS ******
*/
/** * THIS CODE IS NOT PART OF CYGNUSX1. This is class was taken from * W. K. Edwards, Core Jini, Prentice Hall, 1999. Chapter 5, * HelloWorldService. This class has been extended for use to demonstrate * the functionality of CygnusX1. All javadoc comments added by Steven R. * Livingstone. * Inner class to listen for discovery events * @author W. K. Edwards * @author Steven R. Livingstone, Bsc. 33708162 * @version 1.0 2003.09.02 */ class Listener implements DiscoveryListener { /** * Called when we find a new lookup service. * @param ev A new Lookup Server has been discovered */ public void discovered(DiscoveryEvent ev) { System.out.println("discovered a lookup service!"); ServiceRegistrar[] newregs = ev.getRegistrars(); for (int i=0 ; iTwine " + "advertisment"); jiniServSocket.close(); // Only attempt NS if it was a service announcement if (isService == ComsOps.SERVICE_CHAR) { emulatorParent.removeTwine(nameSpecString); } } catch (IOException ioE) { ErrorOps.printError(ioE, "Interrupted Exception"); } System.out.println("*******************************\n" + "Ending JiniEmulator for " + nameSpecString + "\n*******************************"); } /** * Called when JiniEmulator has received results from searching the Twine * network. This method will only be called if the *
JiniEmulator
is emulating a Jini Client. * @param searchRes Set of stringified
NameSpecifier
results * from service searching Twine network */ private void sendSearchResponse(String [] searchRes) { try { if (searchRes == null) System.out.println("JiniEmulator received an empty" + " search return"); else System.out.println("JiniEmulator received " + searchRes.length + " search results. Sending now ..."); StringBuffer nsBuf = new StringBuffer(); for (int sSize = 0; sSize < searchRes.length; sSize++) { nsBuf.append(searchRes[sSize]+ComsOps.DELIM_CHAR); } // End the return results nsBuf.append(ComsOps.NS_END_CHAR); outStream.write(nsBuf.toString()); outStream.flush(); System.out.println("Sent Results"); } catch(IOException ioE) { ErrorOps.printError(ioE, "Interrupted Exception");
Page 194 of 309
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 195 of 309
} catch(Exception eX) { ErrorOps.printError(eX, "General exception sending search " + "results."); } } }
B1.4.3
TwineArch.java
package cygnusX1.arch; // CygnusX1 package imports import cygnusX1.error.*;
// Exception helper methods
// j2sdk package imports import java.net.*; import java.util.*;
// For InetAddress recognition // For hashtable utils
/** * Twine arch acts as a Twine application. It connects to a single INR and * begins announcing new NameSpecifier entries as they are passed to it. * In version 1.0, Twine arch only handles NameSpecifier announcement, it does * not handle service invokation (far more advanced). TwineArch exists for * future extensibility. * @author Steven R. Livingstone, Bsc. 33708162 * @version 1.0 2003.09.02 * @see cygnusX1.error.ErrorOps */ public class TwineArch { private private private private private
Map twineAppMap; // InetAddress cygnusIP; // int twinePort; // TwineAnnouncer twineTalker = null; // Object semaphore; //
// ***** Gui additions private OutputGui advertiseGui = null; private OutputGui searchGui = null;
Current twine search threads InetAddress of CygnusX1/self Port of CygnusX1/self Announces new Jini services Semaphore object
// Graphically displays adv coms // Graphically displays src coms
/** * Initialises the CygnusX1 IP and Twine INR remote port. * @param cygnusIP The IP of this announcer/CygnusX1 * @param twinePort The remote port to connect to INR on */ public TwineArch(InetAddress cygnusIP, int twinePort, boolean useGui) { this.twinePort = twinePort; this.cygnusIP = cygnusIP; semaphore = new Object(); // ***** Gui additions if (useGui) { advertiseGui = new OutputGui("Advertisment Traffic", false); searchGui = new OutputGui("Search Traffic", true); }
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 196 of 309
} /** * Called by CygnusX1 to advertise into the Twine network a new Jini * service. This is handled by the TwineAnnouncer child. Cleanest to * synchronize here as
ins.api.Application
is not thread safe. * @param jiniNS The initial Jini Service
NameSpecifier
to * advertise */ public synchronized void advertiseTwine(String jiniNS) { // ***** Gui additions if (advertiseGui != null) { advertiseGui.outputText("\n*************************************" + "\nAdvertising the following service: " + jiniNS + "\n***********************************"); } if (twineTalker == null) { // First Jini app to advertise in the Twine network try { twineTalker = new TwineAnnouncer(cygnusIP, twinePort, jiniNS); } catch (Exception eX) { ErrorOps.printError(eX, "Could not create TwineAnnouncer!"); } } else { // Already advertising for another Jini service, so only add twineTalker.advertiseJini(jiniNS); } } /** * Called by CygnusX1 to remove a Jini service advertisment from the * currently 'announced' maintained by the TwineAnnouncer. * @param jiniNS The initial Jini Service
NameSpecifier
to * remove */ public synchronized void removeTwine(String jiniNS) { if (twineTalker != null) { // ***** Gui additions if (advertiseGui != null) { advertiseGui.outputText("\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n" + "Removing the following service: " + jiniNS + "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); } twineTalker.removeTwine(jiniNS); } else { String outString = "*********************** XXXXXXXX **********\n" + "Trying to remove service: " + jiniNS + "but Twine Announcer not started!" + "********************** XXXXXXXX **********"; System.out.println(outString); } } /** * Called by CygnusX1 to perform a service search of services in the Twine
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 197 of 309
* network. This is handled by the
TwineSearcher
. The * method is not synchronized to enable multi-threaded searching. A new *
TwineSearcher
must be created each time as *
ins.api.Application
is not thread safe. This slows down * the search process, but is much faster than synchronizing on the * discovery process as here we are synchronizing only * on the construction of an object (uses Datagram Sockets thus no * connection setup overhead), not a search of the network. * @param searchNS The Stringified
NameSpecifier
to search for * @return The set of
NameSpecifier
's that match the initial * parameter */ public String [] searchTwine(String searchNS) { String [] searchResult = null; TwineSearcher twineLooker = null; // ***** Gui additions if (searchGui != null) { searchGui.outputText("\n***************************************" + "\nSearching for the following service: " + searchNS + "\n**************************************"); } // We synchronise to prevent potential thread issues synchronized (semaphore) { try { twineLooker = new TwineSearcher(cygnusIP, twinePort, searchNS); } catch (Exception eX) { ErrorOps.printError(eX, "Could not create TwineSearcher!"); } } // Search occurs outside synch block so threaded search is possible searchResult = twineLooker.searchTwine(searchNS); // ***** Gui additions if (searchGui != null) { String outString = ""; for (int resCnt = 0; resCnt < searchResult.length; resCnt++) { outString += ("\n\t~~~~\tResult " + resCnt + "\t~~~~\n" + searchResult[resCnt] + "\n"); } searchGui.outputText("\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" + "\nObtained the following results: " + outString + "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); } return searchResult; } }
B1.4.4
TwineCygnusApp.java
package cygnusX1.arch; // INS/Twine package imports import ins.api.*; // Required to extend TwineApp import ins.namespace.*; // Required to recognise NameSpecifier
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003. import ins.inr.*;
// Required for INR functions
// j2sdk package imports import java.net.*;
// For InetAddress recognition
/** * Provides the basic outline of Twine applications for CygnusX1. * to this will be for advertising/invokation and searching. * @author Steven R. Livingstone, Bsc. 33708162 * @version 1.0 2003.09.02 * @see ins.api * @see ins.namespace * @see ins.inr */ public abstract class TwineCygnusApp extends TwineApp {
Page 198 of 309
// TwineTester variables protected boolean discoverFull = true; protected long myAppuid = -1; protected TwineLogger log; protected static boolean DISPLAY_OUT = true; protected static NameSpecifier ns = null;
// // // // //
Extensions
Get full names for now For Application logging Write files to disk print packets to screen Namespecifier of app
/** * Passes initial construction up to inheritance tree for construction. * Initialises the CygnusX1 IP, Twine INR remote port and initial * NameSpecifier. * @param cygnusIP The IP of this announcer/CygnusX1 * @param twinePort The remote port to connect to INR on * @param jiniNS Initial
NameSpecifier
of the creating * application */ public TwineCygnusApp(InetAddress cygnusIP, int twinePort, String jiniNS) throws Exception { super(cygnusIP.getHostAddress(), twinePort); // TwineTester commands time_out = 3500; // Long time_out for debugging only this.enableSinglePeering(); byte[] addr = localhost.getAddress(); myAppuid = (long)(Conversion.extract32toInt(addr, 0)); myAppuid = (myAppuid Jini Rules *
* - Service -> java.lang.class service OR Entry.Name (app dependant) *
- Name -> Entry.Name if java.lang.class used in service else lost *
- Entity -> Comment *
- Country -> Entry.Adress.Country *
- State -> Entry.Adress.stateOrProvince *
- City -> Entry.Adress.locality *
- Location -> Entry.Address.organization *
- Building -> Entry.Location.Building *
- Floor -> Entry.Location.floor *
- Room -> Entry.Location.room *
- Node -> None (not required) *
- Port -> None (not required) *
* @author Steven R. Livingstone, Bsc. 33708162 * @version 1.0 2003.09.02 * @see cygnusX1.error */ public class SemanticConvertor { // Basic NameSpecifier Attribute types private final String nsEntity = "entity"; private final String nsService = "service";
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 211 of 309
private final String nsName = "name"; private final String nsJini = "jini"; private final String cygnusIP = null; // Geographical scope array values private final String [] locationScope = {"country", "state", "city", "location", "building", "floor", "room"}; /** * Main constructor. */ public SemanticConvertor(String cygnusIP) { this.cygnusIP = cygnusIP; } /** * This method is called when a search of Twine network has occured and * returned
NameSpecifier
s must be converted for Jini to use. * The incoming
NameSpecifier
is converted to a Jini *
ServiceTemplate
so the service request can be passed to * the awaiting Jini client. This method 'flattens' the hierachical *
NameSpecifier
to a table layout. The passed in *
NameSpecifier
contains the IP of the Twine service * (required for invokation, not implemented as of version 1.0). * @param theNS The
NameSpecifier
to convert to a Jini usable * format * @param theService The service object, e.g. a Printer object * @param theAttempt Use a different form of conversion. This feature * is not implemented in version 1.0 as this is can be used in service * invokation. * @return The Jini representation of initial
NameSpecifier
*/ public ServiceItem twine2jini(NameSpecifier theNS, Object theService, int theAttempt) { ServiceItem twineItem; Entry [] attTmpl = new Entry [4]; // Jini broke rule 101, public vars, not private with public get/set attTmpl[SemOps.ADDRESS_MEM] = new Address(); attTmpl[SemOps.COMMENT_MEM] = new Comment(); attTmpl[SemOps.LOCATION_MEM] = new Location(); attTmpl[SemOps.NAME_MEM] = new Name(); setJGeographical(attTmpl, theNS, theAttempt); try { setJComment(attTmpl, theNS, theAttempt); setJName(attTmpl, theNS, theAttempt); } catch (NullValueException nvE) { ErrorOps.printError(nvE, "Failure trying to perform twine2jini"); System.exit(0); } twineItem = new ServiceItem(null, theService, attTmpl); return twineItem; } /** * This method converts a NameSpecifer to a Service Item. This method is * not in use in version 1.0. (Should accept an array of NS's) * @param theNS The
NameSpecifier
to convert to a Jini usable * format
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 212 of 309
* @param theAttempt Use a different form of conversion. This feature * is not implemented in version 1.0 as this is can be used in service * invokation. * @return The Jini representation of initial
NameSpecifier
*/ public ServiceTemplate twine2jini(NameSpecifier theNS, int theAttempt) { ServiceTemplate twineTemplate; Entry [] attTmpl = new Entry [4]; // Jini broke rule 101, public vars, not private with public get/set attTmpl[SemOps.ADDRESS_MEM] = new Address(); attTmpl[SemOps.COMMENT_MEM] = new Comment(); attTmpl[SemOps.LOCATION_MEM] = new Location(); attTmpl[SemOps.NAME_MEM] = new Name(); setJGeographical(attTmpl, theNS, theAttempt); try { setJComment(attTmpl, theNS, theAttempt); setJName(attTmpl, theNS, theAttempt); } catch (NullValueException nvE) { ErrorOps.printError(nvE, "Failure trying to perform twine2jini"); System.exit(0); } twineTemplate = new ServiceTemplate(null, null, attTmpl); return twineTemplate; } /** * Called when a Jini client searches for a service. The incoming *
ServiceTemplate
must be converted to a Twine *
NameSpecifier
so the service request can be passed to the * locally connected INR. A NameSpecifier is created by first * constructing the AV child elements then combining them to produce * the NameSpecifier. This requires more initial variable declarations, * but simplifies the code. * @param theST The template to match services on * @param classSearch Dictates if search based on java.lang.class and * Entry.Name or Entry.Name alone. * @return The
NameSpecifier
of the matching service template * @exception EmptyServiceException Thrown when a search on the Class type * is specified, yet the Class object is null. Also thrown if both Class * and Entry[] types in theST are null. */ public NameSpecifier jini2twine(ServiceTemplate theST, boolean classSearch) throws EmptyServiceException { Entry [] theTmpl; NameSpecifier convertedNS = new NameSpecifier(); // Declaring all entries prior makes chain construction of NS easier Address enAddress = null; Location enLocation = null; Comment enComment = null; Name enName = null; AVelement avService = null; AVelement avName = null; AVelement avEntity = null; AVelement avLocation = null; AVelement avAddress = null; AVelement avInet = null; if (theST.attributeSetTemplates != null) { // We have a search on Entry types
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 213 of 309
theTmpl = theST.attributeSetTemplates; // The order may not be address, comment, location, name for (int tmplCnt = 0; tmplCnt < theTmpl.length; tmplCnt++) { if (theTmpl[tmplCnt] instanceof Address) { enAddress = (Address)theTmpl[tmplCnt]; } else if (theTmpl[tmplCnt] instanceof Location) { enLocation = (Location)theTmpl[tmplCnt]; } else if (theTmpl[tmplCnt] instanceof Comment) { enComment = (Comment)theTmpl[tmplCnt]; } else if (theTmpl[tmplCnt] instanceof Name) { enName = (Name)theTmpl[tmplCnt]; } } avAddress = setNSAddress(enAddress, enLocation); avEntity = setNSEntity(enComment); if (!classSearch) { // Service AV element only, from Entry.Name avService = setNSService(enName); } else if (theST.serviceTypes.length > 0) { // Service on class and append Entry.Name under 'name' avService = setNSService(theST.serviceTypes[0]); avName = setNSName(enName); if (avName != null) { avService.addAVelement(avName); } } else { throw new EmptyServiceException ("Class search requested yet no .Class's provided"); } } else if(classSearch) { // We have a search on .Class only if (theST.serviceTypes.length > 0) { // Service on class and append Entry.Name under 'name' avService = setNSService(theST.serviceTypes[0]); } else { throw new EmptyServiceException ("Class search requested yet no .Class's provided"); } } else { // No .Class has been provided, nor Entry[] throw new EmptyServiceException ("No .Class or Entry[] provided for conversion"); } /* Add the new AVelements to the NameSpecifier. Keep order same * so printed NS matches original for testing purposes. */ if (avService !=null) convertedNS.addAVelement(avService); if (avAddress !=null) convertedNS.addAVelement(avAddress); if (avEntity !=null) convertedNS.addAVelement(avEntity); return convertedNS; } /** * Called when a Jini service advertises itself in the Twine network. The * incoming
ServiceItem
must be converted to a Twine *
NameSpecifier
so the service description can be passed to * the locally connected INR. A NameSpecifier is created by first * constructing the AV child elements then combining them to produce * the NameSpecifier. This requires more initial variable declarations, * but simplifies the code.
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 214 of 309
* Note, a special Jini
AVelement
is attached to signify that * this is a Jini service, and that if this service is returned by a * Jini client searching the Twine network, it is discarded. This * addition does not effect the results of a Twine client search. * @param theST The service to advertise in the Twine network * @param templateSearch Dictates if advertise with java.lang.class and * Entry.Name or Entry.Name alone. * @return The
NameSpecifier
of the matching service template * @see java.lang.Object * @see java.lang.Class */ public NameSpecifier jini2twine(ServiceItem theST, boolean templateSearch){ Entry [] theTmpl; NameSpecifier convertedNS = new NameSpecifier(); // Declaring all entries prior makes chain construction of NS easier Address enAddress = null; Location enLocation = null; Comment enComment = null; Name enName = null; AVelement avService = null; AVelement avName = null; AVelement avEntity = null; AVelement avLocation = null; AVelement avAddress = null; AVelement avInet = null; AVelement avJiniServ = null; theTmpl = theST.attributeSets; // The order may not be address, comment, location, name for (int tmplCnt = 0; tmplCnt < theTmpl.length; tmplCnt++) { if (theTmpl[tmplCnt] instanceof Address) { enAddress = (Address)theTmpl[tmplCnt]; } else if (theTmpl[tmplCnt] instanceof Location) { enLocation = (Location)theTmpl[tmplCnt]; } else if (theTmpl[tmplCnt] instanceof Comment) { enComment = (Comment)theTmpl[tmplCnt]; } else if (theTmpl[tmplCnt] instanceof Name) { enName = (Name)theTmpl[tmplCnt]; } } avAddress = setNSAddress(enAddress, enLocation); avEntity = setNSEntity(enComment); if (!templateSearch) { // Service AV element only, from jName avService = setNSService(enName); } else { // Service on class and append jName under 'name' avService = setNSService(theST.service.getClass()); avName = setNSName(enName); if (avName != null) { avService.addAVelement(avName); } } // Never get the instance of blank class as Jini requires it /* Add the new AVelements to the NameSpecifier. Keep order same * so printed NS matches original for testing purposes. */ if (avService !=null) convertedNS.addAVelement(avService); if (avAddress !=null) convertedNS.addAVelement(avAddress); if (avEntity !=null) convertedNS.addAVelement(avEntity); convertedNS.addAVelement(setNSJiniServ());
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 215 of 309
return convertedNS; } //----------------------- Jini to Twine methods /** * Creates a partial Location AVelement from the supplied Entry.Address * Called when going Jini to Twine. This method closely follows the logic * of setJGeographical. * j.Entry.Adress.Country -> NS.country, * j.Entry.Adress.stateOrProvince -> NS.state, * j.Entry.Adress.locality -> NS.City, * j.Entry.Address.organization -> NS.Location * j.Entry.Location.Building -> NS.building * j.Entry.Location.floor -> NS.floor * j.Entry.Location.room -> NS.room * Namepecifier Attribute strings are controlled by locationScope[]. * @param theAddress The
Address
to be converted to an *
AVelement
* @param theLocation The
Location
to be converted to an *
AVelement
* @return The resultant
AVelement
from the parameters */ private AVelement setNSAddress(Address theAddress, Location theLocation) { /* The quickest way is to create each AVelement and link the objects * directly, rather than scanning back up the chain each time, also * more flexible. */ // [Country, State, Locality, Organization] AVelement [] avGeo = {null, null, null, null, null, null, null}; if (theAddress == null) { } else { // Check Country if (theAddress.country != null) { avGeo[SemOps.COUNTRY_MEM] = new AVelement (new Attribute(locationScope[SemOps.COUNTRY_MEM]), new Value(theAddress.country)); } // Check State else if (theAddress.stateOrProvince != null) { avGeo[SemOps.STATE_MEM] = new AVelement (new Attribute(locationScope[SemOps.STATE_MEM]), new Value(theAddress.stateOrProvince)); } // Check City (j.locality) else if (theAddress.locality != null) { avGeo[SemOps.CITY_MEM] = new AVelement (new Attribute(locationScope[SemOps.CITY_MEM]), new Value(theAddress.locality)); } // Check organisation (NS.Location) else if (theAddress.organization != null) { avGeo[SemOps.ORG_MEM] = new AVelement (new Attribute(locationScope[SemOps.ORG_MEM]), new Value(theAddress.organization)); } } if (theLocation != null) { // Check Building if (theLocation.building != null) { avGeo[SemOps.BUILD_MEM] = new AVelement
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 216 of 309
(new Attribute(locationScope[SemOps.BUILD_MEM]), new Value(theLocation.building)); } // Check Floor else if (theLocation.floor != null) { avGeo[SemOps.FLOOR_MEM] = new AVelement (new Attribute(locationScope[SemOps.FLOOR_MEM]), new Value(theLocation.floor)); } // Check Room else if (theLocation.room != null) { avGeo[SemOps.ROOM_MEM] = new AVelement (new Attribute(locationScope[SemOps.ROOM_MEM]), new Value(theLocation.room)); } } else; /* Link all the AVelements together into a Geographical AVelement chain * enum neater but more code. This nested loop links n+1 to n, if * both are not null. */ int firstNonNull = -1; for (int geoCnt1 = 0; geoCnt1 < avGeo.length-1; geoCnt1++) { if (avGeo[geoCnt1] != null) { // Set first non-null AVelement to return if (firstNonNull == -1) firstNonNull = geoCnt1; for (int geoCnt2 = geoCnt1+1; geoCnt2 < avGeo.length; geoCnt2++) { if (avGeo[geoCnt2] != null) { avGeo[geoCnt1].addAVelement(avGeo[geoCnt2]); // We only want to add the first instance break; } } } } // May have empty location and address, thus never non-null entry if (firstNonNull != -1) return avGeo[firstNonNull]; else return null; } /** * Converts an Entry.Comment to an AVelement. Called when going from * Jini to Twine. * @param theCommment The
Comment
to be converted to an *
AVelement
* @return The resultant
AVelement
from the parameters */ private AVelement setNSEntity(Comment theComment) { if (theComment.comment != null) { AVelement avEntity = new AVelement(new Attribute(nsEntity), new Value(theComment.comment)); return avEntity; } else { return null; } } /** * Called when service wants value based on Entry.Name attribute.
I.e.
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 217 of 309
* when not a service class advertise/search. Called when going from * Jini to Twine. * @param theName The
Name
to be converted to an *
AVelement
* @return The resultant
AVelement
from the parameter */ private AVelement setNSService(Name theName) { if (theName.name != null) { AVelement avService = new AVelement(new Attribute(nsService), new Value(theName.name)); return avService; } else { return null; } } /** * Called when service wants value based on Service.class. I.e. when * a service class advertise/search. Called when going from * Jini to Twine. * @param serClass The
Class
to be converted to an *
AVelement
* @return The resultant
AVelement
from the parameter */ private AVelement setNSService(Class serClass) { if (serClass != null) { AVelement avService = new AVelement(new Attribute(nsService), new Value(serClass.getName())); return avService; } else { return null; } } /** * Called when want to assign the Name AVelement. This is called only * when we have a service class advertise. Called when going from * Jini to Twine. * @param theName The
Name
to be converted to an *
AVelement
* @return The resultant
AVelement
from the parameter */ private AVelement setNSName(Name theName) { if (theName.name != null) { AVelement avService = new AVelement(new Attribute(nsName), new Value(theName.name)); return avService; } else { return null; } } /** * Creates an AVelement which signifies this is a Jini service being * advertised. This allows Jini clients searching the Twine network * to recognise a returned entry representing a Jini service that has * been advertised in the Twine network. Called when going Jini to Twine. * @return A newly constructed
AVelement
based on the string
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 218 of 309
* "jini" for both
Attribute
and
Value
. */ private AVelement setNSJiniServ() { AVelement avJiniServ = new AVelement(new Attribute(nsJini), new Value(cygnusIP + "," + ComsOps.JINI_SERVER_PORT + "," + ComsOps.TWINE_INR_PORT)); return avJiniServ; } //----------------------- Twine to Jini methods /** * Converts
NameSpecifier
theNS into a
Name
and * places it the
Entry
array attTmpl. Called when going Twine * to Jini. * @param attTmpl The
Entry
array to place the converted *
NameSpecifier
into * @param theNS The
NameSpecifier
to be converted * @param attemptNum deprecated * @exception NullValueException Occurs when the Value element for the * current AVelement is to be null. This is caused by the application * developer. */ private void setJName (Entry[] attTmpl, NameSpecifier theNS, int attemptNum) throws NullValueException { // Entry.name type String theName = null; AVelement serviceAV = getAV(theNS.getAVelements(), SemOps.SERVICE_TYPE); if (serviceAV != null) { theName = getAV(theNS.getAVelements(), SemOps.SERVICE_TYPE).getValue().toString(); // Assign value here, so test in one go if (theName != null) { ((Name) attTmpl[SemOps.NAME_MEM]).name = theName; } else { throw new NullValueException ("The AVelement 'Service' has a null Value element"); } } } /** * Converts
NameSpecifier
theNS into a
Comment
* and places it the
Entry
array attTmpl. Called when going * Twine to Jini. * @param attTmpl The
Entry
array to place the converted *
NameSpecifier
into * @param theNS The
NameSpecifier
to be converted * @param attemptNum deprecated * @exception NullValueException Occurs when the Value element for the * current AVelement is to be null. This is caused by the application * developer. */ private void setJComment (Entry[] attTmpl, NameSpecifier theNS, int attemptNum) throws NullValueException {
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003. String theComment = null; AVelement entityAV = getAV(theNS.getAVelements(), SemOps.ENTITY_TYPE); if (entityAV != null) { theComment = getAV(theNS.getAVelements(), SemOps.ENTITY_TYPE).getValue().toString(); // Assign value here, so test in one go if (theComment != null) { ((Comment) attTmpl[SemOps.COMMENT_MEM]).comment = theComment; } else { throw new NullValueException ("The AVelement 'Entity' has a null Value element"); } } } /** * Converts
NameSpecifier
theNS into a
Address
* and
Location
and places it the
Entry
array * attTmpl. Called when going Twine to Jini. * The conversion rules are as follows: * NS.country -> j.Entry.Adress.Country, * NS.state -> j.Entry.Adress.stateOrProvince, * NS.City -> j.Entry.Adress.locality, * NS.Location -> j.Entry.Address.organization, * NS.building -> j.Entry.Location.Building, * NS.floor -> j.Entry.Location.floor, * NS.room -> j.Entry.Location.room * If entries are not located, they are skipped, continuing down the * tree. If no single j.Entry.Address value is filled, it is set to * null, to quicken search, likewise with j.Entry.Location * As specifying exact location will commonly restrict the number of * discovered entries, future attempts will limit the scope of location. * NameSpecifier Attribute strings are controlled by LocationScope[]. * @param attTmpl The
Entry
array to place the converted *
NameSpecifier
into * @param theNS The
NameSpecifier
to be converted * @param attemptNum deprecated */ private void setJGeographical (Entry[] attTmpl, NameSpecifier theNS, int attemptNum) { Address theAddress = (Address) attTmpl[SemOps.ADDRESS_MEM]; Location theLocation = (Location) attTmpl[SemOps.LOCATION_MEM]; boolean atRoot = true; AVelement theAV = null; AVelement avBackUp = null; Attribute theAtt = null; Enumeration avEnum = null; for (int locCount = 0; locCount < locationScope.length; locCount++) { // If start from root, if (atRoot) { avEnum = theNS.getAVelements(); } // Further down the path of this AV else { /* If an entry is not located, keep searching for others * the previous attempt resets our AV to null */ if (theAV != null) {
Page 219 of 309
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003. avEnum = theAV.getAVelements(); } } avBackUp = getAV(avEnum, locationScope[locCount]); if (avBackUp != null) { theAV = avBackUp; // This works because of ref->ref->obj atRoot = false; /* This is not very neat, as it breaks the 'not knowing * contents' of the array and for loop automation. */ switch (locCount) { case 0: theAddress.country = theAV.getValue().toString(); break; case 1: theAddress.stateOrProvince = theAV.getValue().toString(); break; case 2: theAddress.locality = theAV.getValue().toString(); break; case 3: theAddress.organization = theAV.getValue(). toString(); break; case 4: theLocation.building = theAV.getValue().toString(); break; case 5: theLocation.floor = theAV.getValue().toString(); break; case 6: theLocation.room = theAV.getValue().toString(); break; } } else { //printString("Not Found: ", locationScope[locCount]); } } } /** * Locates the
AVelement
which contains the attribute with * the string. Returns
AVelement
if found, else null. * @param nsEnum The set of
AVelement
to iterate over * @param attType The
Attribute
type to search for * @return The located
AVelement
mathing attType. */ private AVelement getAV(Enumeration nsEnum, String attType) { AVelement theNode = null; Attribute theAtt = null; while (nsEnum.hasMoreElements()) { theNode = (AVelement)nsEnum.nextElement(); theAtt = theNode.getAttribute(); if (theAtt.toString().equalsIgnoreCase(attType)) { return theNode; } } return null; } /** * Takes in an enumeration of
AVelement
s. Prints out the * next
AVelement
, if the current
AVelement
has * a child, i.e. is not a leaf node, recursively calls itself passing in * the enumeration of children
AVelement
s.
Page 220 of 309
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 221 of 309
* @param e1 The enumerated set of
AVelement
s. * @deprecated Obsoleted by getAV */ private void getAVPair(Enumeration e1) { AVelement p = null; Attribute na = null; Value nv = null; while (e1.hasMoreElements()) { p = (AVelement)e1.nextElement(); na = p.getAttribute(); nv = p.getValue(); System.out.print("["); printAVpair(na.toString(),nv.toString()); if (!p.isLeaf()) { getAVPair(p.getAVelements()); } System.out.print("]"); } } /** * Neatly prints the two Strings. * @param prefix First string to print * @param theString The second string to print */ private void printString(String prefix, String theString) { System.out.println(prefix + " " + theString); } /** * Prints the two strings in
NameSpecifier
format. * @param theAtt The first string to print (Attribute) * @param theVale The second string to print (Value) * @deprecated Required by
getAVPair
which is deprecated also */ private void printAVpair(String theAtt, String theVal) { System.out.print(theAtt + "=" + theVal); } }
B1.6.2
SemOps.java
package cygnusX1.convertor; /** * Provides basic semantic conversion related helper variables. * @author Steven R. Livingstone, Bsc. 33708162 * @version 1.0 2003.09.02 * @see cygnusX1.convertor.SemanticConvertor */ public class SemOps {
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003. // Entry array index positions public final static int ADDRESS_MEM public final static int COMMENT_MEM public final static int LOCATION_MEM public final static int NAME_MEM
= = = =
0; 1; 2; 3;
// NameSpecifier/Jini Entry types public final static String SERVICE_TYPE public final static String NAME_TYPE public final static String ENTITY_TYPE public final static String ADDRESS_TYPE public final static String LOCATION_TYPE public final static String BUILDING_TYPE public final static String FLOOR_TYPE public final static String ROOM_TYPE // Which search attempt public final static int ATTEMPT_ONE public final static int ATTEMPT_TWO // Geographical array index public final static int COUNTRY_MEM public final static int STATE_MEM public final static int CITY_MEM public final static int ORG_MEM public final static int BUILD_MEM public final static int FLOOR_MEM public final static int ROOM_MEM }
= = = = = = = =
= 0; = 1; = = = = = = =
0; 1; 2; 3; 4; 5; 6;
"service"; "name"; "entity"; "address"; "location"; "building"; "floor"; "room";
Page 222 of 309
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
B1.7 cygnusX1.error Package This package contains classes used for CygnusX1-specific exception handling.
B1.7.1
EmptyServiceException.java
package cygnusX1.error; /** * Personalised
CygnusX1
exception. * @author Steven R. Livingstone, Bsc. 33708162 * @version 1.0 2003.09.02 */ public class EmptyServiceException extends Exception { /** * Performing a search based on class/object name, but not classes have * been specified to search on. * @param theMsg Message accompanying the error */ public EmptyServiceException(final String theMsg) { super(theMsg); } }
B1.7.2
NullValueException.java
package cygnusX1.error; /** * Personalised
CygnusX1
exception. * @author Steven R. Livingstone, Bsc. 33708162 * @version 1.0 2003.09.02 */ public class NullValueException extends Exception { /** * Occurs when the conversion of a NameSpecifier to a Jini element, and * the
AVelement.Value()
is null. This is from in incorrect * application creation of a
NameSpecifier
. * @param theMsg Message accompanying the error */ public NullValueException(final String theMsg) { super(theMsg); } }
B1.7.3
ErrorOps.java
Page 223 of 309
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003. package cygnusX1.error; /** * Foundation class providing helper methods for *
java.lang.Exception
and personalised
CygnusX1
* exceptions. * @author Steven R. Livingstone, Bsc. 33708162 * @version 1.0 2003.09.02 */ public class ErrorOps { /** * Called when want exception message string printed along with a * stack trace of the error. * @param eX The exception that occurred * @param errorMsg The String the user wants printed for the error */ public static void printError(Exception eX, String errorMsg) { System.out.println("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" + errorMsg + "\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); eX.printStackTrace(); } /** * Called when only want exception message string printed. * @param errorMsg The String the user wants printed for the error */ public static void printError(String errorMsg) { System.out.println("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n" + errorMsg + "\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); } }
Page 224 of 309
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 225 of 309
B1.8 cygnusX1.tests Package This package contains classes used for testing CygnusX1. The sole class in this package is SconvHarness.java, as this is the only section of CynusX1 testing which could be automated.
B1.8.1
SConvHarness.java
package cygnusX1.tests; // CyngusX1 package imports import cygnusX1.convertor.*; // For SemanticConvertor object import cygnusX1.error.*; // Exception helper methods // INS/Twine package imports import ins.namespace.*; // Required for NameSpecifiers // Jini package imports import net.jini.core.lookup.ServiceItem; // For ServiceItem import net.jini.core.lookup.ServiceTemplate; // For ServiceTemplate import net.jini.core.entry.*; // Required to register a service import net.jini.lookup.entry.*; // Provides more descriptive Entry types // j2sdk package imports import java.util.*; import java.io.*; /** * A test harness for Semantic Convertor. This is provided as * SemanticConvertor is directly testable on in/out, secondly because it * is the most important component of CynusX1. This class reads in * NameSpecifier descriptions from the file semanticTests.txt and procedes * to test the conversion. * @author Steven R. Livingstone, Bsc. 33708162 * @version 1.0 2003.09.02 * @see cygnusX1.convertor.SemanticConvertor * @see cygnusX1.error.ErrorOps */ public class SConvHarness { private SemanticConvertor testCon; // SemanticConvertor object to test // Location of text files containing the NameSpecifiers to test private final String testFile = "/home/SRL/Honours/cygnus/cygnusX1/tests/semanticTests.txt"; // Helper strings private final String jiniList = "*****"; private final String classList = "&&&&&"; private final String classTest = "&&&&&& Class Test &&&&&&"; private final String normTest = "@@@@@@ Normal Test @@@@@@"; private final String nsStart = " \t######## Converting to NS ########"; private final String jiStart = " \t######## Converting to Jini ########"; private final String endTest = "\n**************************************" + "*******************"; private int lineCount = 0; // Current file line count /** * Creates a file reader and reads in the lines one at a time.
This
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003. * tester works on the logic of NS->Jini->NS and comparison * of the input vs the output. This round-trip testing allows dual * conversion results. Provisions have been made to test Jini. */ public SConvHarness() { BufferedReader bufRead = null; // Reads the file String inLine = ""; // Current line from file String origNS = null; // NameSpecifer for converting try { bufRead = new BufferedReader(new FileReader(testFile)); testCon = new SemanticConvertor("192.168.0.1"); System.out.println(testCon.getClass().getName()); } catch (IOException ioE) { ErrorOps.printError(ioE, "file error!: "+testFile); System.exit(0); } System.out.println("************************************************" + "*******************************\n" + "************************************************" + "*******************************"); try { inLine = bufRead.readLine(); lineCount++; boolean isClass = false; NameSpecifier convNS; NameSpecifier convTempNS = null; ServiceTemplate theTemplate; ServiceItem theItem; System.out.println(normTest); while (inLine != null) { // Break if we have a blank single line (probably end of file) if (inLine.equals("")) return; while (inLine.charAt(0) == '/') inLine = bufRead.readLine(); if (inLine.substring(0,5).equals(jiniList)) { // Assign as may have no entries. testJini(bufRead, inLine); inLine = null; } else if (inLine.substring(0,5).equals(classList)) { isClass = true; System.out.println(classTest); inLine = bufRead.readLine(); } else { System.out.println("Test "+lineCount+": "+inLine); lineCount++; // Test Twine convNS = new NameSpecifier(inLine); origNS = convNS.toString(); System.out.println(nsStart); theItem = testCon.twine2jini(convNS, this, 0); theTemplate = testCon.twine2jini(convNS, 0); testJini(theItem); testJini(theTemplate); System.out.println(jiStart); if (isClass) { convNS = testCon.jini2twine(theItem, true); convTempNS = testCon.jini2twine(theItem, true); } else { convNS = testCon.jini2twine(theItem, false); convTempNS = testCon.jini2twine(theItem, false); } System.out.println("\nOriginal: "
Page 226 of 309
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003. + origNS + "\nConverted Advertise: " + convNS.toString() + "\nConverted Search: " + convTempNS.toString() + "\n" + endTest); inLine = bufRead.readLine(); } } } catch (Exception eX) { ErrorOps.printError(eX, "Badly formatted or non-existent file"); System.exit(0); } } /** * Perform a test on the String to see if it conforms the expected Jini * output. * @param bufRead The buffered reader object to get file entries from * @param inLine The String to read the line into, saves declaring again * @deprecated There is no test to perform, a round-trip test is used */ private void testJini(BufferedReader bufRead, String inLine) { try { inLine = bufRead.readLine(); } catch (IOException ioE) { ErrorOps.printError(ioE, "IO Exception reading Jini"); System.exit(0); } } /** * Perform rigorous test on the Jini service template returned from the * first conversion twine2jini. * @param theTmpl The ServiceTemplate to print the details of */ private void testJini(ServiceTemplate theTmpl) { Entry[] entrySet = theTmpl.attributeSetTemplates; // Iterate over the Entry set System.out.println("------------ Search Jini Details ------------"); for (int eCnt = 0; eCnt < entrySet.length; eCnt++) { if (entrySet[eCnt] instanceof Address) { Address theAd = (Address)entrySet[eCnt]; System.out.println("\tAddress details ... "); printDetail("Country", theAd.country); printDetail("StateOrProvince", theAd.stateOrProvince); printDetail("Locality", theAd.locality); printDetail("Organization", theAd.organization); } else if (entrySet[eCnt] instanceof Location) { Location theLoc = (Location)entrySet[eCnt]; System.out.println("\tLocation details ... "); printDetail("Building", theLoc.building); printDetail("Floor", theLoc.floor); printDetail("Room", theLoc.room); } else if (entrySet[eCnt] instanceof Comment) { System.out.println("\tComment details ... ");
Page 227 of 309
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003. printDetail("Comment", ((Comment)entrySet[eCnt]).comment); } else if (entrySet[eCnt] instanceof Name) { System.out.println("\tName details ... "); printDetail("Name", ((Name)entrySet[eCnt]).name); } } } /** * Perform rigorous test on the Jini service template returned from the * first conversion twine2jini. * @param theItem The ServiceItem to print the details of */ private void testJini(ServiceItem theItem) { Entry[] entrySet = theItem.attributeSets; System.out.println("----------- Advertise Jini Details -----------"); // Iterate over the Entry set for (int eCnt = 0; eCnt < entrySet.length; eCnt++) { if (entrySet[eCnt] instanceof Address) { Address theAd = (Address)entrySet[eCnt]; System.out.println("\tAddress details ... "); printDetail("Country", theAd.country); printDetail("StateOrProvince", theAd.stateOrProvince); printDetail("Locality", theAd.locality); printDetail("Organization", theAd.organization); } else if (entrySet[eCnt] instanceof Location) { Location theLoc = (Location)entrySet[eCnt]; System.out.println("\tLocation details ... "); printDetail("Building", theLoc.building); printDetail("Floor", theLoc.floor); printDetail("Room", theLoc.room); } else if (entrySet[eCnt] instanceof Comment) { System.out.println("\tComment details ... "); printDetail("Comment", ((Comment)entrySet[eCnt]).comment); } else if (entrySet[eCnt] instanceof Name) { System.out.println("\tName details ... "); printDetail("Name", ((Name)entrySet[eCnt]).name); } } } /** * Prints the two strings in the required manner. * @param eMsg The message accompanying this types * @param eType The type of object we are printing details for. */ private void printDetail(String eMsg, String eType) { if (eMsg != null) { System.out.println("\t\t" + eMsg + ": " + eType); } else System.out.println("\t\t" + eMsg + " is null");
Page 228 of 309
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003. } /** * Main method. Constructs a new SConvHarness. * @param args The command line Strings */ public static void main(String [] args) { System.out.println("SemanticConvertor Test Harness invoked ..."); SConvHarness testHarness = new SConvHarness(); } }
Page 229 of 309
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Appendix C
Page 230 of 309
Script Files
This appendix lists the various script files used to install/run the programs required for CygnusX1, along with run/compile scripts for CygnusX1.
C1.1 CygnusX1 Scripts This section details scripts used solely for CygnusX1 and its helper classes. This includes the JiniHelloWorld client and service classes as they were modified to properly access CygnusX1. These scripts are all located in the directory /cygnusX1.
C1.1.1
makeCygnusX1 Script
This script compiles CygnusX1 program. #!/bin/bash echo "** Compiling CygnusX1 **" javac *.java apps/*.java apps/jiniApps/*.java arch/*.java coms/*.java convertor/*.java tests/*.java echo "** CygnusX1 compilation complete **"
C1.1.2
makedocs Script
This script creates the javadocs from the CygnusX1 source code. #!/bin/bash PACKAGES='cygnusX1 cygnusX1.apps cygnusX1.arch cygnusX1.coms cygnusX1.convertor cygnusX1.error cygnusX1.tests cygnusX1.apps.jiniApps' echo "** Creating javadocs for CygnusX1 **" javadoc -source 1.4.2 -d ./docs -sourcepath ../ -author -package -use -splitIndex version -windowtitle 'CygnusX1 API' -doctitle 'CygnusX1 API' -header 'CygnusX1 API' bottom '' ${PACKAGES} echo "** javadocs created **"
C1.1.3
runCygnusX1 Script
This script runs the CygnusX1 Bridge. #!/bin/bash java cygnusX1.CygnusX1 $1
C1.1.4
runJiniClient Script
This script launches the Jini HelloWorldClient application. This application provides graphical front-end for searching. #!/bin/bash
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 231 of 309
java -Djava.rmi.server.codebase=http://voyager:31338/ Djava.security.policy=/home/SRL/Honours/jini/jini1_2_1_001/example/lookup/policy.all cygnusX1.apps.jiniApps.HelloWorldClient $1
C1.1.5
runJiniService Script
This script launches the Jini HelloWorldService application. This service advertises itself based on a set of Entry [] attributes. #!/bin/bash java -Djava.rmi.server.codebase=http://voyager:31338/ Djava.security.policy=/home/SRL/Honours/jini/jini1_2_1_001/example/lookup/policy.all cygnusX1.apps.jiniApps.HelloWorldService $1
C1.1.6
runJiniService2 Script
This script is identical to runJiniService except that this service advertises itself based on its .Class type. #!/bin/bash java -Djava.rmi.server.codebase=http://voyager:31338/ Djava.security.policy=/home/SRL/Honours/jini/jini1_2_1_001/example/lookup/policy.all cygnusX1.apps.jiniApps.HelloWorldService2 $1
C1.1.7
runSConvHarness Script
This script runs the SemanticConvertor testing harness. #!/bin/bash echo "Running the SemanticConvertor test harness." echo "Test file contained in cygnusX1/tests/semanticTests.txt" java cygnusX1.tests.SConvHarness echo "Testing of SConvHarness complete"
C1.2 INS/Twine and Jini Scripts This section lists script files used to launch all the necessary applications used in this thesis. That is, the Jini and Twine service discovery systems. Jini scripts are prefixed with a lower case j, Twine scripts are prefixed with a lower case t. These scripts are all located in the directory /cygnusX1/ InsJiniRunScripts.
C1.2.1
jLookupServer Script
This script launches the Jini Lookup Server program. #!/bin/bash echo "Jini Run Sequence: 1) rmid, 2) jWebServer, 3) LookupServer" echo "Starting the Jini Lookup Server. Refer to Core Jini Chapter 1 if difficulty encountered" rm -r regLog*
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 232 of 309
java Djava.security.policy=/home/SRL/Honours/jini/jini1_2_1_001/example/lookup/policy.all jar /home/SRL/Honours/jini/jini1_2_1_001/lib/reggie.jar http://voyager:31338/reggiedl.jar /home/SRL/Honours/jini/jini1_2_1_001/example/lookup/policy.all ./regLog1 public
C1.2.2
jRmid Script
This script launches the Jini RMI activation daemon. #!/bin/bash echo "Jini Run Sequence: 1) rmid, 2) jWebServer, 3) LookupServer" echo "Starting RMI activation daemon, please wait. Refer to Core Jini Chapter 1 if difficulty encountered" rmid -JDjava.security.policy=/home/SRL/Honours/jini/jini1_2_1_001/example/lookup/policy.all
C1.2.3
jWebServer Script
This script launches the Java Web Server. #!/bin/bash echo "Jini Run Sequence: 1) rmid, 2) jWebServer, 3) LookupServer" echo "Starting Java Web server. Refer to Core Jini Chapter 1 if difficulty encountered" java -jar ~/Honours/jini/jini1_2_1_001/lib/tools.jar -dir ~/Honours/jini/files/service verbose -port 31338
C1.2.4
tDSR Script
This script launches the INS/Twine DSR node. #!/bin/bash
java ins.dsr.DSR
C1.2.5
tINR Script
This script launches a single instance of an Intentional Name Resolver (INR). #!/bin/bash java ins.inr.TwineResolver wind -udp 31335 -d 192.168.0.1 -rpc 31336 -keyrouter 31338
C1.2.6
tTwineTester1 Script
This script starts the TwineTester program, which comes packaged with INS/Twine. The program begins by advertising a service that would match a Jini Class search. #!/bin/bash java tests.TwineTester 192.168.0.1:31336 [service=cygnusX1.apps.jiniApps.HelloWorldServiceInterface[name=HelloWorld]]
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
C1.2.7
Page 233 of 309
tTwineTester2 Script
This script starts the TwineTester program, which comes packaged with INS/Twine. The program begins by advertising a service that would match a detailed regular service search for a printer. #!/bin/bash java tests.TwineTester 192.168.0.1:31336 [service=Printer][Country=Australia[State=QLD[City=Brisbane[Location=UQ[Building=gps[Flo or=6[Room=611]]]]]]][entity=StringPrinter]
C1.2.8
tTwineTester3 Script
This script starts the TwineTester program, which comes packaged with INS/Twine. The program begins by advertising a service that would match a detailed regular service search for a Hello World Client. #!/bin/bash java tests.TwineTester 192.168.0.1:31336 [service=HelloWorld][Country=Australia[State=QLD[City=Brisbane[Location=UQ[Building=gps[ Floor=6[Room=611]]]]]]][entity=StringPrinter]
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Appendix D
Page 234 of 309
Help Files
This appendix lists the three helper files which are located in /cygnusX1/ installInsJiniHelp. They detail the process to be followed when setting up INS/Twine, Chord, SFS and Jini. It has been found that the supplied scripts with Chord, INS, SFS or Jini rarely work. Thus, helper files have been provided which educate the reader.
D1.1 CygnusX1 Help This file provides help on how to set the classpath required to run CyngusX1. -- Set the cygnusX1 classpath CLASSPATH=$CLASSPATH:/home/SRL/Honours/cygnus:/home/SRL/Honours/cygnus/cygnusX1:
D1.2 Jini Help This file -- Jini Classpath Refer to Core Jini Chapter 1 if this does not work. CLASSPATH=$CLASSPATH:/home/SRL/Honours/jini/jini1_2_1_001/lib/jinicore.jar:/home/SRL/Honours/jini/jini1_2_1_001/lib/jini-ext.jar:/home/SRL/Honours/jini/jini1_2_1_001/lib/sun-util.jar: There is no compilation required for Jini, as it comes pre-compiled.
D1.3 INS/Twine Help _______________________________Chord_____________________________________________ ** NOTE ** The Twine docs are out of date. a INR on a single machine.
Twine DOES NOT REQUIRE CHORD/SFS to run if you run the
-- Compile Chord Used Chord version: The makefile worked for this nightly build -- Configure SFS to specific directory 1) ./configure --prefix=$HOME/Honours/sfs --with-sfsuser=s370816 --with-sfsgroup=honours ** Make process take a roughly 1 hour and requires close to 1 gig of free hd space. 2) make If on lichen/moss use and make it in /tmp (lichen's ram drive, fast and 4 gig space) 2*) make -j 7 -- Running Chord (2a and 2b start two chord nodes, only require one) 1a) cd /home/SRL/Honours/ins/keyrouters/chordkeyrouter/bin 2a) ./lsd -d blah -j 192.168.0.1:31338 -p 31338 2b) ./lsd -j 192.168.0.1:31338 Make sure the ports are correct else INS/Twine fails.
I.e. it's best not to use chord.
________________________________INS/Twine________________________________________
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 235 of 309
CLASSPATH=$CLASSPATH:/home/SRL/Honours/ins:/home/SRL/Honours/ins/apps:/home/SRL/Honours/ ins/libs/security/cryptix32.jar:/home/SRL/Honours/ins/libs:.:/home/SRL/Honours/ins/libs/ remotetea/classes/oncrpc.jar:/home/SRL/Honours/ins/libs/remotetea/classes/jrpcgen.jar:/h ome/SRL/Honours/ins/libs/remotetea/classes/jportmap.jar:/home/SRL/Honours/ins/libs/mpegj ava/mpegjava10.jar -- Compile INS/Twine Their makefile does not work for me.
So I compiled it by hand to save grief:
1a) cd /inr/interResolverSvc 1b) javac -classpath /home/SRL/Honours/:/home/SRL/Honours/ins/apps:/home/SRL/Honours/ins/libs/security/crypti x32.jar:/home/SRL/Honours/ins/libs:.:/home/SRL/Honours/ins/libs/remotetea/classes/oncrpc .jar:/home/SRL/Honours/ins/libs/remotetea/classes/jrpcgen.jar:/home/SRL/Honours/ins/libs /remotetea/classes/jportmap.jar:/home/SRL/Honours/ins/libs/mpegjava/mpegjava10.jar *.java 2a) cd /inr 2b) javac -classpath /home/SRL/Honours/:/home/SRL/Honours/ins/apps:/home/SRL/Honours/ins/libs/security/crypti x32.jar:/home/SRL/Honours/ins/libs:.:/home/SRL/Honours/ins/libs/remotetea/classes/oncrpc .jar:/home/SRL/Honours/ins/libs/remotetea/classes/jrpcgen.jar:/home/SRL/Honours/ins/libs /remotetea/classes/jportmap.jar:/home/SRL/Honours/ins/libs/mpegjava/mpegjava10.jar *.java ../namespace/*.java ../namespace/index/*.java ../dsr/*.java ./twineStrandMapper/*.java ./interResolverSvc/*.java ./twineKeyRouter/*.java ../keyrouters/javakeyrouter/*.java ../api/*.java ../apps/hello/*.java --
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Appendix E
Page 236 of 309
SemanticConvertor Test File
This appendix lists the test file that comes with SconvHarness. The file is located in /cygnusX1/tests/semanticTests.txt / ----- Test Normal type search (non-class based) / / Test Single entries (1-3) [service=HelloWorld] [Country=Australia] [entity=StringPrinter] [service=HelloWorld[Name=lp101]] / / Test two entries (5-10) [service=HelloWorld][Country=Australia] [Country=Australia][service=HelloWorld] [service=HelloWorld][entity=Spooler] [entity=Spooler][service=HelloWorld] [Country=Australia][entity=Spooler] [entity=Spooler][Country=Australia] / / Test two entries with increasing depth and reversal of the two AVelement blocks (11-14) [service=HelloWorld][Country=Australia[State=QLD]] [Country=Australia[State=QLD]][service=HelloWorld] [service=HelloWorld][Country=Australia[State=QLD[City=Brisbane[Location=UQ[Building=gps[Floor=6[Room=611]]]]]]] [Country=Australia[State=QLD[City=Brisbane[Location=UQ[Building=gps[Floor=6[Room=611]]]]]]]][service=HelloWorld] / / Test Geographical not starting at Country (15-20) [City=Brisbane] [service=HelloWorld][City=Brisbane] [City=Brisbane][service=HelloWorld] [State=QLD[Location=UQ]] [service=HelloWorld][State=QLD[Location=UQ]] [State=QLD[Location=UQ]][service=HelloWorld] / / Test when one geographical comes from Entry.Address and the other from Entry.Location (21-24) [service=HelloWorld][Country=Australia[Room=611]] [Country=Australia[Room=611]][service=HelloWorld] [service=HelloWorld][State=QLD[Floor=6]] [State=QLD[Floor=6]][service=HelloWorld] / / Test when both geographical come from Entry.Location (25-26) [Building=gps[Room=611]] [service=HelloWorld][Building=gps[Room=611]] / / Test three entities (27-33) [service=HelloWorld][Country=Australia][entity=Spooler] [service=HelloWorld][entity=Spooler][Country=Australia] [entity=Spooler][Country=Australia][service=HelloWorld] [service=HelloWorld][Country=Australia[State=QLD[City=Brisbane[Location=UQ[Building=gps[Floor=6[Room=611]]]]]]]][ entity=StringPrinter] [service=HelloWorld][entity=StringPrinter][Country=Australia[State=QLD[City=Brisbane[Location=UQ[Building=gps[Floo r=6[Room=611]]]]]]] [entity=StringPrinter][Country=Australia[State=QLD[City=Brisbane[Location=UQ[Building=gps[Floor=6[Room=611]]]]]]]][ service=HelloWorld] [Country=Australia[State=QLD[City=Brisbane[Location=UQ[Building=gps[Floor=6[Room=611]]]]]]]][entity=StringPrinter][ service=HelloWorld] / / ----- Test the conversion occurs on .Class
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 237 of 309
/ &&&&& / / Test Basic class conversion (34-36) [Country=Australia] [Country=Australia][entity=Spooler] [entity=Spooler][Country=Australia] / / Test that Service is appended as a Name AVelement along with object type (37-38) [service=HelloWorld] [service=HelloWorld][Country=Australia][entity=Spooler] / / Prove that the inclusion of Name does not change its operation (39-40) [service=HelloWorld[Name=lp101]] [service=HelloWorld[Name=lp101]][Country=Australia[State=QLD[City=Brisbane[Location=UQ[Building=gps[Floor=6[R oom=611]]]]]]][entity=StringPrinter]
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Appendix F
JiniHelloWorld Modifications
This file lists the modifications to the JiniHelloWorldService class. Modifications to HelloWorldClient are nearly identical. JiniHelloWorld classes come from the Core Jini chapter 5 package. 1) Class Variables protected JiniServiceWrapper myWrapper; // The wrapper for this service protected boolean discoveredLookup = false; // Found a single lookupSrvr protected InetAddress cygnusIP; // IP address of cygnusX1 2) public void discovered() ~~ Following the for loop if (!discoveredLookup) { myWrapper = new JiniServiceWrapper(cygnusIP, item, false); } discoveredLookup = true; As you can see, the modifications are small, around 5 line of code. The modification to JiniClient to allow the GUI required siginificant extension. However, this is the bare minimum required to allow this Jini class to use CygnusX1.
Page 238 of 309
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Appendix G
Page 239 of 309
Java doc Files
This section contains the main document files produced by the javadoc tool. Each package is listed sequentially in alphabetical order.
G1.1 cygnusX1 Package G1.1.1
CygnusX1.java
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
CygnusX1 API
All Classes
cygnusX1 Class CygnusX1 java.lang.Object cygnusX1.CygnusX1
public class CygnusX1 extends java.lang.Object This is the initialisation class for the CygnusX1 bridge. This creates the necessary child Jini/Twine Architecture objects in order function. An aside, HDE226868 is the location of the suspected Blackhole CygnusX-1, after which this thesis has been named. CygnusX1 class has been designed as a harness object, keeping architecture classes modularised. Version: 1.0 2003.09.02 Author: Steven R. Livingstone, Bsc. 33708162 See Also: cygnusX1.coms.ComOps, JiniArch, TwineArch
Constructor Summary CygnusX1(java.net.InetAddress cygnusIP, int httpdPort, int twinePort, boolean useGui)
Constructs a new CygnusX1 object, which initialises the two child architecture objects along with a communications satellite for network traffic handling.
Method Summary
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 240 of 309
void advertiseTwine(java.lang.String jiniNS)
Called when the connected Jini object is a service performing an advertisment. static void main(java.lang.String[] args)
Main method. void newJiniConnection(java.net.Socket jiniServSocket) Passes the Socket connection of the new Jini service/client
to the Jini
architecture object. void removeTwine(java.lang.String jiniNS)
Called when the connected Jini object is a service which has recently closed the Socket connection. java.lang.String[] searchTwine(java.lang.String searchNS)
Called when the connected Jini object is a client performing a service search.
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail CygnusX1 public CygnusX1(java.net.InetAddress cygnusIP, int httpdPort, int twinePort, boolean useGui)
Constructs a new CygnusX1 object, which initialises the two child architecture objects along with a communications satellite for network traffic handling. Parameters: httpdPort - Listens locally for Jini client/service twinePort - Connects to INR on this remote port useGui - Whether to output to a GUI
Method Detail newJiniConnection public void newJiniConnection(java.net.Socket jiniServSocket) Passes the Socket connection of the new Jini service/client to the Jini
architecture object. This method does not need to be synchronized, as the calling method ComsSatellite.jiniAdvertise is synchronized. Parameters: jiniServSocket - Socket the new Jini service is connected on
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 241 of 309
advertiseTwine public void advertiseTwine(java.lang.String jiniNS)
Called when the connected Jini object is a service performing an advertisment. This method is called by Jini Architecture child object (which in turn called from JiniEmulator object). This method then calls on its child object TwineArch to announce the NameSpecifier representation of Jini service into the Twine network. Parameters: jiniNS - Stringified NameSpecfier representation Jini ServiceItem
removeTwine public void removeTwine(java.lang.String jiniNS)
Called when the connected Jini object is a service which has recently closed the Socket connection. This method is called by Jini Architecture child object (which in turn called from JiniEmulator object). This method then calls on its child object TwineArch to stop announcing the NameSpecifier representation of the Jini service to the Twine network. Parameters: jiniNS - Stringified NameSpecfier representation Jini ServiceItem
searchTwine public java.lang.String[] searchTwine(java.lang.String searchNS)
Called when the connected Jini object is a client performing a service search. This method is called by Jini Architecture child object (which in turn called from JiniEmulator object). This method then calls on its child object TwineSearcher to search for the NameSpecifier in the Twine network which matches the representation the specified Jini service.
main public static void main(java.lang.String[] args)
Main method. Constructs a new CyngusX1 object, passing in the statically assigned Jini/Twine ports. Parameters: args - The command line strings
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
All Classes
CygnusX1 API
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 242 of 309
G1.2 cygnusX1.apps Package G1.2.1
JiniWrapper.java
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
CygnusX1 API
All Classes
cygnusX1.apps Class JiniWrapper java.lang.Object cygnusX1.apps.JiniWrapper
Direct Known Subclasses: JiniClientWrapper, JiniServiceWrapper public abstract class JiniWrapper extends java.lang.Object Implements an abstract class from which Jini clients and services extend. This package is meant to be standalone, requiring as little modification to existing Jini clients/services as possible. Version: 1.0 2003.09.02 Author: Steven R. Livingstone, Bsc. 33708162 See Also: cygnusX1.coms.ComOps, SemanticConvertor, ErrorOps, EmptyServiceException
Field Summary protected protected
java.net.InetAddress cygnusIP
protected protected protected protected
boolean classSearch
java.net.Socket cygnusSocket
java.io.InputStreamReader inStream ins.namespace.NameSpecifier jiniNameSpec java.io.OutputStreamWriter outStream
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003. protected protected
Page 243 of 309
SemanticConvertor theConvertor
net.jini.core.lookup.ServiceTemplate wrapperedClient
protected
net.jini.core.lookup.ServiceItem wrapperedService
Constructor Summary JiniWrapper(java.net.InetAddress cygnusIP, net.jini.core.lookup.ServiceItem serviceWrap, boolean templateSearch)
Initialises the SemanticConvertor and converts the ServiceItem parameter to its NameSpecifier representation. JiniWrapper(java.net.InetAddress cygnusIP, net.jini.core.lookup.ServiceTemplate clientWrap)
Initialises the SemanticConvertor and converts the ServiceTemplate parameter to its NameSpecifier representation.
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail wrapperedService protected net.jini.core.lookup.ServiceItem wrapperedService
wrapperedClient protected net.jini.core.lookup.ServiceTemplate wrapperedClient
jiniNameSpec protected ins.namespace.NameSpecifier jiniNameSpec
theConvertor protected SemanticConvertor theConvertor
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 244 of 309
cygnusSocket protected java.net.Socket cygnusSocket
cygnusIP protected java.net.InetAddress cygnusIP
outStream protected java.io.OutputStreamWriter outStream
inStream protected java.io.InputStreamReader inStream
classSearch protected boolean classSearch
Constructor Detail JiniWrapper public JiniWrapper(java.net.InetAddress cygnusIP, net.jini.core.lookup.ServiceItem serviceWrap, boolean templateSearch)
Initialises the SemanticConvertor and converts the ServiceItem parameter to its NameSpecifier representation. Note the Jini Service writer is prevented from saying yes to template search, yet passing in null. Parameters: cygnusIP - The IP address to connect to CygnusX1 on. serviceWrap - The service item to be advertised in the Twine network
JiniWrapper public JiniWrapper(java.net.InetAddress cygnusIP, net.jini.core.lookup.ServiceTemplate clientWrap)
Initialises the SemanticConvertor and converts the ServiceTemplate parameter to its NameSpecifier representation. We do not pass in whether we are searching on .Class as this is determined by the contents of clientWrap. Parameters: cygnusIP - The IP address to connect to CygnusX1 on. clientWrap - The service template to search for in the Twine network
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
G1.2.2
NO FRAMES
Page 245 of 309
CygnusX1 API
All Classes
JiniClientWrapper.java
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
CygnusX1 API
All Classes
cygnusX1.apps Class JiniClientWrapper java.lang.Object cygnusX1.apps.JiniWrapper cygnusX1.apps.JiniClientWrapper
public class JiniClientWrapper extends JiniWrapper This is the sibling class of JiniServiceWrapper. It is a work around to allow a Jini client to search the Twine network for services. Version 1.0 only allows for the searching Twine services. This class differs only slightly from JiniServiceWrapper, in that this is a non-threaded class, due to the mechanics of the current Jini Helloworld Client. Version: 1.0 2003.09.02 Author: Steven R. Livingstone, Bsc. 33708162 See Also: cygnusX1.coms.ComOps, ErrorOps, SemanticConvertor
Field Summary
Fields inherited from class cygnusX1.apps.JiniWrapper classSearch, cygnusIP, cygnusSocket, inStream, jiniNameSpec, outStream, theConvertor, wrapperedClient, wrapperedService
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 246 of 309
Constructor Summary JiniClientWrapper(java.net.InetAddress cygnusIP, net.jini.core.lookup.ServiceTemplate clientWrap)
Initialises the SemanticConvertor and converts the ServiceTemplate parameter to its NameSpecifier representation.
Method Summary void printServiceDetails(net.jini.core.lookup.ServiceMatches printService)
Prints out the complete set of details for the set of ServiceItem's net.jini.core.lookup.Service searchTwine() Matches Connects to
CygnusX1 and requests a service search of the Twine network be performed.
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail JiniClientWrapper public JiniClientWrapper(java.net.InetAddress cygnusIP, net.jini.core.lookup.ServiceTemplate clientWrap)
Initialises the SemanticConvertor and converts the ServiceTemplate parameter to its NameSpecifier representation. We do not pass in whether we are searching on .Class as this is determined by the contents of clientWrap. Note, if a .Class search is performed, the Name of a Twine service will be lost and replaced with the Service .Class string only. Parameters: cygnusIP - The IP address to connect to CygnusX1 on. clientWrap - The service template to search for in the Twine network
Method Detail searchTwine public net.jini.core.lookup.ServiceMatches searchTwine()
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 247 of 309
Connects to CygnusX1 and requests a service search of the Twine network be performed. Analogous to JiniServiceWrapper.run() This method could be renamed to run and operate as a thread, if so desired. Returns: The set of matching ServiceItem's.
printServiceDetails public void printServiceDetails(net.jini.core.lookup.ServiceMatches printService) Prints out the complete set of details for the set of ServiceItem's
Parameters: printService
- The set of results to print details for
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
G1.2.3
NO FRAMES
CygnusX1 API
All Classes
JiniServiceWrapper.java
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
CygnusX1 API
All Classes
cygnusX1.apps Class JiniServiceWrapper java.lang.Object cygnusX1.apps.JiniWrapper cygnusX1.apps.JiniServiceWrapper
All Implemented Interfaces: java.lang.Runnable public class JiniServiceWrapper extends JiniWrapper implements java.lang.Runnable This is the sibling class of JiniClientWrapper. It is a work around to allow a Jini service to advertise its presence in the Twine network. Version 1.0 only allows for the advertising of this service, not its invokation. Version: 1.0 2003.09.02 Author:
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 248 of 309
Steven R. Livingstone, Bsc. 33708162 See Also: cygnusX1.coms.ComOps, SemanticConvertor, ErrorOps
Field Summary
Fields inherited from class cygnusX1.apps.JiniWrapper classSearch, cygnusIP, cygnusSocket, inStream, jiniNameSpec, outStream, theConvertor, wrapperedClient, wrapperedService
Constructor Summary JiniServiceWrapper(java.net.InetAddress cygnusIP, net.jini.core.lookup.ServiceItem serviceWrap, boolean classSearch)
Called by Jini Service Application desires to talk to CygnusX1.
Method Summary void run()
Main method for thread.
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail JiniServiceWrapper public JiniServiceWrapper(java.net.InetAddress cygnusIP, net.jini.core.lookup.ServiceItem serviceWrap, boolean classSearch)
Called by Jini Service Application desires to talk to CygnusX1. Passes construction request back up to JiniWrapper. Note the Jini Service writer is prevented from saying yes to template search, yet passing in null. Parameters: cygnusIP - The IP address to connect to CygnusX1 on.
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 249 of 309
serviceWrap classSearch
- The service item to be advertised in the Twine network - The application must specify whether it wants to advertise itself using its classname, as Jini ServiceItem will always contain a .Class. This is different to a client, who implicitly specifies a .Class search if a non-null parameter is specified.
Method Detail run public void run()
Main method for thread. Attempts a new Socket connection with CygnusX1. If succesful, sends the NameSpecifier representation of the ServiceItem. Specified by: run in interface java.lang.Runnable
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
All Classes
CygnusX1 API
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 250 of 309
G1.3 cygnusX1.apps.jiniApps Package
G1.3.1
ClientGui.java
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
CygnusX1 API
All Classes
cygnusX1.apps.jiniApps Class ClientGui java.lang.Object java.awt.Component java.awt.Container java.awt.Window java.awt.Frame javax.swing.JFrame cygnusX1.apps.jiniApps.ClientGui
All Implemented Interfaces: javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants public class ClientGui extends javax.swing.JFrame THIS CODE IS NOT PART OF CYGNUSX1. This is not production quality code, but a quick knock up for demonstration. Provides a graphical front-end for a Jini client. Version: 1.0 2003.09.02 Author: Steven R. Livingstone, Bsc. 33708162 See Also: Serialized Form
Nested Class Summary
Nested classes inherited from class javax.swing.JFrame javax.swing.JFrame.AccessibleJFrame
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 251 of 309
Nested classes inherited from class java.awt.Frame java.awt.Frame.AccessibleAWTFrame
Nested classes inherited from class java.awt.Window java.awt.Window.AccessibleAWTWindow
Nested classes inherited from class java.awt.Container java.awt.Container.AccessibleAWTContainer
Nested classes inherited from class java.awt.Component java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
Field Summary
Fields inherited from class javax.swing.JFrame accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
Fields inherited from class java.awt.Frame CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
Fields inherited from class java.awt.Window
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 252 of 309
Fields inherited from class java.awt.Container
Fields inherited from class java.awt.Component BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface javax.swing.WindowConstants DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
Fields inherited from interface java.awt.image.ImageObserver ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor Summary ClientGui(java.lang.String guiTitle, boolean isClient, HelloWorldClient jiniClient)
THIS CODE IS NOT PART OF CYGNUSX1. This is not production quality code, but a quick knock up for demonstration.
Method Summary void outputText(java.lang.String theText)
Called by the Frame and parent HelloWorld Objects void receiveResult(java.lang.String[][] resultSet, int numResults)
This is called on the output frame, not the search frame.
Methods inherited from class javax.swing.JFrame addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 253 of 309
Methods inherited from class java.awt.Frame addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
Methods inherited from class java.awt.Window addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront
Methods inherited from class java.awt.Container add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
Methods inherited from class java.awt.Component action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate,
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 254 of 309
inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
Methods inherited from class java.lang.Object clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.awt.MenuContainer getFont, postEvent
Constructor Detail ClientGui public ClientGui(java.lang.String guiTitle, boolean isClient, HelloWorldClient jiniClient)
THIS CODE IS NOT PART OF CYGNUSX1. This is not production quality code, but a quick knock up for demonstration. What a jini/twine client or service looks like is the developers task. Parameters: guiTitle - The name to be displayed at the window top isClient - Whether it is a search or result frame jiniClient - The parent constructing object
Method Detail outputText public void outputText(java.lang.String theText)
Called by the Frame and parent HelloWorld Objects Parameters:
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003. theText
Page 255 of 309
- The string to be displayed
receiveResult public void receiveResult(java.lang.String[][] resultSet, int numResults)
This is called on the output frame, not the search frame. Parameters: resultSet - The 2d array of strings to be displayed. Contains a z*9 set of strings where z is the number of returned entries. numResults - The number of search results returned. This is required as a set of empty strings is returned in the case of zero results.
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
G1.3.2
NO FRAMES
CygnusX1 API
All Classes
HelloWorldClient.java
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
CygnusX1 API
All Classes
cygnusX1.apps.jiniApps Class HelloWorldClient java.lang.Object cygnusX1.apps.jiniApps.HelloWorldClient
All Implemented Interfaces: java.lang.Runnable public class HelloWorldClient extends java.lang.Object implements java.lang.Runnable THIS CODE IS NOT PART OF CYGNUSX1. This is class was taken from Core Jini, W. K. Edwards, Prentice Hall, 1999. Chapter 5, HelloWorldClient. This class has been extended for use to demonstrate the functionality of CygnusX1. All javadoc comments added by Steven R. Livingstone Version: 1.0 2003.09.02 Author:
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 256 of 309
W. K. Edwards, Steven R. Livingstone, Bsc. 33708162
Nested Class Summary (package HelloWorldClient.Listener private) class An inner class to implement
DiscoveryListener.
Field Summary protected protected
java.net.InetAddress cygnusIP
net.jini.discovery.LookupDiscovery disco protected
boolean discoveredLookup
protected
boolean endClient
protected protected
JiniClientWrapper myWrapper
net.jini.core.lookup.ServiceTemplate template
Constructor Summary HelloWorldClient(java.net.InetAddress cygnusIP)
Generates a new HelloWorldClient object, which sets the security manager and adds appropriate discovery listener.
Method Summary java.lang.String getCygnusIP()
Returns the IP addres of CygnusX1 protected
java.lang.Obje lookForService(net.jini.core.lookup.ServiceRegistrar lusvc) ct Once we've found a new lookup service, search for proxies that
implement HelloWorldServiceInterface static void main(java.lang.String[] args)
Create a HelloWorldClient and start its thread java.lang.String[][] prepareResult(net.jini.core.lookup.ServiceMatches printServi ce)
Returns an array of strings for the gui.
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 257 of 309
void run()
Run method as implemented by Core Jini. void searchTwine(java.lang.String[] searchSet, boolean classSearch)
This method has been added to accomadate the Client GUI. boolean wasClassSearch()
Helper method for GUI as can only return one object
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail template protected net.jini.core.lookup.ServiceTemplate template
disco protected net.jini.discovery.LookupDiscovery disco
myWrapper protected JiniClientWrapper myWrapper
discoveredLookup protected boolean discoveredLookup
endClient protected boolean endClient
cygnusIP protected java.net.InetAddress cygnusIP
Constructor Detail
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 258 of 309
HelloWorldClient public HelloWorldClient(java.net.InetAddress cygnusIP) throws java.io.IOException
Generates a new HelloWorldClient object, which sets the security manager and adds appropriate discovery listener. Parameters: cygnusIP - The IP address to connect to CygnusX1 on.
Method Detail lookForService protected java.lang.Object lookForService(net.jini.core.lookup.ServiceRegistrar lusvc)
Once we've found a new lookup service, search for proxies that implement HelloWorldServiceInterface Parameters: lusvc - The object which is used to talk to the LookupServer Returns: The ServiceMatches Objects returned from searching Twine/Jini
searchTwine public void searchTwine(java.lang.String[] searchSet, boolean classSearch)
This method has been added to accomadate the Client GUI. This is not production quality code, this is a quick job for the innovation expo only. Parameters: searchSet - The set of strings representing the service, for which the Twine network will be searched for classSearch - Whether to perform a search based on this class's type
run public void run()
Run method as implemented by Core Jini. The comment about being left to sleep so jvm doesn't exit is false. This has been left to keep the code as unmodified as possible. Specified by: run in interface java.lang.Runnable
main public static void main(java.lang.String[] args)
Create a HelloWorldClient and start its thread Parameters: args - The set of command line arguments, should contain CygnusX1 IP address.
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 259 of 309
wasClassSearch public boolean wasClassSearch()
Helper method for GUI as can only return one object Returns: Whether the search was a class search or not
getCygnusIP public java.lang.String getCygnusIP()
Returns the IP addres of CygnusX1 Returns: Stringified representation of CygnusX1's IP address
prepareResult public java.lang.String[][] prepareResult(net.jini.core.lookup.ServiceMatches printService)
Returns an array of strings for the gui. This method has been added for the GUI. Parameters: printService - Prepares a 2d array of Strings representing the set of returned Service Items. Returns: The newly created 2d array for Strings which represents the set of returned Service Items
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
G1.3.3
NO FRAMES
CygnusX1 API
All Classes
HelloWorldService.java
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
cygnusX1.apps.jiniApps Class HelloWorldService java.lang.Object cygnusX1.apps.jiniApps.HelloWorldService
All Implemented Interfaces: java.lang.Runnable
NO FRAMES
All Classes
CygnusX1 API
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 260 of 309
public class HelloWorldService extends java.lang.Object implements java.lang.Runnable THIS CODE IS NOT PART OF CYGNUSX1. This is class was taken from W. K. Edwards, Core Jini, Prentice Hall, 1999. Chapter 5, HelloWorldService. This class has been extended for use to demonstrate the functionality of CygnusX1. All javadoc comments added by Steven R. Livingstone. HelloWorldService is the "wrapper" class that handles publishing the service item. This Service object advertises itself using Entry [] description Version: 1.0 2003.09.02 Author: W. K. Edwards, Steven R. Livingstone, Bsc. 33708162
Nested Class Summary (package HelloWorldService.Listener private) class THIS CODE IS NOT PART
OF CYGNUSX1. This is class was taken from W.
Field Summary protected protected
java.net.InetAddress cygnusIP
net.jini.discovery.LookupDiscovery disco protected
protected
boolean discoveredLookup
net.jini.core.lookup.ServiceItem item protected protected protected
int LEASE_TIME
JiniServiceWrapper myWrapper java.util.Hashtable registrations
Constructor Summary HelloWorldService(java.net.InetAddress cygnusIP)
Generates a new HelloWorldClient object, which sets the security manager and adds appropriate discovery listener.
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 261 of 309
Method Summary protected
HelloWorldServiceIn createProxy() terface Creates a HelloWorldServiceInterface object
and returns it
static void main(java.lang.String[] args)
Create a new HelloWorldService and start its thread. protected
void registerWithLookup(net.jini.core.lookup.ServiceRegistra r registrar)
This work involves remote calls, and may take a while to complete. void run()
This thread does nothing but sleep, but it makes sure the VM doesn't exit.
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail LEASE_TIME protected final int LEASE_TIME
See Also: Constant Field Values
registrations protected java.util.Hashtable registrations
item protected net.jini.core.lookup.ServiceItem item
disco protected net.jini.discovery.LookupDiscovery disco
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 262 of 309
myWrapper protected JiniServiceWrapper myWrapper
discoveredLookup protected boolean discoveredLookup
cygnusIP protected java.net.InetAddress cygnusIP
Constructor Detail HelloWorldService public HelloWorldService(java.net.InetAddress cygnusIP) throws java.io.IOException
Generates a new HelloWorldClient object, which sets the security manager and adds appropriate discovery listener. Parameters: cygnusIP - The IP address to connect to CygnusX1 on.
Method Detail createProxy protected HelloWorldServiceInterface createProxy()
Creates a HelloWorldServiceInterface object and returns it Returns: The newly created HelloWorldServiceInterface object
registerWithLookup protected void registerWithLookup(net.jini.core.lookup.ServiceRegistrar registrar)
This work involves remote calls, and may take a while to complete. Thus, since it's called from discovered(), it will prevent us from responding in a timely fashion to new discovery events. An improvement would be to spin off a separate short- lived thread to do the work. Parameters: registrar - The Lookup Server to register this service with
run public void run()
This thread does nothing but sleep, but it makes sure the VM doesn't exit. Specified by: run in interface java.lang.Runnable
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 263 of 309
main public static void main(java.lang.String[] args)
Create a new HelloWorldService and start its thread. Parameters: args - The set of command line arguments, should contain CygnusX1 IP address.
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
All Classes
CygnusX1 API
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 264 of 309
G1.4 cygnusX1.arch Package
G1.4.1
JiniArch.java
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
CygnusX1 API
All Classes
cygnusX1.arch Class JiniArch java.lang.Object cygnusX1.arch.JiniArch
public class JiniArch extends java.lang.Object JiniArch handles the architectural specifics of Jini services and clients. It forms the case class for service emulation, Jinvokation and advertisement. Version 1.0 only supports Jini service advertisment yet provides the neccessary classing to allow for service invokation/emulation extensions. Version: 1.0 2003.09.02 Author: Steven R. Livingstone, Bsc. 33708162 See Also: CygnusX1
Constructor Summary JiniArch(CygnusX1 bigBang) Initialises CygnusX1 object
and Map of Jini Client/Service Sockets.
Method Summary void advertiseTwine(java.lang.String jiniNS)
Called by child object JiniEmulator, as it has received the NameSpecifier of the new Jini service. void newJiniConnection(java.net.Socket jServSocket)
Call originated from ComsSatellite (which received a new socket thus connected to a new Jini Service.
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 265 of 309
void removeTwine(java.lang.String jiniNS)
Called by child object JiniEmulator, as it has detected the close of the socket with the Jini service. java.lang.String[] searchTwine(java.lang.String searchNS)
Called by child object JiniEmulator, as it has received a Twine service search request from a Jini client.
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail JiniArch public JiniArch(CygnusX1 bigBang) Initialises CygnusX1 object and Map
of Jini Client/Service Sockets.
Parameters: bigBang
- CygnusX1 object to allow callback methods
Method Detail newJiniConnection public void newJiniConnection(java.net.Socket jServSocket)
Call originated from ComsSatellite (which received a new socket thus connected to a new Jini Service. Child Emulator object then handles processing of connection (threaded). Parameters: jServSocket - The new Socket connection between the Jini Client/ service and CygnusX1.
advertiseTwine public void advertiseTwine(java.lang.String jiniNS)
Called by child object JiniEmulator, as it has received the NameSpecifier of the new Jini service. This will call on CynusX1 to pass the call to be handled by the Twine. Parameters: jiniNS - Stringified NameSpecifier representation of the Jini service to be advertised in the Twine network.
removeTwine public void removeTwine(java.lang.String jiniNS)
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 266 of 309
Called by child object JiniEmulator, as it has detected the close of the socket with the Jini service. This will call on CygnusX1 to remove the Twine service. Parameters: jiniNS - Stringified NameSpecifier representation of the Jini ServiceItem to stop announcement of in the Twine network.
searchTwine public java.lang.String[] searchTwine(java.lang.String searchNS)
Called by child object JiniEmulator, as it has received a Twine service search request from a Jini client. Parameters: searchNS - Stringified NameSpecifier representation of the Jini ServiceTemplate to search for in the Twine network.
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
G1.4.2
NO FRAMES
CygnusX1 API
All Classes
JiniEmulator.java
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
CygnusX1 API
All Classes
cygnusX1.arch Class JiniEmulator java.lang.Object java.lang.Thread cygnusX1.arch.JiniEmulator
All Implemented Interfaces: java.lang.Runnable public class JiniEmulator extends java.lang.Thread Emulates a Jini service. Has all the communications functionality required, the Jini service/client Socket in order to carry out communications. Version 1.0 of CygnusX1 only implements service searching/ advertising. This class is threaded to allow extension for service invokation. Version:
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 267 of 309
1.0 2003.09.02 Author: Steven R. Livingstone, Bsc. 33708162 See Also: cygnusX1.coms.ComOps, ErrorOps
Field Summary
Fields inherited from class java.lang.Thread MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor Summary JiniEmulator(JiniArch emulParent, java.net.Socket jSocket)
Assigns the socket object and constructs an input/output buffered stream writers.
Method Summary void run()
Main method for thread.
Methods inherited from class java.lang.Thread activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Constructor Detail
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 268 of 309
JiniEmulator public JiniEmulator(JiniArch emulParent, java.net.Socket jSocket)
Assigns the socket object and constructs an input/output buffered stream writers. Parameters: emulParent - Parent constructing object to pass back calls which need to be handled by the Twine Architecture jSocket - The Socket the Jini service/client is connected on.
Method Detail run public void run()
Main method for thread. Listens on Socket for character stream. The received char[] will be a Stringified NameSpecifier. The intial char passed in will determine if the remote Jini object is a client or service.
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
G1.4.3
NO FRAMES
CygnusX1 API
All Classes
TwineArch.java
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
CygnusX1 API
All Classes
cygnusX1.arch Class TwineArch java.lang.Object cygnusX1.arch.TwineArch
public class TwineArch extends java.lang.Object Twine arch acts as a Twine application. It connects to a single INR and begins announcing new NameSpecifier entries as they are passed to it. In version 1.0, Twine arch only handles NameSpecifier announcement, it does not handle service invokation (far more advanced). TwineArch exists for future extensibility.
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 269 of 309
Version: 1.0 2003.09.02 Author: Steven R. Livingstone, Bsc. 33708162 See Also: ErrorOps
Constructor Summary TwineArch(java.net.InetAddress cygnusIP, int twinePort, boolean useGui)
Initialises the CygnusX1 IP and Twine INR remote port.
Method Summary void advertiseTwine(java.lang.String jiniNS)
Called by CygnusX1 to advertise into the Twine network a new Jini service. void removeTwine(java.lang.String jiniNS)
Called by CygnusX1 to remove a Jini service advertisment from the currently 'announced' maintained by the TwineAnnouncer. java.lang.String[] searchTwine(java.lang.String searchNS)
Called by CygnusX1 to perform a service search of services in the Twine network.
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail TwineArch public TwineArch(java.net.InetAddress cygnusIP, int twinePort, boolean useGui)
Initialises the CygnusX1 IP and Twine INR remote port. Parameters: cygnusIP - The IP of this announcer/CygnusX1 twinePort - The remote port to connect to INR on
Method Detail
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 270 of 309
advertiseTwine public void advertiseTwine(java.lang.String jiniNS)
Called by CygnusX1 to advertise into the Twine network a new Jini service. This is handled by the TwineAnnouncer child. Cleanest to synchronize here as ins.api.Application is not thread safe. Parameters: jiniNS - The initial Jini Service NameSpecifier to advertise
removeTwine public void removeTwine(java.lang.String jiniNS)
Called by CygnusX1 to remove a Jini service advertisment from the currently 'announced' maintained by the TwineAnnouncer. Parameters: jiniNS - The initial Jini Service NameSpecifier to remove
searchTwine public java.lang.String[] searchTwine(java.lang.String searchNS)
Called by CygnusX1 to perform a service search of services in the Twine network. This is handled by the TwineSearcher. The method is not synchronized to enable multi-threaded searching. A new TwineSearcher must be created each time as ins.api.Application is not thread safe. This slows down the search process, but is much faster than synchronizing on the discovery process as here we are synchronizing only on the construction of an object (uses Datagram Sockets thus no connection setup overhead), not a search of the network. Parameters: searchNS - The Stringified NameSpecifier to search for Returns: The set of NameSpecifier's that match the initial parameter
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
All Classes
CygnusX1 API
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
G.1.4.4
Page 271 of 309
TwineCygnusApp.java
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
All Classes
cygnusX1.arch Class TwineCygnusApp java.lang.Object ins.api.Application ins.api.TwineApp cygnusX1.arch.TwineCygnusApp
Direct Known Subclasses: TwineAnnouncer, TwineSearcher public abstract class TwineCygnusApp extends ins.api.TwineApp Provides the basic outline of Twine applications for CygnusX1. Extensions to this will be for advertising/invokation and searching. Version: 1.0 2003.09.02 Author: Steven R. Livingstone, Bsc. 33708162 See Also: ins.api, ins.namespace, ins.inr
Field Summary protected
boolean discoverFull
protected static boolean DISPLAY_OUT protected
ins.inr.TwineLogger log protected
long myAppuid
protected ns static ins.namespace.NameSpecifier
Fields inherited from class ins.api.Application
CygnusX1 API
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 272 of 309
dpack, DSRSearchString, hostNS, inrmanager, localhost, name_announcer, port, rm, sendLock, sequenceNo, sequenceNoLock, socket, time_out
Constructor Summary TwineCygnusApp(java.net.InetAddress cygnusIP, int twinePort, java.lang.String jiniNS)
Passes initial construction up to inheritance tree for construction.
Method Summary void receivePacket(ins.inr.Packet p)
Method called when a packet is received.
Methods inherited from class ins.api.TwineApp addVSpace
Methods inherited from class ins.api.Application addAnnouncement, addTCPEarlyBinding, changeAppMetric, changeAppMetric, changeAppMetrics, cleanUp, contactDSR, disableSinglePeering, discoverNames, discoverNames, enableSinglePeering, enableSinglePeering, findDSR, getDefaultVspace, getHostByiName, getLocation, getLocationNameSpecifier, getNextSequenceNo, initApplication, pingINR, printStatus, removeAnnouncement, requestVspace, resumeAnnouncer, sendDatagramPacket, sendExpiringAnnouncement, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, setAnnouncementPeriod, setHostNS, setPreNameAnnouncer, startAnnouncer, startAnnouncer, startAnnouncer, startAnnouncer, startReceiveManager, suspendAnnouncer
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail discoverFull protected boolean discoverFull
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 273 of 309
myAppuid protected long myAppuid
log protected ins.inr.TwineLogger log
DISPLAY_OUT protected static boolean DISPLAY_OUT
ns protected static ins.namespace.NameSpecifier ns
Constructor Detail TwineCygnusApp public TwineCygnusApp(java.net.InetAddress cygnusIP, int twinePort, java.lang.String jiniNS) throws java.lang.Exception
Passes initial construction up to inheritance tree for construction. Initialises the CygnusX1 IP, Twine INR remote port and initial NameSpecifier. Parameters: cygnusIP - The IP of this announcer/CygnusX1 twinePort - The remote port to connect to INR on jiniNS - Initial NameSpecifier of the creating application
Method Detail receivePacket public void receivePacket(ins.inr.Packet p)
Method called when a packet is received. The entry is displayed and logged. Parameters: p - The Packet that is received
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
All Classes
CygnusX1 API
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
G1.4.5
Page 274 of 309
TwineArch.java
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
CygnusX1 API
All Classes
cygnusX1.arch Class TwineArch java.lang.Object cygnusX1.arch.TwineArch
public class TwineArch extends java.lang.Object Twine arch acts as a Twine application. It connects to a single INR and begins announcing new NameSpecifier entries as they are passed to it. In version 1.0, Twine arch only handles NameSpecifier announcement, it does not handle service invokation (far more advanced). TwineArch exists for future extensibility. Version: 1.0 2003.09.02 Author: Steven R. Livingstone, Bsc. 33708162 See Also: ErrorOps
Constructor Summary TwineArch(java.net.InetAddress cygnusIP, int twinePort, boolean useGui)
Initialises the CygnusX1 IP and Twine INR remote port.
Method Summary void advertiseTwine(java.lang.String jiniNS)
Called by CygnusX1 to advertise into the Twine network a new Jini service. void removeTwine(java.lang.String jiniNS)
Called by CygnusX1 to remove a Jini service advertisment from the currently 'announced' maintained by the TwineAnnouncer. java.lang.String[] searchTwine(java.lang.String searchNS)
Called by CygnusX1 to perform a service search of services in the Twine network.
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 275 of 309
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail TwineArch public TwineArch(java.net.InetAddress cygnusIP, int twinePort, boolean useGui)
Initialises the CygnusX1 IP and Twine INR remote port. Parameters: cygnusIP - The IP of this announcer/CygnusX1 twinePort - The remote port to connect to INR on
Method Detail advertiseTwine public void advertiseTwine(java.lang.String jiniNS)
Called by CygnusX1 to advertise into the Twine network a new Jini service. This is handled by the TwineAnnouncer child. Cleanest to synchronize here as ins.api.Application is not thread safe. Parameters: jiniNS - The initial Jini Service NameSpecifier to advertise
removeTwine public void removeTwine(java.lang.String jiniNS)
Called by CygnusX1 to remove a Jini service advertisment from the currently 'announced' maintained by the TwineAnnouncer. Parameters: jiniNS - The initial Jini Service NameSpecifier to remove
searchTwine public java.lang.String[] searchTwine(java.lang.String searchNS)
Called by CygnusX1 to perform a service search of services in the Twine network. This is handled by the TwineSearcher. The method is not synchronized to enable multi-threaded searching. A new TwineSearcher must be created each time as ins.api.Application is not thread safe. This slows down the search process, but is much faster than synchronizing on the discovery process as here we are synchronizing only on the construction of an object (uses Datagram Sockets thus no connection setup overhead), not a search of the network. Parameters: searchNS - The Stringified NameSpecifier to search for
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 276 of 309
Returns: The set of NameSpecifier's that match the initial parameter
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
G1.4.6
NO FRAMES
CygnusX1 API
All Classes
TwineAnnouncer.java
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
CygnusX1 API
All Classes
cygnusX1.arch Class TwineAnnouncer java.lang.Object ins.api.Application ins.api.TwineApp cygnusX1.arch.TwineCygnusApp cygnusX1.arch.TwineAnnouncer
public class TwineAnnouncer extends TwineCygnusApp This class handles the announcement of new Jini services to the Twine network. This class is not threaded, as it possible to have a single application announcing multiple NameSpecifiers. This class is taken heavily from ins.apps.tests.TwineTester Version: 1.0 2003.09.02 Author: Steven R. Livingstone, Bsc. 33708162 See Also: ins.namespace, ins.apps.tests.TwineTester
Field Summary
Fields inherited from class cygnusX1.arch.TwineCygnusApp
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 277 of 309
discoverFull, DISPLAY_OUT, log, myAppuid, ns
Fields inherited from class ins.api.Application dpack, DSRSearchString, hostNS, inrmanager, localhost, name_announcer, port, rm, sendLock, sequenceNo, sequenceNoLock, socket, time_out
Constructor Summary TwineAnnouncer(java.net.InetAddress cygnusIP, int twinePort, java.lang.String jiniNS)
Passes construction back up to TwineCygnusApp constructor.
Method Summary void advertiseJini(java.lang.String jiniNS)
Advertises the specified NameSpecifier to the Twine network. void removeTwine(java.lang.String jiniNS)
Removes the specified NameSpecifier from the Twine network.
Methods inherited from class cygnusX1.arch.TwineCygnusApp receivePacket
Methods inherited from class ins.api.TwineApp addVSpace
Methods inherited from class ins.api.Application addAnnouncement, addTCPEarlyBinding, changeAppMetric, changeAppMetric, changeAppMetrics, cleanUp, contactDSR, disableSinglePeering, discoverNames, discoverNames, enableSinglePeering, enableSinglePeering, findDSR, getDefaultVspace, getHostByiName, getLocation, getLocationNameSpecifier, getNextSequenceNo, initApplication, pingINR, printStatus, removeAnnouncement, requestVspace, resumeAnnouncer, sendDatagramPacket, sendExpiringAnnouncement, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, setAnnouncementPeriod, setHostNS, setPreNameAnnouncer, startAnnouncer, startAnnouncer, startAnnouncer, startAnnouncer, startReceiveManager, suspendAnnouncer
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 278 of 309
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail TwineAnnouncer public TwineAnnouncer(java.net.InetAddress cygnusIP, int twinePort, java.lang.String jiniNS) throws java.lang.Exception
Passes construction back up to TwineCygnusApp constructor. Announcer then performs startAnnouncer, announcing the initial NameSpecfier in the Twine network. Parameters: cygnusIP - The IP of this announcer/CygnusX1 twinePort - The remote port to connect to INR on jiniNS - The initial JiniService NameSpecifier to advertise.
Method Detail advertiseJini public void advertiseJini(java.lang.String jiniNS)
Advertises the specified NameSpecifier to the Twine network. This does not return a result as there is no acknowledgement from the INR. Also, this method will never be called if there is no connection to the INR. Parameters: jiniNS - The next Jini service to be advertised
removeTwine public void removeTwine(java.lang.String jiniNS)
Removes the specified NameSpecifier from the Twine network. This method is called when the Jini service closes. The Socket is then closed, with the remove call being passed up the Jini architecture, down the Twine architecture to the announcer. Parameters: jiniNS - The next Jini service to be removed
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
All Classes
CygnusX1 API
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
G1.4.7
Page 279 of 309
TwineSearcher.java
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
CygnusX1 API
All Classes
cygnusX1.arch Class TwineSearcher java.lang.Object ins.api.Application ins.api.TwineApp cygnusX1.arch.TwineCygnusApp cygnusX1.arch.TwineSearcher
public class TwineSearcher extends TwineCygnusApp This class handles the searching of the Twine network for services specified by Jini clients. This class is taken heavily from ins.apps.tests.TwineTester Version: 1.0 2003.09.02 Author: Steven R. Livingstone, Bsc. 33708162 See Also: ins.namespace, ins.apps.tests.TwineTester
Field Summary
Fields inherited from class cygnusX1.arch.TwineCygnusApp discoverFull, DISPLAY_OUT, log, myAppuid, ns
Fields inherited from class ins.api.Application dpack, DSRSearchString, hostNS, inrmanager, localhost, name_announcer, port, rm, sendLock, sequenceNo, sequenceNoLock, socket, time_out
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 280 of 309
Constructor Summary TwineSearcher(java.net.InetAddress cygnusIP, int twinePort, java.lang.String searchNS)
Passes construction back up to TwineCygnusApp constructor.
Method Summary java.lang.String[] searchTwine(java.lang.String searchNS) Called by parent TwineArch to perform a
service search of services in the
Twine network.
Methods inherited from class cygnusX1.arch.TwineCygnusApp receivePacket
Methods inherited from class ins.api.TwineApp addVSpace
Methods inherited from class ins.api.Application addAnnouncement, addTCPEarlyBinding, changeAppMetric, changeAppMetric, changeAppMetrics, cleanUp, contactDSR, disableSinglePeering, discoverNames, discoverNames, enableSinglePeering, enableSinglePeering, findDSR, getDefaultVspace, getHostByiName, getLocation, getLocationNameSpecifier, getNextSequenceNo, initApplication, pingINR, printStatus, removeAnnouncement, requestVspace, resumeAnnouncer, sendDatagramPacket, sendExpiringAnnouncement, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, setAnnouncementPeriod, setHostNS, setPreNameAnnouncer, startAnnouncer, startAnnouncer, startAnnouncer, startAnnouncer, startReceiveManager, suspendAnnouncer
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 281 of 309
TwineSearcher public TwineSearcher(java.net.InetAddress cygnusIP, int twinePort, java.lang.String searchNS) throws java.lang.Exception
Passes construction back up to TwineCygnusApp constructor. Unlike its sister class, TwineAnnouncer, TwineSearcher does not peform a search in the constructor, as a return value is required; where none is required for announcement. The initial NameSpecifier is passed in as TwineTester requires an initial NameSpecifier for construction. The initial application's is used, although any NameSpecifier could be used. Parameters: cygnusIP - The IP of this announcer/CygnusX1 twinePort - The remote port to connect to INR on searchNS - The initial JiniService NameSpecifier required for program construction
Method Detail searchTwine public java.lang.String[] searchTwine(java.lang.String searchNS) Called by parent TwineArch to perform a service search of services in the Twine method converts the array of returned NameSpecifier's to an array of strings.
network. The
Parameters: searchNS - The Stringified NameSpecifier to search for Returns: The set of NameSpecifier's that match the initial parameter
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
All Classes
CygnusX1 API
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 282 of 309
G1.5 cygnusX1.coms Package
G1.5.1
ComsOps.java
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
cygnusX1.coms Class ComsOps java.lang.Object cygnusX1.coms.ComsOps
public class ComsOps extends java.lang.Object Provides basic communications related helper methods and variables. Version: 1.0 2003.09.02 Author: Steven R. Livingstone, Bsc. 33708162
Field Summary static char CLIENT_CHAR static char DELIM_CHAR static int JINI_SERVER_PORT static int MAX_BYTES static int MIN_BYTES static char NS_END_CHAR static int QUEUE_LENGTH static char SERVICE_CHAR
All Classes
CygnusX1 API
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 283 of 309
static int TWINE_INR_PORT
Constructor Summary ComsOps()
Method Summary static java.net.InetAddress getBridgeIP()
Returns the CygnusX1 IP. static void printSocketDetails(java.net.Socket childSocket) Prints the details of the Socket passed in.
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail MAX_BYTES public static final int MAX_BYTES
See Also: Constant Field Values
MIN_BYTES public static final int MIN_BYTES
See Also: Constant Field Values
QUEUE_LENGTH public static final int QUEUE_LENGTH
See Also: Constant Field Values
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
NS_END_CHAR public static final char NS_END_CHAR
See Also: Constant Field Values
CLIENT_CHAR public static final char CLIENT_CHAR
See Also: Constant Field Values
SERVICE_CHAR public static final char SERVICE_CHAR
See Also: Constant Field Values
DELIM_CHAR public static final char DELIM_CHAR
See Also: Constant Field Values
JINI_SERVER_PORT public static final int JINI_SERVER_PORT
See Also: Constant Field Values
TWINE_INR_PORT public static final int TWINE_INR_PORT
See Also: Constant Field Values
Constructor Detail ComsOps public ComsOps()
Method Detail
Page 284 of 309
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 285 of 309
getBridgeIP public static java.net.InetAddress getBridgeIP()
Returns the CygnusX1 IP. A getter method is used, as this allows for an exception to be thrown by every application. Returns: The IP of CygnusX1, which is 192.168.0.1 for now.
printSocketDetails public static void printSocketDetails(java.net.Socket childSocket) Prints the details of the Socket passed in. This includes Local IP, Remote IP,
Remote Port, LocalPort.
Parameters: childSocket
- The Socket to print the details of
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
G1.5.2
NO FRAMES
CygnusX1 API
All Classes
ComsReciever.java
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
CygnusX1 API
All Classes
cygnusX1.coms Class ComsReceiver java.lang.Object cygnusX1.coms.ComsReceiver
All Implemented Interfaces: java.lang.Runnable class ComsReceiver extends java.lang.Object implements java.lang.Runnable A Threaded Socket listener. This class is not used in version 1.0, but provides facilities for use later by Jini Emulator for service invokation. Version: 1.0 2003.09.02
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 286 of 309
Author: Steven R. Livingstone, Bsc. 33708162 See Also: ErrorOps
Constructor Summary (package ComsReceiver(java.net.DatagramSocket socket, ComsSatellite cSat) private) Assigns Socket, ComsSatellite and receive buffer size.
Method Summary void run()
Main method for Thread.
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail ComsReceiver ComsReceiver(java.net.DatagramSocket socket, ComsSatellite cSat) Assigns Socket, ComsSatellite and receive buffer
size.
Parameters: socket
- The Socket to receive on.
Method Detail run public void run()
Main method for Thread. Listens on Socket for an incoming packet. When received, passes back to parent ComsSatellite. Specified by: run in interface java.lang.Runnable
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
NO FRAMES
All Classes
CygnusX1 API
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003. SUMMARY: NESTED | FIELD | CONSTR | METHOD
G1.5.3
Page 287 of 309
DETAIL: FIELD | CONSTR | METHOD
ComsSatellite
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
CygnusX1 API
All Classes
cygnusX1.coms Class ComsSatellite java.lang.Object cygnusX1.coms.ComsSatellite
public class ComsSatellite extends java.lang.Object This class acts as a seperator between the main bridge unit CygnusX1 and the communications facilities. As of version 1.0, its only active entity is the JiniHttpd. Version: 1.0 2003.09.02 Author: Steven R. Livingstone, Bsc. 33708162 See Also: CygnusX1, ErrorOps
Constructor Summary ComsSatellite(CygnusX1 thesis, int httpdPort) Calls startHttpd to initalise the Socket server.
Method Summary void newJiniConnection(java.net.Socket jiniSocket) Called by JiniHttpd when a new Socket connection
has been established.
void receivedPacket(java.net.DatagramPacket recPacket) Called by ComsReceiver when a packet is received.
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 288 of 309
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail ComsSatellite public ComsSatellite(CygnusX1 thesis, int httpdPort) Calls startHttpd to initalise the Socket
server.
Parameters: thesis - Parent object to pass new Sockets to httpdPort - Port to listen on for new connections
Method Detail receivedPacket public void receivedPacket(java.net.DatagramPacket recPacket) Called by ComsReceiver when a packet is received.
Parameters: recPacket - The packet recieved
newJiniConnection public void newJiniConnection(java.net.Socket jiniSocket) Called by JiniHttpd when a new Socket connection has been established.
Parameters: jiniSocket - The new Socket between a Jini service/client and CygnusX1.
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
All Classes
CygnusX1 API
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
G1.5.4
Page 289 of 309
JiniHttpd.java
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
CygnusX1 API
All Classes
cygnusX1.coms Class JiniHttpd java.lang.Object java.lang.Thread cygnusX1.coms.JiniHttpd
All Implemented Interfaces: java.lang.Runnable public class JiniHttpd extends java.lang.Thread This class acts as a seperator between the main bridge unit CygnusX1 and the communications facilities. As of version 1.0, its only active entity is the JiniHttpd. Note the name is not entirely accurate, as we are not using HTTP sockets. Version: 1.0 2003.09.02 Author: Steven R. Livingstone, Bsc. 33708162 See Also: ErrorOps
Field Summary
Fields inherited from class java.lang.Thread MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor Summary JiniHttpd(int listenPort, ComsSatellite comsSat)
Creates a server to listen to incoming Jini client/service connection requests.
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 290 of 309
Method Summary void run()
Thread main method.
Methods inherited from class java.lang.Thread activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Constructor Detail JiniHttpd public JiniHttpd(int listenPort, ComsSatellite comsSat)
Creates a server to listen to incoming Jini client/service connection requests. Parameters: listenPort - The port to listen to incoming connections on comsSat - The parent to pass new Sockets to
Method Detail run public void run()
Thread main method. Constructs a new ServerSocket and awaits for incoming connection requests. Once a request is received, the new Socket is passed back to the parent ComsSatellite.
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
All Classes
CygnusX1 API
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 291 of 309
G1.6 cygnusX1.convertor Package
G1.6.1
SemanticConvertor.java
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
CygnusX1 API
All Classes
cygnusX1.convertor Class SemanticConvertor java.lang.Object cygnusX1.convertor.SemanticConvertor
public class SemanticConvertor extends java.lang.Object This class performs the heart of CygnusX1 operations, conversion between Jini semantics and Twine semantics. Conversion methods are supplied in a method-overloaded fashion so as to minimise the number of different for method similar actions. Below is a summary of the conversion rules used in this class. Indentation indicates a child node of the previous AVelement. The rules stated below are reciprocal for Jini to Twine. Note that only the Jini Entry items that can be set by the user are: Address, Comment, Location and Name. NameSpecifier -> Jini Rules
Service -> java.lang.class service OR Entry.Name (app dependant) Name -> Entry.Name if java.lang.class used in service else lost Entity -> Comment Country -> Entry.Adress.Country State -> Entry.Adress.stateOrProvince City -> Entry.Adress.locality Location -> Entry.Address.organization Building -> Entry.Location.Building Floor -> Entry.Location.floor Room -> Entry.Location.room Node -> None (not required) Port -> None (not required)
Version: 1.0 2003.09.02 Author: Steven R. Livingstone, Bsc. 33708162 See Also: cygnusX1.error
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 292 of 309
Constructor Summary SemanticConvertor()
Main constructor.
Method Summary ins.namespace.NameSpecifier jini2twine(net.jini.core.lookup.ServiceItem theST, boolean templateSearch)
Called when a Jini service advertises itself in the Twine network. ins.namespace.NameSpecifier jini2twine(net.jini.core.lookup.ServiceTemplate the ST, boolean classSearch)
Called when a Jini client searches for a service. net.jini.core.lookup.ServiceTempl twine2jini(ins.namespace.NameSpecifier theNS, ate int theAttempt)
This method converts a NameSpecifer to a Service Item. net.jini.core.lookup.ServiceItem twine2jini(ins.namespace.NameSpecifier theNS, java.lang.Object theService, int theAttempt)
This method is called when a search of Twine network has occured and returned NameSpecifiers must be converted for Jini to use.
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail SemanticConvertor public SemanticConvertor()
Main constructor. Empty.
Method Detail twine2jini public net.jini.core.lookup.ServiceItem twine2jini(ins.namespace.NameSpecifier theNS, java.lang.Object theService, int theAttempt)
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 293 of 309
This method is called when a search of Twine network has occured and returned NameSpecifiers must be converted for Jini to use. The incoming NameSpecifier is converted to a Jini ServiceTemplate so the service request can be passed to the awaiting Jini client. This method 'flattens' the hierachical NameSpecifier to a table layout. The passed in NameSpecifier contains the IP of the Twine service (required for invokation, not implemented as of version 1.0). Parameters: theNS - The NameSpecifier to convert to a Jini usable format theService - The service object, e.g. a Printer object theAttempt - Use a different form of conversion. This feature is not implemented in version 1.0 as this is can be used in service invokation. Returns: The Jini representation of initial NameSpecifier
twine2jini public net.jini.core.lookup.ServiceTemplate twine2jini(ins.namespace.NameSpecifier theNS, int theAttempt)
This method converts a NameSpecifer to a Service Item. This method is not in use in version 1.0. (Should accept an array of NS's) Parameters: theNS - The NameSpecifier to convert to a Jini usable format theAttempt - Use a different form of conversion. This feature is not implemented in version 1.0 as this is can be used in service invokation. Returns: The Jini representation of initial NameSpecifier
jini2twine public ins.namespace.NameSpecifier jini2twine(net.jini.core.lookup.ServiceTemplate theST, boolean classSearch) throws EmptyServiceException Called when a Jini client searches for a service. The incoming ServiceTemplate must be converted to a Twine NameSpecifier so the service request can be passed to the locally connected INR. A
NameSpecifier is created by first constructing the AV child elements then combining them to produce the NameSpecifier. This requires more initial variable declarations, but simplifies the code. Parameters: theST - The template to match services on classSearch - Dictates if search based on java.lang.class and Entry.Name or Entry.Name alone. Returns: The NameSpecifier of the matching service template Throws: EmptyServiceException - Thrown when a search on the Class type is specified, yet the Class object is null. Also thrown if both Class and Entry[] types in theST are null.
jini2twine
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 294 of 309
public ins.namespace.NameSpecifier jini2twine(net.jini.core.lookup.ServiceItem theST, boolean templateSearch) Called when a Jini service advertises itself in the Twine network. The incoming ServiceItem must converted to a Twine NameSpecifier so the service description can be passed to the locally
be
connected INR. A NameSpecifier is created by first constructing the AV child elements then combining them to produce the NameSpecifier. This requires more initial variable declarations, but simplifies the code. Note, a special Jini AVelement is attached to signify that this is a Jini service, and that if this service is returned by a Jini client searching the Twine network, it is discarded. This addition does not effect the results of a Twine client search. Parameters: theST - The service to advertise in the Twine network templateSearch - Dictates if advertise with java.lang.class and Entry.Name or Entry.Name alone. Returns: The NameSpecifier of the matching service template See Also: Object, Class
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
G1.6.2
NO FRAMES
CygnusX1 API
All Classes
SemOps.java
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
cygnusX1.convertor Class SemOps java.lang.Object cygnusX1.convertor.SemOps
public class SemOps extends java.lang.Object Provides basic semantic conversion related helper variables. Version: 1.0 2003.09.02 Author: Steven R. Livingstone, Bsc. 33708162 See Also:
NO FRAMES
All Classes
CygnusX1 API
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003. SemanticConvertor
Field Summary static int ADDRESS_MEM static java.lang.String ADDRESS_TYPE static int ATTEMPT_ONE static int ATTEMPT_TWO static int BUILD_MEM static java.lang.String BUILDING_TYPE static int CITY_MEM static int COMMENT_MEM static int COUNTRY_MEM static java.lang.String ENTITY_TYPE static int FLOOR_MEM static java.lang.String FLOOR_TYPE static int LOCATION_MEM static java.lang.String LOCATION_TYPE static int NAME_MEM static java.lang.String NAME_TYPE static int ORG_MEM static int ROOM_MEM static java.lang.String ROOM_TYPE static java.lang.String SERVICE_TYPE
Page 295 of 309
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 296 of 309
static int STATE_MEM
Constructor Summary SemOps()
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail ADDRESS_MEM public static final int ADDRESS_MEM
See Also: Constant Field Values
COMMENT_MEM public static final int COMMENT_MEM
See Also: Constant Field Values
LOCATION_MEM public static final int LOCATION_MEM
See Also: Constant Field Values
NAME_MEM public static final int NAME_MEM
See Also: Constant Field Values
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
SERVICE_TYPE public static final java.lang.String SERVICE_TYPE
See Also: Constant Field Values
NAME_TYPE public static final java.lang.String NAME_TYPE
See Also: Constant Field Values
ENTITY_TYPE public static final java.lang.String ENTITY_TYPE
See Also: Constant Field Values
ADDRESS_TYPE public static final java.lang.String ADDRESS_TYPE
See Also: Constant Field Values
LOCATION_TYPE public static final java.lang.String LOCATION_TYPE
See Also: Constant Field Values
BUILDING_TYPE public static final java.lang.String BUILDING_TYPE
See Also: Constant Field Values
FLOOR_TYPE public static final java.lang.String FLOOR_TYPE
See Also: Constant Field Values
ROOM_TYPE public static final java.lang.String ROOM_TYPE
Page 297 of 309
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003. See Also: Constant Field Values
ATTEMPT_ONE public static final int ATTEMPT_ONE
See Also: Constant Field Values
ATTEMPT_TWO public static final int ATTEMPT_TWO
See Also: Constant Field Values
COUNTRY_MEM public static final int COUNTRY_MEM
See Also: Constant Field Values
STATE_MEM public static final int STATE_MEM
See Also: Constant Field Values
CITY_MEM public static final int CITY_MEM
See Also: Constant Field Values
ORG_MEM public static final int ORG_MEM
See Also: Constant Field Values
BUILD_MEM public static final int BUILD_MEM
See Also: Constant Field Values
Page 298 of 309
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 299 of 309
FLOOR_MEM public static final int FLOOR_MEM
See Also: Constant Field Values
ROOM_MEM public static final int ROOM_MEM
See Also: Constant Field Values
Constructor Detail SemOps public SemOps()
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
All Classes
CygnusX1 API
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 300 of 309
G1.7 cygnusX1.error Package
G1.7.1
EmptyServiceException.java
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
CygnusX1 API
All Classes
cygnusX1.error Class EmptyServiceException java.lang.Object java.lang.Throwable java.lang.Exception cygnusX1.error.EmptyServiceException
All Implemented Interfaces: java.io.Serializable public class EmptyServiceException extends java.lang.Exception Personalised CygnusX1 exception. Version: 1.0 2003.09.02 Author: Steven R. Livingstone, Bsc. 33708162 See Also: Serialized Form
Field Summary
Fields inherited from class java.lang.Exception
Constructor Summary EmptyServiceException(java.lang.String theMsg)
Performing a search based on class/object name, but not classes have been specified to search on.
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 301 of 309
Methods inherited from class java.lang.Throwable fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Constructor Detail EmptyServiceException public EmptyServiceException(java.lang.String theMsg)
Performing a search based on class/object name, but not classes have been specified to search on. Parameters: theMsg - Message accompanying the error
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
All Classes
CygnusX1 API
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
G1.7.2
Page 302 of 309
NullValueException.java
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
CygnusX1 API
All Classes
cygnusX1.error Class NullValueException java.lang.Object java.lang.Throwable java.lang.Exception cygnusX1.error.NullValueException
All Implemented Interfaces: java.io.Serializable public class NullValueException extends java.lang.Exception Personalised CygnusX1 exception. Version: 1.0 2003.09.02 Author: Steven R. Livingstone, Bsc. 33708162 See Also: Serialized Form
Field Summary
Fields inherited from class java.lang.Exception
Constructor Summary NullValueException(java.lang.String theMsg)
Occurs when the conversion of a NameSpecifier to a Jini element, and the AVelement.Value() is null.
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 303 of 309
Methods inherited from class java.lang.Throwable fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Constructor Detail NullValueException public NullValueException(java.lang.String theMsg)
Occurs when the conversion of a NameSpecifier to a Jini element, and the AVelement.Value() is null. This is from in incorrect application creation of a NameSpecifier. Parameters: theMsg - Message accompanying the error
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
G1.7.3
NO FRAMES
CygnusX1 API
All Classes
ErrorOps.java
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
cygnusX1.error Class ErrorOps java.lang.Object cygnusX1.error.ErrorOps
public class ErrorOps extends java.lang.Object
NO FRAMES
All Classes
CygnusX1 API
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 304 of 309
Foundation class providing helper methods for java.lang.Exception and personalised CygnusX1 exceptions. Version: 1.0 2003.09.02 Author: Steven R. Livingstone, Bsc. 33708162
Constructor Summary ErrorOps()
Method Summary static void printError(java.lang.Exception eX, java.lang.String errorMsg)
Called when want exception message string printed along with a stack trace of the error. static void printError(java.lang.String errorMsg)
Called when only want exception message string printed.
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail ErrorOps public ErrorOps()
Method Detail printError public static void printError(java.lang.Exception eX, java.lang.String errorMsg)
Called when want exception message string printed along with a stack trace of the error. Parameters: eX - The exception that occurred errorMsg - The String the user wants printed for the error
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 305 of 309
printError public static void printError(java.lang.String errorMsg)
Called when only want exception message string printed. Parameters: errorMsg - The String the user wants printed for the error
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
All Classes
CygnusX1 API
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 306 of 309
G1.8 cygnusX1.tests Package
G1.8.1
SconvHarness.java
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
CygnusX1 API
All Classes
cygnusX1.tests Class SConvHarness java.lang.Object cygnusX1.tests.SConvHarness
public class SConvHarness extends java.lang.Object A test harness for Semantic Convertor. This is provided as SemanticConvertor is directly testable on in/out, secondly because it is the most important component of CynusX1. This class reads in NameSpecifier descriptions from the file semanticTests.txt and procedes to test the conversion. Version: 1.0 2003.09.02 Author: Steven R. Livingstone, Bsc. 33708162 See Also: SemanticConvertor, ErrorOps
Constructor Summary SConvHarness()
Creates a file reader and reads in the lines one at a time.
Method Summary static void main(java.lang.String[] args)
Main method.
Methods inherited from class java.lang.Object
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 307 of 309
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail SConvHarness public SConvHarness()
Creates a file reader and reads in the lines one at a time. This tester works on the logic of NS->Jini>NS and comparison of the input vs the output. This round-trip testing allows dual conversion results. Provisions have been made to test Jini.
Method Detail main public static void main(java.lang.String[] args)
Main method. Constructs a new SConvHarness. Parameters: args - The command line Strings
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS
FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
NO FRAMES
All Classes
CygnusX1 API
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
Page 308 of 309
References [1]
W. Adjie-Winoto, E. Schwartz, H. Balakrishnan, J. Lilley. The design and implementation of an Intentional Naming System. 17th ACM Symposium on Operating Systems Principles (SOSP ’99), published as Operating Systems Review, 34(5): 186–201, December 1999. Available from http://wind.lcs.mit.edu/papers/ins-sosp99.html
[2]
M. Balazinska, H. Balakrishnan, D. Karger. INS/Twine: A Scaleable Peer-to-Peer Architecture for Intentional Resource Discovery. In M. Naghshineh, editor, First International Conference, Pervasive 2000, volume 2414 of Lecture notes in computer science, pages 195-211, Springer-Verlag Berlin Heidelberg 2002, Germany.
[3]
R. Robinson, Superstring: A Scaleable Service Discovery Protocol for the Wide-Area Pervasive Environment, Internal report for The University of Queensland, March 2003.
[4]
Microsoft Corporation, Universal Plug and Play Device Architecture. Version 1.0 from http://www.upnp.org/download/UPnPDA10_20000613.htm, June 2000.
[5]
Microsoft Corporation, Understanding Universal Plug and Play. From http://www.upnp.org/download/UPNP_UnderstandingUPNP.doc, June 2000.
[6]
Y. Y. Goland, T. Cai, P. Leach, Y. Gu, Microsoft Corporation, Simple Service Discovery Protocol/1.0, Internet Draft, From http://www.upnp.org/download/draft_cai_ssdp_v1_03.txt, October 1999.
[7]
B.A. Miller and C. Bisdikian, Bluetooth Revealed. Prentice Hall, 2001.
[8]
Bluetooth Special Interest Group, Bluetooth Protocol Architecture, August 1999.
[9]
K.W Edwards, Core JINI. Prentice Hall, 1999.
[10]
Sun Microsystems, Jini Architectural Overview, January 1999.
[11]
Salutation Consortium, Salutation Architecture Specification, Part 1, Version 2. June 1999. Available from http://www.salutation.org/spec/Sa20e1a21.pdf
[12]
Palowireless, Bluetooth resource centre. Extended Service Discovery Profile for Universal Plug & Play. Available from http://www.palowireless.com/infotooth/tutorial/n6_esdp.asp
[13]
B. Miller, Bluetooth whitepaper, Mapping Salutation Architecture APIs to Bluetooth Service Discovery Layer, document number 1.C.118/1.0, version 1.0. July 1999. Available from: http://www.salutation.org/whitepaper/BtoothMapping.PDF
[14]
S. Kasper, L. Bührer, JINI Discovers Bluetooth. Semester Thesis SA-2002.30, Institut für Technische Informatik und Kommunikationsnetze. Summer 2002. Available from: http://www.tik.ee.ethz.ch/~beutel/projects/sada/2002ss_sa_vincent_bt_jini.pdf
[15]
E. Guttman, Sun Microsystems. Service Location Protocol: Automatic Discovery of IP Network Services. IEEE Internet Computing, 71-80, July-August 1999. Available from http://www.srvloc.org/slp-article.pdf
Service Discovery in Pervasive Systems Steven R. Livingstone, 2003.
[16]
Page 309 of 309
J. Allard, V. Chinta, S. Gundala, G. G. Richard III. Jini Meets UPnP: An Architecture for Jini/UPnP Interoperability, Department of Computer Science, University of New Orleans. Available from: http://www.cs.uno.edu/~golden/Stuff/37_richard_g.pdf