@Test public void testIncomingLeaveMessage() throws Exception { expectIncomingMessage(Role.INVITEE, LEAVE); groupInvitationManager.incomingMessage(txn, message, body, meta); }
@Override protected boolean incomingMessage(Transaction txn, Message m, BdfList body, BdfDictionary bdfMeta) throws DbException, FormatException { MessageMetadata meta = messageParser.parseMetadata(bdfMeta); SessionId sessionId = getSessionId(meta.getPrivateGroupId()); StoredSession ss = getSession(txn, m.getGroupId(), sessionId); Session session; MessageId storageId; if (ss == null) { session = handleFirstMessage(txn, m, body, meta); storageId = createStorageId(txn, m.getGroupId()); } else { session = handleMessage(txn, m, body, meta, ss.bdfSession); storageId = ss.storageId; } storeSession(txn, storageId, session); return false; }
GroupInvitationManagerImpl extends ConversationClientImpl implements GroupInvitationManager, Client, ContactHook,
		PrivateGroupHook, ClientVersioningHook { @Override protected boolean incomingMessage(Transaction txn, Message m, BdfList body, BdfDictionary bdfMeta) throws DbException, FormatException { MessageMetadata meta = messageParser.parseMetadata(bdfMeta); SessionId sessionId = getSessionId(meta.getPrivateGroupId()); StoredSession ss = getSession(txn, m.getGroupId(), sessionId); Session session; MessageId storageId; if (ss == null) { session = handleFirstMessage(txn, m, body, meta); storageId = createStorageId(txn, m.getGroupId()); } else { session = handleMessage(txn, m, body, meta, ss.bdfSession); storageId = ss.storageId; } storeSession(txn, storageId, session); return false; } }
GroupInvitationManagerImpl extends ConversationClientImpl implements GroupInvitationManager, Client, ContactHook,
		PrivateGroupHook, ClientVersioningHook { @Override protected boolean incomingMessage(Transaction txn, Message m, BdfList body, BdfDictionary bdfMeta) throws DbException, FormatException { MessageMetadata meta = messageParser.parseMetadata(bdfMeta); SessionId sessionId = getSessionId(meta.getPrivateGroupId()); StoredSession ss = getSession(txn, m.getGroupId(), sessionId); Session session; MessageId storageId; if (ss == null) { session = handleFirstMessage(txn, m, body, meta); storageId = createStorageId(txn, m.getGroupId()); } else { session = handleMessage(txn, m, body, meta, ss.bdfSession); storageId = ss.storageId; } storeSession(txn, storageId, session); return false; } @Inject  GroupInvitationManagerImpl(DatabaseComponent db,
			ClientHelper clientHelper,
			ClientVersioningManager clientVersioningManager,
			MetadataParser metadataParser, MessageTracker messageTracker,
			ContactGroupFactory contactGroupFactory,
			PrivateGroupFactory privateGroupFactory,
			PrivateGroupManager privateGroupManager,
			MessageParser messageParser, SessionParser sessionParser,
			SessionEncoder sessionEncoder,
			ProtocolEngineFactory engineFactory); }
