cvm.model.handlers.schema
Class SchemaAnalizer

java.lang.Object
  extended by cvm.model.handlers.schema.SchemaAnalizer

public class SchemaAnalizer
extends java.lang.Object

This class handles the analysis of all the schemas. It handles the schema population among other tasks.

Author:
Frank Hernandez, Raidel Batista, Eddie Incert

Method Summary
 java.util.ArrayList<ConnectionDevCaps> createDevCapsFromSysInfo(java.util.ArrayList<ConnectionMediumType> mediums)
          This function creates the CVM capabilities into objects that can be used in the schema.
 java.util.ArrayList<ControlSchema> exctractConnectionSchemas(ControlSchema schema)
          This function takes the complete global schema and returns a list of smaller control schemas one for every connection.
 ControlSchema getConnectionSchmaForUsers(ControlSchema connectionSchema, java.lang.String localUsrID, java.lang.String remoteUsrID)
           
static SchemaAnalizer getInstance()
          Singleton implementation
 boolean isNegotiationAccepted(NegotiationSchema schema)
          This function checks if the negotiation schema is meant to accept the negotiation.
 boolean isNegotiationCanceled(NegotiationSchema schema)
          This function checks if the negotiaton schema is meant to cancel the negotiation.
 java.util.HashMap<java.lang.String,NegotiationSchema> performDeviceCapabilityNegotiation(java.util.HashMap<java.lang.String,NegotiationSchema> schemas, ControlSchema ctrSchema)
          Checks that all the schemas have the same number of devices.
 ControlSchema populateSchema(ControlSchema schema)
          This function, for every device in the schema it assigns the device capabilities of the system.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static SchemaAnalizer getInstance()
Singleton implementation

Returns:
singleton instance

populateSchema

public ControlSchema populateSchema(ControlSchema schema)
This function, for every device in the schema it assigns the device capabilities of the system.

Parameters:
schema -
Returns:
populated control schema

createDevCapsFromSysInfo

public java.util.ArrayList<ConnectionDevCaps> createDevCapsFromSysInfo(java.util.ArrayList<ConnectionMediumType> mediums)
This function creates the CVM capabilities into objects that can be used in the schema.

Returns:
new ConnectionDevCaps list

exctractConnectionSchemas

public java.util.ArrayList<ControlSchema> exctractConnectionSchemas(ControlSchema schema)
This function takes the complete global schema and returns a list of smaller control schemas one for every connection.

Parameters:
schema - global control schema.
Returns:
list of control schemas.

getConnectionSchmaForUsers

public ControlSchema getConnectionSchmaForUsers(ControlSchema connectionSchema,
                                                java.lang.String localUsrID,
                                                java.lang.String remoteUsrID)

isNegotiationCanceled

public boolean isNegotiationCanceled(NegotiationSchema schema)
This function checks if the negotiaton schema is meant to cancel the negotiation.

Parameters:
schema -
Returns:
true if is negotiation schema

isNegotiationAccepted

public boolean isNegotiationAccepted(NegotiationSchema schema)
This function checks if the negotiation schema is meant to accept the negotiation.

Parameters:
schema -
Returns:
true if negotiation accepted

performDeviceCapabilityNegotiation

public java.util.HashMap<java.lang.String,NegotiationSchema> performDeviceCapabilityNegotiation(java.util.HashMap<java.lang.String,NegotiationSchema> schemas,
                                                                                                ControlSchema ctrSchema)
Checks that all the schemas have the same number of devices. if someone does not meet the requiremtns the negotiation is canceled. for now.

Parameters:
schemas - list with updated communication schemas.