01.09.2013 Views

Intelligent Transport Systems - Telenor

Intelligent Transport Systems - Telenor

Intelligent Transport Systems - Telenor

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Figure 13 Overview of class<br />

diagram for ITS<br />

Figure 14 Detailed view of<br />

NetworkClient<br />

Figure 15 The datatype<br />

ITSMessage<br />

64<br />

Bjørg<br />

Lyngstad<br />

Datatypes<br />

ADVANCEDSEARCH : int = 2<br />

SIMPLESEARCH : int = 1<br />

Runnable<br />

(from java.lang)<br />

NetworkClient<br />

exception<br />

NetworkClient<br />

Every interaction with the network is done<br />

through the NetworkClient. This class will be<br />

implemented using JXTA for J2ME and will<br />

then be able to interact with any device on the<br />

JXTA network. NetworkClient takes care of<br />

the basic tasks associated with peer group membership,<br />

like group- and user discovery, and the<br />

joining and creation of groups.<br />

Since the only supported protocol in MIDP for<br />

communication over the network is HTTP, the<br />

NetworkClient uses a JXTA relay. At specified<br />

intervals it asks the relay if messages have<br />

arrived for the user. NetworkClient imple-<br />

1<br />

<br />

MIDlet<br />

(from javax.microedition.midlet)<br />

ITSClient<br />

1 1<br />

<br />

1<br />

DatabaseClient<br />

Bjørg Lyngstad &<br />

Jorunn Kaasin<br />

closeNetworkConnection()<br />

joinGroup(groupName : String, groupId : String) : boolean<br />

leaveGroup() : boolean<br />

run()<br />

searchContact(contact : String) : boolean<br />

searchContacts(contactList : String[]) : boolean<br />

searchForGroup(groupName : String, searchType : int) : void<br />

sendMessage(msg : ITSMessage) : boolean<br />

setPollInterval(seconds : int)<br />

NetworkClient(client : ITSClient, relayAddress : String, relayPort : int, clientName : String)<br />

getInstance(client : ITSClient, relayAddress : String, relayPort : int, clientName : String) : NetworkClient<br />

ITSMessage<br />

CONTACTINFO : int = 2<br />

GROUPINFO : int = 1<br />

MESSAGE : int = 3<br />

ITSMessage(content : String, receiver : String, sender : String)<br />

ITSMessage(content : String, receiver : String, sender : String, type : int)<br />

getContent() : String<br />

getReceiver() : String<br />

getSender() : String<br />

getType() : int<br />

Jorunn<br />

Kaasin<br />

CommandListener<br />

(from javax.microedition.lcdui)<br />

ments java.lang.Runnable and creates a<br />

thread for the task of polling the relay. The public<br />

attributes and methods of NetworkClient<br />

are shown in Figure 14.<br />

The non-functional requirement NF-1 states that<br />

the system should be independent of the network.<br />

The realization of the NetworkClient<br />

fulfills this requirement, since it hides the interaction<br />

with the network for the user, and the<br />

exchange of data inside the system is systemspecific,<br />

not network specific. Communication<br />

and exchange of information and data is done<br />

using an ITS specific datatype called ITSMessage,<br />

included in the Datatypes packages. The<br />

class diagram for ITSMessage is shown in Figure<br />

15.<br />

The ITSClient extends the MIDlet class of<br />

J2ME, and since MIDlet is the basic unit of<br />

execution in MIDP, ITSClient is responsible<br />

for the application entry and leaving of states<br />

during the midlet’s whole life cycle. The different<br />

states are pause, active and destroyed. To<br />

react to the different command actions received<br />

from the user, ITSClient implements the<br />

CommandListener interface.<br />

Telektronikk 1.2003

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

Saved successfully!

Ooh no, something went wrong!