com.objectxp.msg
Class UcpMessage

java.lang.Object
  extended by com.objectxp.msg.Message
      extended by com.objectxp.msg.SmsMessage
          extended by com.objectxp.msg.UcpMessage
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class UcpMessage
extends SmsMessage

This class extends the class SmsMessage with UCP specific properties.

See Also:
UcpSmsService, Serialized Form

Field Summary
static int NT_BN
          Notification type: Buffered Notification
static int NT_DN
          Notification type: Delivery Notification
static int NT_ND
          Notification type: Non Delivery Notification
 
Fields inherited from class com.objectxp.msg.SmsMessage
CLASS_0, CLASS_1, CLASS_2, CLASS_3, DC_8BIT, DC_DEFAULT, DC_GROUP_DATA, DC_GROUP_GENERAL, DC_GROUP_MSG_WAITING_DISCARD, DC_GROUP_MSG_WAITING_STORE, DC_UCS2, INDICATION_ACTIVE, INDICATION_INACTIVE, INDICATION_TYPE_EMAIL, INDICATION_TYPE_FAX, INDICATION_TYPE_OTHER, INDICATION_TYPE_VOICEMAIL, NO_CLASS
 
Fields inherited from class com.objectxp.msg.Message
ACK_TIME, MT_BINARY, MT_STATUS, MT_TEXT, SENDER_TYPE_ALPHA, SENDER_TYPE_GUESS, SENDER_TYPE_NUMBER
 
Constructor Summary
UcpMessage()
           
UcpMessage(SmsService service)
          Deprecated. since jSMS 1.7, use UcpMessage()
 
Method Summary
 void deleteExtraServices()
          Remove all additional services (XSer field) for this Message.
 java.util.Date getDeferredDelivery()
          Deprecated. since jSMS 1.6, use SmsMessage.getDeferredDeliveryAsDate() instead.
 byte[] getExtraService(short typeOfService)
          Get additional service (XSer) for this message.
 short[] getExtraServiceTypes()
          Gets all additional service (XSer) types for this message.
 java.lang.String getNotificationAddress()
           
 int getNotificationType()
           
 void setExtraService(short typeOfService, byte[] data)
          Set additional services (XSer) for this message.
 void setNotificationAddress(java.lang.String address)
          Sets the notification address.
 void setNotificationType(int type)
          Sets the notification type.
 java.lang.String toString()
          Constructs a string representation of this Message
 
Methods inherited from class com.objectxp.msg.SmsMessage
containsUserDataHeader, copyFields, getAlphabet, getBytes, getCodingGroup, getDeferredDeliveryAsDate, getDeferredDeliveryInMinutes, getID, getIndicationState, getIndicationType, getMessage, getMessageClass, getParent, getPID, getRecipient, getRecipientAddress, getSender, getSenderAddress, getType, getUserData, getUserDataHeader, getValidityPeriodAsDate, getValidityPeriodInMinutes, hasDeferredDelivery, hasMessageClass, hasValidityPeriod, isCompressed, isMMS, isRejectDuplicates, isRelativeDeferredDelivery, isRelativeValidityPeriod, isReplyPath, requestStatusReport, requestStatusReport, setAlphabet, setCodingGroup, setCompression, setDeferredDelivery, setDeferredDelivery, setIndicationState, setIndicationType, setMessage, setMessage, setMessageClass, setMMS, setParent, setPID, setRecipient, setRecipientAddress, setRejectDuplicates, setReplyPath, setSender, setSenderAddress, setType, setUserData, setUserDataHeader, setUserDataHeader, setValidityPeriod, setValidityPeriod
 
Methods inherited from class com.objectxp.msg.Message
clone, getProperty, getSenderType, getTimestamp, setID, setProperty, setSenderType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NT_DN

public static final int NT_DN
Notification type: Delivery Notification

See Also:
Constant Field Values

NT_ND

public static final int NT_ND
Notification type: Non Delivery Notification

See Also:
Constant Field Values

NT_BN

public static final int NT_BN
Notification type: Buffered Notification

See Also:
Constant Field Values
Constructor Detail

UcpMessage

public UcpMessage()

UcpMessage

public UcpMessage(SmsService service)
Deprecated. since jSMS 1.7, use UcpMessage()

Method Detail

getDeferredDelivery

public java.util.Date getDeferredDelivery()
Deprecated. since jSMS 1.6, use SmsMessage.getDeferredDeliveryAsDate() instead.

Get the delivery date for this message.

Returns:
the deferred delivery date or null

setExtraService

public void setExtraService(short typeOfService,
                            byte[] data)
                     throws java.lang.IllegalArgumentException
Set additional services (XSer) for this message. Each service contains of two fields: the service type, and zero or more data elements (octets). Please notethat trying to set the GSM DCS information or the GSM UDH information will result in a IllegalArgumentException since those fields will already be handled by the message itself.

Parameters:
typeOfService - the XSer Type of service. Refer to the UCP specification for more details about the available service types.
data - the data elements for this service. If data is null, the service will be removed from this message. The data must NOT be IRA (hex) encoded since UcpMessage will care about hex-encoding your data. For services requiring zero data elements, a empty byte array must be passed to this method.
Throws:
java.lang.IllegalArgumentException - if type of Service is lower than 3 or higher than 255, or if the data length exceeds 255 octets.

deleteExtraServices

public void deleteExtraServices()
Remove all additional services (XSer field) for this Message. XSer fields set by the message itself (GSM UDH and GSM DCS) will not be cleared.


getExtraService

public byte[] getExtraService(short typeOfService)
Get additional service (XSer) for this message. Please note that trying to the GSM DCS information or the GSM UDH information will not be returned since those fields will already be handled by the message itself.

Parameters:
typeOfService - the XSer Type of service. Refer to the UCP specification for more details about the available service types.

getExtraServiceTypes

public short[] getExtraServiceTypes()
Gets all additional service (XSer) types for this message. Please notethat trying to set the GSM DCS information or the GSM UDH information will not be returned since those fields are already be handled by the message itself.

Returns:
an array containing the extra service types.

setNotificationAddress

public void setNotificationAddress(java.lang.String address)
Sets the notification address. If the address is null, the notification will be sent to the current session.

Parameters:
address - the notification address

setNotificationType

public void setNotificationType(int type)
Sets the notification type.

Parameters:
type - notification type

getNotificationType

public int getNotificationType()
Returns:
the notification type.
See Also:
setNotificationType(int)

getNotificationAddress

public java.lang.String getNotificationAddress()
Returns:
the notification address
See Also:
setNotificationAddress(String)

toString

public java.lang.String toString()
Description copied from class: Message
Constructs a string representation of this Message

Overrides:
toString in class SmsMessage


object XP, Inc. © 2000-2008. All rights reserved object XP