@Test public void testCreatesContactGroupWhenAddingContact() throws Exception { expectAddingContact(); ClientVersioningManagerImpl c = createInstance(); c.addingContact(txn, contact); }
@Override public void addingContact(Transaction txn, Contact c) throws DbException { Group g = getContactGroup(c); db.addGroup(txn, g); db.setGroupVisibility(txn, c.getId(), g.getId(), SHARED); BdfDictionary meta = new BdfDictionary(); meta.put(GROUP_KEY_CONTACT_ID, c.getId().getInt()); try { clientHelper.mergeGroupMetadata(txn, g.getId(), meta); } catch (FormatException e) { throw new AssertionError(e); } List<ClientVersion> versions = new ArrayList<>(clients); Collections.sort(versions); storeFirstUpdate(txn, g.getId(), versions); }
ClientVersioningManagerImpl implements ClientVersioningManager, Client,
		Service, ContactHook, IncomingMessageHook { @Override public void addingContact(Transaction txn, Contact c) throws DbException { Group g = getContactGroup(c); db.addGroup(txn, g); db.setGroupVisibility(txn, c.getId(), g.getId(), SHARED); BdfDictionary meta = new BdfDictionary(); meta.put(GROUP_KEY_CONTACT_ID, c.getId().getInt()); try { clientHelper.mergeGroupMetadata(txn, g.getId(), meta); } catch (FormatException e) { throw new AssertionError(e); } List<ClientVersion> versions = new ArrayList<>(clients); Collections.sort(versions); storeFirstUpdate(txn, g.getId(), versions); } }
ClientVersioningManagerImpl implements ClientVersioningManager, Client,
		Service, ContactHook, IncomingMessageHook { @Override public void addingContact(Transaction txn, Contact c) throws DbException { Group g = getContactGroup(c); db.addGroup(txn, g); db.setGroupVisibility(txn, c.getId(), g.getId(), SHARED); BdfDictionary meta = new BdfDictionary(); meta.put(GROUP_KEY_CONTACT_ID, c.getId().getInt()); try { clientHelper.mergeGroupMetadata(txn, g.getId(), meta); } catch (FormatException e) { throw new AssertionError(e); } List<ClientVersion> versions = new ArrayList<>(clients); Collections.sort(versions); storeFirstUpdate(txn, g.getId(), versions); } @Inject  ClientVersioningManagerImpl(DatabaseComponent db, ClientHelper clientHelper,
			ContactGroupFactory contactGroupFactory, Clock clock); }
ClientVersioningManagerImpl implements ClientVersioningManager, Client,
		Service, ContactHook, IncomingMessageHook { @Override public void addingContact(Transaction txn, Contact c) throws DbException { Group g = getContactGroup(c); db.addGroup(txn, g); db.setGroupVisibility(txn, c.getId(), g.getId(), SHARED); BdfDictionary meta = new BdfDictionary(); meta.put(GROUP_KEY_CONTACT_ID, c.getId().getInt()); try { clientHelper.mergeGroupMetadata(txn, g.getId(), meta); } catch (FormatException e) { throw new AssertionError(e); } List<ClientVersion> versions = new ArrayList<>(clients); Collections.sort(versions); storeFirstUpdate(txn, g.getId(), versions); } @Inject  ClientVersioningManagerImpl(DatabaseComponent db, ClientHelper clientHelper,
			ContactGroupFactory contactGroupFactory, Clock clock); @Override void registerClient(ClientId clientId, int majorVersion,
			int minorVersion, ClientVersioningHook hook); @Override Visibility getClientVisibility(Transaction txn, ContactId contactId,
			ClientId clientId, int majorVersion); @Override void createLocalState(Transaction txn); @Override void startService(); @Override void stopService(); @Override void addingContact(Transaction txn, Contact c); @Override void removingContact(Transaction txn, Contact c); @Override boolean incomingMessage(Transaction txn, Message m, Metadata meta); }
ClientVersioningManagerImpl implements ClientVersioningManager, Client,
		Service, ContactHook, IncomingMessageHook { @Override public void addingContact(Transaction txn, Contact c) throws DbException { Group g = getContactGroup(c); db.addGroup(txn, g); db.setGroupVisibility(txn, c.getId(), g.getId(), SHARED); BdfDictionary meta = new BdfDictionary(); meta.put(GROUP_KEY_CONTACT_ID, c.getId().getInt()); try { clientHelper.mergeGroupMetadata(txn, g.getId(), meta); } catch (FormatException e) { throw new AssertionError(e); } List<ClientVersion> versions = new ArrayList<>(clients); Collections.sort(versions); storeFirstUpdate(txn, g.getId(), versions); } @Inject  ClientVersioningManagerImpl(DatabaseComponent db, ClientHelper clientHelper,
			ContactGroupFactory contactGroupFactory, Clock clock); @Override void registerClient(ClientId clientId, int majorVersion,
			int minorVersion, ClientVersioningHook hook); @Override Visibility getClientVisibility(Transaction txn, ContactId contactId,
			ClientId clientId, int majorVersion); @Override void createLocalState(Transaction txn); @Override void startService(); @Override void stopService(); @Override void addingContact(Transaction txn, Contact c); @Override void removingContact(Transaction txn, Contact c); @Override boolean incomingMessage(Transaction txn, Message m, Metadata meta);  }