Main Page | Packages | Class Hierarchy | Class List | Directories | File List | Class Members

agents.mobileproxy.SocketMessage Class Reference

Collaboration diagram for agents.mobileproxy.SocketMessage:
[legend]
List of all members.

Public Member Functions

 SocketMessage (String deviceId)
 SocketMessage (Socket client) throws IOException
void createResponse (jade.util.leap.List apps)
void createResponse (ApplicationParam app)
void createResponse (ApplicationStateInfo[] app)
void createResponse (FileStruct fileS)
void createResponse (int messageType, String appId, String appName)
String getResponse ()
String getDeviceId ()
int getMessageType ()
ApplicationData getApplicationData ()
String getUserName ()
String getApplicationId ()
String getDevicePort ()
long getFreeDeviceSpace ()
String getInputFileName ()
String getOutputFileName ()
void setResponse (String response)
String getDeviceBatteryState ()
String getDeviceMemoryState ()

Static Public Attributes

static final int messageNotCorrect = 15
static final int deviceNotRegistered = 14
static final int deviceFreeSpaceNotEnought = 13
static final int appNotFound = 12
static final int fileNotFound = 11
static final int operationWellPerformed = 10
static final int existAppFinished = 9
static final int appFinished = 8
static final int acceptedExecutionRequest = 7
static final int refusedExecutionRequest = 6
static final int mlrmConnection = 30
static final int activeConnection = 5
static final int getApplicationsState = 4
static final int getInputFile = 3
static final int getOutputFile = 2
static final int getApplicationParam = 1
static final int remoteExecution = 0

Private Attributes

String deviceId = null
String devicePort = null
String applicationId = null
String outputFileName = null
String inputFileName = null
long freeDeviceSpace
String deviceMemoryState
String deviceBatteryState
int messageType
ApplicationData app = null
String userName = null
String response = null

Detailed Description

Encapsulates all the protocol created for the communication beetween the proxy and the mobile devices. It creates both the request and the answer
Author:
estevao


Constructor & Destructor Documentation

agents.mobileproxy.SocketMessage.SocketMessage String  deviceId  ) 
 

Creates an empty instance to send responses

Parameters:
deviceId mobile device ID

agents.mobileproxy.SocketMessage.SocketMessage Socket  client  )  throws IOException
 

Creates an instance for reading the mobile device socket and for creating the response to mobile device

Parameters:
client mobile device socket
Exceptions:
IOException when opening and reading the mobile device socket


Member Function Documentation

void agents.mobileproxy.SocketMessage.createResponse int  messageType,
String  appId,
String  appName
 

Creates a response for acceptedExecutionRequest, refusedExecutionRequest and appFinished message received by ASCTR

Parameters:
messageType type of the answer
appId application ID of the message
appName application name of the message

void agents.mobileproxy.SocketMessage.createResponse FileStruct  fileS  ) 
 

Creates the response for an getInputFile or an getOutputFile request

Parameters:
fileS created by ASCTR call getInputFile or getOutputFile

void agents.mobileproxy.SocketMessage.createResponse ApplicationStateInfo[]  app  ) 
 

Creates the response for an getApplicationsState request

Parameters:
app created by ASCTR call getApplicationsState

void agents.mobileproxy.SocketMessage.createResponse ApplicationParam  app  ) 
 

Creates the response for an getApplicationParam request

Parameters:
app created by ASCTR call getApplicationParam

void agents.mobileproxy.SocketMessage.createResponse jade.util.leap.List  apps  ) 
 

Creates the response for an existAppFinished request

Parameters:
app List of finished applications

ApplicationData agents.mobileproxy.SocketMessage.getApplicationData  ) 
 

Returns:
ApplicationData when the message type is remoteExecution, and null when other call is made

String agents.mobileproxy.SocketMessage.getApplicationId  ) 
 

Returns:
applicatin ID when the message type is getApplicationParam, getInputFile or getOutputFile, and null when other call is made

String agents.mobileproxy.SocketMessage.getDeviceBatteryState  ) 
 

Returns:
device battery status when the message type is mlrmConnection and null when other call is made

