cvm.ncb.manager
Class NCB_M_Facade

java.lang.Object
  extended by cvm.ncb.manager.NCB_M_Facade

public class NCB_M_Facade
extends java.lang.Object

Facade into the NCB_Manager package.

Author:
Frank Hernandez

Method Summary
 void addParty(java.lang.String sessionID, java.lang.String participantID)
          This function adds the participants specified to the specific session.
 boolean createdSession()
          Deprecated.  
 void createSession(java.lang.String sessionID)
          This function creates a session with the specific session ID
 UserProfile createUserProfile(UserObject usr, java.lang.Object schema)
          This method generates a user profile for the give user.
 void disableMedium(java.lang.String connectionID, java.lang.String mediumName)
          This command will stop sending the specified medium to all the participants during the connection.
 void enableMedium(java.lang.String connectionID, java.lang.String mediumName)
           
static NCB_M_Facade getInstance()
          Singleton implementation.
 java.lang.String getSessionID(java.lang.String connID)
          Deprecated.  
 boolean isCreatedSession(java.lang.String sessionID)
          This method returns whether the session was created or not.
 UserObject login(java.lang.String userName, java.lang.String password)
          This method will attempt login the given user.
 void logout(java.lang.String userName)
          Logs the user out.
 void mapConnToSession(java.lang.String connectionID, java.lang.String sessionID)
          This function maps a connection to a session.
 void removeParty(java.lang.String sID, java.lang.String participant)
          This method adds the list of participants to the given session.
 void resetNCB()
          Resets the ncb instnace.
 UserSchema retrieveSchemas(java.lang.String userName, java.lang.String password)
          This method returns the schemas for the given user.
 boolean saveSchema(java.lang.Object schema)
          Saves teh given schema.
 boolean sendMedia(java.lang.String sID, java.lang.String medium, java.lang.String mediumURL)
          This command will send the specified medium to all the participants during the connection.
 boolean sendSchema(java.lang.String sID, java.lang.String senderID, java.lang.String listReceiver, java.lang.Object control_xcml)
          This method will send the schema to all participants in the specified connection.
 boolean sendSchema(java.lang.String sID, java.lang.String senderID, java.lang.String listReceiver, java.lang.String control_xcml, java.lang.String data_xcml)
          This methods send a schema to the given user in the given session.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static NCB_M_Facade getInstance()
Singleton implementation.

Returns:
instance of NCB_M_Facade

addParty

public void addParty(java.lang.String sessionID,
                     java.lang.String participantID)
This function adds the participants specified to the specific session. If any participant cannot be added a PartyNotAddedException is thrown. If there is no session a NoSessionException is thrown. NOTE: Exceptions are caught and handled by the NCB Exception Handler. When finished NCB is notified via a notifyPartyAddedReply event.

Parameters:
sessionID - Id of the session to add the participant to.
participantID - Id of the participants to add.
See Also:
NCBExceptionHandler, PartyNotAddedException, NoSessionException

mapConnToSession

public void mapConnToSession(java.lang.String connectionID,
                             java.lang.String sessionID)
This function maps a connection to a session. If there is no session a NoSessionException is thrown. NOTE: Exceptions are caught and handled by the NCB Exception Handler. When finished NCB is notified via a notifyPartyAddedReply event.

Parameters:
sessionID - Id of the session to add the participant to.
connectionID - Id of the participants to add
See Also:
NCBExceptionHandler, NoSessionException

createSession

public void createSession(java.lang.String sessionID)
This function creates a session with the specific session ID

Parameters:
sessionID - ID of the session to create.

isCreatedSession

public boolean isCreatedSession(java.lang.String sessionID)
This method returns whether the session was created or not.

Returns:
is session created.

getSessionID

public java.lang.String getSessionID(java.lang.String connID)
Deprecated. 

This function needs to be changed, there can be to many session for one connection. This method will return the sessionId for the given connection.

Parameters:
connID - Id of the connection uinder which the session should be mapped.
Returns:
session ID Id of the session mapped to the connection.

login

public UserObject login(java.lang.String userName,
                        java.lang.String password)
This method will attempt login the given user.

Parameters:
userName -
password -
Returns:
UserObject, null on failure

retrieveSchemas

public UserSchema retrieveSchemas(java.lang.String userName,
                                  java.lang.String password)
This method returns the schemas for the given user.

Parameters:
userName -
password -
Returns:
schema

createdSession

public boolean createdSession()
Deprecated. 

This method signals whether the session is created or not.

Returns:
true

createUserProfile

public UserProfile createUserProfile(UserObject usr,
                                     java.lang.Object schema)
This method generates a user profile for the give user.

Parameters:
usr - User object to create the profile.
schema - Schema to send to the user.
Returns:
a created user profile.

removeParty

public void removeParty(java.lang.String sID,
                        java.lang.String participant)
This method adds the list of participants to the given session. RIGHT WAY

Parameters:
sID -
participant -

sendSchema

public boolean sendSchema(java.lang.String sID,
                          java.lang.String senderID,
                          java.lang.String listReceiver,
                          java.lang.String control_xcml,
                          java.lang.String data_xcml)
This methods send a schema to the given user in the given session.

Parameters:
sID -
senderID -
listReceiver -
control_xcml -
data_xcml -
Returns:
true

sendSchema

public boolean sendSchema(java.lang.String sID,
                          java.lang.String senderID,
                          java.lang.String listReceiver,
                          java.lang.Object control_xcml)
This method will send the schema to all participants in the specified connection.

Parameters:
sID -
senderID -
listReceiver -
control_xcml -
Returns:
true

sendMedia

public boolean sendMedia(java.lang.String sID,
                         java.lang.String medium,
                         java.lang.String mediumURL)
This command will send the specified medium to all the participants during the connection.

Parameters:
sID -
medium -
mediumURL -
Returns:
true

saveSchema

public boolean saveSchema(java.lang.Object schema)
Saves teh given schema.

Parameters:
schema -

enableMedium

public void enableMedium(java.lang.String connectionID,
                         java.lang.String mediumName)

disableMedium

public void disableMedium(java.lang.String connectionID,
                          java.lang.String mediumName)
This command will stop sending the specified medium to all the participants during the connection.

Parameters:
connectionID -
mediumName -

logout

public void logout(java.lang.String userName)
Logs the user out.

Parameters:
userName -

resetNCB

public void resetNCB()
Resets the ncb instnace.