@Test public void addDistributionGroupIdToLogsTest() { String distributionGroupId = UUID.randomUUID().toString(); DistributeInfoTracker distributeInfoTracker = new DistributeInfoTracker(distributionGroupId); { Log log = newLog(); distributeInfoTracker.onPreparingLog(log, TEST_GROUP); assertNotNull(log.getDistributionGroupId()); assertEquals(distributionGroupId, log.getDistributionGroupId()); } }
@Override synchronized public void onPreparingLog(@NonNull Log log, @NonNull String groupName) { if (mDistributionGroupId == null) { return; } log.setDistributionGroupId(mDistributionGroupId); }
DistributeInfoTracker extends AbstractChannelListener { @Override synchronized public void onPreparingLog(@NonNull Log log, @NonNull String groupName) { if (mDistributionGroupId == null) { return; } log.setDistributionGroupId(mDistributionGroupId); } }
DistributeInfoTracker extends AbstractChannelListener { @Override synchronized public void onPreparingLog(@NonNull Log log, @NonNull String groupName) { if (mDistributionGroupId == null) { return; } log.setDistributionGroupId(mDistributionGroupId); } DistributeInfoTracker(String distributionGroupId); }
DistributeInfoTracker extends AbstractChannelListener { @Override synchronized public void onPreparingLog(@NonNull Log log, @NonNull String groupName) { if (mDistributionGroupId == null) { return; } log.setDistributionGroupId(mDistributionGroupId); } DistributeInfoTracker(String distributionGroupId); @Override synchronized void onPreparingLog(@NonNull Log log, @NonNull String groupName); synchronized void updateDistributionGroupId(String distributionGroupId); synchronized void removeDistributionGroupId(); }
DistributeInfoTracker extends AbstractChannelListener { @Override synchronized public void onPreparingLog(@NonNull Log log, @NonNull String groupName) { if (mDistributionGroupId == null) { return; } log.setDistributionGroupId(mDistributionGroupId); } DistributeInfoTracker(String distributionGroupId); @Override synchronized void onPreparingLog(@NonNull Log log, @NonNull String groupName); synchronized void updateDistributionGroupId(String distributionGroupId); synchronized void removeDistributionGroupId();  }