|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mobicents.protocols.smpp.util.PacketFactory
public final class PacketFactory
Factory class for SMPP packets.
| Constructor Summary | |
|---|---|
PacketFactory()
|
|
| Method Summary | |
|---|---|
SMPPPacket |
newInstance(int id)
Create a new instance of the appropriate sub class of SMPPPacket. |
SMPPPacket |
newResponse(SMPPPacket packet)
Get a response packet for the specified request. |
void |
registerVendorPacket(int id,
Class<? extends SMPPPacket> requestType,
Class<? extends SMPPPacket> responseType)
Register a vendor packet with the factory. |
void |
unregisterVendorPacket(int id)
Remove a vendor packet definition from this factory. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PacketFactory()
| Method Detail |
|---|
public SMPPPacket newInstance(int id)
id - The SMPP command ID of the packet type to return.
SMPPPacket
representing SMPP command id.
BadCommandIDException - if the command ID is not recognized.public SMPPPacket newResponse(SMPPPacket packet)
packet.
packet - The request packet to get a response for.
BadCommandIDException - If there is no response packet for the
specified request (for example, an AlertNotification).
SMPPRuntimeException - If an attempt is made to create a
response to a response packet.
public void registerVendorPacket(int id,
Class<? extends SMPPPacket> requestType,
Class<? extends SMPPPacket> responseType)
This implementation assumes that the ID of the response packet will
be the ID of the request packet ORed with 0x80000000.
This implementation also accepts null for the
responseType since there is at least one incidence in
the specification of such a case (AlertNotification has
no response packet).
id - The command ID of the request packet.requestType - The class which implements the vendor request packet.responseType - The class which implements the vendor response
packet.public void unregisterVendorPacket(int id)
id - The ID of the vendor packet to remove. This will also
unregister the response packet if it exists.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||