Qare Internals
    SQL Tables
    Schema
    Plugins
               Demo Hello World
               Change Password
               Ping
    API
 Site Map
 
Ping Plugin
 
 QareApplications
        AppDir
        ChangePassword
        Count
        CreateAccount
        Delegation
        DelegationDisplay
        DeleteRemote
        HelloWorld
        Inbox
        Login
        Logout
        Pending
        Ping
        Refresh
        Register
        RemoteAccount
        UserGroups
 

Introduction

The 'Ping' plugins is template generated server-side web application that is used to send the <ping/> message in XMLformat to the selected remote system. While the remote system is inactive, the message is held in PENDING MESSAGES on the home system. When the remote system becomes active, the remote system responds with a <pong/> reply message, which is put in the INBOX of the requesting user.

Source Code and Resource Files

The Ping compiles as part of the build process. The source files that contribute to the ping are placed together in a war file as a server application. The 'resources' and 'src' directories contain all these files.

The resources directory contains:

1. ping.txt

This text file provides the graphical user interface for Ping. It also contains the template for some fields which expand generically on-the-fly. It displays the list of systems from where a system can be selected for sending ping message. It also has the two hidden fields action and time. The action is specified as "run". And the current time is passed by the template "time". The "url" template provides the URL and changes with the action. The message is sent on the submition of form. The "msg" template displays the message after submition of form which shows that the message has been sent.
Resource File.

2. system.txt

This text file contains the template "system" with option. This template is passed in java file (PingTemplate) which is then processed.
Resource File .

3. attribute.txt

This is used for refreshing.
Resource File .

4. function.txt

This is a java script file. It gives the refresh delay on which the page is refreshed automatically.
<script language="JAVASCRIPT">

function rld()
{
	seconds=*{{refreshDelay}}*;
	x=seconds*1000;
	window.setInterval("updateTime()",x);
}
function updateTime()
{
	window.location.reload();
}
</script>

5. display.txt

It is used in displaying message.
Resource File .

6. rDate.txt

Gives the receiving date.
Resource File.

7. tDelay.txt

Gives the time delay.
Resource File .

8. display.qjml

It gives the display logic of message displaying.
Resource File.

9. process.qjml

The content of this data file is sent to the remote system in xml format.
Resource File.

10. reply.qjml

The content of this data file is sent as reply message in xml format.
Resource File.

11. data.application

This xml files describes the name of the application, its path directory and action. It also gives the link to help page. The privilege tag represents the specific permission to which the user has access. "run" and "process" privileges are presented by the privilege tag.
Resource File.

12. display.config

This xml file facilitates the processing of command line arguments. The data is held by properties in the name-value pairs. All the specified items are taken from 'displayPing.txt', 'function.txt', 'attribute.txt', 'rDate.txt' and 'tDelay.txt'. They are passed into properties. These items are evaluated in "InboxDisplay.java" by getting them from properties.
Resource File

13. web.xml

This xml file is servlet descriptor. It expresses the servlet name, servlet path and the time(millisecond) taken to load servlet when server starts to redirect to the qare login page.
Resource File

The src directory contains:

1. QServlet.java

The QServlet source file resides in the 'src' directory of the ping. It extends the QHome servlet. It also identifies the data to use by after. It gives the the war file name "Ping3_0_0" to get data of the specific application while parsing data and the parsed data is held in object that sets the application.
Source Code.

2. PingMsg.java

This class extend the base class SDO. It basically contains the overridden methods of it's superclass that support process logic to send the ping message to the remote system . While processing the ping message a session is opened and is passed to PongMsg for reply. The 'get action' method specifies the process action. The eval method is overridden of superclass..
Source Code.

3. PongMsg.java

The PongMsg class extends the SDO (Self Describing Objects) class that is the base class for all Qhome messages in Qare. The PongMsg contains the overrideen methods of it's superclass that gives the pong reply to the sent message. The process method closes the session and updates the Inbox Display as pong message is received. The 'get action' method specifies the reply action. The eval method is overridden of superclass..
Source Code.

4. PingDisplay.java

Source Code