Package com.wowza.io
Class HTTPByteWriter
- Object
- 
- com.wowza.io.HTTPByteWriter
 
- 
 public class HTTPByteWriter extends Object
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected classHTTPByteWriter.SendResult
 - 
Field SummaryFields Modifier and Type Field Description protected intaddrIdxstatic intBUFFERINCSIZEprotected Class<? extends HTTPByteWriter>CLASSprotected StringCLASSNAMEprotected intconnectionTimeoutstatic intCONNECTIONTIMEOUTstatic StringCRLFprotected org.apache.commons.lang.time.FastDateFormatdateFormatprotected java.util.List<String>debugInfoprotected StringdebugPrefixstatic intHEADINDEX_CONTENTLENGTHstatic intHEADINDEX_LASTMODIFIEDstatic intHEADINDEX_SIZEstatic intHEADINDEX_STATUSprotected Stringhostprotected booleanisSSLstatic intLOG_ALLstatic intLOG_DEBUGstatic intLOG_DEFAULTstatic intLOG_DNSstatic intLOG_FRAGMENTSstatic intLOG_QUIETstatic intLOG_REQHEADERSstatic intLOG_TIMEOUTSprotected intlogOptionsstatic intMAXHEADERSIZEprotected intmaxRetriesstatic intMAXRETRIESprotected intmaxUsesBeforeReconnectprotected StringBuffermsgBufprotected Booleannonblockedprotected String[]parseDateFormatsprotected intportprotected StringproxyHostprotected intproxyPortprotected intreadWriteTimeoutstatic intREADWRITETIMEOUTprotected intreceiveBufferSizestatic intRECEIVEBUFFERSIZEprotected StringreqPathprotected booleanrequestFullURLprotected longretryTimeoutstatic longRETRYWAITTIMEprotected intsendBufferSizestatic intSENDBUFFERSIZEprotected java.net.Socketsocketprotected java.nio.channels.SocketChannelsocketChannelprotected StringuserAgentprotected intuses
 - 
Constructor SummaryConstructors Constructor Description HTTPByteWriter(String host, int port, Boolean nonblocked)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLogOptions(int options)voidclose()voidconnect()HTTPByteReaderResultdelete(String path)HTTPByteReaderResultdeleteDirect(String path)protected voiddumpDebug()intgetConnectionTimeout()protected StringgetContextPath()protected voidgetDeleteCommand(String path)booleangetIsSSL()intgetLogOptions()intgetMaxRetries()intgetMaxUsesBeforeReconnect()protected voidgetPostMessage(String method, String path, PacketFragmentList fragmentList)intgetReadWriteTimeout()intgetReceiveBufferSize()protected StringgetRequestPath(String path, String host, int port)longgetRetryTimeout()intgetSendBufferSize()StringgetUserAgent()protected booleaninit()protected voidinitHandShake()protected booleaninnerConnect()booleanisLogOption(int option)booleanisOpen()booleanisRequestFullURL()protected voidparseHeader(HTTPByteWriter.SendResult result, byte[] buffer, int offset, int len, boolean isHead)static intparseLogOptions(String options)protected voidreconnect()voidremoveLogOptions(int options)HTTPByteWriter.SendResultsendRequest(byte[] request, boolean isHead)HTTPByteWriter.SendResultsendRequest(byte[] request, PacketFragmentList fragmentList, int len, boolean isHead)HTTPByteWriter.SendResultsendRequestBlocked(byte[] request, PacketFragmentList fragmentList, int len, boolean isHead)HTTPByteWriter.SendResultsendRequestNonBlocked(byte[] request, PacketFragmentList fragmentList, int len, boolean isHead)voidsetConnectionTimeout(int connectionTimeout)voidsetIsSSL(boolean ssl)voidsetLogOptions(int options)voidsetMaxRetries(int maxRetries)voidsetMaxUsesBeforeReconnect(int maxUsesBeforeReconnect)voidsetProxyAddress(String host, int port)voidsetReadWriteTimeout(int readWriteTimeout)voidsetReceiveBufferSize(int receiveBufferSize)voidsetRequestFullURL(boolean requestFullURL)voidsetRetryTimeout(long timeout)voidsetSendBufferSize(int sendBufferSize)voidsetUserAgent(String userAgent)protected intsocketRead(java.nio.ByteBuffer readBuffer)protected intsocketWrite(java.nio.ByteBuffer reqBuffer)HTTPByteReaderResultwrite(String method, String path, byte[] buffer, int offset, int len)HTTPByteReaderResultwrite(String method, String path, PacketFragmentList fragmentList)HTTPByteReaderResultwrite(String method, String path, String str)HTTPByteReaderResultwriteDirect(String method, String path, PacketFragmentList fragmentList)
 
