|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.arch.wctp.WctpFactory
WctpFactory
Contains general functionality to format and send WCTP packets.
This is beta software that is still in development. Use at your own risk.
New from the previous version 1.1 Beta:
* All methods that receive response from a network have been moved to this class.
* This class is now sub-classed by WctpClientReceive
Copyright 2000-2001 Arch Wireless Holdings, Inc.
Constructor Summary | |
WctpFactory()
|
Method Summary | |
java.lang.String |
convertAll(java.lang.String str)
replaces the '<' symbol with "<" replaces the '>' symbol with ">" replaces the '"' symbol with """ replaces the ' symbol with "'" NOTE: This method does not replace & with & If you wish to replace all entities with &, you can simply call this method and then call:String convertApos(String) For example, a message can not contain the < or the > character as it will be mistaken as an XML processing instruction. |
java.lang.String |
convertAmp(java.lang.String str)
Replaces the & symbol with "&" |
java.lang.String |
convertApos(java.lang.String str)
Replaces the ' symbol with "'" For example, a paramater may not be able to contain the ' character as it will be mistaken as an XML processing instruction. |
java.lang.String |
convertCR(java.lang.String str)
Replaces carriage returns with " " NOTE: This method does not currently work with our gateway. |
java.lang.String |
convertGreaterThan(java.lang.String str)
replaces the '>' symbol with ">" For example, a message can not contain the < or the > character as it will be mistaken as an XML processing instruction. |
java.lang.String |
convertLessThan(java.lang.String str)
replaces the '<' symbol with "<" For example, a message can not contain the < or the > character as it will be mistaken as an XML processing instruction. |
java.lang.String |
convertLF(java.lang.String str)
Replaces line feeds with " " NOTE: This method does not currently work with our gateway. |
java.lang.String |
convertQuote(java.lang.String str)
replaces the '"' symbol with """ For example, a paramater can not contain the " character as it will be mistaken as an XML processing instruction. |
java.lang.String |
getTimestamp()
Get both date amd time and format it for a WCTP packet |
void |
readByteResponse(java.net.URLConnection connCarrier)
Reads the response from the HTTP server and prints the return message in bytes to standard output. Used to debug responses from WCTP servers. |
java.lang.String |
readResponse(java.net.HttpURLConnection connCarrier)
Reads the response from the HTTP server and gives an appropriate message. |
java.net.HttpURLConnection |
sendWctpPacket(java.net.URL carrierAddr,
java.lang.String body)
Opens an HttpURLConnection and sends the WCTP packet to the specified gateway as text/xml. |
java.net.HttpURLConnection |
sendWctpPacket(java.net.URL carrierAddr,
java.lang.String body,
java.lang.String proxy,
int port)
Opens an HttpURLConnection and sends the WCTP packet to the specified gateway as text/xml. |
java.net.HttpURLConnection |
sendWctpPacket(java.net.URL carrierAddr,
java.lang.String body,
java.lang.String proxy,
int port,
java.lang.String username,
java.lang.String password)
Not yet implemented. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public WctpFactory()
Method Detail |
public java.lang.String convertAll(java.lang.String str)
str
- the string to be convertedpublic java.lang.String convertAmp(java.lang.String str)
str
- the string to be convertedpublic java.lang.String convertApos(java.lang.String str)
str
- the string to be convertedpublic java.lang.String convertCR(java.lang.String str)
str
- the string to be convertedpublic java.lang.String convertGreaterThan(java.lang.String str)
str
- the string to be convertedpublic java.lang.String convertLessThan(java.lang.String str)
str
- the string to be convertedpublic java.lang.String convertLF(java.lang.String str)
str
- the string to be convertedpublic java.lang.String convertQuote(java.lang.String str)
str
- the string to be convertedpublic java.lang.String getTimestamp()
public java.lang.String readResponse(java.net.HttpURLConnection connCarrier)
connCarrier
- the URL to connect topublic java.net.HttpURLConnection sendWctpPacket(java.net.URL carrierAddr, java.lang.String body)
carrierAddr
- the specified gateway (i.e. URL carrierAddr = new URL("http://www.arch.com:80/WCTP");)body
- the xml documentpublic java.net.HttpURLConnection sendWctpPacket(java.net.URL carrierAddr, java.lang.String body, java.lang.String proxy, int port)
carrierAddr
- the specified gateway (i.e. URL carrierAddr = new URL("http://www.arch.com:80/WCTP");)body
- the xml documentproxy
- String URL of the proxy (i.e. http://proxy.yourproxy.com/)port
- int port of that the proxy server is using to accept connectionspublic java.net.HttpURLConnection sendWctpPacket(java.net.URL carrierAddr, java.lang.String body, java.lang.String proxy, int port, java.lang.String username, java.lang.String password)
carrierAddr
- java.net.URLbody
- java.lang.Stringproxy
- java.lang.Stringport
- intusername
- java.lang.Stringpassword
- java.lang.Stringpublic void readByteResponse(java.net.URLConnection connCarrier)
connCarrier
- the URL to connect to
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |