javapns.devices.implementations.basic
Class BasicDevice

java.lang.Object
  extended by javapns.devices.implementations.basic.BasicDevice
All Implemented Interfaces:
Device

public class BasicDevice
extends Object
implements Device

This class is used to represent a Device (iPhone)

Author:
Maxime Peron

Constructor Summary
BasicDevice()
           
BasicDevice(String token)
          Default constructor.
BasicDevice(String token, boolean validate)
           
BasicDevice(String id, String token, Timestamp register)
          Constructor
 
Method Summary
 String getDeviceId()
          Getter
 Timestamp getLastRegister()
          Getter
 String getToken()
          Getter
 void setDeviceId(String id)
          Setter
 void setLastRegister(Timestamp lastRegister)
           
 void setToken(String token)
          Setter the device token
 void validateTokenFormat()
           
static void validateTokenFormat(String token)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicDevice

public BasicDevice(String token)
            throws InvalidDeviceTokenFormatException
Default constructor.

Parameters:
token - The device token
Throws:
InvalidDeviceTokenFormatException

BasicDevice

public BasicDevice(String token,
                   boolean validate)
            throws InvalidDeviceTokenFormatException
Throws:
InvalidDeviceTokenFormatException

BasicDevice

public BasicDevice()

BasicDevice

public BasicDevice(String id,
                   String token,
                   Timestamp register)
            throws InvalidDeviceTokenFormatException
Constructor

Parameters:
id - The device id
token - The device token
Throws:
InvalidDeviceTokenFormatException
Method Detail

validateTokenFormat

public void validateTokenFormat()
                         throws InvalidDeviceTokenFormatException
Throws:
InvalidDeviceTokenFormatException

validateTokenFormat

public static void validateTokenFormat(String token)
                                throws InvalidDeviceTokenFormatException
Throws:
InvalidDeviceTokenFormatException

getDeviceId

public String getDeviceId()
Getter

Specified by:
getDeviceId in interface Device
Returns:
the device id

getToken

public String getToken()
Getter

Specified by:
getToken in interface Device
Returns:
the device token

getLastRegister

public Timestamp getLastRegister()
Getter

Specified by:
getLastRegister in interface Device
Returns:
the last register

setDeviceId

public void setDeviceId(String id)
Setter

Specified by:
setDeviceId in interface Device
Parameters:
id - the device id

setToken

public void setToken(String token)
Setter the device token

Specified by:
setToken in interface Device
Parameters:
token -

setLastRegister

public void setLastRegister(Timestamp lastRegister)
Specified by:
setLastRegister in interface Device
Parameters:
lastRegister - the last register