GroupInvitationManagerImpl extends ConversationClientImpl implements GroupInvitationManager, Client, ContactHook,
		PrivateGroupHook, ClientVersioningHook { @Override protected boolean incomingMessage(Transaction txn, Message m, BdfList body, BdfDictionary bdfMeta) throws DbException, FormatException { MessageMetadata meta = messageParser.parseMetadata(bdfMeta); SessionId sessionId = getSessionId(meta.getPrivateGroupId()); StoredSession ss = getSession(txn, m.getGroupId(), sessionId); Session session; MessageId storageId; if (ss == null) { session = handleFirstMessage(txn, m, body, meta); storageId = createStorageId(txn, m.getGroupId()); } else { session = handleMessage(txn, m, body, meta, ss.bdfSession); storageId = ss.storageId; } storeSession(txn, storageId, session); return false; } @Inject  GroupInvitationManagerImpl(DatabaseComponent db,
			ClientHelper clientHelper,
			ClientVersioningManager clientVersioningManager,
			MetadataParser metadataParser, MessageTracker messageTracker,
			ContactGroupFactory contactGroupFactory,
			PrivateGroupFactory privateGroupFactory,
			PrivateGroupManager privateGroupManager,
			MessageParser messageParser, SessionParser sessionParser,
			SessionEncoder sessionEncoder,
			ProtocolEngineFactory engineFactory); @Override void createLocalState(Transaction txn); @Override void addingContact(Transaction txn, Contact c); @Override void removingContact(Transaction txn, Contact c); @Override Group getContactGroup(Contact c); @Override void sendInvitation(GroupId privateGroupId, ContactId c,
			@Nullable String message, long timestamp, byte[] signature); @Override void respondToInvitation(ContactId c, PrivateGroup g, boolean accept); @Override void respondToInvitation(ContactId c, SessionId sessionId,
			boolean accept); @Override void revealRelationship(ContactId c, GroupId g); @Override Collection<InvitationMessage> getInvitationMessages(ContactId c); @Override Collection<GroupInvitationItem> getInvitations(); @Override boolean isInvitationAllowed(Contact c, GroupId privateGroupId); @Override void addingMember(Transaction txn, GroupId privateGroupId, Author a); @Override void removingGroup(Transaction txn, GroupId privateGroupId); @Override void onClientVisibilityChanging(Transaction txn, Contact c,
			Visibility v); }
GroupInvitationManagerImpl extends ConversationClientImpl implements GroupInvitationManager, Client, ContactHook,
		PrivateGroupHook, ClientVersioningHook { @Override protected boolean incomingMessage(Transaction txn, Message m, BdfList body, BdfDictionary bdfMeta) throws DbException, FormatException { MessageMetadata meta = messageParser.parseMetadata(bdfMeta); SessionId sessionId = getSessionId(meta.getPrivateGroupId()); StoredSession ss = getSession(txn, m.getGroupId(), sessionId); Session session; MessageId storageId; if (ss == null) { session = handleFirstMessage(txn, m, body, meta); storageId = createStorageId(txn, m.getGroupId()); } else { session = handleMessage(txn, m, body, meta, ss.bdfSession); storageId = ss.storageId; } storeSession(txn, storageId, session); return false; } @Inject  GroupInvitationManagerImpl(DatabaseComponent db,
			ClientHelper clientHelper,
			ClientVersioningManager clientVersioningManager,
			MetadataParser metadataParser, MessageTracker messageTracker,
			ContactGroupFactory contactGroupFactory,
			PrivateGroupFactory privateGroupFactory,
			PrivateGroupManager privateGroupManager,
			MessageParser messageParser, SessionParser sessionParser,
			SessionEncoder sessionEncoder,
			ProtocolEngineFactory engineFactory); @Override void createLocalState(Transaction txn); @Override void addingContact(Transaction txn, Contact c); @Override void removingContact(Transaction txn, Contact c); @Override Group getContactGroup(Contact c); @Override void sendInvitation(GroupId privateGroupId, ContactId c,
			@Nullable String message, long timestamp, byte[] signature); @Override void respondToInvitation(ContactId c, PrivateGroup g, boolean accept); @Override void respondToInvitation(ContactId c, SessionId sessionId,
			boolean accept); @Override void revealRelationship(ContactId c, GroupId g); @Override Collection<InvitationMessage> getInvitationMessages(ContactId c); @Override Collection<GroupInvitationItem> getInvitations(); @Override boolean isInvitationAllowed(Contact c, GroupId privateGroupId); @Override void addingMember(Transaction txn, GroupId privateGroupId, Author a); @Override void removingGroup(Transaction txn, GroupId privateGroupId); @Override void onClientVisibilityChanging(Transaction txn, Contact c,
			Visibility v);  }