zyneo.sms
Class Notification

java.lang.Object
  |
  +--zyneo.sms.Notification
All Implemented Interfaces:
java.io.Serializable

public class Notification
extends java.lang.Object
implements java.io.Serializable

Represents a Sms-notification. Notifications are delivered from the SMSC if requested, a notfication can indicate five different things:

The notification also contains a timestamp when the event occurred and a message id to identify the message in concern. The timestamp will from the SMSC when availible otherwise it will be from the provider.

Version:
SmsBase-1-0-0
Author:
Niklas Andersson
See Also:
Serialized Form

Field Summary
static int DELIVERED
          Type: DELIVERED message is delivered to MT
static int ERASED
          Type: ERASED message is erased from SMSC
static int ERROR
          Type: ERROR message failed to be delivered to SMSC
protected  java.util.Date m_discharge_time
          Event time from SMSC
protected  java.lang.String m_id
          Message id
protected  java.util.Date m_provider_time
          Time set by provider
protected  java.util.Date m_smsc_time
          Smsc time when message which this notification belongs to arrived at SMSC
protected  int m_type
          Notification type
static int SAVED
          Type: SAVED message is saved on SMSC for deliverance later
static int SENT_TO_SMSC
          Type: SENT_TO_SMSC message is succesfully sent to SMSC
 
Constructor Summary
Notification()
          Constructor Initializes an empty notification object.
Notification(int type, java.util.Date smsc, java.util.Date discharge, java.util.Date provider, java.lang.String id)
          Constructor Creates and initializes all member variables to supplied values.
 
Method Summary
 java.util.Date getDate()
          Retrives notification time and date.
 java.util.Date getDischargeDate()
          Retrives discharge/event time as reported by SMSC
 java.lang.String getId()
          Retrives the message id.
 java.util.Date getProviderDate()
          Retrives time as reported by provider
 java.util.Date getSMSCDate()
          Retrives time as reported by SMSC
 int getType()
          Retrives notification type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SENT_TO_SMSC

public static final int SENT_TO_SMSC
Type: SENT_TO_SMSC message is succesfully sent to SMSC

See Also:
Constant Field Values

DELIVERED

public static final int DELIVERED
Type: DELIVERED message is delivered to MT

See Also:
Constant Field Values

ERASED

public static final int ERASED
Type: ERASED message is erased from SMSC

See Also:
Constant Field Values

SAVED

public static final int SAVED
Type: SAVED message is saved on SMSC for deliverance later

See Also:
Constant Field Values

ERROR

public static final int ERROR
Type: ERROR message failed to be delivered to SMSC

See Also:
Constant Field Values

m_smsc_time

protected java.util.Date m_smsc_time
Smsc time when message which this notification belongs to arrived at SMSC


m_discharge_time

protected java.util.Date m_discharge_time
Event time from SMSC


m_provider_time

protected java.util.Date m_provider_time
Time set by provider


m_type

protected int m_type
Notification type


m_id

protected java.lang.String m_id
Message id

Constructor Detail

Notification

public Notification()
Constructor Initializes an empty notification object.

Since:
SmsBase-1-0-0-0

Notification

public Notification(int type,
                    java.util.Date smsc,
                    java.util.Date discharge,
                    java.util.Date provider,
                    java.lang.String id)
Constructor Creates and initializes all member variables to supplied values.

Parameters:
type - notification type
smsc - date when message arrived at SMSC
discharge - time when event occured as reported by SMSC.
provider - date from provider must not be null.
id - must not be null.
Since:
SmsBase-1-0-0-0
Method Detail

getType

public int getType()
Retrives notification type

Returns:
the notification type.
Since:
SmsBase-1-0-0-0

getDate

public java.util.Date getDate()
Retrives notification time and date. Returns discharge time from SMSC, if null then time from provider is returned.

Returns:
notification time, smsc discharge time if not null, otherwise provider time.

getSMSCDate

public java.util.Date getSMSCDate()
Retrives time as reported by SMSC

Returns:
the time reported by SMSC or null if not set.
Since:
SmsBase-1-0-0-0

getDischargeDate

public java.util.Date getDischargeDate()
Retrives discharge/event time as reported by SMSC

Returns:
the discharge time reported by SMSC or null if not set.
Since:
SmsBase-1-0-0-0

getProviderDate

public java.util.Date getProviderDate()
Retrives time as reported by provider

Returns:
the time reported by provider
Since:
SmsBase-1-0-0-0

getId

public java.lang.String getId()
Retrives the message id.

Returns:
the message id.
Since:
SmsBase-1-0-0-0


Copyright © 2002 Zyneo. All Rights Reserved.