|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mobicents.protocols.smpp.net.ReplayLink
public class ReplayLink
An implementation of the SmscLink interface which can be used to replay an SMPP session.
This implementation is intended to be used in conjunction with data captured from a real SMPP session. All outbound bytes should be captured in one location and all inbound bytes in another. This link will reconstitute the SMPP packets for the session and provide response packets only after it has seen the request packets being sent.
| Constructor Summary | |
|---|---|
ReplayLink(InputStream inPacketSource,
InputStream outPacketSource)
|
|
| Method Summary | |
|---|---|
void |
connect()
Initiate the connection to the SMSC. |
void |
disconnect()
Disconnect from the SMSC. |
void |
flush()
If the underlying link implements some form of output buffering, then this method should flush the buffer. |
SMPPPacket |
getNextOutbound()
|
int |
getTimeout()
Get the current timeout for the underlying link. |
boolean |
isConnected()
Determine if the underlying link is connected to the SMSC. |
boolean |
isTimeoutSupported()
Determine if this SMSC link supports read timeouts. |
SMPPPacket |
read()
Read the next SMPP packet from the underlying link. |
void |
setTimeout(int timeout)
Set the read timeout for the underlying link. |
void |
write(SMPPPacket packet,
boolean withOptionalParams)
Send an SMPP packet to the SMSC. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReplayLink(InputStream inPacketSource,
InputStream outPacketSource)
| Method Detail |
|---|
public void connect()
throws IOException
SmscLink
connect in interface SmscLinkIOException
public void disconnect()
throws IOException
SmscLink
disconnect in interface SmscLinkIOException
public void flush()
throws IOException
SmscLink
flush in interface SmscLinkIOExceptionpublic int getTimeout()
SmscLinkUnsupportedOperationException.
getTimeout in interface SmscLinkSmscLink.setTimeout(int)public void setTimeout(int timeout)
SmscLinktimeout, then a
ReadTimeoutException should be thrown. Supporting read timeouts
is optional for SmscLink implementations. If it is not supported,
calls to this method must throw an
UnsupportedOperationException. A timeout value
of 0 deactivates timeouts - reads will block forever.
setTimeout in interface SmscLinktimeout - The new timeout value, specified in milliseconds.public boolean isConnected()
SmscLink
isConnected in interface SmscLinktrue if connected, false otherwise.public boolean isTimeoutSupported()
SmscLink
isTimeoutSupported in interface SmscLinktrue if the implementation supports read timeouts,
false if not.
public SMPPPacket getNextOutbound()
throws IOException
IOException
public SMPPPacket read()
throws IOException
SmscLink
read in interface SmscLinkbuffer will be returned if it is large enough to
hold all of the packet's data, otherwise a new array is created
and returned with the packet data.
IOException
public void write(SMPPPacket packet,
boolean withOptionalParams)
throws IOException
SmscLink
write in interface SmscLinkpacket - The packet to send.withOptionalParams - true to send the packet's
optional parameters during the write, false to omit the
optional parameters.
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||