11.07.2015 Views

System Introspection for System Analysis on Mobile Devices

System Introspection for System Analysis on Mobile Devices

System Introspection for System Analysis on Mobile Devices

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

1 2 192.168.1.1323 52224 bir<strong>on</strong>@lucy5 hallowelt6 Listing 6.1: Example of the XMPP c<strong>on</strong>figurati<strong>on</strong> in the XML c<strong>on</strong>figurati<strong>on</strong>file <strong>on</strong> the probe - ServerIP and ServerPortdetermine the address of the communicati<strong>on</strong> server.ServerAccount and Password are used to define theaccount used <str<strong>on</strong>g>for</str<strong>on</strong>g> the probe.to other entities. A special XMPPExcepti<strong>on</strong> object is thrown whenever an erroroccurs <strong>on</strong> using XMPP functi<strong>on</strong>alities.Details <str<strong>on</strong>g>for</str<strong>on</strong>g> the communicati<strong>on</strong> with the communicati<strong>on</strong> server are defined inthe XML c<strong>on</strong>figurati<strong>on</strong> file (see Listing 6.1). A server can be addressed by aIP address and a port. For the login <strong>on</strong> the communicati<strong>on</strong> server, the methodlogin() needs the name of the account and the corresp<strong>on</strong>ding password. Ifthe given parameters match the data <strong>on</strong> the XMPP server, the c<strong>on</strong>necti<strong>on</strong> issuccessfully established. Otherwise an XMPPExcepti<strong>on</strong> will be thrown.The probe and the client are using a predefined standard c<strong>on</strong>figurati<strong>on</strong>. Thec<strong>on</strong>figurati<strong>on</strong> of the client can be changed by setting the parameters <strong>on</strong> the startview. The c<strong>on</strong>figurati<strong>on</strong> of the probe can be set directly in the c<strong>on</strong>figurati<strong>on</strong>file.The data exchanged between the probe and the client is filled into Stringpairsc<strong>on</strong>taining a key and a value. To append several pairs to a message eachpair is first added to a map. This map and the recipient are <str<strong>on</strong>g>for</str<strong>on</strong>g>warded tothe sendMessage() method. XMPP is capable of sending String-pairs byadding properties to the message stanza. When sending a new message theproperty map is parsed and all value pairs are added to the message. Thecommunicati<strong>on</strong> interface also offers the possibility to attach a body to eachmessage. This body can be used to add some additi<strong>on</strong>al textual in<str<strong>on</strong>g>for</str<strong>on</strong>g>mati<strong>on</strong>to a message (e.g. logging in<str<strong>on</strong>g>for</str<strong>on</strong>g>mati<strong>on</strong> <strong>on</strong> how the data was collected). Onceall data is appended the message gets <str<strong>on</strong>g>for</str<strong>on</strong>g>warded to the recipient.Additi<strong>on</strong>ally the implementati<strong>on</strong> of the probe can <str<strong>on</strong>g>for</str<strong>on</strong>g>ward excepti<strong>on</strong> objectscaught by the elements of the probe by using the sendError() method. Theimplementati<strong>on</strong> of the XMPPCommunicator reads the errorhandler-object andadds the stacktrace of the error handler to a new message. Error messages are<str<strong>on</strong>g>for</str<strong>on</strong>g>warded to all clients c<strong>on</strong>nected to the element catching the error.35

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!