use of port.sessionserver.SessionParticipantDescription in project GIPC by pdewan.
the class ARelayingDuplexConnectionsManager method joinSessionServer.
protected void joinSessionServer() {
List<SessionParticipantDescription> currentMembers = null;
JoinInfo joinInfo = null;
switch(joinChoice) {
case MEMBER:
case SYMMETRIC_JOIN:
{
joinInfo = logicalSessionsServerProxy.join(sessionName, sessionClientDescription, this);
// .join(sessionName, sessionClientDescription, this));
break;
}
case SERVER_ONLY:
{
joinInfo = logicalSessionsServerProxy.joinAsServer(sessionName, sessionClientDescription, this);
// sessionClientDescription, this));
break;
}
case CLIENT_ONLY:
{
// note needed as no ports are registered
// sessionClientDescription.setID(null);
joinInfo = logicalSessionsServerProxy.joinAsClient(sessionName, sessionClientDescription, this);
// sessionClientDescription, this));
break;
}
default:
{
System.out.println("Code should not reach here");
}
}
currentMembers = AJoinInfo.getMembersClientsAndServers(joinInfo);
servers = joinInfo.getServers();
clients = joinInfo.getClients();
members = joinInfo.getMembers();
Tracer.info(this, "Current members:" + members);
duplexObjectSessionPort.notifyConnect(duplexObjectSessionPort.getLocalName(), // null));
ARelayingDuplexConnectionsManager.toPeerConnectionType(duplexObjectSessionPort.getParticipantChoice()));
// if (joinChoice == ParticipantChoice.JOIN_AND_OBSERVE)
// currentMembers = logicalSessionsServerProxy.join(sessionName,
// sessionClientDescription, this);
// else if (joinChoice == ParticipantChoice.OBSERVE_ONLY)
// currentMembers = logicalSessionsServerProxy.observe (sessionName,
// this);
// List<ServerPortDescription> currentMembers =
// logicalSessionsServerProxy.join(sessionName,
// sessionClientDescription, this);
processCurrentMembers(currentMembers);
}
use of port.sessionserver.SessionParticipantDescription in project GIPC by pdewan.
the class AThreeDepPortClientPseudoLauncher method doPostConnectsAsyncOperations.
@Override
protected void doPostConnectsAsyncOperations() {
ServerPortDescription relayerPortDescription = sessionServerProxy.getRelayerDescripton(sessionName);
JoinInfo joinInfo = joinSessionServer();
ServerPortDescription mvcServerPortDescription = null;
List<SessionParticipantDescription> servers = joinInfo.getServers();
if (servers.size() > 0) {
mvcServerPortDescription = servers.get(0);
} else {
mvcServerHasNotJoined();
}
processMemberJoinInfo(joinInfo);
chainConnectListeners(relayerPortDescription, mvcServerPortDescription);
}
use of port.sessionserver.SessionParticipantDescription 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);
}
use of port.sessionserver.SessionParticipantDescription in project GIPC by pdewan.
the class AThreeDepPortClientLauncher method communicateWithSessionServer.
protected void communicateWithSessionServer() {
ServerPortDescription relayerPortDescription = sessionServerProxy.getRelayerDescripton(sessionName);
JoinInfo joinInfo = joinSessionServer();
ServerPortDescription mvcServerPortDescription = null;
List<SessionParticipantDescription> servers = joinInfo.getServers();
if (servers.size() > 0) {
mvcServerPortDescription = servers.get(0);
} else {
mvcServerHasNotJoined();
}
processMemberJoinInfo(joinInfo);
chainConnectListeners(relayerPortDescription, mvcServerPortDescription);
}
Aggregations