// Path: src/main/java/javapns/devices/Device.java
// public interface Device {
//   /**
//    * An id representing a particular device.
//    * <p>
//    * Note that this is a local reference to the device,
//    * which is not related to the actual device UUID or
//    * other device-specific identification. Most of the
//    * time, this deviceId should be the same as the token.
//    *
//    * @return the device id
//    */
//   String getDeviceId();
// 
//   /**
//    * An id representing a particular device.
//    * <p>
//    * Note that this is a local reference to the device,
//    * which is not related to the actual device UUID or
//    * other device-specific identification. Most of the
//    * time, this deviceId should be the same as the token.
//    *
//    * @param id the device id
//    */
//   void setDeviceId(String id);
// 
//   /**
//    * A device token.
//    *
//    * @return the device token
//    */
//   String getToken();
// 
//   /**
//    * Set the device token
//    *
//    * @param token
//    */
//   void setToken(String token);
// 
//   /**
//    * @return the last register
//    */
//   Timestamp getLastRegister();
// 
//   /**
//    * @param lastRegister the last register
//    */
//   void setLastRegister(Timestamp lastRegister);
// }
// 
// Path: src/main/java/javapns/notification/exceptions/ErrorResponsePacketReceivedException.java
// public class ErrorResponsePacketReceivedException extends Exception {
// 
//   private static final long serialVersionUID = 5798868422603574079L;
//   private final ResponsePacket packet;
// 
//   public ErrorResponsePacketReceivedException(final ResponsePacket packet) {
//     super(String.format("An error response packet was received from the APNS server: %s", packet.getMessage()));
//     this.packet = packet;
//   }
// 
//   public ResponsePacket getPacket() {
//     return packet;
//   }
// 
// }


import javapns.devices.Device;
import javapns.notification.exceptions.ErrorResponsePacketReceivedException;
import java.util.ArrayList;
import java.util.List;

  /**
   * Indicates if the notification has been streamed successfully to Apple's server.
   * This does <b>not</b> indicate if an error-response was received or not, but simply
   * that the library successfully completed the transmission of the notification to
   * Apple's server.
   *
   * @return true if the notification was successfully streamed to Apple, false otherwise
   */
  public boolean isTransmissionCompleted() {
    return transmissionCompleted;
  }

  void setTransmissionCompleted(final boolean completed) {
    this.transmissionCompleted = completed;
  }

  /**
   * If a response packet regarding this notification was received,
   * this method returns it. Otherwise it returns null.
   *
   * @return a response packet, if one was received for this notification
   */
  public ResponsePacket getResponse() {
    return response;
  }

  void setResponse(final ResponsePacket response) {
    this.response = response;
    if (response != null && exception == null) {
// Path: src/main/java/javapns/devices/Device.java
// public interface Device {
//   /**
//    * An id representing a particular device.
//    * <p>
//    * Note that this is a local reference to the device,
//    * which is not related to the actual device UUID or
//    * other device-specific identification. Most of the
//    * time, this deviceId should be the same as the token.
//    *
//    * @return the device id
//    */
//   String getDeviceId();
// 
//   /**
//    * An id representing a particular device.
//    * <p>
//    * Note that this is a local reference to the device,
//    * which is not related to the actual device UUID or
//    * other device-specific identification. Most of the
//    * time, this deviceId should be the same as the token.
//    *
//    * @param id the device id
//    */
//   void setDeviceId(String id);
// 
//   /**
//    * A device token.
//    *
//    * @return the device token
//    */
//   String getToken();
// 
//   /**
//    * Set the device token
//    *
//    * @param token
//    */
//   void setToken(String token);
// 
//   /**
//    * @return the last register
//    */
//   Timestamp getLastRegister();
// 
//   /**
//    * @param lastRegister the last register
//    */
//   void setLastRegister(Timestamp lastRegister);
// }
// 
// Path: src/main/java/javapns/notification/exceptions/ErrorResponsePacketReceivedException.java
// public class ErrorResponsePacketReceivedException extends Exception {
// 
//   private static final long serialVersionUID = 5798868422603574079L;
//   private final ResponsePacket packet;
// 
//   public ErrorResponsePacketReceivedException(final ResponsePacket packet) {
//     super(String.format("An error response packet was received from the APNS server: %s", packet.getMessage()));
//     this.packet = packet;
//   }
// 
//   public ResponsePacket getPacket() {
//     return packet;
//   }
// 
// }


// Path: src/main/java/javapns/notification/PushedNotification.java
import javapns.devices.Device;
import javapns.notification.exceptions.ErrorResponsePacketReceivedException;
import java.util.ArrayList;
import java.util.List;


  /**
   * Indicates if the notification has been streamed successfully to Apple's server.
   * This does <b>not</b> indicate if an error-response was received or not, but simply
   * that the library successfully completed the transmission of the notification to
   * Apple's server.
   *
   * @return true if the notification was successfully streamed to Apple, false otherwise
   */
  public boolean isTransmissionCompleted() {
    return transmissionCompleted;
  }

  void setTransmissionCompleted(final boolean completed) {
    this.transmissionCompleted = completed;
  }

  /**
   * If a response packet regarding this notification was received,
   * this method returns it. Otherwise it returns null.
   *
   * @return a response packet, if one was received for this notification
   */
  public ResponsePacket getResponse() {
    return response;
  }

  void setResponse(final ResponsePacket response) {
    this.response = response;
    if (response != null && exception == null) {
      exception = new ErrorResponsePacketReceivedException(response);