|
SMSLib 3.5.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.smslib.AGateway
public abstract class AGateway
Abstract class representing a Gateway, i.e. an interface capable of sending and/or receiving SMS messages.
Nested Class Summary | |
---|---|
static class |
AGateway.AsyncEvents
|
static class |
AGateway.GatewayAttributes
|
static class |
AGateway.GatewayStatuses
|
static class |
AGateway.Protocols
Enumeration representing the operation protocols of a GSM modem. |
Constructor Summary | |
---|---|
AGateway(java.lang.String id)
|
Method Summary | |
---|---|
boolean |
deleteMessage(InboundMessage msg)
|
int |
getAttributes()
|
int |
getDeliveryErrorCode()
Returns the gateway-specific error code from the last queryMessage() call. |
java.lang.String |
getFrom()
Returns the string that will appear on recipient's phone as the originator. |
java.lang.String |
getGatewayId()
Returns the gateway id assigned to this gateway during initialization. |
int |
getInboundMessageCount()
Returns the total number of messages received by this gateway. |
AGateway |
getMyself()
|
int |
getOutboundMessageCount()
Returns the total number of messages sent via this gateway. |
AGateway.Protocols |
getProtocol()
Returns the communication protocol current in use by the gateway. |
abstract int |
getQueueSchedulingInterval()
Returns the Gateway Queue sending internal (in milliseconds). |
int |
getRestartCount()
|
AGateway.GatewayStatuses |
getStatus()
Returns the gateway status. |
void |
incInboundMessageCount()
|
void |
incOutboundMessageCount()
|
boolean |
isInbound()
Returns true if the the gateway is set for inbound messaging. |
boolean |
isOutbound()
Returns true if the the gateway is set for outbound messaging. |
float |
queryBalance()
Queries the gateway for remaining credit. |
boolean |
queryCoverage(OutboundMessage msg)
Queries the gateway to see if a specific message and its recipient are covered. |
StatusReportMessage.DeliveryStatuses |
queryMessage(OutboundMessage msg)
Query the gateway for message delivery status. |
StatusReportMessage.DeliveryStatuses |
queryMessage(java.lang.String refNo)
Query the gateway for message delivery status. |
InboundMessage |
readMessage(java.lang.String memLoc,
int memIndex)
|
void |
readMessages(java.util.Collection<InboundMessage> msgList,
InboundMessage.MessageClasses msgClass)
|
int |
readPhonebook(Phonebook phonebook)
|
boolean |
sendMessage(OutboundMessage msg)
|
int |
sendMessages(java.util.Collection<OutboundMessage> msgList)
|
java.lang.String |
sendUSSDCommand(java.lang.String ussdCommand)
|
java.lang.String |
sendUSSDCommand(java.lang.String ussdCommand,
boolean interactive)
|
boolean |
sendUSSDRequest(USSDRequest request)
|
void |
setAttributes(int myAttributes)
|
void |
setDeliveryErrorCode(int error)
|
void |
setFrom(java.lang.String myFrom)
Sets the string that will appear on recipient's phone as the originator. |
void |
setInbound(boolean value)
Enables or disables the gateway for inbound messaging. |
void |
setOutbound(boolean value)
Enables or disables the gateway for outbound messaging. |
void |
setProtocol(AGateway.Protocols myProtocoll)
Sets the communication protocol of the gateway. |
void |
setStatus(AGateway.GatewayStatuses myStatus)
Sets the gateway status to a new value. |
void |
startGateway()
|
void |
stopGateway()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AGateway(java.lang.String id)
Method Detail |
---|
public void setAttributes(int myAttributes)
public int getAttributes()
public AGateway getMyself()
public boolean isInbound()
public void setInbound(boolean value)
value
- True to enable the gateway for inbound messaging.public boolean isOutbound()
public void setOutbound(boolean value)
value
- True to enable the gateway for outbound messaging.public void setProtocol(AGateway.Protocols myProtocoll)
myProtocoll
- The protocol to be used.AGateway.Protocols
,
getProtocol()
public AGateway.Protocols getProtocol()
AGateway.Protocols
,
setProtocol(Protocols)
public java.lang.String getGatewayId()
public AGateway.GatewayStatuses getStatus()
AGateway.GatewayStatuses
public void setStatus(AGateway.GatewayStatuses myStatus)
myStatus
- The new gateway status.AGateway.GatewayStatuses
public int getInboundMessageCount()
public void incInboundMessageCount()
public int getOutboundMessageCount()
public void incOutboundMessageCount()
public java.lang.String getFrom()
setFrom(String)
public void setFrom(java.lang.String myFrom)
myFrom
- The originator string.getFrom()
public void startGateway() throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException
public void stopGateway() throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException
public void readMessages(java.util.Collection<InboundMessage> msgList, InboundMessage.MessageClasses msgClass) throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException
public InboundMessage readMessage(java.lang.String memLoc, int memIndex) throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException
public boolean sendMessage(OutboundMessage msg) throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException
public int sendMessages(java.util.Collection<OutboundMessage> msgList) throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException
public boolean deleteMessage(InboundMessage msg) throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException
public float queryBalance() throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
TimeoutException
- The gateway did not respond in a timely manner.
GatewayException
- A Gateway error occurred.
java.io.IOException
- An IO error occurred.
java.lang.InterruptedException
- The call was interrupted.public boolean queryCoverage(OutboundMessage msg) throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
msg
- The message to test.
TimeoutException
- The gateway did not respond in a timely manner.
GatewayException
- A Gateway error occurred.
java.io.IOException
- An IO error occurred.
java.lang.InterruptedException
- The call was interrupted.public StatusReportMessage.DeliveryStatuses queryMessage(OutboundMessage msg) throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
msg
- The OutboundMessage object to be checked.
TimeoutException
- The gateway did not respond in a timely manner.
GatewayException
- A Gateway error occurred.
java.io.IOException
- An IO error occurred.
java.lang.InterruptedException
- The call was interrupted.StatusReportMessage.DeliveryStatuses
,
getDeliveryErrorCode()
public StatusReportMessage.DeliveryStatuses queryMessage(java.lang.String refNo) throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
refNo
- The reference number of a previously sent message to be
checked.
TimeoutException
- The gateway did not respond in a timely manner.
GatewayException
- A Gateway error occurred.
java.io.IOException
- An IO error occurred.
java.lang.InterruptedException
- The call was interrupted.StatusReportMessage.DeliveryStatuses
,
getDeliveryErrorCode()
public int readPhonebook(Phonebook phonebook) throws TimeoutException, GatewayException, java.io.IOException, java.lang.InterruptedException
TimeoutException
GatewayException
java.io.IOException
java.lang.InterruptedException
public int getDeliveryErrorCode()
queryMessage(OutboundMessage)
public void setDeliveryErrorCode(int error)
public int getRestartCount()
public abstract int getQueueSchedulingInterval()
public java.lang.String sendUSSDCommand(java.lang.String ussdCommand) throws GatewayException, TimeoutException, java.io.IOException, java.lang.InterruptedException
GatewayException
TimeoutException
java.io.IOException
java.lang.InterruptedException
public java.lang.String sendUSSDCommand(java.lang.String ussdCommand, boolean interactive) throws GatewayException, TimeoutException, java.io.IOException, java.lang.InterruptedException
GatewayException
TimeoutException
java.io.IOException
java.lang.InterruptedException
public boolean sendUSSDRequest(USSDRequest request) throws GatewayException, TimeoutException, java.io.IOException, java.lang.InterruptedException
GatewayException
TimeoutException
java.io.IOException
java.lang.InterruptedException
|
SMSLib 3.5.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |