com.Komunaldata.SmsGateway
Class SmsGateway

java.lang.Object
  extended by com.Komunaldata.SmsGateway.SmsGateway

public class SmsGateway
extends java.lang.Object

 This class is created for calling webservices provided by Komunáldata Kft.

 Definitions:
        *SMSUser: Individuals with username/password.
        *Account: Individual users belong to an account, one user can only belong to one given account.
        *Credit: Credit is used for sending SMS-es one credit is valid for one SMS (one message can use more than one credit according to it's length and coding, for proper credit usage use getSMSLenght() function prior sending a SMS).
        *Modem: The unit for sending and recieving SMS-es. Each modem is identified by the phone number of its sim card.
                    *Dedicated Modem: Dedicated modems can be used only from the account it is dedicated to.
                    *NonDedicated Modem: Modems which can be used with multiple accounts.
        *Coding: SMS coding can be 7bit for GSM characters or 16bit for Unicode, one SMS can hold 160 7bit chars or 70 16bit chars, for sending longer messages the system uses concatenated SMS-es.
        *Concatenates SMS: A long SMS which can be sent in several parts (upto 256 piece according to the GSM standard) which will arrive as one SMS to the recipient.
 


Constructor Summary
SmsGateway()
           
 
Method Summary
static deleteSmsResponse deleteSmsInById(SMSUser user, java.lang.Integer smsId)
          Deleting a single incoming SMS by its ID.
static deleteSmsResponse deleteSmsInById(SMSUser user, java.lang.Integer[] smsIdList)
          Deleting multiple incoming SMS-es by their ID.
static deleteSmsResponse deleteSmsInById(java.lang.String userName, java.lang.String password, java.lang.Integer smsId)
          Deleting a single incoming SMS by its ID.
static deleteSmsResponse deleteSmsInById(java.lang.String userName, java.lang.String password, java.lang.Integer[] smsIdList)
          Deleting multiple incoming SMS-es by their ID.
static deleteSmsResponse deleteSmsOutById(SMSUser user, java.lang.Integer smsId)
          Deleting a single outgoing SMS by its ID.
static deleteSmsResponse deleteSmsOutById(SMSUser user, java.lang.Integer[] smsIdList)
          Deleting multiple outgoing SMS by its ID.
static deleteSmsResponse deleteSmsOutById(java.lang.String userName, java.lang.String password, java.lang.Integer smsId)
          Deleting a single outgoing SMS by its ID.
static deleteSmsResponse deleteSmsOutById(java.lang.String userName, java.lang.String password, java.lang.Integer[] smsIdList)
          Deleting multiple outgoing SMS by its ID.
static getCreditResponse getCreditAccount(SMSUser user, short accountId)
          Gets the credits available for a given account.
static getCreditResponse getCreditAccount(java.lang.String userName, java.lang.String password, short accountId)
          Gets the credits available for a given account.
static getCreditResponse getCreditUser(SMSUser user)
          Gets the credits available for the user.
static getCreditResponse getCreditUser(java.lang.String userName, java.lang.String password)
          Gets the credits available for the user.
static getModemsByAccountResponse getModemsByAccount(SMSUser user, short accountId)
          Gets the dedicated modems belonging to a given account.
static getModemsByAccountResponse getModemsByAccount(java.lang.String userName, java.lang.String password, short accountId)
          Gets the dedicated modems belonging to a given account.
static getSmsInResponse getSmsInByDedicatedAccount(SMSUser user)
          Gets all incoming SMS which is recieved by dedicated modem for the account the user is member of.
static getSmsInResponse getSmsInByDedicatedAccount(java.lang.String userName, java.lang.String password)
          Gets all incoming SMS which is recieved by dedicated modem for the account the user is member of.
static getSmsInResponse getSmsInByNonDedicatedAccount(SMSUser user)
          Gets all incoming SMS which is recieved by non-dedicated modem for the account the user is member of.
static getSmsInResponse getSmsInByNonDedicatedAccount(java.lang.String userName, java.lang.String password)
          Gets all incoming SMS which is recieved by dedicated modem for the account the user is member of.
static getSmsInResponse getSmsInByUser(SMSUser user)
          Gets all incoming SMS for the user.
static getSmsInResponse getSmsInByUser(java.lang.String userName, java.lang.String password)
          Gets all incoming SMS for the user.
static getSmsLengthResponse getSMSLength(java.lang.String coding, java.lang.String message)
          Gets the exact length of the SMS.
static getSmsLengthResponse getSMSLength(java.lang.String coding, java.lang.String message, java.lang.Boolean wap, java.lang.Boolean wlink, java.lang.Boolean wmessage, java.lang.String mode, java.lang.String href, java.lang.String type, java.util.Date validityTime, java.util.Date releaseTime)
          Gets the exact length of the SMS.
static getSmsOutResponse getSmsOutByAccount(SMSUser user, boolean listDeleted)
          Gets all outgoing SMS for the account which the user is member of.
static getSmsOutResponse getSmsOutByAccount(java.lang.String userName, java.lang.String password, boolean listDeleted)
          Gets all outgoing SMS for the account which the user is member of.
static getSmsOutResponse getSmsOutById(SMSUser user, java.lang.Integer sms_id)
          Gets a single outgoing SMS by its Id.
static getSmsOutResponse getSmsOutById(java.lang.String userName, java.lang.String password, java.lang.Integer sms_id)
          Gets a single outgoing SMS by its Id.
static getSmsOutResponse getSmsOutByUser(SMSUser user, boolean listDeleted)
          Gets all outgoing SMS for the user.
static getSmsOutResponse getSmsOutByUser(java.lang.String userName, java.lang.String password, boolean listDeleted)
          Gets all outgoing SMS for the user.
static insertSmsResponse insertSmsOutNormal(SMSUser user, java.lang.String text, java.lang.String bit, java.lang.String[] recipientList, java.lang.String[] wantedSenderPhones)
          Send SMS.
static insertSmsResponse insertSmsOutNormal(java.lang.String userName, java.lang.String password, java.lang.String text, java.lang.String bit, java.lang.String[] recipientList, java.lang.String[] wantedSenderPhones)
          Send SMS.
static insertSmsResponse insertSmsOutNormal16BitWithTiming(SMSUser user, java.lang.String text, java.lang.String[] recipientList, java.lang.String[] wantedSenderPhones, java.util.Date sendingDate)
          Send 16bit coded SMS with timing.
static insertSmsResponse insertSmsOutNormal16BitWithTiming(java.lang.String userName, java.lang.String password, java.lang.String text, java.lang.String[] recipientList, java.lang.String[] wantedSenderPhones, java.util.Date sendingDate)
          Send 16bit coded SMS with timing.
static insertSmsResponse insertSmsOutNormal7BitWithTiming(SMSUser user, java.lang.String text, java.lang.String[] recipientList, java.lang.String[] wantedSenderPhones, java.util.Date sendingDate)
          Send 7bit coded SMS with timing.
static insertSmsResponse insertSmsOutNormal7BitWithTiming(java.lang.String userName, java.lang.String password, java.lang.String text, java.lang.String[] recipientList, java.lang.String[] wantedSenderPhones, java.util.Date sendingDate)
          Send 7bit coded SMS with timing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmsGateway

public SmsGateway()
Method Detail

deleteSmsInById

public static deleteSmsResponse deleteSmsInById(java.lang.String userName,
                                                java.lang.String password,
                                                java.lang.Integer smsId)
                                         throws java.io.IOException
Deleting a single incoming SMS by its ID.

Parameters:
userName - Username of the user.
password - Password of the user.
smsId - The id of the SMS for deletion.
Returns:
deleteSmsResponse
Throws:
java.io.IOException

deleteSmsInById

public static deleteSmsResponse deleteSmsInById(SMSUser user,
                                                java.lang.Integer smsId)
                                         throws java.io.IOException
Deleting a single incoming SMS by its ID.

Parameters:
user - SMSUser (username,password).
smsId - The id of the SMS for deletion.
Returns:
deleteSmsResponse
Throws:
java.io.IOException

deleteSmsInById

public static deleteSmsResponse deleteSmsInById(java.lang.String userName,
                                                java.lang.String password,
                                                java.lang.Integer[] smsIdList)
                                         throws java.io.IOException
Deleting multiple incoming SMS-es by their ID.

Parameters:
userName - Username of the user.
password - Password of the user.
smsIdList - List of id of SMS-es for deletion.
Returns:
deleteSmsResponse
Throws:
java.io.IOException

deleteSmsInById

public static deleteSmsResponse deleteSmsInById(SMSUser user,
                                                java.lang.Integer[] smsIdList)
                                         throws java.io.IOException
Deleting multiple incoming SMS-es by their ID.

Parameters:
user - SMSUser (username,password).
smsIdList - List of id of SMS-es for deletion.
Returns:
deleteSmsResponse
Throws:
java.io.IOException

deleteSmsOutById

public static deleteSmsResponse deleteSmsOutById(java.lang.String userName,
                                                 java.lang.String password,
                                                 java.lang.Integer smsId)
                                          throws java.io.IOException
Deleting a single outgoing SMS by its ID.

Parameters:
userName - Username of the user.
password - Password of the user.
smsId - The id of the SMS for deletion.
Returns:
deleteSmsResponse
Throws:
java.io.IOException

deleteSmsOutById

public static deleteSmsResponse deleteSmsOutById(SMSUser user,
                                                 java.lang.Integer smsId)
                                          throws java.io.IOException
Deleting a single outgoing SMS by its ID.

Parameters:
user - SMSUser (username,password).
smsId - The id of the SMS for deletion.
Returns:
deleteSmsResponse
Throws:
java.io.IOException

deleteSmsOutById

public static deleteSmsResponse deleteSmsOutById(java.lang.String userName,
                                                 java.lang.String password,
                                                 java.lang.Integer[] smsIdList)
                                          throws java.io.IOException
Deleting multiple outgoing SMS by its ID.

Parameters:
userName - Username of the user.
password - Password of the user.
smsIdList - List of id of SMS-es for deletion.
Returns:
deleteSmsResponse
Throws:
java.io.IOException

deleteSmsOutById

public static deleteSmsResponse deleteSmsOutById(SMSUser user,
                                                 java.lang.Integer[] smsIdList)
                                          throws java.io.IOException
Deleting multiple outgoing SMS by its ID.

Parameters:
user - SMSUser (username,password).
smsIdList - List of id of SMS-es for deletion.
Returns:
deleteSmsResponse
Throws:
java.io.IOException

getCreditAccount

public static getCreditResponse getCreditAccount(java.lang.String userName,
                                                 java.lang.String password,
                                                 short accountId)
                                          throws java.io.IOException
Gets the credits available for a given account.

Parameters:
userName - Username of the user.
password - Password of the user.
accountId - The Id of the account.
Returns:
getCreditResponse: Integer returnValue
Throws:
java.io.IOException

getCreditAccount

public static getCreditResponse getCreditAccount(SMSUser user,
                                                 short accountId)
                                          throws java.io.IOException
Gets the credits available for a given account.

Parameters:
user - SMSUser (username,password).
accountId - The Id of the account.
Returns:
getCreditResponse: Integer returnValue
Throws:
java.io.IOException

getCreditUser

public static getCreditResponse getCreditUser(java.lang.String userName,
                                              java.lang.String password)
                                       throws java.io.IOException
Gets the credits available for the user.

Parameters:
userName - Username of the user.
password - Password of the user.
Returns:
getCreditResponse: Integer returnValue
Throws:
java.io.IOException

getCreditUser

public static getCreditResponse getCreditUser(SMSUser user)
                                       throws java.io.IOException
Gets the credits available for the user.

Parameters:
user - SMSUser (username,password).
Returns:
getCreditResponse: Integer returnValue
Throws:
java.io.IOException

getModemsByAccount

public static getModemsByAccountResponse getModemsByAccount(java.lang.String userName,
                                                            java.lang.String password,
                                                            short accountId)
                                                     throws java.io.IOException
Gets the dedicated modems belonging to a given account.
Returns a list of string containing the phone number of the dedicated modems if any.

Parameters:
userName - Username of the user.
password - Password of the user.
accountId - The Id of the account.
Returns:
getModemsByAccountResponse: String[] returnValue
Throws:
java.io.IOException

getModemsByAccount

public static getModemsByAccountResponse getModemsByAccount(SMSUser user,
                                                            short accountId)
                                                     throws java.io.IOException
Gets the dedicated modems belonging to a given account.
Returns a list of string containing the phone number of the dedicated modems if any.

Parameters:
user - SMSUser (username,password).
accountId - The Id of the account.
Returns:
getModemsByAccountResponse: String[] returnValue
Throws:
java.io.IOException

getSMSLength

public static getSmsLengthResponse getSMSLength(java.lang.String coding,
                                                java.lang.String message)
                                         throws java.io.IOException
Gets the exact length of the SMS.
* 7bit SMS can hold 160 GSM chars
* 16bit SMS can hold 70 Unicode chars
Longer messages will be concatenated and sent in different parts (upto 256 parts) and delivered as one message to the recipient.
This functions tells if the SMS has to be concatenated or not and the number of parts it is concatenated to.
Credit usage of the SMS is calculated with this function, every part of the SMS uses one credit.

Parameters:
coding - "7" for 7bit, "16" for 16bit - 8bit is not implemented.
message - The text of the SMS.
Returns:
getSMSLength: Integer returnValue
Throws:
java.io.IOException

getSMSLength

public static getSmsLengthResponse getSMSLength(java.lang.String coding,
                                                java.lang.String message,
                                                java.lang.Boolean wap,
                                                java.lang.Boolean wlink,
                                                java.lang.Boolean wmessage,
                                                java.lang.String mode,
                                                java.lang.String href,
                                                java.lang.String type,
                                                java.util.Date validityTime,
                                                java.util.Date releaseTime)
                                         throws java.io.IOException
Gets the exact length of the SMS.
* 7bit SMS can hold 160 GSM chars
* 16bit SMS can hold 70 Unicode chars
Longer messages will be concatenated and sent in different parts (upto 256 parts) and delivered as one message to the recipient.
This functions tells if the SMS has to be concatenated or not and the number of parts it is concatenated to.
Credit usage of the SMS is calculated with this function, every part of the SMS uses one credit.

Parameters:
coding - "7" for 7bit, "16" for 16bit - 8bit is not implemented.
message - The text of the SMS.
wap -
wlink -
wmessage -
mode -
href -
type -
validityTime -
releaseTime -
Returns:
getSMSLength: Integer returnValue
Throws:
java.io.IOException

getSmsInByDedicatedAccount

public static getSmsInResponse getSmsInByDedicatedAccount(java.lang.String userName,
                                                          java.lang.String password)
                                                   throws java.io.IOException
Gets all incoming SMS which is recieved by dedicated modem for the account the user is member of.

Parameters:
userName - Username of the user.
password - Password of the user.
Returns:
getSmsInResponse: SMSIn[] returnValue
Throws:
java.io.IOException

getSmsInByDedicatedAccount

public static getSmsInResponse getSmsInByDedicatedAccount(SMSUser user)
                                                   throws java.io.IOException
Gets all incoming SMS which is recieved by dedicated modem for the account the user is member of.

Parameters:
user - SMSUser (username,password).
Returns:
getSmsInResponse: SMSIn[] returnValue
Throws:
java.io.IOException

getSmsInByNonDedicatedAccount

public static getSmsInResponse getSmsInByNonDedicatedAccount(java.lang.String userName,
                                                             java.lang.String password)
                                                      throws java.io.IOException
Gets all incoming SMS which is recieved by dedicated modem for the account the user is member of.

Parameters:
userName - Username of the user.
password - Password of the user.
Returns:
getSmsInResponse: SMSIn[] returnValue
Throws:
java.io.IOException

getSmsInByNonDedicatedAccount

public static getSmsInResponse getSmsInByNonDedicatedAccount(SMSUser user)
                                                      throws java.io.IOException
Gets all incoming SMS which is recieved by non-dedicated modem for the account the user is member of.

Parameters:
user - SMSUser (username,password).
Returns:
getSmsInResponse: SMSIn[] returnValue
Throws:
java.io.IOException

getSmsInByUser

public static getSmsInResponse getSmsInByUser(java.lang.String userName,
                                              java.lang.String password)
                                       throws java.io.IOException
Gets all incoming SMS for the user.

Parameters:
userName - Username of the user.
password - Password of the user.
Returns:
getSmsInResponse: SMSIn[] returnValue
Throws:
java.io.IOException

getSmsInByUser

public static getSmsInResponse getSmsInByUser(SMSUser user)
                                       throws java.io.IOException
Gets all incoming SMS for the user.

Parameters:
user - SMSUser (username,password).
Returns:
getSmsInResponse: SMSIn[] returnValue
Throws:
java.io.IOException

getSmsOutByAccount

public static getSmsOutResponse getSmsOutByAccount(java.lang.String userName,
                                                   java.lang.String password,
                                                   boolean listDeleted)
                                            throws java.io.IOException
Gets all outgoing SMS for the account which the user is member of.

Parameters:
userName - Username of the user.
password - Password of the user.
listDeleted - If set to true, it will show the SMS-es marked for deletion.
Returns:
getSmsOutResponse: SMSOut[] returnValue
Throws:
java.io.IOException

getSmsOutByAccount

public static getSmsOutResponse getSmsOutByAccount(SMSUser user,
                                                   boolean listDeleted)
                                            throws java.io.IOException
Gets all outgoing SMS for the account which the user is member of.

Parameters:
user - SMSUser (username,password).
listDeleted - If set to true, it will show the SMS-es marked for deletion.
Returns:
getSmsOutResponse: SMSOut[] returnValue
Throws:
java.io.IOException

getSmsOutById

public static getSmsOutResponse getSmsOutById(java.lang.String userName,
                                              java.lang.String password,
                                              java.lang.Integer sms_id)
                                       throws java.io.IOException
Gets a single outgoing SMS by its Id.

Parameters:
userName - Username of the user.
password - Password of the user.
sms_id - The Id of the SMS.
Returns:
getSmsOutResponse: SMSOut[] returnValue
Throws:
java.io.IOException

getSmsOutById

public static getSmsOutResponse getSmsOutById(SMSUser user,
                                              java.lang.Integer sms_id)
                                       throws java.io.IOException
Gets a single outgoing SMS by its Id.

Parameters:
user - SMSUser (username,password).
sms_id - The Id of the SMS.
Returns:
getSmsOutResponse: SMSOut[] returnValue
Throws:
java.io.IOException

getSmsOutByUser

public static getSmsOutResponse getSmsOutByUser(java.lang.String userName,
                                                java.lang.String password,
                                                boolean listDeleted)
                                         throws java.io.IOException
Gets all outgoing SMS for the user.

Parameters:
userName - Username of the user.
password - Password of the user.
listDeleted - If set to true, it will show the SMS-es marked for deletion.
Returns:
getSmsOutResponse: SMSOut[] returnValue
Throws:
java.io.IOException

getSmsOutByUser

public static getSmsOutResponse getSmsOutByUser(SMSUser user,
                                                boolean listDeleted)
                                         throws java.io.IOException
Gets all outgoing SMS for the user.

Parameters:
user - SMSUser (username,password).
listDeleted - If set to true, it will show the SMS-es marked for deletion.
Returns:
getSmsOutResponse: SMSOut[] returnValue
Throws:
java.io.IOException

insertSmsOutNormal

public static insertSmsResponse insertSmsOutNormal(java.lang.String userName,
                                                   java.lang.String password,
                                                   java.lang.String text,
                                                   java.lang.String bit,
                                                   java.lang.String[] recipientList,
                                                   java.lang.String[] wantedSenderPhones)
                                            throws java.io.IOException
Send SMS.

Parameters:
userName - Username of the user.
password - Password of the user.
text - The text of the SMS.
bit - Coding "7" for 7bit and "16" for 16bit codeing.
recipientList - List of string containing the phone number of recipients.
wantedSenderPhones - List of dedicated modems to use for sending the SMS.
Returns:
insertSmsOutNormal: Integer[] retrunValue - the ID of the SMS
Throws:
java.io.IOException

insertSmsOutNormal

public static insertSmsResponse insertSmsOutNormal(SMSUser user,
                                                   java.lang.String text,
                                                   java.lang.String bit,
                                                   java.lang.String[] recipientList,
                                                   java.lang.String[] wantedSenderPhones)
                                            throws java.io.IOException
Send SMS.

Parameters:
user - SMSUser (username,password).
text - The text of the SMS.
bit - Coding "7" for 7bit and "16" for 16bit codeing.
recipientList - List of string containing the phone number of recipients.
wantedSenderPhones - List of dedicated modems to use for sending the SMS.
Returns:
insertSmsOutNormal: Integer[] retrunValue - the ID of the SMS
Throws:
java.io.IOException

insertSmsOutNormal7BitWithTiming

public static insertSmsResponse insertSmsOutNormal7BitWithTiming(java.lang.String userName,
                                                                 java.lang.String password,
                                                                 java.lang.String text,
                                                                 java.lang.String[] recipientList,
                                                                 java.lang.String[] wantedSenderPhones,
                                                                 java.util.Date sendingDate)
                                                          throws java.io.IOException
Send 7bit coded SMS with timing.

Parameters:
userName - Username of the user.
password - Password of the user.
text - The text of the SMS.
recipientList - List of string containing the phone number of recipients.
wantedSenderPhones - List of dedicated modems to use for sending the SMS.
sendingDate - The date when the SMS should be sent.
Returns:
insertSmsOutNormal: Integer[] retrunValue - the ID of the SMS
Throws:
java.io.IOException

insertSmsOutNormal7BitWithTiming

public static insertSmsResponse insertSmsOutNormal7BitWithTiming(SMSUser user,
                                                                 java.lang.String text,
                                                                 java.lang.String[] recipientList,
                                                                 java.lang.String[] wantedSenderPhones,
                                                                 java.util.Date sendingDate)
                                                          throws java.io.IOException
Send 7bit coded SMS with timing.

Parameters:
user - SMSUser (username,password).
text - The text of the SMS.
recipientList - List of string containing the phone number of recipients.
wantedSenderPhones - List of dedicated modems to use for sending the SMS.
sendingDate - The date when the SMS should be sent.
Returns:
insertSmsOutNormal: Integer[] retrunValue - the ID of the SMS
Throws:
java.io.IOException

insertSmsOutNormal16BitWithTiming

public static insertSmsResponse insertSmsOutNormal16BitWithTiming(java.lang.String userName,
                                                                  java.lang.String password,
                                                                  java.lang.String text,
                                                                  java.lang.String[] recipientList,
                                                                  java.lang.String[] wantedSenderPhones,
                                                                  java.util.Date sendingDate)
                                                           throws java.io.IOException
Send 16bit coded SMS with timing.

Parameters:
userName - Username of the user.
password - Password of the user.
text - The text of the SMS.
recipientList - List of string containing the phone number of recipients.
wantedSenderPhones - List of dedicated modems to use for sending the SMS.
sendingDate - The date when the SMS should be sent.
Returns:
insertSmsOutNormal: Integer[] retrunValue - the ID of the SMS
Throws:
java.io.IOException

insertSmsOutNormal16BitWithTiming

public static insertSmsResponse insertSmsOutNormal16BitWithTiming(SMSUser user,
                                                                  java.lang.String text,
                                                                  java.lang.String[] recipientList,
                                                                  java.lang.String[] wantedSenderPhones,
                                                                  java.util.Date sendingDate)
                                                           throws java.io.IOException
Send 16bit coded SMS with timing.

Parameters:
user - SMSUser (username,password).
text - The text of the SMS.
recipientList - List of string containing the phone number of recipients.
wantedSenderPhones - List of dedicated modems to use for sending the SMS.
sendingDate - The date when the SMS should be sent.
Returns:
insertSmsOutNormal: Integer[] retrunValue - the ID of the SMS
Throws:
java.io.IOException