package com.worklight.location.internal.events;

import com.worklight.wlclient.WLRequestPiggybacker;
import com.worklight.wlclient.api.WLFailResponse;
import com.worklight.wlclient.api.WLRequestOptions;
import com.worklight.wlclient.api.WLResponse;
import java.util.Timer;

final class EventTransmitterPiggybacker
  implements WLRequestPiggybacker
{
  private final long delay;
  private final EventTransmitter eventTransmitter;
  private Timer timer;

  public EventTransmitterPiggybacker(EventTransmitter paramEventTransmitter, long paramLong)
  {
    this.eventTransmitter = paramEventTransmitter;
    this.delay = paramLong;
  }

  public EventTransmitter getEventTransmitter()
  {
    return this.eventTransmitter;
  }

  public Timer getTimer()
  {
    return this.timer;
  }

  public void onFailure(WLFailResponse paramWLFailResponse)
  {
    if (paramWLFailResponse.getErrorCode() != null);
    switch (1.$SwitchMap$com$worklight$wlclient$api$WLErrorCode[paramWLFailResponse.getErrorCode().ordinal()])
    {
    default:
      return;
    case 1:
    case 2:
    case 3:
    case 4:
    }
    this.eventTransmitter.setClientConnected(false);
  }

  public void onSuccess(WLResponse paramWLResponse)
  {
    try
    {
      this.eventTransmitter.setClientConnected(true);
      boolean bool = this.eventTransmitter.isTransmitting();
      if (bool);
      while (true)
      {
        return;
        if (this.timer != null)
          this.timer.cancel();
        this.timer = new Timer("Piggybacker timer");
        this.timer.schedule(new PiggybackerFlush(this), this.delay);
      }
    }
    finally
    {
    }
  }

  public void processOptions(String paramString, WLRequestOptions paramWLRequestOptions)
  {
  }

  public void setTimer(Timer paramTimer)
  {
    this.timer = paramTimer;
  }
}

/* Location:           C:\Documents and Settings\Cesar Cabello Cea\Mis documentos\Downloads\apk-downloader\com.ikea.kompis-6_dex2jar.jar
 * Qualified Name:     com.worklight.location.internal.events.EventTransmitterPiggybacker
 * JD-Core Version:    0.6.2
 */