- 
- 
- 
Field Detail- 
CLASSNAMEprotected String CLASSNAME 
 - 
CLASSprotected Class<? extends HTTPByteWriter> CLASS 
 - 
MAXHEADERSIZEpublic static final int MAXHEADERSIZE - See Also:
- Constant Field Values
 
 - 
BUFFERINCSIZEpublic static final int BUFFERINCSIZE - See Also:
- Constant Field Values
 
 - 
READWRITETIMEOUTpublic static final int READWRITETIMEOUT - See Also:
- Constant Field Values
 
 - 
CONNECTIONTIMEOUTpublic static final int CONNECTIONTIMEOUT - See Also:
- Constant Field Values
 
 - 
SENDBUFFERSIZEpublic static final int SENDBUFFERSIZE - See Also:
- Constant Field Values
 
 - 
RECEIVEBUFFERSIZEpublic static final int RECEIVEBUFFERSIZE - See Also:
- Constant Field Values
 
 - 
MAXRETRIESpublic static final int MAXRETRIES - See Also:
- Constant Field Values
 
 - 
RETRYWAITTIMEpublic static final long RETRYWAITTIME - See Also:
- Constant Field Values
 
 - 
CRLFpublic static final String CRLF - See Also:
- Constant Field Values
 
 - 
HEADINDEX_STATUSpublic static final int HEADINDEX_STATUS - See Also:
- Constant Field Values
 
 - 
HEADINDEX_CONTENTLENGTHpublic static final int HEADINDEX_CONTENTLENGTH - See Also:
- Constant Field Values
 
 - 
HEADINDEX_LASTMODIFIEDpublic static final int HEADINDEX_LASTMODIFIED - See Also:
- Constant Field Values
 
 - 
HEADINDEX_SIZEpublic static final int HEADINDEX_SIZE - See Also:
- Constant Field Values
 
 - 
LOG_QUIETpublic static final int LOG_QUIET - See Also:
- Constant Field Values
 
 - 
LOG_TIMEOUTSpublic static final int LOG_TIMEOUTS - See Also:
- Constant Field Values
 
 - 
LOG_DEBUGpublic static final int LOG_DEBUG - See Also:
- Constant Field Values
 
 - 
LOG_FRAGMENTSpublic static final int LOG_FRAGMENTS - See Also:
- Constant Field Values
 
 - 
LOG_DNSpublic static final int LOG_DNS - See Also:
- Constant Field Values
 
 - 
LOG_REQHEADERSpublic static final int LOG_REQHEADERS - See Also:
- Constant Field Values
 
 - 
LOG_ALLpublic static final int LOG_ALL - See Also:
- Constant Field Values
 
 - 
LOG_DEFAULTpublic static final int LOG_DEFAULT - See Also:
- Constant Field Values
 
 - 
hostprotected String host 
 - 
portprotected int port 
 - 
reqPathprotected String reqPath 
 - 
proxyHostprotected String proxyHost 
 - 
proxyPortprotected int proxyPort 
 - 
dateFormatprotected org.apache.commons.lang.time.FastDateFormat dateFormat 
 - 
socketprotected java.net.Socket socket 
 - 
socketChannelprotected java.nio.channels.SocketChannel socketChannel 
 - 
msgBufprotected StringBuffer msgBuf 
 - 
maxRetriesprotected int maxRetries 
 - 
maxUsesBeforeReconnectprotected int maxUsesBeforeReconnect 
 - 
retryTimeoutprotected long retryTimeout 
 - 
usesprotected int uses 
 - 
readWriteTimeoutprotected int readWriteTimeout 
 - 
connectionTimeoutprotected int connectionTimeout 
 - 
debugInfoprotected java.util.List<String> debugInfo 
 - 
debugPrefixprotected String debugPrefix 
 - 
requestFullURLprotected boolean requestFullURL 
 - 
parseDateFormatsprotected String[] parseDateFormats 
 - 
sendBufferSizeprotected int sendBufferSize 
 - 
receiveBufferSizeprotected int receiveBufferSize 
 - 
userAgentprotected String userAgent 
 - 
nonblockedprotected Boolean nonblocked 
 - 
logOptionsprotected int logOptions 
 - 
addrIdxprotected int addrIdx 
 - 
isSSLprotected boolean isSSL 
 
- 
 - 