String agents.mobileproxy.SocketMessage.getDeviceId  ) 
 

Returns:
device ID

String agents.mobileproxy.SocketMessage.getDeviceMemoryState  ) 
 

Returns:
device memory status when the message type is mlrmConnection and null when other call is made

String agents.mobileproxy.SocketMessage.getDevicePort  ) 
 

Returns:
user name when the message type is activeConnection, and null when other call is made

long agents.mobileproxy.SocketMessage.getFreeDeviceSpace  ) 
 

Returns:
free device space when the message type is getInputFile or getOutputFile, and null when other call is made

String agents.mobileproxy.SocketMessage.getInputFileName  ) 
 

Returns:
input file name when the message type is getInputFile and null when other call is made

int agents.mobileproxy.SocketMessage.getMessageType  ) 
 

Returns:
message type received from mobile device socket

String agents.mobileproxy.SocketMessage.getOutputFileName  ) 
 

Returns:
output file name when the message type is getOutputFile and null when other call is made

String agents.mobileproxy.SocketMessage.getResponse  ) 
 

Gets the response to send to mobile device, it's necessary to call an createResponse call first

Returns:
the response created

String agents.mobileproxy.SocketMessage.getUserName  ) 
 

Returns:
user name when the message type is remoteExecution or getApplicationsState, and null when other call is made

void agents.mobileproxy.SocketMessage.setResponse String  response  ) 
 

Parameters:
response response that will be sended to mobile device


Member Data Documentation

final int agents.mobileproxy.SocketMessage.acceptedExecutionRequest = 7 [static]
 

final int agents.mobileproxy.SocketMessage.activeConnection = 5 [static]
 

ApplicationData agents.mobileproxy.SocketMessage.app = null [private]
 

final int agents.mobileproxy.SocketMessage.appFinished = 8 [static]
 

String agents.mobileproxy.SocketMessage.applicationId = null [private]
 

final int agents.mobileproxy.SocketMessage.appNotFound = 12 [static]
 

String agents.mobileproxy.SocketMessage.deviceBatteryState [private]
 

final int agents.mobileproxy.SocketMessage.deviceFreeSpaceNotEnought = 13 [static]
 

String agents.mobileproxy.SocketMessage.deviceId = null [private]
 

String agents.mobileproxy.SocketMessage.deviceMemoryState [private]
 

final int agents.mobileproxy.SocketMessage.deviceNotRegistered = 14 [static]
 

String agents.mobileproxy.SocketMessage.devicePort = null [private]
 

final int agents.mobileproxy.SocketMessage.existAppFinished = 9 [static]
 

final int agents.mobileproxy.SocketMessage.fileNotFound = 11 [static]
 

long agents.mobileproxy.SocketMessage.freeDeviceSpace [private]
 

final int agents.mobileproxy.SocketMessage.getApplicationParam = 1 [static]
 

final int agents.mobileproxy.SocketMessage.getApplicationsState = 4 [static]
 

final int agents.mobileproxy.SocketMessage.getInputFile = 3 [static]
 

final int agents.mobileproxy.SocketMessage.getOutputFile = 2 [static]
 

String agents.mobileproxy.SocketMessage.inputFileName = null [private]
 

final int agents.mobileproxy.SocketMessage.messageNotCorrect = 15 [static]
 

int agents.mobileproxy.SocketMessage.messageType [private]
 

final int agents.mobileproxy.SocketMessage.mlrmConnection = 30 [static]
 

final int agents.mobileproxy.SocketMessage.operationWellPerformed = 10 [static]
 

String agents.mobileproxy.SocketMessage.outputFileName = null [private]
 

final int agents.mobileproxy.SocketMessage.refusedExecutionRequest = 6 [static]
 

final int agents.mobileproxy.SocketMessage.remoteExecution = 0 [static]
 

String agents.mobileproxy.SocketMessage.response = null [private]
 

String agents.mobileproxy.SocketMessage.userName = null [private]
 


The documentation for this class was generated from the following file:
Generated on Fri Feb 17 09:37:54 2006 for MAG by  doxygen 1.4.4