peer2me.framework
Interface FrameworkListener


public interface FrameworkListener

This interface must be implemented by all Peer2Me MIDlets. It ensures that the Framework can access a set of methods in the MIDlet in order to notify the MIDlet about various events.

Author:
Torbjørn Vatn & Steinar A. Hestnes

Method Summary
 void notifyAboutException(java.lang.String location, java.lang.Exception exception)
          This method is called by the framework whenever an exception notice is given by the log.
 void notifyAboutFoundNode(java.lang.String nodeAddress, java.lang.String remoteNodeName)
          This method is called by the framework when a node is found.
 void notifyAboutParticipants(java.util.Hashtable participants)
          This method is called from from the framework to notify the midlet about the participants of the ad hoc network.
 void notifyAboutReceivedFilePackage(java.lang.String senderName, java.lang.String filePath)
          This method is called from the framework whenever a file package is received from a remote node.
 void notifyAboutReceivedTextPackage(java.lang.String senderName, java.lang.String textMessage)
          This method is called from the framework whenever a text package is received from a remote node.
 

Method Detail

notifyAboutException

public void notifyAboutException(java.lang.String location,
                                 java.lang.Exception exception)
This method is called by the framework whenever an exception notice is given by the log. This will be done in cases where exceptions occure in threads and cannot be thrown in the usual way.

Parameters:
location - The location where the Exception occured
exception - The actual Exception

notifyAboutFoundNode

public void notifyAboutFoundNode(java.lang.String nodeAddress,
                                 java.lang.String remoteNodeName)
This method is called by the framework when a node is found. These nodes are not yet connected in a network. To do this, use the Framework.connectToNodes() method.

Parameters:
nodeAddress - The network address of the node
remoteNodeName - The name of the found remote node

notifyAboutReceivedTextPackage

public void notifyAboutReceivedTextPackage(java.lang.String senderName,
                                           java.lang.String textMessage)
This method is called from the framework whenever a text package is received from a remote node.

Parameters:
senderName - The name of the sender
textMessage - The received text message

notifyAboutReceivedFilePackage

public void notifyAboutReceivedFilePackage(java.lang.String senderName,
                                           java.lang.String filePath)
This method is called from the framework whenever a file package is received from a remote node.

Parameters:
senderName - The name of the sender
filePath - The path to the received file

notifyAboutParticipants

public void notifyAboutParticipants(java.util.Hashtable participants)
This method is called from from the framework to notify the midlet about the participants of the ad hoc network.

Parameters:
participants - A hashtable that contains the names of the participants as unique keys and the network addresses as values.