/**
 * Copyright (c) 2012-2012 Malhar, Inc.
 * All rights reserved.
 */
package com.malhartech.stram;

import com.malhartech.bufferserver.client.Controller;
import com.malhartech.bufferserver.packet.PurgeRequestTuple;
import com.malhartech.bufferserver.packet.ResetRequestTuple;
import java.net.InetSocketAddress;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Encapsulates buffer server control interface, used by the master for purging data.
 */
class BufferServerController extends Controller
{
  /**
   * Use a single thread group for all buffer server interactions.
   */
  InetSocketAddress addr;

  BufferServerController(String id)
  {
    super(id);
  }

  @Override
  public void onMessage(byte[] buffer, int offset, int size)
  {
    StramChild.eventloop.disconnect(this);
  }

  private static final Logger logger = LoggerFactory.getLogger(BufferServerController.class);
}

@@ -307,16 +307,41 @@
 ddress;%0A
+import java.util.Arrays;%0A
 import o
@@ -773,24 +773,156 @@
 t size)%0A  %7B%0A
+    logger.debug(%22Controller received %7B%7D, now disconnecting.%22, Arrays.toString(Arrays.copyOfRange(buffer, offset, offset + size)));%0A
     StramChi

put debugging to note down disconnection by Controller.