|
SMSLib 3.5.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.smslib.smsserver.interfaces.Interface<T>
public class Interface<T>
The base class of all implemented SMSServer interfaces.
An SMSServer interface can be thought of as a message producer or a message consumer.
SMSServer comes with a couple of ready-made interfaces. If you wish to extend SMSServer with new interface functionality, create your own interface by implementing the current class.
Nested Class Summary | |
---|---|
static class |
Interface.InterfaceTypes
Class representing SMSServer interface types. |
Constructor Summary | |
---|---|
Interface(java.lang.String myInfId,
java.util.Properties myProps,
SMSServer myServer,
Interface.InterfaceTypes myType)
|
Method Summary | |
---|---|
void |
callReceived(java.lang.String gtwId,
java.lang.String callerId)
This method is called by SMSServer every time an inbound call is received. |
java.lang.String |
getDescription()
Returns the interface description. |
java.lang.String |
getId()
|
java.util.Map<java.lang.Long,T> |
getMessageCache()
|
java.util.Collection<OutboundMessage> |
getMessagesToSend()
SMSServer calls this method in order to query the interface for messages that need to be send out. |
int |
getPendingMessagesToSend()
This method returns the number of outbound queued messages identified by this interface. |
java.lang.String |
getProperty(java.lang.String key)
Reads the property key of this interface. |
java.lang.String |
getProperty(java.lang.String key,
java.lang.String defaultValue)
Reads the property key of this interface. |
SMSServer |
getServer()
|
Interface.InterfaceTypes |
getType()
Returns the interface type. |
boolean |
isInbound()
Returns true if the interface is for inbound messaging. |
boolean |
isOutbound()
Returns true if the interface is for outbound messaging. |
void |
markMessage(OutboundMessage msg)
After a successful or unsuccessful attempt to send a message, SMSServer calls this method. |
void |
markMessages(java.util.Collection<OutboundMessage> msgList)
|
void |
messagesReceived(java.util.Collection<InboundMessage> msgList)
This method is called by SMSServer every time a message (or more messages) is received. |
void |
setDescription(java.lang.String myDescription)
Sets the interface description. |
void |
start()
Called once before SMSServer starts its operation. |
void |
stop()
Called once after SMSServer has finished. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Interface(java.lang.String myInfId, java.util.Properties myProps, SMSServer myServer, Interface.InterfaceTypes myType)
Method Detail |
---|
public final SMSServer getServer()
public java.lang.String getId()
public void callReceived(java.lang.String gtwId, java.lang.String callerId) throws java.lang.Exception
Override this call if you wish to implement your own functionality.
gtwId
- The Id of the gateway which received the call.callerId
- The caller id.
java.lang.Exception
public final java.lang.String getDescription()
public final void setDescription(java.lang.String myDescription)
myDescription
- The interface description.public final java.util.Map<java.lang.Long,T> getMessageCache()
public java.util.Collection<OutboundMessage> getMessagesToSend() throws java.lang.Exception
Override this call if you wish to implement your own functionality.
java.lang.Exception
public int getPendingMessagesToSend() throws java.lang.Exception
java.lang.Exception
public final java.lang.String getProperty(java.lang.String key)
key
- The key of the property to read.
public final java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
key
- The key of the property to read.defaultValue
- The defaultValue if key is not defined.
public final Interface.InterfaceTypes getType()
Interface.InterfaceTypes
public final boolean isInbound()
public final boolean isOutbound()
public void markMessage(OutboundMessage msg) throws java.lang.Exception
Override this call if you wish to implement your own functionality.
msg
- The Outbound message.
java.lang.Exception
public void markMessages(java.util.Collection<OutboundMessage> msgList) throws java.lang.Exception
java.lang.Exception
public void messagesReceived(java.util.Collection<InboundMessage> msgList) throws java.lang.Exception
Override this call if you wish to implement your own functionality.
msgList
- A message list of all received messages.
java.lang.Exception
public void start() throws java.lang.Exception
Override this call if you wish to implement your own functionality.
java.lang.Exception
- An exception thrown will stop SMSServer from starting its
processing.public void stop() throws java.lang.Exception
Override this call if you wish to implement your own functionality.
java.lang.Exception
|
SMSLib 3.5.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |