






Registry
The registry will keep track of a device's attributes, and can read and write them in XML form. Here's what it will accept, so far:
<Device>
<Sensor>
<Attributes>Text, Video, Audio, Motion, Data</Attributes>
<Description>This describes the sensor, in English</Description>
</Sensor>
<Actuator>
<Atributes>Text, Video, Audio, Motion, Data</Attributes>
<Description>This describes the actuator, in English</Description>
</Actuator>
<Location>201 systems lab</Location>
<Class>ExampleClass</Class>
<Server>
<Name>localhost.localdomain</Name>
<Port>1234</Port>
</Server>
</Device>
The default port to connect to is port 3000.
To register a device, send the line "REGISTER", and then the XML data describing the device. When a device is successfully registered, the registry will reply with "OK", then the lease time, then the device ID. To renew a device, the mediator needs to send "RENEW" and then the device ID.
To search for sensors, the client sends the line "SEARCH", and then a block of XML data containing the parameters to search for. The registry sends back the data for the matching sensors. If no data is provided to search for, all sensors will be returned.
The main functions of both RegisterSensor and RegistrySearch give examples on how to use those classes in your programs to make using the registry easier.
Client classes:
RegisterSensor.java
RegistrySearch.java
Shared:
RegistryEntry.java
Server classes:
Registry.java
RegistryClientThread.java
Link to this Page
- Summer 2004 last edited on 21 August 2004 at 7:58 pm by r34h24.res.gatech.edu