@Test public void testOnJoinMessageFromBothJoined() throws Exception { PeerSession session = getDefaultSession(BOTH_JOINED); expectAbortWhenSubscribedToGroup(); PeerSession newSession = engine.onJoinMessage(txn, session, joinMessage); assertSessionAborted(session, newSession); }
@Override public PeerSession onJoinMessage(Transaction txn, PeerSession s, JoinMessage m) throws DbException, FormatException { switch (s.getState()) { case AWAIT_MEMBER: case BOTH_JOINED: case LOCAL_LEFT: return abort(txn, s); case START: return onRemoteJoinFromStart(txn, s, m); case NEITHER_JOINED: return onRemoteJoinFromNeitherJoined(txn, s, m); case LOCAL_JOINED: return onRemoteJoinFromLocalJoined(txn, s, m); case ERROR: return s; default: throw new AssertionError(); } }
PeerProtocolEngine extends AbstractProtocolEngine<PeerSession> { @Override public PeerSession onJoinMessage(Transaction txn, PeerSession s, JoinMessage m) throws DbException, FormatException { switch (s.getState()) { case AWAIT_MEMBER: case BOTH_JOINED: case LOCAL_LEFT: return abort(txn, s); case START: return onRemoteJoinFromStart(txn, s, m); case NEITHER_JOINED: return onRemoteJoinFromNeitherJoined(txn, s, m); case LOCAL_JOINED: return onRemoteJoinFromLocalJoined(txn, s, m); case ERROR: return s; default: throw new AssertionError(); } } }
PeerProtocolEngine extends AbstractProtocolEngine<PeerSession> { @Override public PeerSession onJoinMessage(Transaction txn, PeerSession s, JoinMessage m) throws DbException, FormatException { switch (s.getState()) { case AWAIT_MEMBER: case BOTH_JOINED: case LOCAL_LEFT: return abort(txn, s); case START: return onRemoteJoinFromStart(txn, s, m); case NEITHER_JOINED: return onRemoteJoinFromNeitherJoined(txn, s, m); case LOCAL_JOINED: return onRemoteJoinFromLocalJoined(txn, s, m); case ERROR: return s; default: throw new AssertionError(); } } PeerProtocolEngine(DatabaseComponent db, ClientHelper clientHelper,
			ClientVersioningManager clientVersioningManager,
			PrivateGroupManager privateGroupManager,
			PrivateGroupFactory privateGroupFactory,
			GroupMessageFactory groupMessageFactory,
			IdentityManager identityManager, MessageParser messageParser,
			MessageEncoder messageEncoder, MessageTracker messageTracker,
			Clock clock); }
PeerProtocolEngine extends AbstractProtocolEngine<PeerSession> { @Override public PeerSession onJoinMessage(Transaction txn, PeerSession s, JoinMessage m) throws DbException, FormatException { switch (s.getState()) { case AWAIT_MEMBER: case BOTH_JOINED: case LOCAL_LEFT: return abort(txn, s); case START: return onRemoteJoinFromStart(txn, s, m); case NEITHER_JOINED: return onRemoteJoinFromNeitherJoined(txn, s, m); case LOCAL_JOINED: return onRemoteJoinFromLocalJoined(txn, s, m); case ERROR: return s; default: throw new AssertionError(); } } PeerProtocolEngine(DatabaseComponent db, ClientHelper clientHelper,
			ClientVersioningManager clientVersioningManager,
			PrivateGroupManager privateGroupManager,
			PrivateGroupFactory privateGroupFactory,
			GroupMessageFactory groupMessageFactory,
			IdentityManager identityManager, MessageParser messageParser,
			MessageEncoder messageEncoder, MessageTracker messageTracker,
			Clock clock); @Override PeerSession onInviteAction(Transaction txn, PeerSession s,
			@Nullable String message, long timestamp, byte[] signature); @Override PeerSession onJoinAction(Transaction txn, PeerSession s); @Override PeerSession onLeaveAction(Transaction txn, PeerSession s); @Override PeerSession onMemberAddedAction(Transaction txn, PeerSession s); @Override PeerSession onInviteMessage(Transaction txn, PeerSession s,
			InviteMessage m); @Override PeerSession onJoinMessage(Transaction txn, PeerSession s,
			JoinMessage m); @Override PeerSession onLeaveMessage(Transaction txn, PeerSession s,
			LeaveMessage m); @Override PeerSession onAbortMessage(Transaction txn, PeerSession s,
			AbortMessage m); }
PeerProtocolEngine extends AbstractProtocolEngine<PeerSession> { @Override public PeerSession onJoinMessage(Transaction txn, PeerSession s, JoinMessage m) throws DbException, FormatException { switch (s.getState()) { case AWAIT_MEMBER: case BOTH_JOINED: case LOCAL_LEFT: return abort(txn, s); case START: return onRemoteJoinFromStart(txn, s, m); case NEITHER_JOINED: return onRemoteJoinFromNeitherJoined(txn, s, m); case LOCAL_JOINED: return onRemoteJoinFromLocalJoined(txn, s, m); case ERROR: return s; default: throw new AssertionError(); } } PeerProtocolEngine(DatabaseComponent db, ClientHelper clientHelper,
			ClientVersioningManager clientVersioningManager,
			PrivateGroupManager privateGroupManager,
			PrivateGroupFactory privateGroupFactory,
			GroupMessageFactory groupMessageFactory,
			IdentityManager identityManager, MessageParser messageParser,
			MessageEncoder messageEncoder, MessageTracker messageTracker,
			Clock clock); @Override PeerSession onInviteAction(Transaction txn, PeerSession s,
			@Nullable String message, long timestamp, byte[] signature); @Override PeerSession onJoinAction(Transaction txn, PeerSession s); @Override PeerSession onLeaveAction(Transaction txn, PeerSession s); @Override PeerSession onMemberAddedAction(Transaction txn, PeerSession s); @Override PeerSession onInviteMessage(Transaction txn, PeerSession s,
			InviteMessage m); @Override PeerSession onJoinMessage(Transaction txn, PeerSession s,
			JoinMessage m); @Override PeerSession onLeaveMessage(Transaction txn, PeerSession s,
			LeaveMessage m); @Override PeerSession onAbortMessage(Transaction txn, PeerSession s,
			AbortMessage m);  }