// 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/devices/exceptions/InvalidDeviceTokenFormatException.java
// public class InvalidDeviceTokenFormatException extends Exception {
// 
//   private static final long serialVersionUID = -8571997399252125457L;
// 
//   public InvalidDeviceTokenFormatException(final String message) {
//     super(message);
//   }
// 
//   public InvalidDeviceTokenFormatException(final String token, final String problem) {
//     super(String.format("Device token cannot be parsed, most likely because it contains invalid hexadecimal characters: %s in %s", problem, token));
//   }
// 
// }


import javapns.devices.Device;
import javapns.devices.exceptions.InvalidDeviceTokenFormatException;
import java.sql.Timestamp;
package javapns.devices.implementations.basic;



/**
 * This class is used to represent a Device (iPhone)
 *
 * @author Maxime Peron
 */
public class BasicDevice implements Device {

  /*
   * An id representing a particular device.
   *
   * 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.
   */
  private String deviceId;

  /* The device token given by Apple Server, hexadecimal form, 64bits length */
  private String token;

  /* The last time a device registered */
  private Timestamp lastRegister;

  public BasicDevice() {
    // empty
  }

  /**
   * Default constructor.
   *
   * @param token The device token
   */
// 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/devices/exceptions/InvalidDeviceTokenFormatException.java
// public class InvalidDeviceTokenFormatException extends Exception {
// 
//   private static final long serialVersionUID = -8571997399252125457L;
// 
//   public InvalidDeviceTokenFormatException(final String message) {
//     super(message);
//   }
// 
//   public InvalidDeviceTokenFormatException(final String token, final String problem) {
//     super(String.format("Device token cannot be parsed, most likely because it contains invalid hexadecimal characters: %s in %s", problem, token));
//   }
// 
// }


// Path: src/main/java/javapns/devices/implementations/basic/BasicDevice.java
import javapns.devices.Device;
import javapns.devices.exceptions.InvalidDeviceTokenFormatException;
import java.sql.Timestamp;

package javapns.devices.implementations.basic;



/**
 * This class is used to represent a Device (iPhone)
 *
 * @author Maxime Peron
 */
public class BasicDevice implements Device {

  /*
   * An id representing a particular device.
   *
   * 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.
   */
  private String deviceId;

  /* The device token given by Apple Server, hexadecimal form, 64bits length */
  private String token;

  /* The last time a device registered */
  private Timestamp lastRegister;

  public BasicDevice() {
    // empty
  }

  /**
   * Default constructor.
   *
   * @param token The device token
   */
  public BasicDevice(final String token) throws InvalidDeviceTokenFormatException {