com.skype
Class SMS

java.lang.Object
  extended by com.skype.SMS
All Implemented Interfaces:
Serializable

public final class SMS
extends Object

Implementation of the Skype SMS object (Skype API 2.5). Use this class to send and receive SMS message through Skype.

See Also:
https://developer.skype.com/Docs/DevNotes?action=AttachFile&do=get&target=DevNotes-2.5beta.pdf, Serialized Form

Nested Class Summary
static class SMS.FailureReason
          Enumeration of SMS failure reason.
static class SMS.Status
          Enumeration of SMS Status.
static class SMS.TargetStatus
          Inner class to determine the target status.
static class SMS.Type
          Enumeration of SMS types.
 
Method Summary
 void delete()
          Delete this SMS message.
 boolean equals(Object compared)
          Overridden to compare ID of SMS objects.
 String[] getAllContentChunks()
          When an SMS message is too large it is split up in multiple SMS messages.
 String[] getAllTargetNumbers()
          Return an array of phonenumbers to send this SMS to.
 SMS.TargetStatus[] getAllTargetStatuses()
          Return an array of Status for each target phone number.
 String getContent()
          Return the body of this SMS message.
 String getCurrencyUnit()
          Return the costs currency.
 Object getData(String name)
          Returns the user data to which this object maps to the specified by the name.
 SMS.FailureReason getFailureReason()
          Return the failure reason of sending this SMS.
 String getId()
          Return the unique ID of this SMS object.
 BigDecimal getPrice()
          Return the costs of this SMS to send.
 String getReplyToNumber()
          The phone number to reply to if an SMS is received.
 SMS.Status getStatus()
          Return the status of this SMS message.
 Date getTime()
          Return the timestamp of this SMS.
 SMS.Type getType()
          Return the type of this SMS message.
 int hashCode()
          Overridden to use ID as the hashcode.
 boolean isCheckedFailure()
          Check if SMS is seen.
 void setAllTargetNumbers(String[] newValues)
          Set the target phone numbers.
 void setData(String name, Object userData)
          Associates the specified user data with the specified name in this object.
 void setReplyToNumber(String newValue)
          Set the phone number the other party can reply to.
 void toCheckedFailure()
          Set SMS IS_FAILED_UNSEEN to TRUE.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hashCode

public int hashCode()
Overridden to use ID as the hashcode.

Overrides:
hashCode in class Object
Returns:
ID.

equals

public boolean equals(Object compared)
Overridden to compare ID of SMS objects.

Overrides:
equals in class Object
Parameters:
compared - the object to compare this SMS to.
Returns:
true if objects have the same ID.

getId

public String getId()
Return the unique ID of this SMS object.

Returns:
ID.

getContent

public String getContent()
                  throws SkypeException
Return the body of this SMS message.

Returns:
BODY of this SMS message.
Throws:
SkypeException - when connection to Skype client has gone bad.

getType

public SMS.Type getType()
                 throws SkypeException
Return the type of this SMS message.

Returns:
type of SMS.
Throws:
SkypeException - when connection to Skype client has gone bad.

getStatus

public SMS.Status getStatus()
                     throws SkypeException
Return the status of this SMS message.

Returns:
status of SMS.
Throws:
SkypeException - when connection to Skype client has gone bad.

getFailureReason

public SMS.FailureReason getFailureReason()
                                   throws SkypeException
Return the failure reason of sending this SMS.

Returns:
failure reason.
Throws:
SkypeException - when connection to Skype client has gone bad.

isCheckedFailure

public boolean isCheckedFailure()
                         throws SkypeException
Check if SMS is seen.

Returns:
true if SMS is seen.
Throws:
SkypeException - when connection to Skype client has gone bad.

toCheckedFailure

public void toCheckedFailure()
                      throws SkypeException
Set SMS IS_FAILED_UNSEEN to TRUE.

Throws:
SkypeException - when connection to Skype client has gone bad.

getTime

public Date getTime()
             throws SkypeException
Return the timestamp of this SMS.

Returns:
timestamp of SMS.
Throws:
SkypeException - when the connection to the Skype client has gone bad.

getPrice

public BigDecimal getPrice()
                    throws SkypeException
Return the costs of this SMS to send.

Returns:
the costs.
Throws:
SkypeException - when the connection to the Skype client has gone bad.

getCurrencyUnit

public String getCurrencyUnit()
                       throws SkypeException
Return the costs currency.

Returns:
currency.
Throws:
SkypeException - when the connection to the Skype client has gone bad.

getReplyToNumber

public String getReplyToNumber()
                        throws SkypeException
The phone number to reply to if an SMS is received.

Returns:
phone number of other party.
Throws:
SkypeException - when the connection to the Skype client has gone bad.

setReplyToNumber

public void setReplyToNumber(String newValue)
                      throws SkypeException
Set the phone number the other party can reply to.

Parameters:
newValue - phone number to reply to.
Throws:
SkypeException - when the connection to the Skype client has gone bad.

getAllTargetNumbers

public String[] getAllTargetNumbers()
                             throws SkypeException
Return an array of phonenumbers to send this SMS to.

Returns:
array of target phone numbers.
Throws:
SkypeException - when the connection to the Skype client has gone bad.

setAllTargetNumbers

public void setAllTargetNumbers(String[] newValues)
                         throws SkypeException
Set the target phone numbers.

Parameters:
newValues - the numbers to set as target.
Throws:
SkypeException - when the connection to the Skype client has gone bad.

getAllTargetStatuses

public SMS.TargetStatus[] getAllTargetStatuses()
                                        throws SkypeException
Return an array of Status for each target phone number.

Returns:
array of traget status.
Throws:
SkypeException - when the connection to the Skype client has gone bad.

getAllContentChunks

public String[] getAllContentChunks()
                             throws SkypeException
When an SMS message is too large it is split up in multiple SMS messages. This method returns the message in one string array.

Returns:
an array containing all chunks.
Throws:
SkypeException - when the connection to the Skype client has gone bad.

delete

public void delete()
            throws SkypeException
Delete this SMS message.

Throws:
SkypeException - when the connection to the Skype client has gone bad.

getData

public final Object getData(String name)
Returns the user data to which this object maps to the specified by the name. Returns null if this object contains no mapping for the name.

Parameters:
name - name whose associated user data is to be returned.
Returns:
the user data to which this object maps the specified name, or null if this object contains no mapping for the name.
See Also:
Map.get(Object)

setData

public final void setData(String name,
                          Object userData)
Associates the specified user data with the specified name in this object.

Parameters:
name - name with which the specified user data is to be associated.
userData - user data to be associated with the specified name.
See Also:
Map.put(Object, Object)


Copyright © 2004-2011. All Rights Reserved.