Method Detail- 
getConnectionTimeoutpublic int getConnectionTimeout() 
 - 
setConnectionTimeoutpublic void setConnectionTimeout(int connectionTimeout) 
 - 
getRetryTimeoutpublic long getRetryTimeout() 
 - 
setRetryTimeoutpublic void setRetryTimeout(long timeout) 
 - 
getSendBufferSizepublic int getSendBufferSize() 
 - 
setSendBufferSizepublic void setSendBufferSize(int sendBufferSize) 
 - 
getReceiveBufferSizepublic int getReceiveBufferSize() 
 - 
setReceiveBufferSizepublic void setReceiveBufferSize(int receiveBufferSize) 
 - 
getUserAgentpublic String getUserAgent() 
 - 
setUserAgentpublic void setUserAgent(String userAgent) 
 - 
getLogOptionspublic int getLogOptions() 
 - 
setLogOptionspublic void setLogOptions(int options) 
 - 
addLogOptionspublic void addLogOptions(int options) 
 - 
removeLogOptionspublic void removeLogOptions(int options) 
 - 
isLogOptionpublic boolean isLogOption(int option) 
 - 
setIsSSLpublic void setIsSSL(boolean ssl) 
 - 
getIsSSLpublic boolean getIsSSL() 
 - 
setProxyAddresspublic void setProxyAddress(String host, int port)
 - 
closepublic void close() 
 - 
connectpublic void connect() 
 - 
reconnectprotected void reconnect() 
 - 
isOpenpublic boolean isOpen() 
 - 
parseHeaderprotected void parseHeader(HTTPByteWriter.SendResult result, byte[] buffer, int offset, int len, boolean isHead) 
 - 
deletepublic HTTPByteReaderResult delete(String path) 
 - 
getDeleteCommandprotected void getDeleteCommand(String path) 
 - 
deleteDirectpublic HTTPByteReaderResult deleteDirect(String path) 
 - 
writepublic HTTPByteReaderResult write(String method, String path, String str) 
 - 
writepublic HTTPByteReaderResult write(String method, String path, byte[] buffer, int offset, int len) 
 - 
writepublic HTTPByteReaderResult write(String method, String path, PacketFragmentList fragmentList) 
 - 
getPostMessageprotected void getPostMessage(String method, String path, PacketFragmentList fragmentList)
 - 
writeDirectpublic HTTPByteReaderResult writeDirect(String method, String path, PacketFragmentList fragmentList) 
 - 
getRequestPathprotected String getRequestPath(String path, String host, int port)
 - 
getContextPathprotected String getContextPath() 
 - 
dumpDebugprotected void dumpDebug() 
 - 
sendRequestpublic HTTPByteWriter.SendResult sendRequest(byte[] request, boolean isHead) 
 - 
sendRequestpublic HTTPByteWriter.SendResult sendRequest(byte[] request, PacketFragmentList fragmentList, int len, boolean isHead) 
 - 
sendRequestBlockedpublic HTTPByteWriter.SendResult sendRequestBlocked(byte[] request, PacketFragmentList fragmentList, int len, boolean isHead) 
 - 
sendRequestNonBlockedpublic HTTPByteWriter.SendResult sendRequestNonBlocked(byte[] request, PacketFragmentList fragmentList, int len, boolean isHead) 
 - 
getMaxUsesBeforeReconnectpublic int getMaxUsesBeforeReconnect() 
 - 
setMaxUsesBeforeReconnectpublic void setMaxUsesBeforeReconnect(int maxUsesBeforeReconnect) 
 - 
getMaxRetriespublic int getMaxRetries() 
 - 
setMaxRetriespublic void setMaxRetries(int maxRetries) 
 - 
getReadWriteTimeoutpublic int getReadWriteTimeout() 
 - 
setReadWriteTimeoutpublic void setReadWriteTimeout(int readWriteTimeout) 
 - 
isRequestFullURLpublic boolean isRequestFullURL() 
 - 
setRequestFullURLpublic void setRequestFullURL(boolean requestFullURL) 
 - 
initprotected boolean init() 
 - 
innerConnectprotected boolean innerConnect() 
 - 
initHandShakeprotected void initHandShake() throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
socketWriteprotected int socketWrite(java.nio.ByteBuffer reqBuffer) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
socketReadprotected int socketRead(java.nio.ByteBuffer readBuffer) throws java.io.IOException, InterruptedException- Throws:
- java.io.IOException
- InterruptedException
 
 - 
parseLogOptionspublic static int parseLogOptions(String options) 
 
- 
 
-