Search in sources :

Example 1 with LatecomerJoinInfo

use of port.sessionserver.relay.late.LatecomerJoinInfo in project GIPC by pdewan.

the class ALatecomerRelayingGroupConnectionsManager method doJoinSessionServer.

// // no reason for this to be a separate method as far as I can tell
// protected void doJoinSessionServer() {
// Tracer.info (this, "About to make late join session sync call to  session server :" + sessionName);
// LatecomerJoinInfo joinRetVal = logicalLatecomerSessionsServerProxy.lateJoin(sessionName, sessionClientDescription, this);
// //		LatecomerSessionsServer physicalSessionsServerProxy = (LatecomerSessionsServer) physicalServerNameToProxy.get(serverName);
// //		LatecomerJoinInfo joinRetVal = physicalSessionsServerProxy.lateJoin(sessionName, sessionClientDescription, this);
// Tracer.info (this, "Received back late join info :" + joinRetVal);
// List<ServerPortDescription> currentMembers = joinRetVal.getUsers();
// processCurrentMembers(currentMembers);
// List<MessageWithSource> pastMessages = joinRetVal.getMessages();
// processPastMessages(pastMessages);
// }
// no reason for this to be a separate method as far as I can tell
// artiact of the fact that at one time remote calls were not executed
// in a separate thread
// actually received calls are in a separate thread
// this is an initiated call, so needs gto be in separate thread
protected void doJoinSessionServer() {
    List<SessionParticipantDescription> currentMembers = null;
    List<MessageWithSource> pastMessages = null;
    Tracer.info(this, "About to make late join session sync call to  session server :" + sessionName);
    LatecomerJoinInfo lateJoinInfo = null;
    switch(joinChoice) {
        case SYMMETRIC_JOIN:
        case MEMBER:
            lateJoinInfo = logicalLatecomerSessionsServerProxy.lateJoin(sessionName, sessionClientDescription, this);
            Tracer.info(this, "Received back late join info :" + lateJoinInfo);
            // currentMembers = AJoinInfo.getMembersClientsAndServers(lateJoinInfo);
            // this was commented out before
            pastMessages = lateJoinInfo.getMessages();
            break;
        case SERVER_ONLY:
            lateJoinInfo = logicalLatecomerSessionsServerProxy.lateJoinAsServer(sessionName, sessionClientDescription, this);
            // currentMembers = AJoinInfo.getMembersAndClients(lateJoinInfo); // can add everyone if needed, connect type allows that
            // commentd out before
            pastMessages = lateJoinInfo.getClientMessages();
            break;
        case CLIENT_ONLY:
            lateJoinInfo = logicalLatecomerSessionsServerProxy.lateJoinAsClient(sessionName, sessionClientDescription, this);
            // currentMembers =AJoinInfo.getMembersAndServers(lateJoinInfo); // can add everyone if necessary
            // c commented out befoere
            pastMessages = lateJoinInfo.getServerMessages();
            // Tracer.setKeywordDisplayStatus(Tracer.ALL_KEYWORDS, true);
            break;
    }
    // this is members and servers in old distTeaching. This is what causes the connected call to have to
    // check if the joined process is  a server
    currentMembers = AJoinInfo.getMembersClientsAndServers(lateJoinInfo);
    // commenting this out as we want specialized semantics
    // pastMessages = lateJoinInfo.getMessages();
    servers = lateJoinInfo.getServers();
    clients = lateJoinInfo.getClients();
    members = lateJoinInfo.getMembers();
    // this is to be consistent with P2P, but perhaps this connection should not be generated
    // as it causes issues down the line with single response
    // this connect will trigger addition of server
    duplexObjectSessionPort.notifyConnect(duplexObjectSessionPort.getLocalName(), ASessionBasedFP2PBufferConnectionsManager.toMyConnectionType(joinChoice));
    processCurrentMembers(currentMembers);
    Tracer.info(this, "Past messages:" + pastMessages);
    // bring this here so that control message (because of upstream connect) can be sent after messages processed
    processPastMessages(pastMessages);
    // this happens after replay, so messages may not be sent
    if (duplexObjectSessionPort.getLogicalRemoteEndPoint() != null && currentMembers.size() > 0) {
        // a replicated port
        duplexObjectSessionPort.notifyConnect(duplexObjectSessionPort.getLogicalRemoteEndPoint(), ConnectionType.TO_LOGICAL_SERVER);
        initialJoin = false;
        logicalConnectionNotificationSent = true;
    }
// processPastMessages(pastMessages);
}
Also used : MessageWithSource(sessionport.datacomm.duplex.object.relayed.MessageWithSource) AMessageWithSource(sessionport.datacomm.duplex.object.relayed.AMessageWithSource) SessionParticipantDescription(port.sessionserver.SessionParticipantDescription) LatecomerJoinInfo(port.sessionserver.relay.late.LatecomerJoinInfo)

Aggregations

SessionParticipantDescription (port.sessionserver.SessionParticipantDescription)1 LatecomerJoinInfo (port.sessionserver.relay.late.LatecomerJoinInfo)1 AMessageWithSource (sessionport.datacomm.duplex.object.relayed.AMessageWithSource)1 MessageWithSource (sessionport.datacomm.duplex.object.relayed.MessageWithSource)1