• Nenhum resultado encontrado

5.2 General Architecture

5.2.1 Agenda Manager

The Agenda Manager (AM) is an independent agent that serves as a gateway for other agents and web-services. That is, the AM acts as the agents’ controller since it initializes other agents, implements message context filtering, sets the receiving behaviors, and serves as system security.

Figure 40: Snippet of a data structure (JSON) with the user and agent features

This agent contains information related to the features of the remaining platform, containing data about the user and the people who interact with him/her in form of a user customization. So, all that is about people is kept in a database. That is, the system database has the description of different user’s features.

The AM also saves personal details about the user such as their name, location and contact. In addition, the AM contains information about itself, such as name and features, which will be used to register it in the network (Figure 40).

For that, the AM internally has a data structure saving all interactions with other users and agents resulting in a daily record for further analysis, if necessary.

The AM includes a message context filtering that optimizes platform performance and security. Mainly, it is achieved by implementing message filtering models that use performative, ontology and protocol.

These fields help to quickly detect the agents’ intention, by annunciating them ahead in specific fields, and leaving the details in the content field.

On their behalf, the communication protocols are managed by the FIPA-ACL standard. Its use is a requirement for all the agents with the aim of ensuring communication compatibility and uniqueness. In that way, all the agents use the same standard what means that messages will be always received by the destination agent.

Figure 41: Representation of the fields involved in the communication process

The message arrival is guaranteed by message buffer offered by the JADE platform. The reason lies in the fact that it manages the message send and receive process. This buffer, provided by the Message Transport System (MTS) agent, retains all messages that do not reach the destination agent for a specified time until the receiver agent becomes active, in which case it delivers them, or until the delivery time is exceeded, in which case it rejects the messages (Figure 41). Consequently, messages should have a time stamp or a conversation handle since they are not synchronous and could cause an erroneous conversation session.

In terms of overall performance, Figure 42 illustrates the process from the reception of a new message to its sending to the appropriate agent by means of an activity diagram. As shown, the AM agent is in charge of initializing the Conflicts Manager and Free Time Manager. In section 9.1.1 is show in greater detail the agent classes and structure.

Figure 42: AM activity diagram Services

Currently, the progress of applications and services provided by companies cannot be denied. A case in point is the products offered by Google (www.google.com). Products like Gmail and Google Calendar (GCal) are booming, as being used by 155 million people (Nielsen Wire, 2011). Thus, it can be considered a synergy between these services and the iGenda.

GCal is the product that most closely resembles the iGenda features. It may be more advantageous for this project. Hence, the connection with this product is of utmost importance. Also, the API from Google Calendar is freely available. Thanks to that, developers are able to build an application that bi-directionally communicates and can import and export the data contained in the web platform.

With that purpose, a web-service that communicated with the GCal was built. Thereby different services

addition, it can be used as an event aggregation service, having the events remotely and locally saved.

Hence, the system creates an event list always active and updated, taking the advantage of symbiotically integrating it with mobile devices working under the Android operating system (Ughetti et al., 2008; Canalys, 2010; Meier, 2009). Since Android was also chosen to implement the iGenda interface, it represents a system integrator of the various available services.

A bidirectional web-service has been implemented on the AM. It can get the events from the user’s account as well as send new events, being able to change and delete data from calendars. This data capture is triggered when an event is received such that it gathers all the information, checks its consistency and delivers it to the appropriate agents. So, once all agents notify to the AM that the calendar is consistent, two replicas are saved, one locally and other in GCal.

Figure 43: Communication relationship between the GCal and the AM

GCal provides the users with a web-based visual environment, allowing the use of interactive elements like the ability to drag an event to another day, the creation of events and its placements, and the variation of descriptions beyond the date and event title. Due to its API, GCal offers the possibility of recovering online information in a simplified way, being able to import common formats such as iCalendar (RFC 5545) and without resourcing the visual interface.

In terms of web-service communication, JSON format (RFC 4627) is used to transmit internal data fields related to an event. This means that events are not necessarily constrained by the base structure, what offers flexibility to add new fields containing residual or contextual information. JSON is a good alternative to XML (Sporny, 2010; Crockford, 2006; Nurseitov et al., 2009) because of its highly serialized format. That is, JSON has a structured system of identifiers, distinguishing between the several types and their content.

The GCal service together with the email service becomes a powerful communication system of daily management. In the context of iGenda, they mostly act as remote storage and a compatibility bridge. In terms of storage, it uses the cloud service, which has the ability to integrate simple events and save

them on the data communication load. In addition, it provides flexible data storage in terms of event fields. This is very important because iGenda needs reserved fields for extra information regarding the event. In terms of compatibility bridging, it spreads the information between all the used devices.

Storage

Regarding storage, iGenda makes local copies of data in the iCalendar format. These agendas are divided into months. The search and data delivery are performed in a simple and immediate way, being possible to view the calendar without any additional processing. The monthly schedule is used to optimize the way iGenda processes the calendars such that it does not overload the system when rescheduling. Hence, the iGenda uses load balance of resources, given that the less data is used, a shorter response of disk drive I/O is required. Moreover, the communication load is very small since data strings are simple and short in size.

This process takes into account the events that may span for more than a month or even those that may be divided into several days. Thus, iGenda detects that span and loads all the necessary calendars to change that event as only one. This is necessary because iGenda considers events as time frames, i.e., blocks that span over an amount of seconds on a seconds calendar.

No documento Ângelo Gonçalo Araújo da Silva Costa (páginas 97-101)