cvm.se.communication
Class CommunicationProcess

java.lang.Object
  extended by cvm.se.communication.CommunicationProcess

public class CommunicationProcess
extends java.lang.Object

This is the process in charge of controlling a single communication. Each Communication Process controls the negotiation, renegotiation, and the communication status. Each communication process is composed of 2 concurrent sub processes, one for negotiation/renegotiation and one for communication.

Author:
Frank Hernandez, Raidel Batista, Eddie Incert

Constructor Summary
CommunicationProcess(java.lang.String sProcID)
           
CommunicationProcess(java.lang.String sProcID, ControlSchema schema)
           
 
Method Summary
 void AnalyzeSchema()
          This function analzes the schema, makes the required changes, and removes any lost participant.
 ControlSchema getConnSchema()
           
 ControlSchema getCurrentConnectionSchema()
          Returns the current connection schema
 NegotiationObject getNegObj()
          Returns negotiation object for last control schema.
 void handleCommunication(ControlSchema schemaUCI)
          This function receives the control schema from UCI.
 void handleCommunictationUpdate()
           
 void handleDataSchema(DataSchema data)
          This method handles all the operations dealing with the data schema for this process.
 void handleIncommingNegotiation(NegotiationSchema negSchema)
          This function handles incoming negotiation shemas.
 boolean isBIsAlive()
           
 void KillProcess()
          This function kills this communication process.
 void registerControlSchema(ControlSchema schema)
          Register control schema for the communication process.
 void registerSchema(NegotiationSchema negSchema)
          This function registers every schema received only when all the schemas are received, it signals the start of negotiation.
 void SendSchema(ControlSchema schema)
          This function encapsulates the schema into the negotiation schema object, and sends it to each of the participant.
 void setBIsAlive(boolean isAlive)
           
 void signalProcessKill()
           
 void StartProcess()
          This function starts the communication process.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommunicationProcess

public CommunicationProcess(java.lang.String sProcID)

CommunicationProcess

public CommunicationProcess(java.lang.String sProcID,
                            ControlSchema schema)
Method Detail

StartProcess

public void StartProcess()
This function starts the communication process. It basically starts all the threads under this process, negotiation handler thread, and communication handler thread at the time of this API.


KillProcess

public void KillProcess()
This function kills this communication process. It interrupts all the threads associated to this process.


signalProcessKill

public void signalProcessKill()

isBIsAlive

public boolean isBIsAlive()

setBIsAlive

public void setBIsAlive(boolean isAlive)

SendSchema

public void SendSchema(ControlSchema schema)
This function encapsulates the schema into the negotiation schema object, and sends it to each of the participant. This object is in turrn converted into text to be send to the user across the nextwork. Not Implemented

Parameters:
schema - Object with the information to send.

AnalyzeSchema

public void AnalyzeSchema()
This function analzes the schema, makes the required changes, and removes any lost participant. Not Implemented


registerSchema

public void registerSchema(NegotiationSchema negSchema)
This function registers every schema received only when all the schemas are received, it signals the start of negotiation. This is called when a negotiation schema is received from NCB.

Parameters:
negSchema - Negotiation schema received from other users.

handleIncommingNegotiation

public void handleIncommingNegotiation(NegotiationSchema negSchema)
This function handles incoming negotiation shemas.

Parameters:
negSchema - negotation schema.

handleCommunication

public void handleCommunication(ControlSchema schemaUCI)
This function receives the control schema from UCI. It splits the schema into communication schema. For every communication schema it, searches for the communication process, if it doesn't exist create create the process. Give the connection schema to the process for handling specific communication.

Parameters:
schemaUCI -

registerControlSchema

public void registerControlSchema(ControlSchema schema)
Register control schema for the communication process.

Parameters:
schema -

handleCommunictationUpdate

public void handleCommunictationUpdate()

handleDataSchema

public void handleDataSchema(DataSchema data)
This method handles all the operations dealing with the data schema for this process.

Parameters:
data -

getCurrentConnectionSchema

public ControlSchema getCurrentConnectionSchema()
Returns the current connection schema

Returns:
current connection schema

getConnSchema

public ControlSchema getConnSchema()

getNegObj

public NegotiationObject getNegObj()
Returns negotiation object for last control schema. NegotiationObject contains negotiation schema.

Returns:
NegotiationObject containing negotiation schema.