package org.realityforge.replicant.client.transport;

import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
 * Summary describing the result of a data load action.
 */
public final class DataLoadStatus
{
  private final boolean _bulkLoad;
  @Nullable
  private final String requestID;
  @Nonnull
  private final List<ChannelChangeStatus> _channelAdds;
  @Nonnull
  private final List<ChannelChangeStatus> _channelUpdates;
  @Nonnull
  private final List<ChannelChangeStatus> _channelRemoves;

  // The number of entities created or updated as part of change message
  private final int _entityUpdateCount;
  // The number of entities removed as part of change message
  private final int _entityRemoveCount;
  // The number of entities where link() was invoked
  private final int _entityLinkCount;

  public DataLoadStatus( final boolean bulkLoad,
                         final String requestID,
                         @Nonnull final List<ChannelChangeStatus> channelAdds,
                         @Nonnull final List<ChannelChangeStatus> channelUpdates,
                         @Nonnull final List<ChannelChangeStatus> channelRemoves,
                         final int entityUpdateCount,
                         final int entityRemoveCount,
                         final int entityLinkCount )
  {
    _bulkLoad = bulkLoad;
    this.requestID = requestID;
    _channelAdds = channelAdds;
    _channelUpdates = channelUpdates;
    _channelRemoves = channelRemoves;
    _entityUpdateCount = entityUpdateCount;
    _entityRemoveCount = entityRemoveCount;
    _entityLinkCount = entityLinkCount;
  }

  public boolean isBulkLoad()
  {
    return _bulkLoad;
  }

  @Nullable
  public String getRequestID()
  {
    return requestID;
  }

  @Nonnull
  public List<ChannelChangeStatus> getChannelAdds()
  {
    return _channelAdds;
  }

  @Nonnull
  public List<ChannelChangeStatus> getChannelUpdates()
  {
    return _channelUpdates;
  }

  @Nonnull
  public List<ChannelChangeStatus> getChannelRemoves()
  {
    return _channelRemoves;
  }

  public int getEntityUpdateCount()
  {
    return _entityUpdateCount;
  }

  public int getEntityRemoveCount()
  {
    return _entityRemoveCount;
  }

  public int getEntityLinkCount()
  {
    return _entityLinkCount;
  }
}

@@ -238,16 +238,47 @@
 tatus%0A%7B%0A
+  private final int _sequence;%0A
   privat
@@ -331,32 +331,33 @@
 te final String 
+_
 requestID;%0A  @No
@@ -890,16 +890,61 @@
 dStatus(
+ final int sequence,%0A                        
  final b
@@ -1413,24 +1413,50 @@
 Count )%0A  %7B%0A
+    _sequence = sequence;%0A
     _bulkLoa
@@ -1477,13 +1477,9 @@
     
-this.
+_
 requ
@@ -1730,32 +1730,90 @@
 LinkCount;%0A  %7D%0A%0A
+  public int getSequence()%0A  %7B%0A    return _sequence;%0A  %7D%0A%0A
   public boolean
@@ -1915,16 +1915,17 @@
  return 
+_
 requestI

Include status in sequence