|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mobicents.protocols.smpp.net.AbstractStreamLink
public abstract class AbstractStreamLink
Abstract base implementation of the SmscLink
interface that operates on java.io streams.
This class implements basic read and write functionality that can be re-used by other implementations.
Concrete implementations of this class must call both
setInputStream(InputStream) and
setOutputStream(OutputStream) during the
SmscLink.connect() operation in order to set up instances of
this class properly.
| Constructor Summary | |
|---|---|
AbstractStreamLink()
Create a new unconnected SmscLink. |
|
| Method Summary | |
|---|---|
int |
available()
Get the number of bytes currently available on the input stream. |
void |
disconnect()
Close the connection to the SMSC. |
void |
flush()
Flush the output stream of the SMSC link. |
boolean |
getAutoFlush()
Get the auto flush behaviour of this link. |
SMPPPacket |
read()
Read the next SMPP packet from the SMSC. |
void |
setAutoFlush(boolean flush)
Set the auto flush behaviour of this link. |
protected void |
setInputStream(InputStream inputStream)
|
protected void |
setOutputStream(OutputStream outputStream)
|
void |
setSnoopStreams(OutputStream snoopIn,
OutputStream snoopOut)
Set the snooper streams. |
void |
write(SMPPPacket pak,
boolean withOptional)
Send a packet to the SMSC. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.mobicents.protocols.smpp.net.SmscLink |
|---|
connect, getTimeout, isConnected, isTimeoutSupported, setTimeout |
| Constructor Detail |
|---|
public AbstractStreamLink()
| Method Detail |
|---|
public void disconnect()
throws IOException
Session.unbind()) before
closing the underlying network link. The connection may be reestablished
using #open.
disconnect in interface SmscLinkIOException - If an exception occurs while closing the connection.
public void write(SMPPPacket pak,
boolean withOptional)
throws IOException
write in interface SmscLinkpak - the SMPP packet to send.withOptional - true to send the optional parameters over the link too, false
to only send the mandatory parameters.
IOException - if an exception occurs during writing or if the connection is
not open.
public void flush()
throws IOException
flush in interface SmscLinkIOException - If an exception occurs while flushing the output stream.public boolean getAutoFlush()
true.
setAutoFlush(boolean),
APIConfigpublic void setAutoFlush(boolean flush)
getAutoFlush()
public SMPPPacket read()
throws IOException
read in interface SmscLinkarray - a byte array buffer to read the packet into.
EOFException - If the end of stream is reached before a full packet can be
read.
IOException - If an exception occurs when reading the packet from the input
stream.public final int available()
public void setSnoopStreams(OutputStream snoopIn,
OutputStream snoopOut)
snoopIn - stream to receive incoming bytes from the SMSC (may be null).snoopOut - stream to receive outgoing bytes to the SMSC (may be null).protected void setInputStream(InputStream inputStream)
protected void setOutputStream(OutputStream outputStream)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||